From 7a988c17fe25f18815889ff5221a5ebcf01fabdc Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期一, 13 十月 2025 18:15:59 +0800
Subject: [PATCH] 武汉黄陂军粮-质检报告共享接口同步及推送3
---
src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1302.java | 41 ++++++++++++++++++++++++++++++-----------
1 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1302.java b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1302.java
index c4bf0c7..1f17c90 100644
--- a/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1302.java
+++ b/src/main/java/com/fzzy/async/fzzy35/impl/Fzzy35Sync1302.java
@@ -16,7 +16,6 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-
import java.util.Date;
import java.util.List;
@@ -24,7 +23,7 @@
/**
* 娓╂箍搴︽娴嬫暟鎹悓姝�
*
- * @author chen
+ * @author czt
* @date 2022-09-07 14:41
*/
@Slf4j
@@ -67,11 +66,10 @@
log.info("1302---鍚屾鏁版嵁锛氭病鏈夋煡璇㈠埌闇�瑕佸悓姝ョ殑鏁版嵁");
return;
}
- log.info(JSONObject.toJSONString(list));
Date syncTime = new Date();
Api1302 api1302;
Api1105 api1105;
- //int index = 10001;
+ List<Api1302> api1302List;
for (Fz35Grain fz35Grain : list) {
//鑾峰彇璐т綅淇℃伅
api1105 = commonService.getApi1105Cache(fz35Grain.getDepotId());
@@ -88,14 +86,14 @@
api1302.setCfww(fz35Grain.getTempOut() == null ? 0.00: fz35Grain.getTempOut());
if(null == fz35Grain.getHumidityOut() || fz35Grain.getHumidityOut() < 0){
- api1302.setCfws(-1);
+ api1302.setCfws(0);
}else {
api1302.setCfws(fz35Grain.getHumidityOut());
}
api1302.setCfnw(fz35Grain.getTempIn() == null ? 0.00: fz35Grain.getTempIn());
if(null == fz35Grain.getHumidityIn() || fz35Grain.getHumidityIn() < 0){
- api1302.setCfns(-1);
+ api1302.setCfns(0);
}else {
api1302.setCfns(fz35Grain.getHumidityIn());
}
@@ -103,6 +101,14 @@
api1302.setLszgw(fz35Grain.getTempMax() == null ? 0.00: fz35Grain.getTempMax());
api1302.setLspjw(fz35Grain.getTempAve() == null ? 0.00: fz35Grain.getTempAve());
api1302.setLszdw(fz35Grain.getTempMin() == null ? 0.00: fz35Grain.getTempMin());
+
+ //鍒ゆ柇绮鏈�浣庢俯銆佸钩鍧囨俯銆佹渶楂樻俯鏄惁绗﹀悎閫昏緫
+ if(api1302.getLszdw() >= api1302.getLspjw()){
+ continue;
+ }
+ if(api1302.getLspjw() >= api1302.getLszgw()){
+ continue;
+ }
//娓╁害闆嗗悎
if (StringUtils.isEmpty(fz35Grain.getCableCir())) {
@@ -113,15 +119,19 @@
api1302.setLssdzjh(getHumPointList2(fz35Grain.getPoints(), fz35Grain.getCable(), fz35Grain.getCableCir()));
}
- api1302.setCzbz(Constant.CZBZ_I);
- api1302.setZhgxsj(syncTime);
+ api1302.setZhgxsj(fz35Grain.getReceiveDate());
api1302.setBizId(fz35Grain.getBatchId());
api1302.setKqdm(api1105.getKqdm());
api1302.setSyncTime(syncTime);
+ api1302List = api1302Rep.getDataByWsdjcdh(api1302.getWsdjcdh());
+ if(null == api1302List || api1302List.isEmpty()){
+ api1302.setCzbz(Constant.CZBZ_I);
+ }else {
+ api1302.setCzbz(api1302List.get(0).getCzbz());
+ }
log.info("1302---鍚屾鏁版嵁锛�" + api1302.toString());
api1302Rep.save(api1302);
- // index++;
}
} catch (Exception e) {
@@ -145,10 +155,13 @@
String[] points = point.split(",");
String result = "";
+ if (c * h * l > points.length) {
+ return result;
+ }
for (int i = 1; i <= l; i++) {
for (int j = 1; j <= h; j++) {
for (int z = 1; z <= c; z++) {
- result += ("|" + points[(i * j - 1) * c + z - 1] + "," + z + "," + j + "," + i);
+ result += ("|" + points[((i-1)*h+j-1)*c + z -1] + "," + z + "," + j + "," + i);
}
}
}
@@ -169,9 +182,15 @@
int g = 0; //鍦堟牴鏁�
int g1 = 1; //鍦堣捣濮嬫牴鏁�
int g2 = 0; //鍦堟埅姝㈡牴鏁�
-
+ int genNum = 0;
+ for (String s : cab) {
+ genNum += Integer.valueOf(s);
+ }
String[] points = point.split(",");
String result = "";
+ if (c * genNum > points.length) {
+ return result;
+ }
for (int i = 1; i <= q; i++) {
g1 += g2;
g = Integer.valueOf(cab[i - 1]);
--
Gitblit v1.9.3