|
|
@@ -33,7 +33,6 @@ import java.util.*;
|
|
|
* 超过5天未审批的单据自动全部通过
|
|
|
*/
|
|
|
@Component
|
|
|
-@EnableScheduling
|
|
|
@Slf4j
|
|
|
public class StocklandAutoFinishFlowTask {
|
|
|
|
|
|
@@ -58,6 +57,7 @@ public class StocklandAutoFinishFlowTask {
|
|
|
private String companyMasterPhone;
|
|
|
|
|
|
@Scheduled(cron = "0 0 0 * * ?") // 每天凌晨12点执行
|
|
|
+// @Scheduled(cron = "0 0/1 * * * ?") // 每分钟执行一次
|
|
|
public void autoFinishFlow() {
|
|
|
|
|
|
List<StockLand> allNeedJudgeStockLand = stockLandService.findAllNeedJudgeStockLand();
|
|
|
@@ -81,8 +81,9 @@ public class StocklandAutoFinishFlowTask {
|
|
|
|
|
|
private void autoJudge(StockLand stockLand) throws ParseException, ClientException, InterruptedException {
|
|
|
Approval latestApproval = approvalService.getLatestApproval(stockLand.getId(), Constant.DictionaryType.STOCKLAND);
|
|
|
+ Approval dispatchApproval = approvalService.getLatestDispatchApproval(stockLand.getId(), Constant.DictionaryType.STOCKLAND);
|
|
|
// 最后一个审批超过5天的 开始自动审批
|
|
|
- Boolean overTime = DateUtil.isOverTime(latestApproval.getCreate_time(), 5);
|
|
|
+ Boolean overTime = DateUtil.isOverTime(dispatchApproval.getCreate_time(), 5);
|
|
|
if (!overTime) return;
|
|
|
log.info("开始自动审批单据, apply_no: " + stockLand.getApply_no());
|
|
|
String nextchecker = latestApproval.getNextchecker();
|
|
|
@@ -104,7 +105,7 @@ public class StocklandAutoFinishFlowTask {
|
|
|
log.info("开始自动审批单据, apply_no: " + stockLand.getApply_no() + ",currentChecker: " + currentChecker +" 自动置为简易流程汇总");
|
|
|
|
|
|
stockLand.setApprove_status(Constant.LandApproveStatus.JYLCHZ);
|
|
|
- stockLandService.save(stockLand);
|
|
|
+ stockLandService.saveStatus(stockLand);
|
|
|
stockLandService.autoSaveApproval(stockLand.getId(),
|
|
|
"超时自动审批通过",
|
|
|
currentChecker,
|
|
|
@@ -119,7 +120,7 @@ public class StocklandAutoFinishFlowTask {
|
|
|
//当最后一个人审核后,将该单据的状态设为“后面是合规性审查汇总”
|
|
|
log.info("开始自动审批单据, apply_no: " + stockLand.getApply_no() + ",currentChecker: " + currentChecker+ "自动置为合规性审查汇总");
|
|
|
stockLand.setApprove_status(Constant.LandApproveStatus.HGXSCTG);
|
|
|
- stockLandService.save(stockLand);
|
|
|
+ stockLandService.saveStatus(stockLand);
|
|
|
stockLandService.autoSaveApproval(stockLand.getId(),
|
|
|
"超时自动审批通过",
|
|
|
currentChecker,
|