Browse Source

grid/abandon弃用网格入口

dev
yinzuomei 3 years ago
parent
commit
c45778bbf3
  1. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  2. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java
  3. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AbandonGridResDTO.java
  4. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  5. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  6. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java
  7. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  8. 85
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java

@ -151,4 +151,8 @@ public class CustomerGridDTO implements Serializable {
* 联系电话
*/
private String mobile;
/**
* 弃用1正常使用0
*/
private Boolean abandonFlag;
}

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

@ -0,0 +1,14 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class AbandonGridFormDTO implements Serializable {
@NotBlank(message = "网格id不能为空",groups = AddGroup.class)
private String gridId;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AbandonGridResDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 废弃网格前置条件查询返参
*/
@AllArgsConstructor
@Data
public class AbandonGridResDTO implements Serializable {
/**
* true:可以弃用false:不可以弃用
*/
private Boolean abandonFlag;
/**
* 待办事项
*/
private List<String> toDoList;
}

6
epmet-module/gov-org/gov-org-server/pom.xml

@ -136,6 +136,12 @@
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-issue-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

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

@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -226,4 +227,15 @@ public class GridController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<GridTreeResultDTO>>().ok(customerGridService.getGridTree(formDTO));
}
/**
* 弃用网格
* @param formDTO
* @return
*/
@PostMapping("abandon")
public Result<AbandonGridResDTO> abandonGrid(@RequestBody AbandonGridFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
return new Result<AbandonGridResDTO>().ok(customerGridService.abandonGrid(formDTO));
}
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java

@ -109,4 +109,9 @@ public class CustomerGridEntity extends BaseEpmetEntity {
* 联系电话
*/
private String mobile;
/**
* 弃用1正常使用0
*/
private Boolean abandonFlag;
}

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

@ -374,4 +374,11 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2022/1/17 3:50 下午
*/
List<CustomerStaffGridResultDTO> getStaffGridList(String customerId, String orgId, String orgType);
/**
* 弃用网格前置条件查询
* @param formDTO
* @return
*/
AbandonGridResDTO abandonGrid(AbandonGridFormDTO formDTO);
}

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

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
@ -28,6 +29,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
@ -43,10 +45,9 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.feign.*;
import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResultDTO;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
@ -88,10 +89,21 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Autowired
private RedisUtils redisUtils;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
//迁移网格
@Autowired
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<CustomerGridDTO> page(Map<String, Object> params) {
IPage<CustomerGridEntity> page = baseDao.selectPage(
@ -945,4 +957,65 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return baseDao.getStaffGridList(customerId,orgId,orgType);
}
/**
* 弃用网格
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public AbandonGridResDTO abandonGrid(AbandonGridFormDTO formDTO) {
//待审核党员、待审核热心居民
Result<WarnAndPartyAuditResultDTO> partyMem = resiPartyMemberOpenFeignClient.partyMemberAuditReset(formDTO.getGridId());
if (!partyMem.success() || null == partyMem.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "partyMemberAuditReset failed", "数据校验异常");
}
//未处理的事件
Result<Boolean> eventRes = govProjectOpenFeignClient.eventAuditReset(formDTO.getGridId());
if (!eventRes.success() || null == eventRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "eventAuditReset failed", "数据校验异常");
}
//表决中的议题
Result<Boolean> issueAuditReset = govIssueOpenFeignClient.issueAuditReset(formDTO.getGridId());
if (!issueAuditReset.success() || null == issueAuditReset.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "issueAuditReset failed", "数据校验异常");
}
//徽章????
AbandonGridResDTO result=new AbandonGridResDTO(true,new ArrayList<>());
if(partyMem.getData().getPartyMemberStatus()){
result.setAbandonFlag(false);
result.getToDoList().add("存在未审核的党员申请");
}
if(partyMem.getData().getWarnStatus()){
result.setAbandonFlag(false);
result.getToDoList().add("存在未审核的热心居民申请");
}
if(eventRes.getData()){
result.setAbandonFlag(false);
result.getToDoList().add("存在未处理的事件");
}
if(issueAuditReset.getData()){
result.setAbandonFlag(false);
result.getToDoList().add("存在未处理的议题");
}
if(!result.getAbandonFlag()){
return result;
}
//可以弃用、处理数据 todo
// ....
// ....
//处理成功,隐藏网格
LambdaUpdateWrapper<CustomerGridEntity> updateGrid=new LambdaUpdateWrapper<>();
updateGrid.set(CustomerGridEntity::getAbandonFlag,true);
updateGrid.eq(CustomerGridEntity::getId,formDTO.getGridId());
baseDao.update(null,updateGrid);
return result;
}
}

Loading…
Cancel
Save