From ca0ba8f31193e6dfd7ebb610d174a17ff436559a Mon Sep 17 00:00:00 2001
From: WS <1143478319@qq.com>
Date: 星期三, 23 八月 2023 09:20:34 +0800
Subject: [PATCH] 上海接口接数据上报-库存 客户

---
 src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java      |  118 +++++++++++++++++++++++
 src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java      |   81 ++++++++++++++++
 src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java    |   43 ++++++++
 src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java |   44 ++++++++
 4 files changed, 284 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
index c21e5ec..7abcb9b 100644
--- a/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
+++ b/src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -439,6 +439,37 @@
                 list.add(api1206);
             }
             return JSON.toJSONString(list);
+        } else if (SH2023Constant.SH_2023_API_CODE_1208.equals(inteId)) {
+            SH2023Api1208 api1208;
+            //鏈�鍚庤浆鎹负json
+            List<SH2023Api1208> list = new ArrayList<>();
+            //鎶奷ata杞寲鎴恖ist闆嗗悎
+            List<Api1208> api1208List = castList(data, Api1208.class);
+            for (Api1208 apiData : api1208List) {
+                api1208 = new SH2023Api1208();
+                BeanUtils.copyProperties(apiData, api1208);
+                api1208.setZglkdm(api1208.getHwdm().substring(0, 21));
+
+                //TODO 鏉ョ伯浠g爜
+
+                api1208.setBjw(ShAreaBjw.getBjw(code));
+                api1208.setPch(apiData.getHwdm() + apiData.getShnd());
+                list.add(api1208);
+            }
+            return JSON.toJSONString(list);
+        } else if (SH2023Constant.SH_2023_API_CODE_1212.equals(inteId)) {
+            SH2023Api1212 api1212;
+            //鏈�鍚庤浆鎹负json
+            List<SH2023Api1212> list = new ArrayList<>();
+            //鎶奷ata杞寲鎴恖ist闆嗗悎
+            List<Api1212> api1212List = castList(data, Api1212.class);
+            for (Api1212 apiData : api1212List) {
+                api1212 = new SH2023Api1212();
+                BeanUtils.copyProperties(apiData, api1212);
+                api1212.setBjw(ShAreaBjw.getBjw(code));
+                list.add(api1212);
+            }
+            return JSON.toJSONString(list);
         } else if (SH2023Constant.SH_2023_API_CODE_1301.equals(inteId)) {
             SH2023Api1301 api1301;
             //鏈�鍚庤浆鎹负json
@@ -570,6 +601,19 @@
                 list.add(api1401);
             }
             return JSON.toJSONString(list);
+        }else if (SH2023Constant.SH_2023_API_CODE_1401.equals(inteId)) {
+            SH2023Api1401 api1401;
+            //鏈�鍚庤浆鎹负json
+            List<SH2023Api1401> list = new ArrayList<>();
+            //鎶奷ata杞寲鎴恖ist闆嗗悎
+            List<Api1401> api1401List = castList(data, Api1401.class);
+            for (Api1401 apiData : api1401List) {
+                api1401 = new SH2023Api1401();
+                BeanUtils.copyProperties(apiData, api1401);
+                api1401.setBjw(ShAreaBjw.getBjw(code));
+                list.add(api1401);
+            }
+            return JSON.toJSONString(list);
         } else {
             return JSON.toJSONString(data);
         }
diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java
index db90a98..0340836 100644
--- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java
+++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java
@@ -273,7 +273,27 @@
      * 1208 绮搴撳瓨
      */
     public void pushData1208(ApiRemoteService apiRemoteService, ApiParam param) {
-        //TODO
+        //鑾峰彇绮搴撳瓨淇℃伅
+        List<Api1208> list = api1208Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd());
+
+        if (null == list || list.isEmpty()) {
+            log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮搴撳瓨淇℃伅锛屼笉鎺ㄩ��-----");
+            return;
+        }
+        param.setInteId(SH2023Constant.SH_2023_API_CODE_1208);
+        //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+        ResponseDto responseDto = apiRemoteService.pushData(param, list);
+        if (responseDto.getSuccess() == 0) {
+            //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+            for (Api1208 data : list) {
+                if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+                    data.setCzbz(Constant.CZBZ_U);
+                    //鏇存柊鐘舵��
+                    api1208Rep.save(data);
+                }
+            }
+        }
 
     }
 
@@ -305,8 +325,27 @@
      * 1212 瀹㈡埛淇℃伅
      */
     public void pushData1212(ApiRemoteService apiRemoteService, ApiParam param) {
-        //TODO
+        //鑾峰彇瀹㈡埛淇℃伅
+        List<Api1212> list = api1212Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd());
 
