Browse Source

Merge remote-tracking branch 'origin/dev_abandon_grid' into dev_abandon_grid

# Conflicts:
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
dev
yinzuomei 4 years ago
parent
commit
af1dacd619
  1. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

14
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;
//迁移网格 //迁移网格
@ -989,10 +992,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
public void abandonGridForDealBizData(AbandonGridFormDTO formDTO) { public void abandonGridForDealBizData(AbandonGridFormDTO formDTO) {
try { try {
//根据网格id 获取网格内工作人员及其添加关系 //根据网格id 获取网格内工作人员及其添加关系
List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId()); List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(gridId);
if (CollectionUtils.isEmpty(staffList)){ if (staffList == null){
log.info("abandonGridForDealBizData gridId:{} have any staff", formDTO.getGridId()); 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,9 +1015,9 @@ 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,formDTO.getGridId(),formDTO.getUserId(), staffList, updateList);
//清空工作人员缓存 //清空工作人员缓存
staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId())); staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId()));

Loading…
Cancel
Save