Browse Source

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

dev
jianjun 4 years ago
parent
commit
8b7fc49bb7
  1. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java
  2. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  3. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

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

@ -11,4 +11,5 @@ import java.io.Serializable;
public class AbandonGridFormDTO implements Serializable { public class AbandonGridFormDTO implements Serializable {
@NotBlank(message = "网格id不能为空",groups = AddGroup.class) @NotBlank(message = "网格id不能为空",groups = AddGroup.class)
private String gridId; private String gridId;
private String userId;
} }

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

@ -235,7 +235,8 @@ public class GridController {
*/ */
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE) @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE)
@PostMapping("abandon") @PostMapping("abandon")
public Result abandonGrid(@RequestBody AbandonGridFormDTO formDTO){ public Result abandonGrid(@LoginUser TokenDto tokenDto,@RequestBody AbandonGridFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, AddGroup.class); ValidatorUtils.validateEntity(formDTO, AddGroup.class);
customerGridService.abandonGrid(formDTO); customerGridService.abandonGrid(formDTO);
return new Result(); return new Result();

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -384,7 +384,7 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
/** /**
* desc:移除网格内的工作人员关系 并迁移到组织 * desc:移除网格内的工作人员关系 并迁移到组织
* @param gridId * @param formDTO
*/ */
void abandonGridForDealBizData(String gridId); void abandonGridForDealBizData(AbandonGridFormDTO formDTO);
} }

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

@ -984,15 +984,15 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
} }
//可以弃用、处理数据(网格工作人员所属关系(网格工作人员人数), 删除正在审核中的徽章认证) //可以弃用、处理数据(网格工作人员所属关系(网格工作人员人数), 删除正在审核中的徽章认证)
this.abandonGridForDealBizData(formDTO.getGridId()); this.abandonGridForDealBizData(formDTO);
CustomerOrgRedis.delGridInfo(formDTO.getGridId()); CustomerOrgRedis.delGridInfo(formDTO.getGridId());
} }
@Override @Override
public void abandonGridForDealBizData(String gridId) { public void abandonGridForDealBizData(AbandonGridFormDTO formDTO) {
try { try {
//根据网格id 获取网格内工作人员及其添加关系 //根据网格id 获取网格内工作人员及其添加关系
List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(gridId); List<StaffOrgRelationDTO> staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId());
if (staffList == null){ if (staffList == null){
staffList = new ArrayList<>(); staffList = new ArrayList<>();
} }
@ -1017,7 +1017,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}); });
String customerId = loginUserUtil.getLoginUserCustomerId(); String customerId = loginUserUtil.getLoginUserCustomerId();
//更新工作人员组织关系 //更新工作人员组织关系
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()));
@ -1028,7 +1028,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
} }
@Transactional @Transactional
public void dealBizDataForAbandon(String customerId, String gridId, List<StaffOrgRelationDTO> staffList, List<StaffOrgRelationEntity> updateList) { public void dealBizDataForAbandon(String customerId, String gridId, String userId,List<StaffOrgRelationDTO> staffList, List<StaffOrgRelationEntity> updateList) {
//1.删除工作人员与网格的关系 //1.删除工作人员与网格的关系
LambdaQueryWrapper<CustomerStaffGridEntity> updateWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CustomerStaffGridEntity> updateWrapper = new LambdaQueryWrapper<>();
updateWrapper.eq(CustomerStaffGridEntity::getGridId,gridId); updateWrapper.eq(CustomerStaffGridEntity::getGridId,gridId);
@ -1050,6 +1050,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
//处理成功,隐藏网格 //处理成功,隐藏网格
LambdaUpdateWrapper<CustomerGridEntity> updateGrid=new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CustomerGridEntity> updateGrid=new LambdaUpdateWrapper<>();
updateGrid.set(CustomerGridEntity::getAbandonFlag,NumConstant.ONE); updateGrid.set(CustomerGridEntity::getAbandonFlag,NumConstant.ONE);
updateGrid.set(CustomerGridEntity::getUpdatedBy,userId);
updateGrid.set(CustomerGridEntity::getUpdatedTime,new Date());
updateGrid.eq(CustomerGridEntity::getId,gridId); updateGrid.eq(CustomerGridEntity::getId,gridId);
baseDao.update(null,updateGrid); baseDao.update(null,updateGrid);
} }

Loading…
Cancel
Save