+        if (null == list || list.isEmpty()) {
+            log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹㈡埛淇℃伅锛屼笉鎺ㄩ��-----");
+            return;
+        }
+        param.setInteId(SH2023Constant.SH_2023_API_CODE_1212);
+        //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮�
+        ResponseDto responseDto = apiRemoteService.pushData(param, list);
+        if (responseDto.getSuccess() == 0) {
+            //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵��
+            for (Api1212 data : list) {
+                if (Constant.CZBZ_I.equals(data.getCzbz())) {
+
+                    data.setCzbz(Constant.CZBZ_U);
+                    //鏇存柊鐘舵��
+                    api1212Rep.save(data);
+                }
+            }
+        }
     }
 
     /**
diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java
new file mode 100644
index 0000000..bfcee7a
--- /dev/null
+++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1208.java
@@ -0,0 +1,118 @@
+package com.fzzy.push.sh2023.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.bstek.dorado.annotation.PropertyDef;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鎺ュ彛琛�-绮搴撳瓨淇℃伅
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SH2023Api1208 implements Serializable {
+    /**
+     *
+     */
+    private static final long serialVersionUID = -8778664614878279565L;
+
+    @PropertyDef(label = "璐т綅浠g爜")
+    private String hwdm;
+
+    @PropertyDef(label = "绮鍝佺浠g爜")
+    private String lspzdm;
+
+    @PropertyDef(label = "绮鎬ц川浠g爜")
+    private String lsxzdm;
+
+    @PropertyDef(label = "绮绛夌骇浠g爜")
+    private String lsdjdm;
+
+    @PropertyDef(label = "鏀惰幏骞村害")
+    private String shnd;
+
+    @PropertyDef(label = "鍥藉埆")
+    private Date gb;
+
+    @PropertyDef(label = "浜у湴")
+    private String cd;
+
+    @PropertyDef(label = "淇濈鍛�")
+    private String bgy;
+
+    @PropertyDef(label = "涓荤绮簱浠g爜")
+    private String zglkdm;
+
+    @PropertyDef(label = "绠$悊鏂瑰紡")
+    private String glfs;
+
+    @PropertyDef(label = "鏀跺偍鍦扮偣")
+    private String scdd;
+
+    @PropertyDef(label = "鍌ㄧ伯鏂瑰紡")
+    private String clfs;
+
+    @PropertyDef(label = "璐т綅锛堟补缃愶級鐘舵��")
+    private String hwzt;
+
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    @PropertyDef(label = "鍏ヤ粨鏃堕棿")
+    private Date rcsj;
+
+    @JSONField(format = "yyyy-MM-dd")
+    @PropertyDef(label = "灏佷粨鏃ユ湡")
+    private Date fcrq;
+
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    @PropertyDef(label = "鍑轰粨瀹屾垚鏃堕棿")
+    private Date ccwcsj;
+
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    @PropertyDef(label = "娓呬粨鏃堕棿")
+    private Date qcsj;
+
+    @PropertyDef(label = "鎴愯揣浣嶅墠鎹熻��")
+    private Double chwqsh;
+
+    @PropertyDef(label = "瀹為檯鏁伴噺")
+    private Double sjsl;
+
+    @PropertyDef(label = "璁′环鏁伴噺")
+    private Double jjsl;
+
+    @PropertyDef(label = "鍖呭瓨绮寘鏁�")
+    private Integer bclbs;
+
+    @PropertyDef(label = "瀹為檯瑁呯伯绾块珮")
+    private Double sjzlxg;
+
+    @PropertyDef(label = "绮爢浣撶Н")
+    private Double ldtj;
+
+    @PropertyDef(label = "澶囨敞")
+    private String bz;
+
+    @PropertyDef(label = "鎿嶄綔鏍囧織")
+    private String czbz;
+
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    @PropertyDef(label = "鏈�鍚庢洿鏂版椂闂�")
+    private Date zhgxsj;
+
+    @PropertyDef(label = "鎵规鍙�")
+    private String pch;
+
+    @PropertyDef(label = "鏍囪浣�")
+    private String bjw;
+
+    @PropertyDef(label = "鎴愬搧绮鏍�")
+    private String cplgg;
+
+    @PropertyDef(label = "鏉ョ伯浠g爜")
+    private String goodscode;
+
+
+}
diff --git a/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java
new file mode 100644
index 0000000..756e56d
--- /dev/null
+++ b/src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1212.java
@@ -0,0 +1,81 @@
+package com.fzzy.push.sh2023.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.bstek.dorado.annotation.PropertyDef;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 鎺ュ彛琛�-绮搴撳瓨淇℃伅
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SH2023Api1212 implements Serializable {
+    /**
+     *
+     */
+    private static final long serialVersionUID = -8778664614878279565L;
+
+    @PropertyDef(label = "鍗曚綅浠g爜")
+    private String dwdm;
+
+    @PropertyDef(label = "鍗曚綅鍚嶇О")
+    private String dwmc;
+
+    @PropertyDef(label = "搴撳尯浠g爜")
+    private String kqdm;
+
+    @PropertyDef(label = "搴撳尯鍚嶇О")
+    private String kqmc;
+
+    @PropertyDef(label = "瀹㈡埛绫诲瀷")
+    private String khlx;
+
+    @PropertyDef(label = "瀹㈡埛缁熶竴绀句細淇$敤浠g爜鎴栬韩浠借瘉鍙�")
+    private String Khtyshxydmhsfzh;
+
+    @PropertyDef(label = "瀹㈡埛鍚嶇О")
+    private String khmc;
+
+    @PropertyDef(label = "娉曞畾浠h〃浜�")
+    private String fddbr;
+
+    @PropertyDef(label = "閫氳鍦板潃")
+    private String txdz;
+
+    @PropertyDef(label = "閭斂缂栫爜")
+    private String yzbm;
+
+    @PropertyDef(label = "鑱旂郴浜哄鍚�")
+    private String lxrxm;
+
+    @PropertyDef(label = "鑱旂郴鐢佃瘽")
+    private String lxrdh;
+
+    @PropertyDef(label = "鑱旂郴浜鸿韩浠借瘉鍙�")
+    private String lxrsfzh;
+
+    @PropertyDef(label = "鐢靛瓙淇$")
+    private String dzyx;
+
+    @PropertyDef(label = "瀹㈡埛鏂瑰紑鎴疯")
+    private String khfkhh;
+
+    @PropertyDef(label = "瀹㈡埛鏂硅处鍙�")
+    private String khfzh;
+
+    @PropertyDef(label = "鎿嶄綔鏍囧織")
+    private String czbz;
+
+    @PropertyDef(label = "鏍囪浣�")
+    private String bjw;
+
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    @PropertyDef(label = "鏈�鍚庢洿鏂版椂闂�")
+    private Date zhgxsj;
+
+
+}

--
Gitblit v1.9.3