结束跟进调整

This commit is contained in:
zhangchenbiao
2024-04-17 14:18:23 +08:00
parent 01352e3723
commit fb924859a2
11 changed files with 78 additions and 74 deletions

View File

@@ -0,0 +1,36 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: AuditRequest
* @Description:
* @date 2024-03-20 14:28
*/
@Data
public class AuditCloseRequest {
@NotNull
@ApiModelProperty("线索ID")
private Long lineId;
@NotBlank
@ApiModelProperty("公开拒绝原因")
private String rejectPublicReason;
@NotBlank
@ApiModelProperty("真实拒绝原因")
private String rejectRealReason;
@NotEmpty
@ApiModelProperty("证明文件与凭证")
private List<String> certifyFile;
}

View File

@@ -65,11 +65,6 @@ public class BankServiceImpl extends LineFlowService implements BankService {
return resultPage; return resultPage;
} }
@Override
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
return null;
}
@Override @Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage()); WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
@@ -89,12 +84,6 @@ public class BankServiceImpl extends LineFlowService implements BankService {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId) {
return Boolean.TRUE;
}
@Override @Override
public Boolean repayment(AuditRejectRequest request) { public Boolean repayment(AuditRejectRequest request) {
//更新线索 //更新线索

View File

@@ -0,0 +1,23 @@
package com.cool.store.service.impl;
import com.cool.store.entity.LineInfoDO;
import org.springframework.stereotype.Service;
/**
* @author zhangchenbiao
* @FileName: DefaultLineFlowService
* @Description:
* @date 2024-04-17 14:12
*/
@Service
public class DefaultLineFlowService extends LineFlowService{
@Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
return null;
}
@Override
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo, String userId) {
return null;
}
}

View File

@@ -120,11 +120,6 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
return response; return response;
} }
@Override
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
return null;
}
@Override @Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
//校验是否是审核节点 //校验是否是审核节点
@@ -177,10 +172,6 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId) {
return Boolean.TRUE;
}
@Override @Override
public ResponseResult initiating(InitiatingRequest request) { public ResponseResult initiating(InitiatingRequest request) {

View File

@@ -91,11 +91,6 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
return null;
}
@Override @Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage()); WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
@@ -117,12 +112,6 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId) {
return Boolean.TRUE;
}
@Override @Override
public PartnerBaseInfoVO getByLineId(Long lineId) { public PartnerBaseInfoVO getByLineId(Long lineId) {
LineInfoDO byLineId = lineInfoDAO.getLineInfo(lineId); LineInfoDO byLineId = lineInfoDAO.getLineInfo(lineId);

View File

@@ -10,6 +10,7 @@ import com.cool.store.enums.AuditResultTypeEnum;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.LineStatusEnum; import com.cool.store.enums.LineStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.request.AuditCloseRequest;
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 com.cool.store.request.LineFollowLogRequest; import com.cool.store.request.LineFollowLogRequest;
@@ -25,7 +26,7 @@ import javax.annotation.Resource;
* @Description: * @Description:
* @date 2024-03-20 14:32 * @date 2024-03-20 14:32
*/ */
@Service @Service("lineFlowService")
public abstract class LineFlowService { public abstract class LineFlowService {
@Resource @Resource
@@ -86,11 +87,8 @@ public abstract class LineFlowService {
* @return * @return
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean auditClose(AuditRejectRequest request, LoginUserInfo user){ public Boolean auditClose(AuditCloseRequest request, LoginUserInfo user){
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId()); 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());
@@ -99,7 +97,6 @@ public abstract class LineFlowService {
auditInfo.setRejectPublicReason(request.getRejectPublicReason()); auditInfo.setRejectPublicReason(request.getRejectPublicReason());
auditInfo.setRejectRealReason(request.getRejectRealReason()); auditInfo.setRejectRealReason(request.getRejectRealReason());
auditInfo.setCertifyFile(JSONObject.toJSONString(request.getCertifyFile())); auditInfo.setCertifyFile(JSONObject.toJSONString(request.getCertifyFile()));
Long auditId = lineAuditInfoDAO.addAuditInfo(auditInfo);
LineInfoDO updateLineInfo = new LineInfoDO(); LineInfoDO updateLineInfo = new LineInfoDO();
updateLineInfo.setId(request.getLineId()); updateLineInfo.setId(request.getLineId());
updateLineInfo.setUpdateUserId(user.getUserId()); updateLineInfo.setUpdateUserId(user.getUserId());
@@ -109,11 +106,9 @@ public abstract class LineFlowService {
lineFollowLogRequest.setLineId(request.getLineId()); lineFollowLogRequest.setLineId(request.getLineId());
lineFollowLogRequest.setMessage(String.format("结束跟进原因:%s", request.getRejectRealReason())); lineFollowLogRequest.setMessage(String.format("结束跟进原因:%s", request.getRejectRealReason()));
lineFollowService.addFollowLog(lineFollowLogRequest,user.getUserId(),user.getName()); lineFollowService.addFollowLog(lineFollowLogRequest,user.getUserId(),user.getName());
return auditClose(auditId, lineInfo,user.getUserId()); return Boolean.TRUE;
} }
protected abstract Boolean initStage(Long auditId, LineInfoDO lineInfo);
/** /**
* 审核通过 流转到下一阶段 * 审核通过 流转到下一阶段
* @param auditId * @param auditId
@@ -130,14 +125,6 @@ public abstract class LineFlowService {
*/ */
protected abstract Boolean auditReject(Long auditId, LineInfoDO lineInfo,String userId); protected abstract Boolean auditReject(Long auditId, LineInfoDO lineInfo,String userId);
/**
* 结束跟进
* @param auditId
* @param lineInfo
* @return
*/
protected abstract Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId);
} }

View File

@@ -394,12 +394,6 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
return lineInfoDAO.updateWorkflowStage(lineInfo.getId(), null, workflowSubStageStatus,null); return lineInfoDAO.updateWorkflowStage(lineInfo.getId(), null, workflowSubStageStatus,null);
} }
@Override
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
return null;
}
@Override @Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage()); InterviewTypeEnum interviewType = WorkflowSubStageEnum.getInterviewType(lineInfo.getWorkflowSubStage());
@@ -456,9 +450,4 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0; return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0;
} }
@Override
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId) {
return Boolean.TRUE;
}
} }

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.dao.LineAuditInfoDAO; import com.cool.store.dao.LineAuditInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.ShopInfoDAO; import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dao.ShopStageInfoDAO; import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.LineAuditInfoDO; import com.cool.store.entity.LineAuditInfoDO;
@@ -41,6 +42,8 @@ public class ShopServiceImpl implements ShopService {
private ShopStageInfoDAO shopStageInfoDAO; private ShopStageInfoDAO shopStageInfoDAO;
@Resource @Resource
private LineAuditInfoDAO lineAuditInfoDAO; private LineAuditInfoDAO lineAuditInfoDAO;
@Resource
private LineInfoDAO lineInfoDAO;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -100,8 +103,13 @@ public class ShopServiceImpl implements ShopService {
@Override @Override
public Long addShop(AddShopRequest request) { public Long addShop(AddShopRequest request) {
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
if(Objects.isNull(lineInfo)){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
ShopInfoDO addShop = new ShopInfoDO(); ShopInfoDO addShop = new ShopInfoDO();
addShop.setLineId(request.getLineId()); addShop.setLineId(request.getLineId());
addShop.setPartnerId(lineInfo.getPartnerId());
addShop.setShopName(request.getShopName()); addShop.setShopName(request.getShopName());
return shopInfoDAO.addShopInfo(addShop); return shopInfoDAO.addShopInfo(addShop);
} }

View File

@@ -121,11 +121,6 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
return leaseBaseInfoDO; return leaseBaseInfoDO;
} }
@Override
protected Boolean initStage(Long auditId, LineInfoDO lineInfo) {
return null;
}
@Override @Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage()); WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
@@ -141,9 +136,4 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
} }
@Override
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo,String userId) {
return Boolean.TRUE;
}
} }

