Browse Source

居民端-添加热心居民申请审核接口

dev
sunyuchao 5 years ago
parent
commit
17e88bf785
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 10
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/ResiPartymemberFeignClient.java
  3. 6
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/fallback/ResiPartymemberFeignClientFallBack.java
  4. 11
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
  5. 10
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedService.java
  6. 27
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedServiceImpl.java
  7. 65
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java
  8. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java
  9. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
  10. 40
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -25,7 +25,8 @@ public enum EpmetErrorCode {
*/
MOBILE_EXIST(8201, "该手机号已注册居民,请使用其他手机号注册!"),
PARAMETER_EXCEPTION(8202, "必要参数存在空值或手机号输入不合规,请检查参数赋值情况!!"),
UPDATE_EXCEPTION(8203, "用户居民注册访问记录表更新数据失败!");
UPDATE_EXCEPTION(8203, "用户居民注册访问记录表更新数据失败!"),
PARTICIPATION_EXCEPTION(8204, "参数异常,请检查所传参数是否合规!");
private int value;

10
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/ResiPartymemberFeignClient.java

@ -7,6 +7,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -76,4 +77,13 @@ public interface ResiPartymemberFeignClient {
*/
@PostMapping("/resi/partymember/confirm/extra")
Result partyMemberInfoExtra(@RequestBody PartymemberInfoDTO partyMemberInfoDTO);
/**
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/manageaudit")
Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
}

6
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/feign/fallback/ResiPartymemberFeignClientFallBack.java

@ -8,6 +8,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -61,4 +62,9 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC
public Result partyMemberInfoExtra(PartymemberInfoDTO partyMemberInfoDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "partyMemberInfoExtra", partyMemberInfoDTO);
}
@Override
public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "manageAudit", formDTO);
}
}

11
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.service.ResiWarmheartedService;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -44,5 +45,15 @@ public class ResiWarmheartedController {
return resiWarmheartedService.submit(tokenDTO, formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@PostMapping("manageaudit")
public Result manageAudit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedAuditFormDTO formDTO) {
return resiWarmheartedService.manageAudit(tokenDTO, formDTO);
}
}

10
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedService.java

@ -2,6 +2,7 @@ package com.epmet.modules.warmhearted.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -31,4 +32,13 @@ public interface ResiWarmheartedService {
*/
Result submit(TokenDto tokenDTO, ResiWarmheartedSubmitFormDTO formDTO);
/**
* 政府端-热心居民申请人工审核
*
* @param
* @return void
* @author sun
*/
Result manageAudit(TokenDto tokenDTO, ResiWarmheartedAuditFormDTO formDTO);
}

27
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedServiceImpl.java

@ -1,11 +1,13 @@
package com.epmet.modules.warmhearted.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.feign.ResiPartymemberFeignClient;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.modules.warmhearted.service.ResiWarmheartedService;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -51,15 +53,36 @@ public class ResiWarmheartedServiceImpl implements ResiWarmheartedService {
@Override
public Result submit(TokenDto tokenDTO, ResiWarmheartedSubmitFormDTO formDTO) {
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) {
return new Result<ResiWarmheartedResultDTO>().error(ModuleConstant.USER_NOT_NULL);
return new Result().error(ModuleConstant.USER_NOT_NULL);
}
if (null == formDTO || StringUtils.isBlank(formDTO.getCustomerId())
|| StringUtils.isBlank(formDTO.getGridId())
|| StringUtils.isBlank(formDTO.getResiWarmVisitId())
|| StringUtils.isBlank(formDTO.getReason())) {
return new Result<ResiWarmheartedResultDTO>().error(EpmetErrorCode.PARAMETER_EXCEPTION.getName());
return new Result().error(EpmetErrorCode.PARAMETER_EXCEPTION.getName());
}
formDTO.setUserId(tokenDTO.getUserId());
return resiPartymemberFeignClient.submit(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请人工审核
**/
@Override
public Result manageAudit(TokenDto tokenDTO, ResiWarmheartedAuditFormDTO formDTO) {
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) {
return new Result().error(ModuleConstant.USER_NOT_NULL);
}
if (null == formDTO || StringUtils.isBlank(formDTO.getCustomerId())
|| StringUtils.isBlank(formDTO.getResiWarmApplyId())
|| StringUtils.isBlank(formDTO.getAuditStatus())
|| (!NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())&&!NumConstant.ONE_STR.equals(formDTO.getAuditStatus()))) {
return new Result().error(EpmetErrorCode.PARTICIPATION_EXCEPTION.getName());
}
formDTO.setUserId(tokenDTO.getUserId());
return resiPartymemberFeignClient.manageAudit(formDTO);
}
}

