From ae0ff4837fd968cebbbbf7f735546cbb8d66ecec Mon Sep 17 00:00:00 2001 From: LSH Date: 星期二, 06 六月 2023 10:52:12 +0800 Subject: [PATCH] # --- /dev/null | 158 ---------------------------------------------------- src/main/resources/application.yml | 16 ----- 2 files changed, 0 insertions(+), 174 deletions(-) diff --git a/src/main/java/com/zy/ints/entity/ErpDetTb.java b/src/main/java/com/zy/ints/entity/ErpDetTb.java deleted file mode 100644 index 2ba895b..0000000 --- a/src/main/java/com/zy/ints/entity/ErpDetTb.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import com.core.common.Cools; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Data -@TableName("ERP_DETTB") -public class ErpDetTb implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍗曟嵁鍙风爜 涓婚敭 - */ - @ApiModelProperty(value = "鍗曟嵁鍙风爜") - @TableId(value = "BIL_NO", type = IdType.INPUT) - @TableField("BIL_NO") - private String billNo; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("PRD_NO") - private String prdNo; - - /** - * 鍗曟嵁绫诲埆 - */ - @ApiModelProperty(value = "鍗曟嵁绫诲埆:" + - "TF_PSS:閲囪喘閿�鍞甛n" + - "TF_IC:搴撳瓨璋冩嫧\n" + - "TF_IJ:搴撳瓨璋冩暣\n" + - "TF_ML:鐢熶骇棰嗘枡\n" + - "TF_MM0:鐢熶骇缂村簱\n" + - "TF_TC:鎵樺伐閫�鍥�") - private String iokindid; - - /** - * 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級 - */ - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - private String addId; - - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - @TableField("ADD_ID") - private Integer addId2; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - @TableField("QTY") - private Double qty; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("PRD_MARK") - private String prdMark; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - @TableField("WH") - private String wh; - - /** - * 鏃ユ湡 - */ - @ApiModelProperty(value = "鏃ユ湡") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @TableField("BIL_DATE") - private Date billdate; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - @TableField("STATUS") - private Integer status; - - /** - * 琛屽彿 涓婚敭 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - @TableField("ITM") - private Integer itm; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - @TableField("Temp1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - @TableField("Temp2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - @TableField("Temp3") - private String temp3; - - public ErpDetTb() { - } - - public ErpDetTb(String billNo, String prdNo, String iokindid, int itm, Integer addId2, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.iokindid = iokindid; - this.itm = itm; - this.addId2 = addId2; - this.addId = addId; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - - public ErpDetTb(String billNo, String prdNo, int itm, Integer addId2, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.itm = itm; - this.addId2 = addId2; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// DetTb detTb = new DetTb( -// null, // id[闈炵┖] -// null, // 鍗曟嵁鍙风爜[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍗曟嵁绫诲埆[闈炵┖] -// null, // 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 浠撳簱 -// null, // 鏃ユ湡[闈炵┖] -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getBilldate$() { - if (Cools.isEmpty(this.billdate)) { - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); - } - - public String getIokindid$(){ - if (null == this.iokindid){ return null; } - switch (this.iokindid){ - case "TF_PSS": - return "閲囪喘閿�鍞�"; - case "TF_IC": - return "搴撳瓨璋冩嫧"; - case "TF_IJ": - return "搴撳瓨璋冩暣"; - case "TF_ML": - return "鐢熶骇棰嗘枡"; - case "TF_MM0": - return "鐢熶骇缂村簱"; - case "TF_TC": - return "鎵樺伐閫�鍥�"; - default: - return String.valueOf(this.status); - } - } - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - -} diff --git a/src/main/java/com/zy/ints/entity/ErpDetTbBak.java b/src/main/java/com/zy/ints/entity/ErpDetTbBak.java deleted file mode 100644 index fd9cfe4..0000000 --- a/src/main/java/com/zy/ints/entity/ErpDetTbBak.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import com.core.common.Cools; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Data -@TableName("ERP_DETTB_BAK") -public class ErpDetTbBak implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍗曟嵁鍙风爜 涓婚敭 - */ - @ApiModelProperty(value = "鍗曟嵁鍙风爜") - @TableId(value = "BIL_NO", type = IdType.INPUT) - @TableField("BIL_NO") - private String billNo; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("PRD_NO") - private String prdNo; - - /** - * 鍗曟嵁绫诲埆 - */ - @ApiModelProperty(value = "鍗曟嵁绫诲埆:" + - "TF_PSS:閲囪喘閿�鍞甛n" + - "TF_IC:搴撳瓨璋冩嫧\n" + - "TF_IJ:搴撳瓨璋冩暣\n" + - "TF_ML:鐢熶骇棰嗘枡\n" + - "TF_MM0:鐢熶骇缂村簱\n" + - "TF_TC:鎵樺伐閫�鍥�") - private String iokindid; - - /** - * 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級 - */ - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - private String addId; - - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - @TableField("ADD_ID") - private Integer addId2; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - @TableField("QTY") - private Double qty; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("PRD_MARK") - private String prdMark; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - @TableField("WH") - private String wh; - - /** - * 鏃ユ湡 - */ - @ApiModelProperty(value = "鏃ユ湡") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @TableField("BIL_DATE") - private Date billdate; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - @TableField("STATUS") - private Integer status; - - /** - * 琛屽彿 涓婚敭 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - @TableField("ITM") - private Integer itm; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - @TableField("Temp1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - @TableField("Temp2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - @TableField("Temp3") - private String temp3; - - public ErpDetTbBak() { - } - - public ErpDetTbBak(String billNo, String prdNo, String iokindid, int itm, int addId2, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.iokindid = iokindid; - this.itm = itm; - this.addId2 = addId2; - this.addId = addId; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - - public ErpDetTbBak(String billNo, String prdNo, int itm, int addId2, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.itm = itm; - this.addId2 = addId2; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// DetTb detTb = new DetTb( -// null, // id[闈炵┖] -// null, // 鍗曟嵁鍙风爜[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍗曟嵁绫诲埆[闈炵┖] -// null, // 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 浠撳簱 -// null, // 鏃ユ湡[闈炵┖] -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getBilldate$() { - if (Cools.isEmpty(this.billdate)) { - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); - } - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/ErpLk.java b/src/main/java/com/zy/ints/entity/ErpLk.java deleted file mode 100644 index f70be53..0000000 --- a/src/main/java/com/zy/ints/entity/ErpLk.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.enums.IdType; -import com.baomidou.mybatisplus.annotations.TableField; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import com.baomidou.mybatisplus.annotations.TableName; - -import java.io.Serializable; - -@Data -@TableName("bas_erp_lk") -public class ErpLk implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("prd_mark") - private String prdMark; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - private Double qty; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - private String wh; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public ErpLk() { - } - - public ErpLk(String prdNo, String prdMark, Double qty, String wh, Integer status, String temp1, String temp2, String temp3) { - this.prdNo = prdNo; - this.prdMark = prdMark; - this.qty = qty; - this.wh = wh; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// ErpLk erpLk = new ErpLk( -// null, // id[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 浠撳簱 -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/ErpLkBak.java b/src/main/java/com/zy/ints/entity/ErpLkBak.java deleted file mode 100644 index 3399fe8..0000000 --- a/src/main/java/com/zy/ints/entity/ErpLkBak.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -@Data -@TableName("bas_erp_lk_bak") -public class ErpLkBak implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("prd_mark") - private String prdMark; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - private Double qty; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - private String wh; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public ErpLkBak() { - } - - public ErpLkBak(String prdNo, String prdMark, Double qty, String wh, Integer status, String temp1, String temp2, String temp3) { - this.prdNo = prdNo; - this.prdMark = prdMark; - this.qty = qty; - this.wh = wh; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// ErpLk erpLk = new ErpLk( -// null, // id[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 浠撳簱 -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/LkDetTb.java b/src/main/java/com/zy/ints/entity/LkDetTb.java deleted file mode 100644 index 694975f..0000000 --- a/src/main/java/com/zy/ints/entity/LkDetTb.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import com.core.common.Cools; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Data -@TableName("lk_det_tb") -public class LkDetTb implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍗曟嵁鍙风爜 - */ - @ApiModelProperty(value = "鍗曟嵁鍙风爜") - @TableId(value = "bill_no", type = IdType.INPUT) - @TableField("bill_no") - private String billNo; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 鍗曟嵁绫诲埆 - */ - @ApiModelProperty(value = "鍗曟嵁绫诲埆:" + - "TF_PSS:閲囪喘閿�鍞甛n" + - "TF_IC:搴撳瓨璋冩嫧\n" + - "TF_IJ:搴撳瓨璋冩暣\n" + - "TF_ML:鐢熶骇棰嗘枡\n" + - "TF_MM0:鐢熶骇缂村簱\n" + - "TF_TC:鎵樺伐閫�鍥�") - private String iokindid; - - /** - * 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級 - */ - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - @TableField("add_id") - private String addId; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - private Double qty; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("prd_mark") - private String prdMark; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - private String wh; - - /** - * 鏃ユ湡 - */ - @ApiModelProperty(value = "鏃ユ湡") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date billdate; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public LkDetTb() { - } - - public LkDetTb(String billNo, String prdNo, String iokindid, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.iokindid = iokindid; - this.addId = addId; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// DetTb detTb = new DetTb( -// null, // id[闈炵┖] -// null, // 鍗曟嵁鍙风爜[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍗曟嵁绫诲埆[闈炵┖] -// null, // 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 浠撳簱 -// null, // 鏃ユ湡[闈炵┖] -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getBilldate$() { - if (Cools.isEmpty(this.billdate)) { - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); - } - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/LkDetTbBak.java b/src/main/java/com/zy/ints/entity/LkDetTbBak.java deleted file mode 100644 index f21d57a..0000000 --- a/src/main/java/com/zy/ints/entity/LkDetTbBak.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import com.core.common.Cools; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; -import java.text.SimpleDateFormat; -import java.util.Date; - -@Data -@TableName("lk_det_tb_bak") -public class LkDetTbBak implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍗曟嵁鍙风爜 - */ - @ApiModelProperty(value = "鍗曟嵁鍙风爜") - @TableId(value = "bill_no", type = IdType.INPUT) - @TableField("bill_no") - private String billNo; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 鍗曟嵁绫诲埆 - */ - @ApiModelProperty(value = "鍗曟嵁绫诲埆:" + - "TF_PSS:閲囪喘閿�鍞甛n" + - "TF_IC:搴撳瓨璋冩嫧\n" + - "TF_IJ:搴撳瓨璋冩暣\n" + - "TF_ML:鐢熶骇棰嗘枡\n" + - "TF_MM0:鐢熶骇缂村簱\n" + - "TF_TC:鎵樺伐閫�鍥�") - private String iokindid; - - /** - * 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級 - */ - @ApiModelProperty(value = "澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級") - @TableField("add_id") - private String addId; - - /** - * 鏁伴噺 - */ - @ApiModelProperty(value = "鏁伴噺") - private Double qty; - - /** - * 璐у搧鐗瑰緛 - */ - @ApiModelProperty(value = "璐у搧鐗瑰緛") - @TableId(value = "prd_mark", type = IdType.INPUT) - @TableField("prd_mark") - private String prdMark; - - /** - * 浠撳簱 - */ - @ApiModelProperty(value = "浠撳簱") - private String wh; - - /** - * 鏃ユ湡 - */ - @ApiModelProperty(value = "鏃ユ湡") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date billdate; - - /** - * 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級 - */ - @ApiModelProperty(value = "鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public LkDetTbBak() { - } - - public LkDetTbBak(String billNo, String prdNo, String iokindid, String addId, Double qty, String prdMark, String wh, Date billdate, Integer status, String temp1, String temp2, String temp3) { - this.billNo = billNo; - this.prdNo = prdNo; - this.iokindid = iokindid; - this.addId = addId; - this.qty = qty; - this.prdMark = prdMark; - this.wh = wh; - this.billdate = billdate; - this.status = status; - this.temp1 = temp1; - this.temp2 = temp2; - this.temp3 = temp3; - } - -// DetTb detTb = new DetTb( -// null, // id[闈炵┖] -// null, // 鍗曟嵁鍙风爜[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍗曟嵁绫诲埆[闈炵┖] -// null, // 澧炲噺绗﹀彿:1锛堝姞锛屽叆搴擄級銆�2锛堝噺锛屽嚭搴擄級[闈炵┖] -// null, // 鏁伴噺[闈炵┖] -// null, // 璐у搧鐗瑰緛[闈炵┖] -// null, // 浠撳簱 -// null, // 鏃ユ湡[闈炵┖] -// null, // 鐘舵��:0锛堝垵濮嬬姸鎬侊級銆�1锛堝凡鎺ユ敹锛夈��2锛堝紓甯革級[闈炵┖] -// null, // 澶囩敤瀛楁1 -// null, // 澶囩敤瀛楁2 -// null // 澶囩敤瀛楁3 -// ); - - public String getBilldate$() { - if (Cools.isEmpty(this.billdate)) { - return ""; - } - return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); - } - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/Prdt.java b/src/main/java/com/zy/ints/entity/Prdt.java deleted file mode 100644 index 46515f3..0000000 --- a/src/main/java/com/zy/ints/entity/Prdt.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.enums.IdType; -import com.baomidou.mybatisplus.annotations.TableField; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import com.baomidou.mybatisplus.annotations.TableName; - -import java.io.Serializable; - -@Data -@TableName("ERP_PRDT") -public class Prdt implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 鍝佸悕 - */ - @ApiModelProperty(value = "鍝佸悕") - private String name; - - /** - * 鍗曚綅 - */ - @ApiModelProperty(value = "鍗曚綅") - private String ut; - - /** - * 瑙勬牸 - */ - @ApiModelProperty(value = "瑙勬牸") - private String spc; - - /** - * 绫诲瀷 - */ - @ApiModelProperty(value = "绫诲瀷") - private Integer type; - - /** - * 鐘舵�� - */ - @ApiModelProperty(value = "鐘舵��") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public Prdt() { - } - - public Prdt(String prdNo, String name, String ut, String spc, Integer type, Integer status) { - this.prdNo = prdNo; - this.name = name; - this.ut = ut; - this.spc = spc; - this.type = type; - this.status = status; - } - -// Prdt prdt = new Prdt( -// null, // id[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍝佸悕[闈炵┖] -// null, // 鍗曚綅 -// null, // 瑙勬牸 -// null, // 绫诲瀷[闈炵┖] -// null // 鐘舵�乕闈炵┖] -// ); - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/entity/PrdtBak.java b/src/main/java/com/zy/ints/entity/PrdtBak.java deleted file mode 100644 index fc7228b..0000000 --- a/src/main/java/com/zy/ints/entity/PrdtBak.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.zy.ints.entity; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableId; -import com.baomidou.mybatisplus.annotations.TableName; -import com.baomidou.mybatisplus.enums.IdType; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -@Data -@TableName("ERP_PRDT_BAK") -public class PrdtBak implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 鍝佸彿 - */ - @ApiModelProperty(value = "鍝佸彿") - @TableId(value = "prd_no", type = IdType.INPUT) - @TableField("prd_no") - private String prdNo; - - /** - * 鍝佸悕 - */ - @ApiModelProperty(value = "鍝佸悕") - private String name; - - /** - * 鍗曚綅 - */ - @ApiModelProperty(value = "鍗曚綅") - private String ut; - - /** - * 瑙勬牸 - */ - @ApiModelProperty(value = "瑙勬牸") - private String spc; - - /** - * 绫诲瀷 - */ - @ApiModelProperty(value = "绫诲瀷") - private Integer type; - - /** - * 鐘舵�� - */ - @ApiModelProperty(value = "鐘舵��") - private Integer status; - - /** - * 澶囩敤瀛楁1 - */ - @ApiModelProperty(value = "澶囩敤瀛楁1") - private String temp1; - - /** - * 澶囩敤瀛楁2 - */ - @ApiModelProperty(value = "澶囩敤瀛楁2") - private String temp2; - - /** - * 澶囩敤瀛楁3 - */ - @ApiModelProperty(value = "澶囩敤瀛楁3") - private String temp3; - - public PrdtBak() { - } - - public PrdtBak(String prdNo, String name, String ut, String spc, Integer type, Integer status) { - this.prdNo = prdNo; - this.name = name; - this.ut = ut; - this.spc = spc; - this.type = type; - this.status = status; - } - -// Prdt prdt = new Prdt( -// null, // id[闈炵┖] -// null, // 鍝佸彿[闈炵┖] -// null, // 鍝佸悕[闈炵┖] -// null, // 鍗曚綅 -// null, // 瑙勬牸 -// null, // 绫诲瀷[闈炵┖] -// null // 鐘舵�乕闈炵┖] -// ); - - public String getStatus$(){ - if (null == this.status){ return null; } - switch (this.status){ - case 0: - return "0(鍒濆鐘舵��)"; - case 1: - return "1(宸叉帴鏀�)"; - case 2: - return "2(寮傚父)"; - default: - return String.valueOf(this.status); - } - } - - -} diff --git a/src/main/java/com/zy/ints/erp/ErpDbProperties.java b/src/main/java/com/zy/ints/erp/ErpDbProperties.java deleted file mode 100644 index 30df009..0000000 --- a/src/main/java/com/zy/ints/erp/ErpDbProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.zy.ints.erp; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * Created by vincent on 2020/11/26 - */ -@Data -@ConfigurationProperties(prefix = "erp.db") -@Component -public class ErpDbProperties { - - private String driver_class_name; - - private String url; - - private String username; - - private String password; - -// { -// driver_class_name = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; -// ur = "jdbc:sqlserver://127.0.0.1:1433;databasename=byrk"; -// username = "sa"; -// password = "sa@123"; -// } - -} diff --git a/src/main/java/com/zy/ints/erp/ErpSqlServer.java b/src/main/java/com/zy/ints/erp/ErpSqlServer.java deleted file mode 100644 index fc8b96b..0000000 --- a/src/main/java/com/zy/ints/erp/ErpSqlServer.java +++ /dev/null @@ -1,363 +0,0 @@ -package com.zy.ints.erp; - -import com.baomidou.mybatisplus.annotations.TableField; -import com.baomidou.mybatisplus.annotations.TableName; -import com.core.common.Cools; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.sql.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 绠�鍗曟寔涔呭眰妗嗘灦 - * Created by vincent on 2020/11/26 - */ -@Slf4j -@Service -public class ErpSqlServer { - - // 鏁版嵁搴撹繛鎺� -// private Connection conn; - // 鍒涘缓棰勭紪璇戣鍙ュ璞★紝涓�鑸兘鏄敤杩欎釜鑰屼笉鐢⊿tatement - private PreparedStatement pstm = null; - // 鍒涘缓涓�涓粨鏋滈泦瀵硅薄 - private ResultSet rs = null; - - @Autowired - private ErpDbProperties erpDbProperties; - - /*****************************************************************************/ - /********************************** 灏佽 **********************************/ - /*****************************************************************************/ - - /** - * 鏌ヨ - */ - public <T> List<T> select(String sql, Class<T> cls) { - List<Map<String, Object>> result = executeQuery(sql); - List<T> list = new ArrayList<>(); - if (null != result) { - for (Map<String, Object> entity : result) { - list.add(Cools.conver(entity, cls)); - } - } - return list; - } - - - /** - * 鎵弿鎵�鏈夊疄鍔涚被灞炴�ч噷鐨凾ableField娉ㄨВ,骞跺皢閲岄潰鐨勫�间綔涓篶olumn - * - * @param cls - * @param <T> - * @return - */ - public <T> String selectFrontPart(Class<T> cls) { - String tableName = cls.getDeclaredAnnotation(TableName.class).value(); - List<HashMap<String, String>> columnAndField = new ArrayList<>(); - String sql = "SELECT "; - if (Cools.isEmpty(tableName)) { - return null; - } - Field[] allFields = Cools.getAllFields(cls); - for (Field f : allFields) { - if (Modifier.isFinal(f.getModifiers()) - || Modifier.isStatic(f.getModifiers()) - || Modifier.isTransient(f.getModifiers())) { - continue; - } - String column = null; - if (f.isAnnotationPresent(TableField.class)) { - column = f.getAnnotation(TableField.class).value(); - } - if (Cools.isEmpty(column)) { - column = f.getName(); - } - String name = f.getName(); - HashMap<String, String> container = new HashMap<>(); - container.put(column, name); - columnAndField.add(container); - } - for (int i = 0; i < columnAndField.size(); i++) { - HashMap<String, String> stringStringHashMap = columnAndField.get(i); - if (i == columnAndField.size() - 1) { - for (String s : stringStringHashMap.keySet()) { - sql = sql + s + " AS " + stringStringHashMap.get(s); - } - } else { - for (String s : stringStringHashMap.keySet()) { - sql = sql + s + " AS " + stringStringHashMap.get(s) + ", "; - } - } - } - sql = sql + " FROM " + tableName; - return sql; - } - - public String addWhere(String sql, Map<String, String> condition) { - int conditionSize = 1; - sql = sql + " WHERE "; - for (String s : condition.keySet()) { - if (conditionSize == condition.keySet().size()) { - sql = sql + s + " = " + condition.get(s); - } else { - sql = sql + s + " = " + condition.get(s) + " and "; - } - conditionSize = conditionSize + 1; - } - return sql; - } - - /** - * map鐨勯敭鏄垪鍚�, 鍊肩瓑鍚屼簬鍊� - * key: id, value: 1 绛夊悓浜� WHERE id = 1 - * 濡傛灉瑕佹煡璇㈠瓧绗︿覆闇�瑕佽嚜琛屽姞涓�'' - * key:name, value: 'zhs'绛夊悓浜� WHERE name = 'zhs' - * - * @param cls - * @param condition - * @param <T> - * @return - */ - public <T> List<T> selectList(Class<T> cls, Map<String, String> condition) { - String sql = selectFrontPart(cls); - String finalSQL = addWhere(sql, condition); - return select(finalSQL, cls); - } - - public <T> List<T> selectAll(Class<T> cls) { - String sql = selectFrontPart(cls); - return select(sql, cls); - } - - public List<Map<String, Object>> select(String sql) { - return executeQuery(sql); - } - - /** - * 淇敼 - */ - public int update(String sql) { - return executeUpdate(sql); - } - - public <T> int delete(Class<T> cls, Map<String, String> condition) { - String tableName = cls.getDeclaredAnnotation(TableName.class).value(); - if (Cools.isEmpty(tableName)) { - return 0; - } - String sql = "DELETE FROM " + tableName; - String finalSQL = addWhere(sql, condition); - return executeUpdate(finalSQL); - } - - public <T> int insert(Class<T> cls, Map<String, Object> condition) { - String tableName = cls.getDeclaredAnnotation(TableName.class).value(); - if (Cools.isEmpty(tableName)) { - return 0; - } - String sql = "INSERT INTO " + tableName + " ("; - int conditionSize = 1; - for (String s : condition.keySet()) { - if (conditionSize == condition.keySet().size()) { - sql = sql + s + ")"; - } else { - sql = sql + s + ","; - } - conditionSize = conditionSize + 1; - } - sql = sql + " VALUES("; - int valuesSize = 1; - for (String s : condition.keySet()) { - if (valuesSize == condition.keySet().size()) { - - sql = sql + condition.get(s) + ")"; - } else { - sql = sql + condition.get(s) + ","; - } - valuesSize = valuesSize + 1; - } - - return executeUpdate(sql); - } - - - /*****************************************************************************/ - /********************************* 鏍稿績灞� *********************************/ - /*****************************************************************************/ - - - private List<Map<String, Object>> executeQuery(String sql) { - Connection conn = null; - try { - conn = getConn(); - pstm = conn.prepareStatement(sql); - rs = pstm.executeQuery(); -// List<Map<String, Object>> maps = convertList(rs); - return convertList(rs); - } catch (Exception e) { - e.printStackTrace(); - return null; - } finally { - release(); - if (conn != null) { - try { - conn.close(); - conn = null; - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - } - - public Number executeQueryCount(String sql, String column) { - Number value = 0; - Connection conn = null; - try { - conn = getConn(); - pstm = conn.prepareStatement(sql); - rs = pstm.executeQuery(); -// ResultSetMetaData metaData = rs.getMetaData(); - while (rs.next()) { - value = (Number) rs.getInt(column); - } - return value; - } catch (Exception e) { - e.printStackTrace(); - return 0; - } finally { - release(); - if (conn != null) { - try { - conn.close(); - conn = null; - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - } - - private int executeUpdate(String sql) { - Connection conn = null; - try { - conn = getConn(); - if (null != conn) { - pstm = conn.prepareStatement(sql); - } else { - log.error("鏇存柊ERP涓棿琛ㄥけ璐�===>>鏁版嵁搴撹繛鎺onn涓虹┖"); - log.error("鏇存柊ERP涓棿琛ㄥけ璐�===>>" + sql); - } - return pstm.executeUpdate(); - } catch (Exception e) { - e.printStackTrace(); - log.error("鏇存柊ERP涓棿琛ㄥけ璐�===>>" + sql); - log.error("鏇存柊ERP涓棿琛ㄥけ璐�===>>" + e); - return 0; - } finally { - release(); - if (conn != null) { - try { - conn.close(); - conn = null; - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - } - - private static List<Map<String, Object>> convertList(ResultSet rs) throws SQLException { - List<Map<String, Object>> list = new ArrayList<>(); - ResultSetMetaData md = rs.getMetaData(); - int columnCount = md.getColumnCount(); - while (rs.next()) { - Map<String, Object> rowData = new HashMap<>(); - for (int i = 1; i <= columnCount; i++) { - rowData.put(md.getColumnName(i), rs.getObject(i)); - } - list.add(rowData); - } - return list; - } - - //synchronized - public Connection getConn() throws SQLException { - Connection conn = null; - try { - Class.forName(erpDbProperties.getDriver_class_name()).newInstance(); - conn = DriverManager.getConnection(erpDbProperties.getUrl(), erpDbProperties.getUsername(), erpDbProperties.getPassword()); - } catch (Exception e) { - log.error("鑾峰彇ERP鏁版嵁搴撹繛鎺ュけ璐�"); - e.printStackTrace(); - throw new RuntimeException("鑾峰彇ERP鏁版嵁搴撹繛鎺ュけ璐�"); - } - return conn; -// if (null == this.conn || this.conn.isClosed()) { -// try { -// Class.forName(erpDbProperties.getDriver_class_name()).newInstance(); -// this.conn = DriverManager.getConnection(erpDbProperties.getUr(), erpDbProperties.getUsername(), erpDbProperties.getPassword()); -// } catch (Exception e) { -// log.error("鑾峰彇ERP鏁版嵁搴撹繛鎺ュけ璐�"); -// e.printStackTrace(); -// throw new RuntimeException("鑾峰彇ERP鏁版嵁搴撹繛鎺ュけ璐�"); -// } -// } -// return this.conn; - } - - private void release() { - if (rs != null) { - try { - rs.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - if (pstm != null) { - try { - pstm.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } -// if (conn != null) { -// try { -// conn.close(); -// conn = null; -// } catch (SQLException e) { -// e.printStackTrace(); -// } -// } - } - - /** - * 娣辨嫹璐� - */ - public ArrayList deepClone(List list) throws Exception { - // 搴忓垪鍖� - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - - oos.writeObject(list); - - // 鍙嶅簭鍒楀寲 - ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); - ObjectInputStream ois = new ObjectInputStream(bis); - - return (ArrayList) ois.readObject(); - } - -} diff --git a/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java b/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java deleted file mode 100644 index 8911123..0000000 --- a/src/main/java/com/zy/ints/task/scheduler/ErpDetTbScheduler.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.zy.ints.task.scheduler; - -import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.core.common.Cools; -import com.core.common.DateUtils; -import com.core.common.SnowflakeIdWorker; -import com.zy.asrs.entity.*; -import com.zy.asrs.service.*; -import com.zy.ints.entity.ErpDetTb; -import com.zy.ints.entity.ErpDetTbBak; -import com.zy.ints.erp.ErpSqlServer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * erp浠诲姟鎺у埗鍣� - * Created by vincent on 2020/11/27 - */ -@Slf4j -@Component -public class ErpDetTbScheduler { - /** - * ERP鎺ュ彛鏄惁鍚敤 - */ - @Value("${erp.enabled}") - private Boolean erpEnabled; - @Value("${erp.enabledErpDetTb}") - private Boolean erpEnabledErpDetTb; - @Value("${erp.useName.ip}") - private String ip; - @Autowired - private ErpSqlServer erpSqlServer; - @Autowired - private MatService matService; - @Autowired - private OrderService orderService; - @Autowired - private OrderDetlService orderDetlService; - @Autowired - private SnowflakeIdWorker snowflakeIdWorker; - @Autowired - private DocTypeService docTypeService; - @Autowired - private ApiLogService apiLogService; - - /** - * 鑾峰彇鍏ュ嚭搴撹鍗曚俊鎭� - */ - @Scheduled(cron = "${erp.refreshtime}") - public void InOrOutOrder() { - if (!erpEnabledErpDetTb) return; - String sqlSelectErpDetTb = "select BIL_NO as billNo,prd_no as prdNo,ITM as itm,ADD_ID as addId2,QTY as qty,PRD_MARK as prdMark,WH as wh,STATUS as status,Temp1 as temp1,Temp2 as temp2,Temp3 as temp3 from ERP_DETTB where 1=1"; - String sqlUpDateErpDetTbOne = "update ERP_DETTB set STATUS=1 where 1=1 and PRD_NO="; - String sqlUpDateErpDetTbTwo = "update ERP_DETTB set STATUS=2 "; - - try { - List<ErpDetTb> erpDetTbs = erpSqlServer.select(sqlSelectErpDetTb, ErpDetTb.class); - if (erpDetTbs.size() > 0) { - for (ErpDetTb erpDetTb : erpDetTbs) { - Date now = new Date(); - Integer status = erpDetTb.getStatus(); - if (status == 0) { - Mat mat = matService.selectByMatnr(erpDetTb.getPrdNo()); - if (Cools.isEmpty(mat)) { - if(Cools.isEmpty(erpDetTb.getTemp1())){ - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒'" + "where 1=1 " - +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" - +" and ITM=" + "'" + erpDetTb.getItm() + "'" - +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "鍝佸彿淇℃伅鍦ㄧ珛搴撲笉瀛樺湪锛岃鍏堟坊鍔犲晢鍝侊紒锛侊紒", false); - } - } else { - Order order = orderService.selectByNo(erpDetTb.getBillNo()); - if (Cools.isEmpty(order)) { - order = new Order( - String.valueOf(snowflakeIdWorker.nextId()), // 缂栧彿[闈炵┖] - erpDetTb.getBillNo(), // 璁㈠崟缂栧彿 - DateUtils.convert(now), // 鍗曟嵁鏃ユ湡 - null, // 鍗曟嵁绫诲瀷 - null, // 椤圭洰缂栧彿 - null, // - null, // 璋冩嫧椤圭洰缂栧彿 - null, // 鍒濆绁ㄦ嵁鍙� - null, // 绁ㄦ嵁鍙� - null, // 瀹㈡埛缂栧彿 - null, // 瀹㈡埛 - null, // 鑱旂郴鏂瑰紡 - null, // 鎿嶄綔浜哄憳 - null, // 鍚堣閲戦 - null, // 浼樻儬鐜� - null, // 浼樻儬閲戦 - null, // 閿�鍞垨閲囪喘璐圭敤鍚堣 - null, // 瀹炰粯閲戦 - null, // 浠樻绫诲瀷 - null, // 涓氬姟鍛� - null, // 缁撶畻澶╂暟 - null, // 閭垂鏀粯绫诲瀷 - null, // 閭垂 - null, // 浠樻鏃堕棿 - null, // 鍙戣揣鏃堕棿 - null, // 鐗╂祦鍚嶇О - null, // 鐗╂祦鍗曞彿 - 1L, // 璁㈠崟鐘舵�� - 1, // 鐘舵�� - 9999L, // 娣诲姞浜哄憳 - now, // 娣诲姞鏃堕棿 - 9999L, // 淇敼浜哄憳 - now, // 淇敼鏃堕棿 - null // 澶囨敞 - ); - String InAndOut = erpDetTb.getAddId2().equals(2) ? "锛堝嚭搴擄級" : "锛堝叆搴擄級"; - DocType docType = docTypeService.selectOrAdd("ERP璁㈠崟"+InAndOut, erpDetTb.getAddId2().equals(1)); - if (!Cools.isEmpty(docType)) { - order.setDocType(docType.getDocId()); - if (!orderService.insert(order)) { - callApiLogSave(erpDetTb, "ERP_DETTB", "璁㈠崟涓绘。娣诲姞澶辫触锛侊紒", false); - continue; - } else { - callApiLogSave(erpDetTb, "ERP_DETTB", "璁㈠崟涓绘。娣诲姞鎴愬姛锛侊紒", true); - } - } - } - Order order1 = orderService.selectByNo(erpDetTb.getBillNo()); - if (!Cools.isEmpty(order1)) { -// OrderDetl orderDetl = orderDetlService.selectItem(order1.getId(), erpDetTb.getBillNo(), erpDetTb.getPrdMark()); - OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no",erpDetTb.getBillNo()).eq("matnr",erpDetTb.getPrdNo())); - if (Cools.isEmpty(orderDetl)) { - orderDetl = new OrderDetl(); - orderDetl.setOrderId(order1.getId()); - orderDetl.setOrderNo(erpDetTb.getBillNo()); - orderDetl.setAnfme(erpDetTb.getQty()); - orderDetl.setQty(0.0D); - orderDetl.setMatnr(erpDetTb.getPrdNo()); - orderDetl.setMaktx(mat.getMaktx()); - orderDetl.setBatch(erpDetTb.getPrdMark()); - orderDetl.setSpecs(mat.getSpecs()); - orderDetl.setUnit(mat.getUnit()); - orderDetl.setOrigin(erpDetTb.getItm().toString()); - - orderDetl.setStatus(1); - orderDetl.setCreateBy(9999L); - orderDetl.setCreateTime(now); - orderDetl.setUpdateBy(9999L); - orderDetl.setUpdateTime(now); - orderDetl.setMemo(erpDetTb.getWh()); - if (orderDetlService.insert(orderDetl)) { - erpSqlServer.update(sqlUpDateErpDetTbOne + "'" + erpDetTb.getPrdNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟鎺ユ敹鎴愬姛锛侊紒", true); - } else { - if (Cools.isEmpty(erpDetTb.getTemp2())){ - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp2='娣诲姞璁㈠崟鏄庣粏妗eけ璐ワ紒锛侊紒'" + "where 1=1 " - +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" - +" and ITM=" + "'" + erpDetTb.getItm() + "'" - +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟鎺ユ敹澶辫触锛侊紒", false); - } - } - }else if (!erpDetTb.getItm().toString().equals(orderDetl.getOrigin())){ - orderDetl.setAnfme(orderDetl.getAnfme()+erpDetTb.getQty()); - EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>(); - wrapper.eq("id", orderDetl.getId()); - if (orderDetlService.update(orderDetl,wrapper)) { - erpSqlServer.update(sqlUpDateErpDetTbOne + "'" + erpDetTb.getPrdNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟鎺ユ敹鎴愬姛锛侊紒", true); - } else { - if (Cools.isEmpty(erpDetTb.getTemp2())){ - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp2='鏇存柊璁㈠崟鏄庣粏妗eけ璐ワ紒锛侊紒'" + "where 1=1 " - +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" - +" and ITM=" + "'" + erpDetTb.getItm() + "'" - +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟鎺ユ敹澶辫触锛侊紒", false); - } - } - }else { - if (Cools.isEmpty(erpDetTb.getTemp3())){ - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",temp3='鏇存柊璁㈠崟鏄庣粏妗eけ璐ワ紒锛侊紒璁㈠崟鏄庣粏宸插瓨鍦紒锛�'" + "where 1=1 " - +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" - +" and ITM=" + "'" + erpDetTb.getItm() + "'" - +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟鎺ユ敹澶辫触锛侊紒", false); - } - } - } - } - } else if (status == 1) { - String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now); - HashMap<String, Object> condition = new HashMap<>(); - condition.put("BIL_NO", "'" + erpDetTb.getBillNo() + "'"); - condition.put("PRD_NO", "'" + erpDetTb.getPrdNo() + "'"); - condition.put("ITM", "'" + erpDetTb.getItm() + "'"); - condition.put("ADD_ID", "'" + erpDetTb.getAddId2() + "'"); - condition.put("QTY", "'" + erpDetTb.getQty() + "'"); - condition.put("PRD_MARK", "'" + erpDetTb.getPrdMark() + "'"); - condition.put("WH", "'" + erpDetTb.getWh() + "'"); - condition.put("BIL_DATE", "'" + format + "'"); - condition.put("STATUS", "'" + erpDetTb.getStatus() + "'"); - condition.put("Temp1", "'" + erpDetTb.getTemp1() + "'"); - condition.put("Temp2", "'" + erpDetTb.getTemp2() + "'"); - condition.put("Temp3", "'" + erpDetTb.getTemp3() + "'"); - erpSqlServer.insert(ErpDetTbBak.class, condition); - -// callApiLogSave(erpDetTb, "ERP_DETTB_BAK", "ERP涓嬪彂璁㈠崟澶囦唤鎴愬姛锛侊紒", true); - - HashMap<String, String> condition2 = new HashMap<>(); - condition2.put("BIL_NO", "'" + erpDetTb.getBillNo() + "'"); - condition2.put("PRD_NO", "'" + erpDetTb.getPrdNo() + "'"); - condition2.put("ITM", "'" + erpDetTb.getItm() + "'"); -// condition2.put("PRD_MARK", "'" + erpDetTb.getPrdMark() + "'"); - erpSqlServer.delete(ErpDetTb.class, condition2); - -// callApiLogSave(erpDetTb, "ERP_DETTB", "ERP涓嬪彂璁㈠崟澶囦唤鍚庡垹闄ゆ垚鍔燂紒锛�", true); - - } else { - if (Cools.isEmpty(erpDetTb.getTemp1()) && Cools.isEmpty(erpDetTb.getTemp2()) && Cools.isEmpty(erpDetTb.getTemp3())){ - erpSqlServer.update(sqlUpDateErpDetTbTwo + ",Temp1='鎺ユ敹ERP涓嬪彂璁㈠崟澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒璇稥RP銆佺珛搴撳弻鏂瑰崗鍔╄В鍐炽��'" + "where 1=1 " - +" and PRD_NO=" + "'" + erpDetTb.getPrdNo() + "'" - +" and ITM=" + "'" + erpDetTb.getItm() + "'" - +" and BIL_NO=" + "'" + erpDetTb.getBillNo() + "'"); - callApiLogSave(erpDetTb, "ERP_DETTB", "鎺ユ敹ERP涓嬪彂璁㈠崟澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒", false); - } - } - } - } - } catch (Exception e) { - Date date = new Date(); - log.error(date + ": 琛ㄥ悕锛欵RP_DETTB :" + e); - } - } - - public void callApiLogSave(ErpDetTb erpDetTb, String tableName, String response, Boolean bool) { - apiLogService.save("ERP涓嬪彂璁㈠崟淇℃伅", tableName, "null", ip, - "璁㈠崟鍙凤細" + erpDetTb.getBillNo() + "銆佸搧鍙凤細" + erpDetTb.getPrdNo() + "銆佽揣鍝佺壒寰侊細" + erpDetTb.getPrdMark() + "銆佺姸鎬侊細" + erpDetTb.getStatus$(), - response, bool); - } -} diff --git a/src/main/java/com/zy/ints/task/scheduler/ErpLkScheduler.java b/src/main/java/com/zy/ints/task/scheduler/ErpLkScheduler.java deleted file mode 100644 index e5e7c3f..0000000 --- a/src/main/java/com/zy/ints/task/scheduler/ErpLkScheduler.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.zy.ints.task.scheduler; - -import com.baomidou.mybatisplus.plugins.Page; -import com.zy.asrs.entity.LocDetl; -import com.zy.asrs.service.ApiLogService; -import com.zy.asrs.service.LocDetlService; -import com.zy.common.web.BaseController; -import com.zy.ints.entity.ErpLk; -import com.zy.ints.entity.ErpLkBak; -import com.zy.ints.erp.ErpSqlServer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * erp浠诲姟鎺у埗鍣� - * Created by vincent on 2020/11/27 - */ -@Slf4j -@Component -public class ErpLkScheduler extends BaseController { - /** - * ERP鎺ュ彛鏄惁鍚敤 - */ - @Value("${erp.enabled}") - private Boolean erpEnabled; - @Value("${erp.useName.ip}") - private String ip; - @Autowired - private ApiLogService apiLogService; - @Autowired - private ErpSqlServer erpSqlServer; - @Autowired - private LocDetlService locDetlService; - - /** - * ERP涓巐k搴撳瓨鏁版嵁姣斿 - */ - @Scheduled(cron = "${erp.refreshtime}") - public void proofread() { - if (!erpEnabled) return; - String sqlSelectErpLk = "select prd_no as prdNo,prd_mark as prdMark,qty,wh,status,temp1,temp2,temp3 from bas_erp_lk where 1=1"; - String sqlSelectErpLkBak = "select prd_no as prdNo,prd_mark as prdMark,qty,wh,status,temp1,temp2,temp3 from bas_erp_lk_bak where 1=1"; - String sqlUpDateErpLkOne = "update bas_erp_lk set status=1 where prd_no="; - String sqlUpDateErpLkTwo = "update bas_erp_lk set status=2 where prd_no="; - String sqlUpDateErpLkBak = "update bas_erp_lk_bak set qty="; - - try { - List<ErpLk> erpLks = erpSqlServer.select(sqlSelectErpLk, ErpLk.class); - if (erpLks.size() > 0) { - for (ErpLk erpLk : erpLks) { - Integer status = erpLk.getStatus(); - if (status == 0) { - HashMap<String, Object> param = new HashMap<>(); - param.put("curr", 1); - param.put("limit", 20); - param.put("matnr", erpLk.getPrdNo()); - param.put("batch", erpLk.getPrdMark()); - Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(1, 10, param, LocDetl.class)); - if (stockStatis.getRecords().size() == 1) { - for (LocDetl locDetl : stockStatis.getRecords()) { - if (locDetl.getAnfme() - erpLk.getQty() == 0) { - erpSqlServer.update(sqlUpDateErpLkOne + "'" + erpLk.getPrdNo() + "' and prd_mark='" + erpLk.getPrdMark() + "'"); - callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮鏁伴噺鐩稿悓锛侊紒锛佹�婚噺涓猴細" + erpLk.getQty(), true); - } else { - erpSqlServer.update(sqlUpDateErpLkTwo + "'" + erpLk.getPrdNo() + "' and prd_mark='" + erpLk.getPrdMark() + "'"); - callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮鏁伴噺涓嶅悓锛侊紒锛佺珛搴撴�婚噺涓猴細" + locDetl.getAnfme() + "銆丒RP鎬婚噺涓猴細" + erpLk.getQty(), false); - } - } - } else { - callApiLogSave(erpLk, "bas_erp_lk", "绔嬪簱搴撳瓨寮傚父锛侊紒锛佺浉鍚屽搧鍙枫�佽揣鍝佺壒寰佺殑璐х墿閲嶅锛侊紒锛�", false); - } - } else if (status == 1) { - List<ErpLkBak> erpLkBaks = erpSqlServer.select(sqlSelectErpLkBak + " and prd_no='" + erpLk.getPrdNo() + "' and prd_mark='" + erpLk.getPrdMark() + "'", ErpLkBak.class); - if (erpLkBaks.size() == 1) { - erpSqlServer.update(sqlUpDateErpLkBak + "'" + erpLk.getQty() + "' where 1=1 " + - "and prd_no='" + erpLk.getPrdNo() + "'" + - "and prd_mark='" + erpLk.getPrdMark() + "'" - ); - } else if (erpLkBaks.size() == 0) { - HashMap<String, Object> condition = new HashMap<>(); - condition.put("prd_no", "'" + erpLk.getPrdNo() + "'"); - condition.put("prd_mark", "'" + erpLk.getPrdMark() + "'"); - condition.put("qty", "'" + erpLk.getQty() + "'"); - condition.put("wh", "'" + erpLk.getWh() + "'"); - condition.put("status", "'" + erpLk.getStatus() + "'"); - condition.put("temp1", "'" + erpLk.getTemp1() + "'"); - condition.put("temp2", "'" + erpLk.getTemp2() + "'"); - condition.put("temp3", "'" + erpLk.getTemp3() + "'"); - erpSqlServer.insert(ErpLkBak.class, condition); - } else { - callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮璁板綍澶囦唤瀛樺湪寮傚父锛侊紒锛�", false); - } -// callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮璁板綍澶囦唤鎴愬姛锛侊紒锛佹�婚噺涓猴細" + erpLk.getQty(), true); - - HashMap<String, String> condition2 = new HashMap<>(); - condition2.put("prd_no", "'" + erpLk.getPrdNo() + "'"); - condition2.put("prd_mark", "'" + erpLk.getPrdMark() + "'"); - erpSqlServer.delete(ErpLk.class, condition2); -// callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮璁板綍澶囦唤鍚庡垹闄ゆ垚鍔燂紒锛侊紒鎬婚噺涓猴細" + erpLk.getQty(), true); - - } else { - callApiLogSave(erpLk, "bas_erp_lk", "搴撳瓨瀵规瘮瀛樺湪寮傚父鏁版嵁鏈鐞嗭紒锛侊紒", false); - } - } - } - } catch (Exception e) { - Date date = new Date(); - log.error(date + ": 琛ㄥ悕锛歜as_erp_lk :" + e); - } - } - - public void callApiLogSave(ErpLk erpLk, String tableName, String response, Boolean bool) { - apiLogService.save("ERP涓巐k搴撳瓨鏁版嵁姣斿", tableName, "null", ip, - "鍝佸彿锛�" + erpLk.getPrdNo() + "銆佽揣鍝佺壒寰侊細" + erpLk.getPrdMark() + "銆佹暟閲忥細" + erpLk.getQty() + "銆佺姸鎬侊細" + erpLk.getStatus$(), - response, bool); - } -} diff --git a/src/main/java/com/zy/ints/task/scheduler/ErpPrdtScheduler.java b/src/main/java/com/zy/ints/task/scheduler/ErpPrdtScheduler.java deleted file mode 100644 index 7992a73..0000000 --- a/src/main/java/com/zy/ints/task/scheduler/ErpPrdtScheduler.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.zy.ints.task.scheduler; - -import com.core.common.Cools; -import com.zy.asrs.entity.Mat; -import com.zy.asrs.entity.Tag; -import com.zy.asrs.service.ApiLogService; -import com.zy.asrs.service.MatService; -import com.zy.asrs.service.TagService; -import com.zy.ints.entity.Prdt; -import com.zy.ints.entity.PrdtBak; -import com.zy.ints.erp.ErpSqlServer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * erp浠诲姟鎺у埗鍣� - * Created by vincent on 2020/11/27 - */ -@Slf4j -@Component -public class ErpPrdtScheduler { - - /** - * ERP鎺ュ彛鏄惁鍚敤 - */ - @Value("${erp.enabled}") - private Boolean erpEnabled; - @Value("${erp.useName.ip}") - private String ip; - @Value("${erp.enabledErpPrdt}") - private Boolean enabledErpPrdt; - @Autowired - private ApiLogService apiLogService; - @Autowired - private TagService tagService; - @Autowired - private ErpSqlServer erpSqlServer; - @Autowired - private MatService matService; - - /** - * 鑾峰彇鍟嗗搧淇℃伅琛ㄨ祫鏂� - */ - @Scheduled(cron = "${erp.refreshtime}") - public void obtainPedt() { - if (!enabledErpPrdt) return; - String sqlSelectPrdt = "select prd_no as prdNo,name,ut,spc,status,type,temp1,temp2,temp3 from ERP_PRDT where 1=1 and temp1 is null"; - String sqlUpDatePrdtOne = "update ERP_PRDT set status=1 where prd_no="; - String sqlUpDatePrdtTwo = "update ERP_PRDT set status=2 "; - try { - Tag tag = tagService.selectByName("鍏ㄩ儴", 1); - - List<Prdt> prdts = erpSqlServer.select(sqlSelectPrdt, Prdt.class); - if (prdts.size() > 0) { - for (Prdt prdt : prdts) { - Date date = new Date(); - if (prdt.getStatus() == 0) { - Integer type = prdt.getType(); - if (type == 1) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (Cools.isEmpty(mat)) { - Mat matNew = new Mat(); - matNew.setTagId(tag.getId()); - matNew.setMatnr(prdt.getPrdNo()); - matNew.setMaktx(prdt.getName()); - matNew.setUnit(prdt.getUt()); - matNew.setSpecs(prdt.getSpc()); - matNew.setCreateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setCreateTime(date); - matNew.setUpdateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setUpdateTime(date); - if (matService.insert(matNew)) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佹坊鍔犲晢鍝佷俊鎭垚鍔燂紒", true); - } else { - if (Cools.isEmpty(prdt.getTemp1())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='娣诲姞ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "娣诲姞ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佺姸鎬佸紓甯革紒锛侊紒", false); - } - } - } else { - if (Cools.isEmpty(prdt.getTemp1())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佸晢鍝佸凡瀛樺湪锛侊紒锛�'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佸晢鍝佸凡瀛樺湪锛侊紒锛�", false); - } - } - } else if (type == 2) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (!Cools.isEmpty(mat)) { - mat.setMaktx(prdt.getName()); - mat.setUnit(prdt.getUt()); - mat.setSpecs(prdt.getSpc()); - if (matService.updateById(mat)) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佷慨鏀瑰晢鍝佷俊鎭垚鍔燂紒", true); - } else { - if (Cools.isEmpty(prdt.getTemp1())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佷慨鏀瑰晢鍝佷俊鎭け璐ワ紒锛侊紒'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佷慨鏀瑰晢鍝佷俊鎭け璐ワ紒锛侊紒", false); - } - } - } - } else if (type == 3) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (!Cools.isEmpty(mat)) { - if (matService.deleteById(mat.getId())) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佸垹闄ゅ晢鍝佷俊鎭垚鍔燂紒", true); - } else { - if (Cools.isEmpty(prdt.getTemp1())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佸垹闄ゅ晢鍝佷俊鎭け璐ワ紒'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佸垹闄ゅ晢鍝佷俊鎭け璐ワ紒", false); - } - } - } - } else { - if (Cools.isEmpty(prdt.getTemp1()) && Cools.isEmpty(prdt.getTemp2()) && Cools.isEmpty(prdt.getTemp3())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛乼ype鐘舵�佸紓甯革紒锛侊紒'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鍟嗗搧淇℃伅鍑虹幇寮傚父璧勬枡鏈鐞嗭紒", false); - } - } - } else if (prdt.getStatus() == 1) { - HashMap<String, Object> condition = new HashMap<>(); - condition.put("prd_no", "'" + prdt.getPrdNo() + "'"); - condition.put("name", "'" + prdt.getName() + "'"); - condition.put("ut", "'" + prdt.getUt() + "'"); - condition.put("spc", "'" + prdt.getSpc() + "'"); - condition.put("type", "'" + prdt.getType() + "'"); - condition.put("status", "'" + prdt.getStatus() + "'"); - erpSqlServer.insert(PrdtBak.class, condition); -// callApiLogSave(prdt, "erp_prdt_bak", "ERP涓嬪彂鍟嗗搧淇℃伅澶囦唤鎴愬姛锛�", true); - - HashMap<String, String> condition2 = new HashMap<>(); - condition2.put("prd_no", "'" + prdt.getPrdNo() + "'"); - erpSqlServer.delete(Prdt.class, condition2); -// callApiLogSave(prdt, "erp_prdt", "ERP涓嬪彂鍟嗗搧淇℃伅澶囦唤鍚庡垹闄ゆ垚鍔燂紒", true); - } else { - if (Cools.isEmpty(prdt.getTemp1()) && Cools.isEmpty(prdt.getTemp2()) && Cools.isEmpty(prdt.getTemp3())){ - erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛乻tatus鐘舵�佸紓甯革紒锛侊紒'" - + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "ERP_PRDT", "鍟嗗搧淇℃伅鍑虹幇寮傚父璧勬枡鏈鐞嗭紒", false); - } - } - } - } - } catch (Exception e) { - Date date = new Date(); - log.error(date + ": 琛ㄥ悕锛欵RP_PRDT :" + e); - } - } - - public void callApiLogSave(Prdt prdt, String tableName, String response, Boolean bool) { - apiLogService.save("ERP涓嬪彂鍟嗗搧淇℃伅", tableName, "null", ip, - "鍝佸彿锛�" + prdt.getPrdNo() + "銆佸搧鍚嶏細" + prdt.getName() + "銆佺被鍨嬶細" + prdt.getType() + "銆佺姸鎬侊細" + prdt.getStatus$(), - response, bool); - } -} diff --git a/src/main/java/com/zy/ints/task/scheduler/ErpPrdtSchedulerNew.java b/src/main/java/com/zy/ints/task/scheduler/ErpPrdtSchedulerNew.java deleted file mode 100644 index a35671f..0000000 --- a/src/main/java/com/zy/ints/task/scheduler/ErpPrdtSchedulerNew.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.zy.ints.task.scheduler; - -import com.core.common.Cools; -import com.zy.asrs.entity.Mat; -import com.zy.asrs.entity.Tag; -import com.zy.asrs.service.ApiLogService; -import com.zy.asrs.service.MatService; -import com.zy.asrs.service.TagService; -import com.zy.ints.entity.Prdt; -import com.zy.ints.entity.PrdtBak; -import com.zy.ints.erp.ErpSqlServer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * erp浠诲姟鎺у埗鍣� - * Created by vincent on 2020/11/27 - */ -@Slf4j -@Component -public class ErpPrdtSchedulerNew { - - /** - * ERP鎺ュ彛鏄惁鍚敤 - */ - @Value("${erp.enabled}") - private Boolean erpEnabled; - @Value("${erp.enabledNew}") - private Boolean erpEnabledNew; - @Value("${erp.useName.ip}") - private String ip; - @Autowired - private ApiLogService apiLogService; - @Autowired - private TagService tagService; - @Autowired - private ErpSqlServer erpSqlServer; - @Autowired - private MatService matService; - - /** - * 鑾峰彇鍟嗗搧淇℃伅琛ㄨ祫鏂� 骞村墠 - */ - @Scheduled(cron = "${erp.refreshtime}") - public void obtainPedt() { - if (!erpEnabledNew) return; - String sqlSelectPrdt = "select PRD_NO as prdNo,NAME as name,UT as ut,SPC as spc from PRDT where 1=1"; - String sqlUpDatePrdtOne = "update PRDT set STATUS=1 where PRD_NO="; - String sqlUpDatePrdtTwo = "update PRDT set STATUS=2 where PRD_NO="; - try { - Tag tag = tagService.selectByName("鍏ㄩ儴", 1); - - List<Prdt> prdts = erpSqlServer.select(sqlSelectPrdt, Prdt.class); - Date date = new Date(); - if (prdts.size() > 0) { - for (Prdt prdt : prdts) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (Cools.isEmpty(mat)) { - Mat matNew = new Mat(); - matNew.setTagId(tag.getId()); - matNew.setMatnr(prdt.getPrdNo()); - matNew.setMaktx(prdt.getName()); - matNew.setUnit(prdt.getUt()); - matNew.setSpecs(prdt.getSpc()); - matNew.setCreateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setCreateTime(date); - matNew.setUpdateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setUpdateTime(date); - if (matService.insert(matNew)) { -// erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佹坊鍔犲晢鍝佷俊鎭垚鍔燂紒", true); - } else { -// erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佹坊鍔犲晢鍝佷俊鎭け璐ワ紒锛侊紒", false); - } - } else { -// erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佸晢鍝佸凡瀛樺湪锛侊紒锛�", false); - } - } - } - /*if (prdts.size() > 0) { - for (Prdt prdt : prdts) { - Date date = new Date(); - if (prdt.getStatus() == 0) { - Integer type = prdt.getType(); - if (type == 1) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (Cools.isEmpty(mat)) { - Mat matNew = new Mat(); - matNew.setTagId(tag.getId()); - matNew.setMatnr(prdt.getPrdNo()); - matNew.setMaktx(prdt.getName()); - matNew.setUnit(prdt.getUt()); - matNew.setSpecs(prdt.getSpc()); - matNew.setCreateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setCreateTime(date); - matNew.setUpdateBy(9999L);//9999琛ㄧずerp涓嬪彂 - matNew.setUpdateTime(date); - if (matService.insert(matNew)) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佹坊鍔犲晢鍝佷俊鎭垚鍔燂紒", true); - } else { - erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佹坊鍔犲晢鍝佷俊鎭け璐ワ紒锛侊紒", false); - } - } else { - erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佸晢鍝佸凡瀛樺湪锛侊紒锛�", false); - } - } else if (type == 2) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (!Cools.isEmpty(mat)) { - mat.setMaktx(prdt.getName()); - mat.setUnit(prdt.getUt()); - mat.setSpecs(prdt.getSpc()); - if (matService.updateById(mat)) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佷慨鏀瑰晢鍝佷俊鎭垚鍔燂紒", true); - } else { - erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅澶辫触锛侊紒锛佷慨鏀瑰晢鍝佷俊鎭け璐ワ紒锛侊紒", false); - } - } - } else if (type == 3) { - Mat mat = matService.selectByMatnr(prdt.getPrdNo()); - if (!Cools.isEmpty(mat)) { - if (matService.deleteById(mat.getId())) { - erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佸垹闄ゅ晢鍝佷俊鎭垚鍔燂紒", true); - } else { - erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); - callApiLogSave(prdt, "PRDT", "鎺ユ敹ERP涓嬪彂鍟嗗搧淇℃伅鎴愬姛锛佸垹闄ゅ晢鍝佷俊鎭け璐ワ紒", false); - } - } - } else { - callApiLogSave(prdt, "PRDT", "鍟嗗搧淇℃伅鍑虹幇寮傚父璧勬枡鏈鐞嗭紒", false); - } - } else if (prdt.getStatus() == 1) { - HashMap<String, Object> condition = new HashMap<>(); - condition.put("PRD_NO", "'" + prdt.getPrdNo() + "'"); - condition.put("NAME", "'" + prdt.getName() + "'"); - condition.put("UT", "'" + prdt.getUt() + "'"); - condition.put("SPC", "'" + prdt.getSpc() + "'"); - condition.put("TYPE", "'" + prdt.getType() + "'"); - condition.put("STATUS", "'" + prdt.getStatus() + "'"); - erpSqlServer.insert(PrdtBak.class, condition); -// callApiLogSave(prdt, "erp_prdt_bak", "ERP涓嬪彂鍟嗗搧淇℃伅澶囦唤鎴愬姛锛�", true); - - HashMap<String, String> condition2 = new HashMap<>(); - condition2.put("prd_no", "'" + prdt.getPrdNo() + "'"); - erpSqlServer.delete(Prdt.class, condition2); -// callApiLogSave(prdt, "erp_prdt", "ERP涓嬪彂鍟嗗搧淇℃伅澶囦唤鍚庡垹闄ゆ垚鍔燂紒", true); - } else { - callApiLogSave(prdt, "PRDT", "鍟嗗搧淇℃伅鍑虹幇寮傚父璧勬枡鏈鐞嗭紒", false); - } - }*/ -// } - } catch (Exception e) { - Date date = new Date(); - log.error(date + ": 琛ㄥ悕锛歅RDT :" + e); - } - } - - public void callApiLogSave(Prdt prdt, String tableName, String response, Boolean bool) { - apiLogService.save("ERP涓嬪彂鍟嗗搧淇℃伅", tableName, "null", ip, - "鍝佸彿锛�" + prdt.getPrdNo() + "銆佸搧鍚嶏細" + prdt.getName() + "銆佺被鍨嬶細" + prdt.getType() + "銆佺姸鎬侊細" + prdt.getStatus$(), - response, bool); - } -} diff --git a/src/main/java/com/zy/ints/task/scheduler/LkDetTbScheduler.java b/src/main/java/com/zy/ints/task/scheduler/LkDetTbScheduler.java deleted file mode 100644 index 2c347f3..0000000 --- a/src/main/java/com/zy/ints/task/scheduler/LkDetTbScheduler.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.zy.ints.task.scheduler; - -import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.core.common.Cools; -import com.zy.asrs.entity.DocType; -import com.zy.asrs.entity.Order; -import com.zy.asrs.entity.OrderDetl; -import com.zy.asrs.service.ApiLogService; -import com.zy.asrs.service.DocTypeService; -import com.zy.asrs.service.OrderDetlService; -import com.zy.asrs.service.OrderService; -import com.zy.ints.entity.LkDetTb; -import com.zy.ints.entity.LkDetTbBak; -import com.zy.ints.erp.ErpSqlServer; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * erp浠诲姟鎺у埗鍣� - * Created by vincent on 2020/11/27 - */ -@Slf4j -@Component -public class LkDetTbScheduler { - /** - * ERP鎺ュ彛鏄惁鍚敤 - */ - @Value("${erp.enabled}") - private Boolean erpEnabled; - @Value("${erp.useName.ip}") - private String ip; - @Autowired - private ApiLogService apiLogService; - @Autowired - private ErpSqlServer erpSqlServer; - @Autowired - private OrderService orderService; - @Autowired - private OrderDetlService orderDetlService; - @Autowired - private DocTypeService docTypeService; - - /** - * 涓婃姤鍏ュ嚭搴撳畬缁撹鍗曚俊鎭� - */ - @Scheduled(cron = "${erp.refreshtime}") - public void reportOrder() { - if (!erpEnabled) return; - String sqlSelectLkDetTb = "select bill_no as billNo,prd_no as prdNo,iokindid,add_id as addId,qty,prd_mark as prdMark,wh,billdate,status,temp1,temp2,temp3 from lk_det_tb where 1=1"; - String sqlSelectLkDetTbBak = "select bill_no as billNo,prd_no as prdNo,iokindid,add_id as addId,qty,prd_mark as prdMark,wh,billdate,status,temp1,temp2,temp3 from lk_det_tb_bak where 1=1"; - - try { - List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); - if (orders.size() > 0) { - for (Order order : orders) { - List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); - if (!Cools.isEmpty(orderDetls)) { - for (OrderDetl orderDetl : orderDetls) { - Date now = new Date(); - List<LkDetTb> lkDetTbs = erpSqlServer.select(sqlSelectLkDetTb + - " and bill_no='" + orderDetl.getOrderNo() + "'" + - " and prd_no='" + orderDetl.getMatnr() + "'" + - " and prd_mark='" + orderDetl.getBatch() + "'" - , LkDetTb.class); - List<LkDetTbBak> lkDetTbBaks = erpSqlServer.select(sqlSelectLkDetTbBak + - " and bill_no='" + orderDetl.getOrderNo() + "'" + - " and prd_no='" + orderDetl.getMatnr() + "'" + - " and prd_mark='" + orderDetl.getBatch() + "'" - , LkDetTbBak.class); - if (lkDetTbs.size() == 1) { - callApiLogSaveLkDetTb(lkDetTbs.get(0), "erp_det_tb", "宸茬粡涓婃姤浣嗘槸鏄庣粏渚濇棫瀛樺湪锛岃鑱旂郴寮�鍙戜汉鍛橈紒锛侊紒", false); - continue; - } else if (lkDetTbBaks.size() == 1) { - callApiLogSaveLkDetTbBak(lkDetTbBaks.get(0), "erp_det_tb_bak", "宸茬粡涓婃姤浣嗘槸鏄庣粏渚濇棫瀛樺湪锛岃鑱旂郴寮�鍙戜汉鍛橈紒锛侊紒", false); - continue; - } else if (lkDetTbs.size() > 1) { - callApiLogSaveLkDetTb(lkDetTbs.get(0), "erp_det_tb", "瀛樺湪閲嶅璧勬枡锛岃仈绯诲紑鍙戜汉鍛橈紒锛侊紒", false); - continue; - } else if (lkDetTbBaks.size() > 1) { - callApiLogSaveLkDetTbBak(lkDetTbBaks.get(0), "erp_det_tb_bak", "瀛樺湪閲嶅璧勬枡锛岃仈绯诲紑鍙戜汉鍛橈紒锛侊紒", false); - continue; - } else { - String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now); - HashMap<String, Object> condition = new HashMap<>(); - condition.put("bill_no", "'" + orderDetl.getOrderNo() + "'"); - condition.put("prd_no", "'" + orderDetl.getMatnr() + "'"); - - DocType docType = docTypeService.selectById(order.getDocType()); - if (!Cools.isEmpty(docType)) { - int addid = docType.getPakin() == 1 ? 1 : 2; - condition.put("iokindid", "'" + docType.getDocName$() + "'"); - condition.put("add_id", "'" + addid + "'"); - } - - condition.put("qty", "'" + orderDetl.getQty() + "'"); - condition.put("prd_mark", "'" + orderDetl.getBatch() + "'"); - condition.put("wh", "'" + orderDetl.getMemo() + "'"); - condition.put("billdate", "'" + format + "'"); - condition.put("status", "'" + 0 + "'"); - erpSqlServer.insert(LkDetTb.class, condition); - callApiLogSaveOrderDetl(orderDetl, "瀹岀粨璁㈠崟鏄庣粏涓婃姤瀹屾垚", true); - } - //淇濆瓨璁㈠崟鏄庣粏鍘嗗彶妗� - if (orderDetlService.addToLogTable(orderDetl)) { -// callApiLogSaveOrderDetl(orderDetl, "淇濆瓨璁㈠崟鏄庣粏鍘嗗彶妗f垚鍔燂紒", true); - //鍒犻櫎璁㈠崟鏄庣粏 - orderDetlService.deleteById(orderDetl.getId()); - callApiLogSaveOrderDetl(orderDetl, "璁㈠崟鏄庣粏妗d繚瀛樺悗鍒犻櫎鎴愬姛锛�", true); - } - } - //淇濆瓨璁㈠崟鍘嗗彶妗� - if (orderService.addToLogTable(order)) { -// callApiLogSaveOrder(order, "瀹岀粨璁㈠崟涓婃姤瀹屾垚锛屽苟淇濆瓨璁㈠崟鍘嗗彶妗f垚鍔燂紒锛侊紒", true); - //鍒犻櫎瀹岀粨璁㈠崟 - orderService.deleteById(order.getId()); - callApiLogSaveOrder(order, "瀹岀粨璁㈠崟涓婃姤瀹屾垚锛屽苟淇濆瓨璁㈠崟鍘嗗彶妗e悗鍒犻櫎瀹岀粨璁㈠崟鎴愬姛锛侊紒锛�", true); - } - } - } - } - - } catch (Exception e) { - Date date = new Date(); - log.error(date + ": 琛ㄥ悕锛歭k_det_tb :" + e); - } - } - - public void callApiLogSaveLkDetTb(LkDetTb lkDetTb, String tableName, String response, Boolean bool) { - apiLogService.save("涓婃姤瀹岀粨璁㈠崟鏄庣粏淇℃伅", tableName, "null", ip, - "璁㈠崟鍙凤細" + lkDetTb.getBillNo() + "銆佸搧鍙凤細" + lkDetTb.getPrdNo() + "銆佽揣鍝佺壒寰侊細" + lkDetTb.getPrdMark() + "銆佺姸鎬侊細" + lkDetTb.getStatus$(), - response, bool); - } - - public void callApiLogSaveLkDetTbBak(LkDetTbBak lkDetTbBak, String tableName, String response, Boolean bool) { - apiLogService.save("涓婃姤瀹岀粨璁㈠崟鏄庣粏淇℃伅", tableName, "null", ip, - "璁㈠崟鍙凤細" + lkDetTbBak.getBillNo() + "銆佸搧鍙凤細" + lkDetTbBak.getPrdNo() + "銆佽揣鍝佺壒寰侊細" + lkDetTbBak.getPrdMark() + "銆佺姸鎬侊細" + lkDetTbBak.getStatus$(), - response, bool); - } - - public void callApiLogSaveOrderDetl(OrderDetl orderDetl, String response, Boolean bool) { - apiLogService.save("涓婃姤瀹岀粨璁㈠崟鏄庣粏淇℃伅", "lk_det_tb", "null", ip, - "璁㈠崟鍙凤細" + orderDetl.getOrderNo() + "銆佸搧鍙凤細" + orderDetl.getMatnr() + "銆佽揣鍝佺壒寰侊細" + orderDetl.getBatch(), - response, bool); - } - - public void callApiLogSaveOrder(Order order, String response, Boolean bool) { - apiLogService.save("瀹岀粨璁㈠崟淇℃伅涓婃姤瀹屾垚", "lk_det_tb", "null", ip, - "璁㈠崟鍙凤細" + order.getOrderNo(), response, bool); - } -} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 6837ac5..1d36cb3 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -54,22 +54,6 @@ doubleLocsLeft : 1,5,9 # 鍙虫繁搴撲綅鎺掑彿 doubleLocsRight : 4,8,12 -#ERP鎺ュ彛 -erp: - enabled: false - enabledNew: false - enabledErpDetTb: false - enabledErpPrdt: false - # enabled: false - #鏌ョ湅ERP涓棿琛ㄩ棿闅� - refreshtime: 0/5 * * * * ? - db: - driver_class_name: com.microsoft.sqlserver.jdbc.SQLServerDriver - url: jdbc:sqlserver://192.168.0.13:1433;databasename=DB_2022 - username: sa - password: Qaz@1234 - useName: - ip: 192.168.0.13 comb: -- Gitblit v1.9.1