View File

@@ -4,16 +4,19 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dao.LineInfoDAO; import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.LineInfoDO; import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.WorkflowSubStageEnum; import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.request.AuditCloseRequest;
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 com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.BankService; import com.cool.store.service.BankService;
import com.cool.store.service.impl.CommonService; import com.cool.store.service.impl.CommonService;
import com.cool.store.service.impl.DefaultLineFlowService;
import com.cool.store.service.impl.LineFlowService; import com.cool.store.service.impl.LineFlowService;
import com.cool.store.service.impl.LineInterviewServiceImpl; import com.cool.store.service.impl.LineInterviewServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -35,6 +38,8 @@ public class LineAuditController {
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource(name = "defaultLineFlowService")
private LineFlowService lineFlowService;
@Resource @Resource
BankService bankService; BankService bankService;
@@ -59,8 +64,8 @@ public class LineAuditController {
@ApiOperation("结束跟进") @ApiOperation("结束跟进")
@PostMapping("/close") @PostMapping("/close")
public ResponseResult<Boolean> auditClose(@RequestBody AuditRejectRequest request){ public ResponseResult<Boolean> auditClose(@RequestBody AuditCloseRequest request){
return ResponseResult.success(commonService.getLineFlowService(request.getWorkflowSubStage()).auditClose(request, CurrentUserHolder.getUser())); return ResponseResult.success(lineFlowService.auditClose(request, CurrentUserHolder.getUser()));
} }
} }

View File

@@ -1,15 +1,12 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.request.*; import com.cool.store.request.*;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.PointService; import com.cool.store.service.PointService;
import com.cool.store.vo.LinePointBaseInfoVO; import com.cool.store.vo.LinePointBaseInfoVO;
import com.cool.store.vo.point.*; import com.cool.store.vo.point.*;
import com.cool.store.vo.shop.ShopStageVO; import com.cool.store.vo.shop.ShopStageVO;
import com.cool.store.vo.shop.ShopSubStageVO;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;