Commit 9cccfde8 by liyanlin

1、流程变更,提单人->对应部门负责人审核->人事->总经办->财务->最终审->出纳;

2、总经办和最终审无需审核DSP的单。
parent 743a1a18
...@@ -48,8 +48,8 @@ public class FinalCheckState extends CostState { ...@@ -48,8 +48,8 @@ public class FinalCheckState extends CostState {
@Resource @Resource
UnPayState unPayState; UnPayState unPayState;
@Resource //@Resource
GeneralManagerCheckState generalManagerCheckState; //GeneralManagerCheckState generalManagerCheckState;
@Resource @Resource
CostLogDao costLogDao; CostLogDao costLogDao;
@Resource @Resource
...@@ -62,7 +62,7 @@ public class FinalCheckState extends CostState { ...@@ -62,7 +62,7 @@ public class FinalCheckState extends CostState {
private void autoPass() { private void autoPass() {
CostDomain costDomain = costContext.costDomain; CostDomain costDomain = costContext.costDomain;
costDomain.setCostStatus(CostDomain.STATUS_MANAGER_CHECK); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
...@@ -70,11 +70,9 @@ public class FinalCheckState extends CostState { ...@@ -70,11 +70,9 @@ public class FinalCheckState extends CostState {
costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername) costLogService.saveByManage(costDomain.getCostNo(), "最终审核自动通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername)
.collect(Collectors.joining(",")), CostLogDomain.DEPARTMENT_AUTO_PASS); .collect(Collectors.joining(",")), CostLogDomain.DEPARTMENT_AUTO_PASS);
//流转状态 //流转状态
nextState(generalManagerCheckState); nextState(unPayState);
//尝试自动下一个流程自动审核
costSubscribe.subscribe(costContext);
//通知财务系统 //通知财务系统
//costContext.costService.toFinancial(costDomain); costContext.costService.toFinancial(costDomain);
} }
@Resource @Resource
...@@ -131,6 +129,12 @@ public class FinalCheckState extends CostState { ...@@ -131,6 +129,12 @@ public class FinalCheckState extends CostState {
return; return;
} }
if (costDomain.getProjectType().equalsIgnoreCase("DSP")) {
log.info("费用单:{}不需要最终审核审核,原因:该订单为DSP。最终审核人自动通过", costDomain.getCostNo());
this.autoPass();
return;
}
//需要自动审核 //需要自动审核
if (costTemplate.shouldFinalAutoCheck(costDomain)) { if (costTemplate.shouldFinalAutoCheck(costDomain)) {
//自动审核通过 //自动审核通过
...@@ -151,7 +155,7 @@ public class FinalCheckState extends CostState { ...@@ -151,7 +155,7 @@ public class FinalCheckState extends CostState {
.costNo(costDomain.getCostNo()) .costNo(costDomain.getCostNo())
.isPassed(true) .isPassed(true)
.build(); .build();
costDomain.setCostStatus(CostDomain.STATUS_MANAGER_CHECK); costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
...@@ -162,11 +166,9 @@ public class FinalCheckState extends CostState { ...@@ -162,11 +166,9 @@ public class FinalCheckState extends CostState {
sendWxMsg(costDomain, currentUserId); sendWxMsg(costDomain, currentUserId);
//流转状态 //流转状态
nextState(generalManagerCheckState); nextState(unPayState);
//通知财务系统 //通知财务系统
//costContext.costService.toFinancial(costDomain); costContext.costService.toFinancial(costDomain);
//尝试自动下一个流程自动审核
costSubscribe.subscribe(costContext);
} }
//人工审核没权限 //人工审核没权限
......
...@@ -22,6 +22,7 @@ import java.math.BigDecimal; ...@@ -22,6 +22,7 @@ import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -34,8 +35,10 @@ import java.util.stream.Collectors; ...@@ -34,8 +35,10 @@ import java.util.stream.Collectors;
@Scope("prototype") @Scope("prototype")
public class GeneralManagerCheckState extends CostState { public class GeneralManagerCheckState extends CostState {
//@Resource
//UnPayState unPayState;
@Resource @Resource
UnPayState unPayState; FinancialCheckState financialCheckState;
@Resource @Resource
CostCurrentReviewerMapper costCurrentReviewerMapper; CostCurrentReviewerMapper costCurrentReviewerMapper;
@Resource @Resource
...@@ -55,7 +58,7 @@ public class GeneralManagerCheckState extends CostState { ...@@ -55,7 +58,7 @@ public class GeneralManagerCheckState extends CostState {
} }
//小于1w的自动审核 //小于1w的自动审核
if (this.autoPass(costDomain)) { if (this.autoPass(costDomain)) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_FINANCIAL_CHECK);
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
...@@ -63,12 +66,12 @@ public class GeneralManagerCheckState extends CostState { ...@@ -63,12 +66,12 @@ public class GeneralManagerCheckState extends CostState {
costLogService.saveByManage(costDomain.getCostNo(), "总经办自动审核通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername) costLogService.saveByManage(costDomain.getCostNo(), "总经办自动审核通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername)
.collect(Collectors.joining(",")), CostLogDomain.MANAGER_AUTO_PASS); .collect(Collectors.joining(",")), CostLogDomain.MANAGER_AUTO_PASS);
//流转状态 //流转状态
nextState(unPayState); nextState(financialCheckState);
//发布到总线尝试下个环节的自动审核 //发布到总线尝试下个环节的自动审核
//costSubscribe.subscribe(costContext); costSubscribe.subscribe(costContext);
//通知财务系统 //通知财务系统
costContext.costService.toFinancial(costDomain); //costContext.costService.toFinancial(costDomain);
return; return;
} }
...@@ -77,7 +80,7 @@ public class GeneralManagerCheckState extends CostState { ...@@ -77,7 +80,7 @@ public class GeneralManagerCheckState extends CostState {
if (currentUserId == 681 || currentUserId == 2346) { if (currentUserId == 681 || currentUserId == 2346) {
//大于等于1w需要铭哥审批 //大于等于1w需要铭哥审批
if (costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) >= 0) { if (costDomain.getAmountRmb().compareTo(new BigDecimal("10000")) >= 0) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY); costDomain.setCostStatus(CostDomain.STATUS_FINANCIAL_CHECK);
costDomain.setLastModifyDate(LocalDateTime.now()); costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain); costDao.updateById(costDomain);
...@@ -85,12 +88,12 @@ public class GeneralManagerCheckState extends CostState { ...@@ -85,12 +88,12 @@ public class GeneralManagerCheckState extends CostState {
costLogService.saveByManage(costDomain.getCostNo(), "总经办审核通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername) costLogService.saveByManage(costDomain.getCostNo(), "总经办审核通过,当前审核人:" + costCurrentReviewerList.stream().map(CostCurrentReviewer::getUsername)
.collect(Collectors.joining(",")), CostLogDomain.MANAGER_MANUAL_PASS); .collect(Collectors.joining(",")), CostLogDomain.MANAGER_MANUAL_PASS);
//流转状态 //流转状态
nextState(unPayState); nextState(financialCheckState);
//发布到总线尝试下个环节的自动审核 //发布到总线尝试下个环节的自动审核
//costSubscribe.subscribe(costContext); costSubscribe.subscribe(costContext);
//通知财务系统 //通知财务系统
costContext.costService.toFinancial(costDomain); //costContext.costService.toFinancial(costDomain);
return; return;
} }
} else { } else {
...@@ -104,14 +107,14 @@ public class GeneralManagerCheckState extends CostState { ...@@ -104,14 +107,14 @@ public class GeneralManagerCheckState extends CostState {
CostDomain costDomain = costContext.costDomain; CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId; Integer currentUserId = costContext.currentUserId;
CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo()); //CostCompanyDomain costCompany = costCompanyDao.selectByNo(costDomain.getCompanyNo());
//check status //check status
if (!costDomain.getCostStatus().equals(CostDomain.STATUS_MANAGER_CHECK)) { if (!costDomain.getCostStatus().equals(CostDomain.STATUS_MANAGER_CHECK)) {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
//人工审核通过 //人工审核拒绝
if (currentUserId == 681 || currentUserId == 2346) { if (currentUserId == 681 || currentUserId == 2346) {
ApprovalHistoryDomain approvalHistoryDomain = ApprovalHistoryDomain.builder() ApprovalHistoryDomain approvalHistoryDomain = ApprovalHistoryDomain.builder()
.approvalUserId(currentUserId) .approvalUserId(currentUserId)
...@@ -153,6 +156,10 @@ public class GeneralManagerCheckState extends CostState { ...@@ -153,6 +156,10 @@ public class GeneralManagerCheckState extends CostState {
//收款不需要审核 //收款不需要审核
return true; return true;
} }
if (costDomain.getProjectType().equalsIgnoreCase("DSP")) {
//DSP不需要审核
return true;
}
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo()); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costDomain.getTypeNo());
if (costTypeDomain.getTypeName().contains("工资") || costTypeDomain.getTypeName().contains("物流")|| costTypeDomain.getTypeName().contains("社保费")) { if (costTypeDomain.getTypeName().contains("工资") || costTypeDomain.getTypeName().contains("物流")|| costTypeDomain.getTypeName().contains("社保费")) {
return true; return true;
......
...@@ -33,8 +33,10 @@ import java.util.List; ...@@ -33,8 +33,10 @@ import java.util.List;
@Scope("prototype") @Scope("prototype")
public class HrCheckState extends CostState { public class HrCheckState extends CostState {
@Autowired //@Autowired
FinancialCheckState financialCheckState; //FinancialCheckState financialCheckState;
@Resource
GeneralManagerCheckState generalManagerCheckState;
@Resource @Resource
OaDepartmentMapper oaDepartmentMapper; OaDepartmentMapper oaDepartmentMapper;
@Resource @Resource
...@@ -63,7 +65,7 @@ public class HrCheckState extends CostState { ...@@ -63,7 +65,7 @@ public class HrCheckState extends CostState {
costDao.updateById(costDomain); costDao.updateById(costDomain);
//流转状态 //流转状态
nextState(financialCheckState); nextState(generalManagerCheckState);
costSubscribe.subscribe(costContext); costSubscribe.subscribe(costContext);
return; return;
...@@ -86,7 +88,7 @@ public class HrCheckState extends CostState { ...@@ -86,7 +88,7 @@ public class HrCheckState extends CostState {
costLogService.save(costDomain.getCostNo(), currentUserId, "行政审核通过", CostLogDomain.HR_PASS); costLogService.save(costDomain.getCostNo(), currentUserId, "行政审核通过", CostLogDomain.HR_PASS);
approvalHistoryService.save(approvalHistoryDomain); approvalHistoryService.save(approvalHistoryDomain);
nextState(financialCheckState); nextState(generalManagerCheckState);
//发布到总线尝试下个环节的自动审核 //发布到总线尝试下个环节的自动审核
costSubscribe.subscribe(costContext); costSubscribe.subscribe(costContext);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment