|
@ -25,11 +25,14 @@ import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; |
|
|
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
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.PartyMemberConstant; |
|
|
import com.epmet.constant.PartyMemberConstant; |
|
|
import com.epmet.dto.UserRoleDTO; |
|
|
import com.epmet.dto.UserRoleDTO; |
|
|
|
|
|
import com.epmet.dto.form.UserResiInfoFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; |
|
|
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; |
|
|
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; |
|
|
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; |
|
@ -129,8 +132,19 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) { |
|
|
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) { |
|
|
|
|
|
Result<ResiWarmheartedResultDTO> result = new Result<ResiWarmheartedResultDTO>(); |
|
|
|
|
|
//0:先判断该用户是否是已注册居民
|
|
|
|
|
|
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); |
|
|
|
|
|
userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
userResiInfoFormDTO.setUserId(formDTO.getUserId()); |
|
|
|
|
|
Result<UserResiInfoResultDTO> result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); |
|
|
|
|
|
if (!result1.success() || null == result1.getData()) { |
|
|
|
|
|
result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getValue()); |
|
|
|
|
|
result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getName()); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
//1:热心居民申请行为记录表新增数据
|
|
|
//1:热心居民申请行为记录表新增数据
|
|
|
Result<ResiWarmheartedResultDTO> result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); |
|
|
result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); |
|
|
if (!result.success()) { |
|
|
if (!result.success()) { |
|
|
log.warn(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); |
|
|
log.warn(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION); |
|
|
} |
|
|
} |
|
@ -193,9 +207,11 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea |
|
|
baseDao.updateById(entity); |
|
|
baseDao.updateById(entity); |
|
|
//2:审核通过的添加热心居民的角色
|
|
|
//2:审核通过的添加热心居民的角色
|
|
|
if (NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) { |
|
|
if (NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) { |
|
|
|
|
|
//查询需要添加热心居民角色的userId
|
|
|
|
|
|
ResiWarmheartedApplyEntity resiWarmheartedApplyEntity = baseDao.selectById(formDTO.getResiWarmApplyId()); |
|
|
UserRoleDTO dto = new UserRoleDTO(); |
|
|
UserRoleDTO dto = new UserRoleDTO(); |
|
|
dto.setCustomerId(formDTO.getCustomerId()); |
|
|
dto.setCustomerId(formDTO.getCustomerId()); |
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
dto.setUserId(resiWarmheartedApplyEntity.getUserId()); |
|
|
//所属端-居民端
|
|
|
//所属端-居民端
|
|
|
dto.setApp(AppClientConstant.APP_RESI); |
|
|
dto.setApp(AppClientConstant.APP_RESI); |
|
|
//角色-热心居民
|
|
|
//角色-热心居民
|
|
|