Browse Source

Merge branch 'dev_abandon_grid' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

master
jianjun 4 years ago
parent
commit
6c38e90e07
  1. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

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

@ -40,6 +40,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
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.CustomerGridConstant; import com.epmet.constant.CustomerGridConstant;
@ -98,6 +99,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient; private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
//迁移网格 //迁移网格
@ -990,9 +993,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
try { try {
//根据网格id 获取网格内工作人员及其添加关系 //根据网格id 获取网格内工作人员及其添加关系
List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(gridId); List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(gridId);
if (CollectionUtils.isEmpty(staffList)){ if (staffList == null){
log.info("abandonGridForDealBizData gridId:{} have any staff", gridId); staffList = new ArrayList<>();
return;
} }
logger.debug("abandonGridForDealBizData staffList:{}", JSON.toJSONString(staffList)); logger.debug("abandonGridForDealBizData staffList:{}", JSON.toJSONString(staffList));
List<StaffOrgRelationEntity> updateList = new ArrayList<>(); List<StaffOrgRelationEntity> updateList = new ArrayList<>();
@ -1013,8 +1015,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
entity.setOrgId(gridInfo.getPid()); entity.setOrgId(gridInfo.getPid());
updateList.add(entity); updateList.add(entity);
}); });
String customerId = loginUserUtil.getLoginUserCustomerId();
//更新工作人员组织关系 //更新工作人员组织关系
String customerId = staffList.get(NumConstant.ZERO).getCustomerId();
dealBizDataForAbandon(customerId,gridId, staffList, updateList); dealBizDataForAbandon(customerId,gridId, staffList, updateList);
//清空工作人员缓存 //清空工作人员缓存
staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId())); staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId()));

Loading…
Cancel
Save