公共处理
This commit is contained in:
@@ -58,7 +58,7 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
|
|
||||||
LINE_ID_IS_NOT_EXIST(500001, "线索信息不存在!", null),
|
LINE_ID_IS_NOT_EXIST(500001, "线索信息不存在!", null),
|
||||||
WORK_FLOW_STAGE_PASS_ERROR(500002, "通过错误,非对应阶段!", null),
|
WORK_FLOW_STAGE_PASS_ERROR(500002, "审核失败,非对应阶段!", null),
|
||||||
PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在!", null),
|
PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在!", null),
|
||||||
ZONE_NOT_EXIST(500004, "战区不存在!", null),
|
ZONE_NOT_EXIST(500004, "战区不存在!", null),
|
||||||
PARTNER_BASEINFO_NOT_EXIST(500005, "基本信息不存在!", null),
|
PARTNER_BASEINFO_NOT_EXIST(500005, "基本信息不存在!", null),
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ public class AuditPassRequest {
|
|||||||
@ApiModelProperty("线索ID")
|
@ApiModelProperty("线索ID")
|
||||||
private Long lineId;
|
private Long lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("线索子阶段")
|
||||||
|
private Integer workflowSubStage;
|
||||||
|
|
||||||
@ApiModelProperty("证明文件与凭证")
|
@ApiModelProperty("证明文件与凭证")
|
||||||
private List<String> certifyFile;
|
private List<String> certifyFile;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ public class AuditRejectRequest {
|
|||||||
@ApiModelProperty("线索ID")
|
@ApiModelProperty("线索ID")
|
||||||
private Long lineId;
|
private Long lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("线索子阶段")
|
||||||
|
private Integer workflowSubStage;
|
||||||
|
|
||||||
@ApiModelProperty("公开拒绝原因")
|
@ApiModelProperty("公开拒绝原因")
|
||||||
private String rejectPublicReason;
|
private String rejectPublicReason;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.cool.store.dao.LineInfoDAO;
|
|||||||
import com.cool.store.entity.LineAuditInfoDO;
|
import com.cool.store.entity.LineAuditInfoDO;
|
||||||
import com.cool.store.entity.LineInfoDO;
|
import com.cool.store.entity.LineInfoDO;
|
||||||
import com.cool.store.enums.AuditResultTypeEnum;
|
import com.cool.store.enums.AuditResultTypeEnum;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.request.AuditPassRequest;
|
import com.cool.store.request.AuditPassRequest;
|
||||||
import com.cool.store.request.AuditRejectRequest;
|
import com.cool.store.request.AuditRejectRequest;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -28,11 +30,14 @@ public abstract class LineFlowService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核通过
|
* 审核通过
|
||||||
* @param lineInfo
|
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean auditPass(LineInfoDO lineInfo, AuditPassRequest request){
|
public Boolean auditPass(AuditPassRequest request){
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
|
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.WORK_FLOW_STAGE_PASS_ERROR);
|
||||||
|
}
|
||||||
String partnerId = lineInfo.getPartnerId();
|
String partnerId = lineInfo.getPartnerId();
|
||||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||||
auditInfo.setLineId(request.getLineId());
|
auditInfo.setLineId(request.getLineId());
|
||||||
@@ -46,11 +51,14 @@ public abstract class LineFlowService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核拒绝
|
* 审核拒绝
|
||||||
* @param lineInfo
|
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean auditReject(LineInfoDO lineInfo, AuditRejectRequest request){
|
public Boolean auditReject(AuditRejectRequest request){
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
|
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.WORK_FLOW_STAGE_PASS_ERROR);
|
||||||
|
}
|
||||||
String partnerId = lineInfo.getPartnerId();
|
String partnerId = lineInfo.getPartnerId();
|
||||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||||
auditInfo.setLineId(request.getLineId());
|
auditInfo.setLineId(request.getLineId());
|
||||||
@@ -65,11 +73,14 @@ public abstract class LineFlowService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束跟进
|
* 结束跟进
|
||||||
* @param lineInfo
|
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean auditClose(LineInfoDO lineInfo, AuditRejectRequest request){
|
public Boolean auditClose(AuditRejectRequest request){
|
||||||
|
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||||
|
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.WORK_FLOW_STAGE_PASS_ERROR);
|
||||||
|
}
|
||||||
String partnerId = lineInfo.getPartnerId();
|
String partnerId = lineInfo.getPartnerId();
|
||||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||||
auditInfo.setLineId(request.getLineId());
|
auditInfo.setLineId(request.getLineId());
|
||||||
|
|||||||
@@ -30,38 +30,32 @@ import javax.annotation.Resource;
|
|||||||
public class LineAuditController {
|
public class LineAuditController {
|
||||||
|
|
||||||
private LineFlowService lineFlowService;
|
private LineFlowService lineFlowService;
|
||||||
@Resource
|
|
||||||
private LineInfoDAO lineInfoDAO;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
@ApiOperation("审核通过")
|
@ApiOperation("审核通过")
|
||||||
@PostMapping("/pass")
|
@PostMapping("/pass")
|
||||||
public ResponseResult<Boolean> auditPass(@RequestBody AuditPassRequest request){
|
public ResponseResult<Boolean> auditPass(@RequestBody AuditPassRequest request){
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
initLineFlowService(request.getWorkflowSubStage());
|
||||||
initLineFlowService(lineInfo);
|
return ResponseResult.success(lineFlowService.auditPass(request));
|
||||||
return ResponseResult.success(lineFlowService.auditPass(lineInfo, request));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("审核拒绝")
|
@ApiOperation("审核拒绝")
|
||||||
@PostMapping("/reject")
|
@PostMapping("/reject")
|
||||||
public ResponseResult<Boolean> auditReject(@RequestBody AuditRejectRequest request){
|
public ResponseResult<Boolean> auditReject(@RequestBody AuditRejectRequest request){
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
initLineFlowService(request.getWorkflowSubStage());
|
||||||
initLineFlowService(lineInfo);
|
return ResponseResult.success(lineFlowService.auditReject(request));
|
||||||
return ResponseResult.success(lineFlowService.auditReject(lineInfo, request));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("结束跟进")
|
@ApiOperation("结束跟进")
|
||||||
@PostMapping("/close")
|
@PostMapping("/close")
|
||||||
public ResponseResult<Boolean> auditClose(@RequestBody AuditRejectRequest request){
|
public ResponseResult<Boolean> auditClose(@RequestBody AuditRejectRequest request){
|
||||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
initLineFlowService(request.getWorkflowSubStage());
|
||||||
initLineFlowService(lineInfo);
|
return ResponseResult.success(lineFlowService.auditClose(request));
|
||||||
return ResponseResult.success(lineFlowService.auditClose(lineInfo, request));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initLineFlowService(LineInfoDO lineInfo){
|
private void initLineFlowService(Integer workflowSubStage){
|
||||||
Integer workflowSubStage = lineInfo.getWorkflowSubStage();
|
|
||||||
if(workflowSubStage == 1){
|
if(workflowSubStage == 1){
|
||||||
this.lineFlowService = (LineFlowService)applicationContext.getBean(LineInterviewServiceImpl.class);
|
this.lineFlowService = (LineFlowService)applicationContext.getBean(LineInterviewServiceImpl.class);
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user