|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|