Commit 9cccfde8 by liyanlin

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

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