65
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java

@ -0,0 +1,65 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 政府端-人工审核热心居民申请-配置入参
* @author sun
*/
@Data
public class ResiWarmheartedAuditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
private String resiWarmApplyId;
/**
* 审核状态(0:取消驳回 1:审核通过)
*/
@NotBlank(message = "审核状态不能为空")
private String auditStatus;
/**
* 驳回理由
*/
@NotBlank(message = "驳回理由不能为空")
private String refuseReason;
/**
* 客户Id CUSTOMER.id
*/
@NotBlank(message = "客户ID不能为空")
private String customerId;
/**
* 用户Id
*/
@NotBlank(message = "用户ID不能为空")
private String userId;
}

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java

@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.warmhearted.excel.ResiWarmheartedApplyExcel;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -40,7 +41,7 @@ import java.util.Map;
/**
* 热心居民申请表
* 热心居民申请表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
@ -48,24 +49,24 @@ import java.util.Map;
@RestController
@RequestMapping("resiwarmheartedapply")
public class ResiWarmheartedApplyController {
@Autowired
private ResiWarmheartedApplyService resiWarmheartedApplyService;
@GetMapping("page")
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params){
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ResiWarmheartedApplyDTO> page = resiWarmheartedApplyService.page(params);
return new Result<PageData<ResiWarmheartedApplyDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id){
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id) {
ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
return new Result<ResiWarmheartedApplyDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ResiWarmheartedApplyDTO dto){
public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.save(dto);
@ -73,7 +74,7 @@ public class ResiWarmheartedApplyController {
}
@PutMapping
public Result update(@RequestBody ResiWarmheartedApplyDTO dto){
public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.update(dto);
@ -81,7 +82,7 @@ public class ResiWarmheartedApplyController {
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
resiWarmheartedApplyService.delete(ids);
@ -95,13 +96,18 @@ public class ResiWarmheartedApplyController {
}
@PostMapping("init")
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO){
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO) {
return resiWarmheartedApplyService.init(formDTO);
}
@PostMapping("submit")
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO){
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
return resiWarmheartedApplyService.submit(formDTO);
}
@PostMapping("manageaudit")
public Result manageAudit(@RequestBody ResiWarmheartedAuditFormDTO formDTO) {
return resiWarmheartedApplyService.manageAudit(formDTO);
}
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -114,4 +115,13 @@ public interface ResiWarmheartedApplyService extends BaseService<ResiWarmhearted
* @author sun
*/
Result submit(ResiWarmheartedSubmitFormDTO formDTO);
/**
* 政府端-热心居民申请人工审核
*
* @param
* @return void
* @author sun
*/
Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
}

40
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

@ -21,11 +21,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.dto.UserRoleDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
@ -33,6 +38,7 @@ import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
@ -65,6 +71,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
private ResiWarmheartedVisitService resiWarmheartedVisitService;
@Autowired
private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Override
public PageData<ResiWarmheartedApplyDTO> page(Map<String, Object> params) {
@ -123,7 +131,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) {
//1:热心居民申请行为记录表新增数据
Result<ResiWarmheartedResultDTO> result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
if(!result.success()){
if (!result.success()) {
log.warn(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
}
ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
@ -150,6 +158,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
/**
* 热心居民申请表新增数据
*
* @param formDTO
* @return
*/
@ -165,4 +174,33 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea
baseDao.insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
Result result = new Result();
//1:更新热心居民申请表数据
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setId(formDTO.getResiWarmApplyId());
if (NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())) {
//审核状态-未通过
entity.setAuditStatus(PartyMemberConstant.REJECTED);
} else {
//审核状态-通过
entity.setAuditStatus(PartyMemberConstant.APPROVED);
}
entity.setRefuseReason(formDTO.getRefuseReason());
baseDao.updateById(entity);
//2:审核通过的添加热心居民的角色
if(NumConstant.ONE_STR.equals(formDTO.getAuditStatus())){
UserRoleDTO dto = new UserRoleDTO();
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserId(formDTO.getUserId());
//所属端-居民端
dto.setApp(AppClientConstant.APP_RESI);
//角色-热心居民
dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
result = epmetUserFeignClient.saveUserRole(dto);
}
return result;
}
}
Loading…
Cancel
Save