Browse Source

Merge remote-tracking branch 'remotes/origin/dev_pingyin_7_22'

# Conflicts:
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
master
jianjun 3 years ago
parent
commit
7158f46c92
  1. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java
  2. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  4. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  5. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  6. 26
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  7. 5
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java
  8. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  9. 75
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java

@ -22,6 +22,11 @@ public class OrgOrStaffMQMsg implements Serializable {
//删除网格:grid_delete;删除组织:agency_delete //删除网格:grid_delete;删除组织:agency_delete
private String type; private String type;
/**
* org原有的Code
*/
private String oldCode;
//工作人员Id集合 //工作人员Id集合
private List<String> staffIdList; private List<String> staffIdList;

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java

@ -25,6 +25,7 @@ public class EditGridFormDTO implements Serializable {
/** /**
* gridId 网格id * gridId 网格id
*/ */
@NotBlank(message = "网格ID不能为空")
private String gridId; private String gridId;
/** /**

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -177,16 +177,7 @@ public class AgencyController {
formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setCustomerId(tokenDTO.getCustomerId());
ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class);
Result result = agencyService.editAgency(formDTO); Result result = agencyService.editAgency(formDTO);
//发送mq 消息迁移至service
//2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDTO.getCustomerId());
mq.setOrgId(formDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
return result; return result;
} }

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -79,16 +79,7 @@ public class GridController {
editGridFormDTO.setCustomerId(tokenDto.getCustomerId()); editGridFormDTO.setCustomerId(tokenDto.getCustomerId());
Result result = customerGridService.editGrid(tokenDto,editGridFormDTO); Result result = customerGridService.editGrid(tokenDto,editGridFormDTO);
//2021-10-18 推送mq,数据同步到中介库 start //发送mq 消息 移至service
if (result.success()) {
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgId(editGridFormDTO.getGridId());
mq.setOrgType("grid");
mq.setType("grid_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end
return result; return result;
} }

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
@ -52,13 +53,14 @@ import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.entity.CustomerGridEntity; import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCrmFeignClient; import com.epmet.feign.OperCrmFeignClient;
import com.epmet.redis.CustomerAgencyRedis; import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.AgencyService; import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerOrgParameterService; import com.epmet.service.CustomerOrgParameterService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -71,7 +73,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -107,6 +108,8 @@ public class AgencyServiceImpl implements AgencyService {
private IcBuildingDao icBuildingDao; private IcBuildingDao icBuildingDao;
@Autowired @Autowired
private CustomerDepartmentDao customerDepartmentDao; private CustomerDepartmentDao customerDepartmentDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/** /**
* @param formDTO * @param formDTO
@ -240,6 +243,16 @@ public class AgencyServiceImpl implements AgencyService {
//5.redis缓存 //5.redis缓存
customerAgencyRedis.delete(formDTO.getAgencyId()); customerAgencyRedis.delete(formDTO.getAgencyId());
//2021-10-18 推送mq,数据同步到中介库 start【中介库只放了组织的名称、级别,所以涉及批量修改pname的操作不涉及同步中间库】
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(originalEntity.getCustomerId());
mq.setOrgId(formDTO.getAgencyId());
mq.setOrgType("agency");
mq.setType("agency_change");
mq.setOldCode(originalEntity.getCode());
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
//6.一些下拉组织树的缓存要清除掉 //6.一些下拉组织树的缓存要清除掉
String orgTreeCachePrexKey = RedisKeys.getOrgTreeCachePrexKey(formDTO.getCustomerId()); String orgTreeCachePrexKey = RedisKeys.getOrgTreeCachePrexKey(formDTO.getCustomerId());
customerAgencyRedis.deleteByPrex(orgTreeCachePrexKey); customerAgencyRedis.deleteByPrex(orgTreeCachePrexKey);

26
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -55,7 +55,6 @@ import com.epmet.entity.CustomerGridEntity;
import com.epmet.entity.CustomerStaffGridEntity; import com.epmet.entity.CustomerStaffGridEntity;
import com.epmet.entity.StaffOrgRelationEntity; import com.epmet.entity.StaffOrgRelationEntity;
import com.epmet.feign.*; import com.epmet.feign.*;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.send.SendMqMsgUtil; import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerGridService;
@ -111,10 +110,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Autowired @Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient; private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired @Autowired
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@ -331,8 +326,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result editGrid(TokenDto tokenDto, EditGridFormDTO editGridFormDTO) { public Result editGrid(TokenDto tokenDto, EditGridFormDTO editGridFormDTO) {
AddGridResultDTO gridId = baseDao.selectGridIdByGridName(editGridFormDTO.getGridName(), editGridFormDTO.getAgencyId(), editGridFormDTO.getGridId()); CustomerGridEntity gridEntity = baseDao.selectById(editGridFormDTO.getGridId());
if (gridId!=null){ if(gridEntity == null){
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
}
AddGridResultDTO gridInfo = baseDao.selectGridIdByGridName(editGridFormDTO.getGridName(), editGridFormDTO.getAgencyId(), editGridFormDTO.getGridId());
if (gridInfo!=null){
return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode());
} }
CustomerGridDTO customerGridDTO = new CustomerGridDTO(); CustomerGridDTO customerGridDTO = new CustomerGridDTO();
@ -352,6 +351,19 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
} }
customerGridDTO.setCenterAddress(editGridFormDTO.getCenterAddress()); customerGridDTO.setCenterAddress(editGridFormDTO.getCenterAddress());
baseDao.editGrid(customerGridDTO); baseDao.editGrid(customerGridDTO);
//2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgId(editGridFormDTO.getGridId());
mq.setOrgType("grid");
mq.setType("grid_change");
mq.setOldCode(gridEntity.getCode());
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
//2021-10-18 end
//一些下拉组织树的缓存要清除掉 //一些下拉组织树的缓存要清除掉
String orgTreeCachePrexKey = RedisKeys.getOrgTreeCachePrexKey(tokenDto.getCustomerId()); String orgTreeCachePrexKey = RedisKeys.getOrgTreeCachePrexKey(tokenDto.getCustomerId());
redisUtils.deleteByPrex(orgTreeCachePrexKey); redisUtils.deleteByPrex(orgTreeCachePrexKey);

5
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java

@ -36,5 +36,10 @@ public class ExractGridInfoPingYinFormDTO implements Serializable {
*/ */
@NotBlank(message = "操作类型【新增:add 修改删除:edit 初始化所有数据:all】不能为空", groups = {GridInfo.class}) @NotBlank(message = "操作类型【新增:add 修改删除:edit 初始化所有数据:all】不能为空", groups = {GridInfo.class})
private String type; private String type;
/**
* org 编辑之前的Code 如果有修改 则直接更新其他涉及到的表
*/
private String oldCode;
} }

