|
@@ -13,10 +13,8 @@ import java.util.stream.Collectors;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.pj.api.dto.BorderDTO;
|
|
|
-import com.pj.api.dto.DclBorderList;
|
|
|
-import com.pj.api.dto.GroupDto;
|
|
|
-import com.pj.api.dto.HtGroupDto;
|
|
|
+import com.pj.api.client.admin.AdminInterface;
|
|
|
+import com.pj.api.dto.*;
|
|
|
import com.pj.current.satoken.StpUserUtil;
|
|
|
import com.pj.enummj.DeleteStatus;
|
|
|
import com.pj.enummj.IsLock;
|
|
@@ -68,6 +66,8 @@ public class TbGroupService extends ServiceImpl<TbGroupMapper, TbGroup> implemen
|
|
|
|
|
|
@Resource
|
|
|
private TbTradeAreaService tbTradeAreaService;
|
|
|
+ @Autowired
|
|
|
+ private AdminInterface adminInterface;
|
|
|
|
|
|
/**
|
|
|
* 增
|
|
@@ -373,6 +373,11 @@ public class TbGroupService extends ServiceImpl<TbGroupMapper, TbGroup> implemen
|
|
|
*/
|
|
|
public boolean groupDto(HtGroupDto groupDto) {
|
|
|
log.info("还是处理互助组信息:{}",JSONUtil.toJsonStr(groupDto));
|
|
|
+ // 边民信息表体信息
|
|
|
+ List<BorderDTO> borderDTOList = JSONUtil.toList(groupDto.getBorderList(), BorderDTO.class);
|
|
|
+ //互助组边民代表(组长)表体信息——>默认一个互助组只有一个组长
|
|
|
+ List<DclBorderList> dclBorderList = JSONUtil.toList(groupDto.getDclBorderList(), DclBorderList.class);
|
|
|
+
|
|
|
TbTradeArea tbTradeArea = tbTradeAreaService.updateHandler(groupDto.getFieldCode(), "", "");
|
|
|
//根据编号进行事务处理
|
|
|
TbGroup tbGroup = this.findByAreaCodeAndSeqCode(tbTradeArea.getId(), groupDto.getPlatSeqNo());
|
|
@@ -386,10 +391,7 @@ public class TbGroupService extends ServiceImpl<TbGroupMapper, TbGroup> implemen
|
|
|
.setTradeAreaName(tbTradeArea.getName());
|
|
|
this.save(tbGroup);
|
|
|
}
|
|
|
- // 边民信息表体信息
|
|
|
- List<BorderDTO> borderDTOList = JSONUtil.toList(groupDto.getBorderList(), BorderDTO.class);
|
|
|
- //互助组边民代表(组长)表体信息
|
|
|
- List<DclBorderList> dclBorderList = JSONUtil.toList(groupDto.getDclBorderList(), DclBorderList.class);
|
|
|
+
|
|
|
for (BorderDTO borderDTO : borderDTOList) {
|
|
|
TbPeople tbPeople = tbPeopleService.findByIdCarNo(borderDTO.getIdCardNo());
|
|
|
if (tbPeople == null) {
|
|
@@ -406,10 +408,20 @@ public class TbGroupService extends ServiceImpl<TbGroupMapper, TbGroup> implemen
|
|
|
tbPeople.setGroupName(tbGroup.getOrgName()).setGroupId(tbGroup.getId()).setTradeAreaId(tbTradeArea.getId())
|
|
|
.setTradeAreaName(tbTradeArea.getName()).setUpdateTime(new Date());
|
|
|
tbPeopleService.saveOrUpdate(tbPeople);
|
|
|
- //todo 继续同步边民信息
|
|
|
+ if (dclBorderList1.size() > 0) {
|
|
|
+ tbGroup.setLeaderId(tbPeople.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ AppUserDto appUser = adminInterface.getByFkId(tbPeople.getId());
|
|
|
+ if(appUser != null) {
|
|
|
+ appUser.setUserType("2");
|
|
|
+ adminInterface.saveAppUserInfo(appUser);
|
|
|
+ }
|
|
|
}
|
|
|
//修改
|
|
|
BeanUtils.copyProperties(groupDto, tbGroup);
|
|
|
+ tbGroup.setLeaderName(dclBorderList.get(0).getDeclareName())
|
|
|
+ .setLeaderPhone(dclBorderList.get(0).getDeclareTel());
|
|
|
tbGroup.setUpdateTime(new Date());
|
|
|
super.saveOrUpdate(tbGroup);
|
|
|
return true;
|