From 2f4505f4e2a36245a49b87840b711ad00729891e Mon Sep 17 00:00:00 2001
From: ZY <zc857179121@qq.com>
Date: 星期一, 19 八月 2024 08:46:12 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/third/erp/task/ERPInHedTBScheduler.java | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/zy/third/erp/task/ERPInHedTBScheduler.java b/src/main/java/com/zy/third/erp/task/ERPInHedTBScheduler.java
index 996a7ec..28a8308 100644
--- a/src/main/java/com/zy/third/erp/task/ERPInHedTBScheduler.java
+++ b/src/main/java/com/zy/third/erp/task/ERPInHedTBScheduler.java
@@ -1,5 +1,6 @@
package com.zy.third.erp.task;
+import com.core.common.Cools;
import com.zy.common.service.erp.ErpSqlServer;
import com.zy.third.erp.entity.InDetTB;
import com.zy.third.erp.entity.InHedTB;
@@ -33,7 +34,7 @@
private ErpSqlServer erpSqlServer;
- @Transactional(rollbackFor = Throwable.class)
+ //@Transactional(rollbackFor = Throwable.class)
@Scheduled(cron = "${erp.refreshtime}")
public void InHedTBScheduler() {
//log.info("InHedTBScheduler寮�濮嬩簡");
@@ -42,20 +43,25 @@
List<InHedTB> inHeds = erpSqlServer.select(sqlInHed, InHedTB.class);
if (!inHeds.isEmpty()) {
for (InHedTB inHed : inHeds) {
+ if (!Cools.isEmpty(inHed.getTemp3()) && inHed.getTemp3().equals("fault")) {
+ continue;
+ }
HashMap<String, String> condition = new HashMap<>();
condition.put("BillNo", "'" + inHed.getBillNo() + "'");
List<InDetTB> inDetTBS = erpSqlServer.selectList(InDetTB.class, condition);
HashMap<String, Object> hedAndDet = new HashMap<>();
hedAndDet.put("hed", inHed);
hedAndDet.put("det", inDetTBS);
- boolean result = inMS.createInOrder(inHed, inDetTBS);
- if (result) {
- log.info("鍏ュ簱鍗曟嵁鎴愬姛,{}", inHed);
- move(hedAndDet);
- } else {
- String sql = "UPDATE erp_InHedTB SET Temp3 = 鈥榝ault鈥� WHERE BillNo = '" + inHed.getBillNo() + "'";
+ try {
+ inMS.createInOrder(inHed, inDetTBS);
+ } catch (Exception e) {
+ e.printStackTrace();
+ String sql = "UPDATE erp_InHedTB SET Temp3 = 'fault' WHERE BillNo = '" + inHed.getBillNo() + "'";
erpSqlServer.update(sql);
}
+ log.info("鍏ュ簱鍗曟嵁鎴愬姛,{}", inHed);
+ move(hedAndDet);
+
}
}
}
--
Gitblit v1.9.1