3
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java

@ -51,7 +51,7 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent
} }
try { try {
msgs.forEach(msg -> consumeMessage(msg)); msgs.forEach(this::consumeMessage);
} catch (Exception e) { } catch (Exception e) {
logger.error(ExceptionUtils.getErrorStackTrace(e)); logger.error(ExceptionUtils.getErrorStackTrace(e));
return ConsumeConcurrentlyStatus.RECONSUME_LATER; return ConsumeConcurrentlyStatus.RECONSUME_LATER;
@ -94,6 +94,7 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent
ExractGridInfoPingYinFormDTO extractFormDto = new ExractGridInfoPingYinFormDTO(); ExractGridInfoPingYinFormDTO extractFormDto = new ExractGridInfoPingYinFormDTO();
extractFormDto.setCustomerId(obj.getCustomerId()); extractFormDto.setCustomerId(obj.getCustomerId());
extractFormDto.setType(obj.getType()); extractFormDto.setType(obj.getType());
extractFormDto.setOldCode(obj.getOldCode());
List<String> orgIdList = new ArrayList<>(); List<String> orgIdList = new ArrayList<>();
if(StringUtils.isNotBlank(obj.getOrgId())){ if(StringUtils.isNotBlank(obj.getOrgId())){
orgIdList.add(obj.getOrgId()); orgIdList.add(obj.getOrgId());

75
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.opendata.service.impl; package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
@ -7,14 +8,22 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.IndexCalConstant; import com.epmet.constant.IndexCalConstant;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.EventreportPingyinDao;
import com.epmet.opendata.dao.GridInfoPingyinDao; import com.epmet.opendata.dao.GridInfoPingyinDao;
import com.epmet.opendata.dao.GridstaffInfoPingyinDao;
import com.epmet.opendata.dao.GridstaffWorkInfoPingyinDao;
import com.epmet.opendata.dto.constant.DataWorkerConstant; import com.epmet.opendata.dto.constant.DataWorkerConstant;
import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO; import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO;
import com.epmet.opendata.entity.EventreportPingyinEntity;
import com.epmet.opendata.entity.GridInfoPingyinEntity; import com.epmet.opendata.entity.GridInfoPingyinEntity;
import com.epmet.opendata.entity.GridstaffInfoPingyinEntity;
import com.epmet.opendata.entity.GridstaffWorkInfoPingyinEntity;
import com.epmet.opendata.service.GridInfoPingyinService; import com.epmet.opendata.service.GridInfoPingyinService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -33,11 +42,18 @@ import java.util.List;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2022-07-22 * @since v1.0.0 2022-07-22
*/ */
@Slf4j
@Service @Service
public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinDao, GridInfoPingyinEntity> implements GridInfoPingyinService { public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinDao, GridInfoPingyinEntity> implements GridInfoPingyinService {
@Autowired @Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Autowired
private GridstaffInfoPingyinDao gridstaffInfoPingyinDao;
@Autowired
private GridstaffWorkInfoPingyinDao gridstaffWorkInfoPingyinDao;
@Autowired
private EventreportPingyinDao eventreportPingyinDao;
/** /**
* 抽取customer_agency到grid_info_pingyin表 * 抽取customer_agency到grid_info_pingyin表
@ -99,9 +115,13 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
this.insertBatch(gridInfoList); this.insertBatch(gridInfoList);
} else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) {
// 修改组织时,先根据code查询,如果有数据,更新 // 修改组织时,先根据code查询,如果有数据,更新
for (GridInfoPingyinEntity entity : gridInfoList) { for (GridInfoPingyinEntity entity : gridInfoList) {
//网格code变更了 则将旧的code 的数据删除状态设置为Y
if (StringUtils.isNotBlank(formDTO.getOldCode()) && !formDTO.getOldCode().equals(entity.getGridCode())){
baseDao.deleteByCode(formDTO.getOldCode());
}
List<GridInfoPingyinEntity> orginList = baseDao.selectByGridCode(entity.getGridCode()); List<GridInfoPingyinEntity> orginList = baseDao.selectByGridCode(entity.getGridCode());
if (CollectionUtils.isNotEmpty(orginList)) { if (CollectionUtils.isNotEmpty(orginList)) {
@ -138,7 +158,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
@Override @Override
public void exractGrid(ExractGridInfoPingYinFormDTO formDTO) { public void exractGrid(ExractGridInfoPingYinFormDTO formDTO) {
// 1.查询网格基础信息 // 1.查询网格基础信息
com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, GridBaseInfoFormDTO.class);
if (StringUtils.isBlank(formDTO.getType())||DataWorkerConstant.ALL.equals(formDTO.getType())) { if (StringUtils.isBlank(formDTO.getType())||DataWorkerConstant.ALL.equals(formDTO.getType())) {
formDTO1.setDelFlag("0"); formDTO1.setDelFlag("0");
} else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) { } else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) {
@ -150,6 +170,7 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
} }
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1); Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1);
if (!result.success()) { if (!result.success()) {
log.warn("根据网格Id 没有找到网格 等待再次调用");
throw new RenException(result.getInternalMsg()); throw new RenException(result.getInternalMsg());
} }
if (null == result.getData() || result.getData().size() < NumConstant.ONE) { if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
@ -195,7 +216,9 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
} else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) {
// 修改组织时,先根据code查询,如果有数据,更新 // 修改组织时,先根据code查询,如果有数据,更新
for (GridInfoPingyinEntity entity : gridInfoList) { for (GridInfoPingyinEntity entity : gridInfoList) {
//code 变更了
gridCodeChanged(formDTO, entity);
//根据修改后的网格code 获取网格信息
List<GridInfoPingyinEntity> orginList = baseDao.selectByGridCode(entity.getGridCode()); List<GridInfoPingyinEntity> orginList = baseDao.selectByGridCode(entity.getGridCode());
if (CollectionUtils.isNotEmpty(orginList)) { if (CollectionUtils.isNotEmpty(orginList)) {
@ -224,5 +247,51 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
} }
/**
* desc:判断是否需要网格Code 如果修改了则 同步修改其他的相关业务数据
* @param formDTO
* @param entity
*/
private void gridCodeChanged(ExractGridInfoPingYinFormDTO formDTO, GridInfoPingyinEntity entity) {
if (StringUtils.isNotBlank(formDTO.getOldCode()) && !formDTO.getOldCode().equals(entity.getGridCode())){
GridInfoPingyinEntity gridInfoEntity = new GridInfoPingyinEntity();
gridInfoEntity.setGridCode(entity.getGridCode());
gridInfoEntity.setUpdateTime(new Date());
LambdaUpdateWrapper<GridInfoPingyinEntity> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(GridInfoPingyinEntity::getGridCode,formDTO.getOldCode());
int update = baseDao.update(gridInfoEntity, updateWrapper);
log.info("code changed gridinfo effect row:{}",update);
//更新完 网格code 去更新其他的业务【工作人员、例行工作、事件】数据对应的code
GridstaffInfoPingyinEntity staffInfo = new GridstaffInfoPingyinEntity();
staffInfo.setGridCode(entity.getGridCode());
staffInfo.setUpdateTime(new Date());
LambdaUpdateWrapper<GridstaffInfoPingyinEntity> staffInfoWrapper = new LambdaUpdateWrapper<>();
staffInfoWrapper.eq(GridstaffInfoPingyinEntity::getGridCode,formDTO.getOldCode());
update = gridstaffInfoPingyinDao.update(staffInfo, staffInfoWrapper);
log.info("code changed gridStaffInfo effect row:{}",update);
GridstaffWorkInfoPingyinEntity workInfo = new GridstaffWorkInfoPingyinEntity();
workInfo.setGridCode(entity.getGridCode());
workInfo.setUpdateTime(new Date());
LambdaUpdateWrapper<GridstaffWorkInfoPingyinEntity> workInfoWrapper = new LambdaUpdateWrapper<>();
workInfoWrapper.eq(GridstaffWorkInfoPingyinEntity::getGridCode,formDTO.getOldCode());
update = gridstaffWorkInfoPingyinDao.update(workInfo, workInfoWrapper);
log.info("code changed staffWorkInfo effect row:{}",update);
EventreportPingyinEntity eventEntity = new EventreportPingyinEntity();
eventEntity.setGridCode(entity.getGridCode());
eventEntity.setUpdateTime(new Date());
LambdaUpdateWrapper<EventreportPingyinEntity> eventWrapper = new LambdaUpdateWrapper<>();
eventWrapper.eq(EventreportPingyinEntity::getGridCode,formDTO.getOldCode());
update = eventreportPingyinDao.update(eventEntity, eventWrapper);
log.info("code changed eventreport effect row:{}",update);
}
}
} }

Loading…
Cancel
Save