From acdc4b3427cbd2a6dc811aed202fbd3e9c309d69 Mon Sep 17 00:00:00 2001
From: 18516761980 <4761516tqsxp>
Date: 星期五, 05 十一月 2021 10:57:12 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/erp/task/ErpScheduler.java | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/common/service/erp/task/ErpScheduler.java b/src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
index cf2464e..c50eae7 100644
--- a/src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
+++ b/src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
@@ -16,6 +16,7 @@
import com.zy.common.service.erp.ErpService;
import com.zy.common.service.erp.dto.InStockDto;
import com.zy.common.service.erp.entity.*;
+import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@@ -23,6 +24,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -52,7 +54,8 @@
/**
* 鍘熸潗鏂欏叆搴撳崟
*/
- @Scheduled(cron = "0/5 * * * * ? ")
+ @Scheduled(cron = "0/30 * * * * ? ")
+ @Synchronized
// @PostConstruct
public void inStockExecute(){
List<InStockDto> readyInStock = erpService.getReadyInStock();
@@ -121,7 +124,8 @@
/**
* 鎴愬搧鍏ュ簱鍗�
*/
- @Scheduled(cron = "0/5 * * * * ? ")
+ @Scheduled(cron = "0/20 * * * * ? ")
+ @Synchronized
// @PostConstruct
public void inCPICMOExecute(){
List<CPICMO> cpicmos = erpService.getReadyCPICMO();
@@ -178,7 +182,8 @@
}
}
- @Scheduled(cron = "0/5 * * * * ? ")
+ @Scheduled(cron = "0/30 * * * * ? ")
+ @Synchronized
public void syncMat(){
List<M_item> items = erpService.getItem();
for (M_item item : items) {
@@ -213,6 +218,7 @@
* 鎴愬搧鍑哄簱 鍙戣揣閫氱煡鍗曡〃澶�,琛ㄦ槑缁�
*/
@Scheduled(cron = "0/15 * * * * ? ")
+ @Synchronized
@Transactional
public void syncOutStock(){
List<OutStockBill> outStockBills = erpService.syncOutStock();
@@ -244,6 +250,7 @@
if (null == one) {
// String Fnumber = (Cools.isEmpty(outStockBillEntry.getFSourceBillNo())) ? outStockBillEntry.getFnumber() : outStockBillEntry.getFnumber()+"|"+outStockBillEntry.getFSourceBillNo();
// outStockBillEntry.setFnumber(Fnumber); //浜у搧浠g爜|鐢熶骇鍗曞彿
+ outStockBillEntry.setFAmount(new BigDecimal(0));
if (!outStockService.insert(outStockBillEntry)) {
log.info("鎻愬彇鍑哄簱閫氱煡鏄庣粏琛∣utStockBillEntry澶辫触[FBrNo={},FInterID={},FEntryID={}]",outStockBillEntry.getFBrNo(),
outStockBillEntry.getFInterID(),outStockBillEntry.getFEntryID());
@@ -256,6 +263,7 @@
} else {
// 鏁伴噺鏈夊彉鍖栬繘琛屾洿鏂�
if (Double.doubleToLongBits(one.getFAuxQty().doubleValue()) != Double.doubleToLongBits(outStockBillEntry.getFAuxQty().doubleValue())) {
+ outStockBillEntry.setFAmount(new BigDecimal(0));
if (!outStockService.update(outStockBillEntry, wrapper)) {
log.info("鍚屾鏇存柊閫氱煡鏄庣粏琛∣utStockBillEntry澶辫触[FBrNo={},FInterID={},FEntryID={}]",outStockBillEntry.getFBrNo(),
outStockBillEntry.getFInterID(),outStockBillEntry.getFEntryID());
--
Gitblit v1.9.1