4个文件已添加
1 文件已重命名
3 文件已复制
5个文件已修改
copy from src/main/java/com/zy/ints/entity/DetTb.java
copy to src/main/java/com/zy/ints/entity/ErpDetTb.java
File was copied from src/main/java/com/zy/ints/entity/DetTb.java |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | 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 com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("erp_det_tb") |
| | | public class DetTb implements Serializable { |
| | | public class ErpDetTb implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 单据号码 |
| | | */ |
| | | @ApiModelProperty(value= "单据号码") |
| | | @ApiModelProperty(value = "单据号码") |
| | | @TableId(value = "bill_no", type = IdType.INPUT) |
| | | @TableField("bill_no") |
| | | private String billNo; |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 单据类别 |
| | | */ |
| | | @ApiModelProperty(value= "单据类别") |
| | | @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(减,出库)") |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("add_id") |
| | | private String addId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 货品特征 |
| | | */ |
| | | @ApiModelProperty(value= "货品特征") |
| | | @ApiModelProperty(value = "货品特征") |
| | | @TableId(value = "prd_mark", type = IdType.INPUT) |
| | | @TableField("prd_mark") |
| | | private String prdMark; |
| | |
| | | /** |
| | | * 仓库 |
| | | */ |
| | | @ApiModelProperty(value= "仓库") |
| | | @ApiModelProperty(value = "仓库") |
| | | private String wh; |
| | | |
| | | /** |
| | | * 日期 |
| | | */ |
| | | @ApiModelProperty(value= "日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billdate; |
| | | |
| | | /** |
| | | * 状态:0(初始状态)、1(已接收)、2(异常) |
| | | */ |
| | | @ApiModelProperty(value= "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | @ApiModelProperty(value = "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | @ApiModelProperty(value = "备用字段1") |
| | | private String temp1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | @ApiModelProperty(value = "备用字段2") |
| | | private String temp2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | @ApiModelProperty(value = "备用字段3") |
| | | private String temp3; |
| | | |
| | | public DetTb() {} |
| | | public ErpDetTb() { |
| | | } |
| | | |
| | | public DetTb(String billNo,String prdNo,String iokindid,String addId,Double qty,String prdMark,String wh,Date billdate,Integer status,String temp1,String temp2,String temp3) { |
| | | public ErpDetTb(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; |
| | |
| | | // null // 备用字段3 |
| | | // ); |
| | | |
| | | public String getBilldate$(){ |
| | | if (Cools.isEmpty(this.billdate)){ |
| | | public String getBilldate$() { |
| | | if (Cools.isEmpty(this.billdate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); |
copy from src/main/java/com/zy/ints/entity/DetTb.java
copy to src/main/java/com/zy/ints/entity/ErpDetTbBak.java
File was copied from src/main/java/com/zy/ints/entity/DetTb.java |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | 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 com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("erp_det_tb") |
| | | public class DetTb implements Serializable { |
| | | @TableName("erp_det_tb_bak") |
| | | public class ErpDetTbBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 单据号码 |
| | | */ |
| | | @ApiModelProperty(value= "单据号码") |
| | | @ApiModelProperty(value = "单据号码") |
| | | @TableId(value = "bill_no", type = IdType.INPUT) |
| | | @TableField("bill_no") |
| | | private String billNo; |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 单据类别 |
| | | */ |
| | | @ApiModelProperty(value= "单据类别") |
| | | @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(减,出库)") |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("add_id") |
| | | private String addId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 货品特征 |
| | | */ |
| | | @ApiModelProperty(value= "货品特征") |
| | | @ApiModelProperty(value = "货品特征") |
| | | @TableId(value = "prd_mark", type = IdType.INPUT) |
| | | @TableField("prd_mark") |
| | | private String prdMark; |
| | |
| | | /** |
| | | * 仓库 |
| | | */ |
| | | @ApiModelProperty(value= "仓库") |
| | | @ApiModelProperty(value = "仓库") |
| | | private String wh; |
| | | |
| | | /** |
| | | * 日期 |
| | | */ |
| | | @ApiModelProperty(value= "日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billdate; |
| | | |
| | | /** |
| | | * 状态:0(初始状态)、1(已接收)、2(异常) |
| | | */ |
| | | @ApiModelProperty(value= "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | @ApiModelProperty(value = "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | @ApiModelProperty(value = "备用字段1") |
| | | private String temp1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | @ApiModelProperty(value = "备用字段2") |
| | | private String temp2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | @ApiModelProperty(value = "备用字段3") |
| | | private String temp3; |
| | | |
| | | public DetTb() {} |
| | | public ErpDetTbBak() { |
| | | } |
| | | |
| | | public DetTb(String billNo,String prdNo,String iokindid,String addId,Double qty,String prdMark,String wh,Date billdate,Integer status,String temp1,String temp2,String temp3) { |
| | | public ErpDetTbBak(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; |
| | |
| | | // null // 备用字段3 |
| | | // ); |
| | | |
| | | public String getBilldate$(){ |
| | | if (Cools.isEmpty(this.billdate)){ |
| | | public String getBilldate$() { |
| | | if (Cools.isEmpty(this.billdate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | 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 |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 货品特征 |
| | | */ |
| | | @ApiModelProperty(value= "货品特征") |
| | | @ApiModelProperty(value = "货品特征") |
| | | @TableId(value = "prd_mark", type = IdType.INPUT) |
| | | @TableField("prd_mark") |
| | | private String prdMark; |
| | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 仓库 |
| | | */ |
| | | @ApiModelProperty(value= "仓库") |
| | | @ApiModelProperty(value = "仓库") |
| | | private String wh; |
| | | |
| | | /** |
| | | * 状态:0(初始状态)、1(已接收)、2(异常) |
| | | */ |
| | | @ApiModelProperty(value= "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | @ApiModelProperty(value = "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | @ApiModelProperty(value = "备用字段1") |
| | | private String temp1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | @ApiModelProperty(value = "备用字段2") |
| | | private String temp2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | @ApiModelProperty(value = "备用字段3") |
| | | private String temp3; |
| | | |
| | | public ErpLk() {} |
| | | public ErpLk() { |
| | | } |
| | | |
| | | public ErpLk(String prdNo,String prdMark,Double qty,String wh,Integer status,String temp1,String temp2,String temp3) { |
| | | 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; |
New file |
| | |
| | | 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 |
| | | // ); |
| | | |
| | | |
| | | } |
File was renamed from src/main/java/com/zy/ints/entity/DetTb.java |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | 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 com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("erp_det_tb") |
| | | public class DetTb implements Serializable { |
| | | @TableName("lk_det_tb") |
| | | public class LkDetTb implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 单据号码 |
| | | */ |
| | | @ApiModelProperty(value= "单据号码") |
| | | @ApiModelProperty(value = "单据号码") |
| | | @TableId(value = "bill_no", type = IdType.INPUT) |
| | | @TableField("bill_no") |
| | | private String billNo; |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 单据类别 |
| | | */ |
| | | @ApiModelProperty(value= "单据类别") |
| | | @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(减,出库)") |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("add_id") |
| | | private String addId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 货品特征 |
| | | */ |
| | | @ApiModelProperty(value= "货品特征") |
| | | @ApiModelProperty(value = "货品特征") |
| | | @TableId(value = "prd_mark", type = IdType.INPUT) |
| | | @TableField("prd_mark") |
| | | private String prdMark; |
| | |
| | | /** |
| | | * 仓库 |
| | | */ |
| | | @ApiModelProperty(value= "仓库") |
| | | @ApiModelProperty(value = "仓库") |
| | | private String wh; |
| | | |
| | | /** |
| | | * 日期 |
| | | */ |
| | | @ApiModelProperty(value= "日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billdate; |
| | | |
| | | /** |
| | | * 状态:0(初始状态)、1(已接收)、2(异常) |
| | | */ |
| | | @ApiModelProperty(value= "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | @ApiModelProperty(value = "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | @ApiModelProperty(value = "备用字段1") |
| | | private String temp1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | @ApiModelProperty(value = "备用字段2") |
| | | private String temp2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | @ApiModelProperty(value = "备用字段3") |
| | | private String temp3; |
| | | |
| | | public DetTb() {} |
| | | public LkDetTb() { |
| | | } |
| | | |
| | | public DetTb(String billNo,String prdNo,String iokindid,String addId,Double qty,String prdMark,String wh,Date billdate,Integer status,String temp1,String temp2,String temp3) { |
| | | 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; |
| | |
| | | // null // 备用字段3 |
| | | // ); |
| | | |
| | | public String getBilldate$(){ |
| | | if (Cools.isEmpty(this.billdate)){ |
| | | public String getBilldate$() { |
| | | if (Cools.isEmpty(this.billdate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); |
copy from src/main/java/com/zy/ints/entity/DetTb.java
copy to src/main/java/com/zy/ints/entity/LkDetTbBak.java
File was copied from src/main/java/com/zy/ints/entity/DetTb.java |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | 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 com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("erp_det_tb") |
| | | public class DetTb implements Serializable { |
| | | @TableName("lk_det_tb_bak") |
| | | public class LkDetTbBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 单据号码 |
| | | */ |
| | | @ApiModelProperty(value= "单据号码") |
| | | @ApiModelProperty(value = "单据号码") |
| | | @TableId(value = "bill_no", type = IdType.INPUT) |
| | | @TableField("bill_no") |
| | | private String billNo; |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 单据类别 |
| | | */ |
| | | @ApiModelProperty(value= "单据类别") |
| | | @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(减,出库)") |
| | | @ApiModelProperty(value = "增减符号:1(加,入库)、2(减,出库)") |
| | | @TableField("add_id") |
| | | private String addId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 货品特征 |
| | | */ |
| | | @ApiModelProperty(value= "货品特征") |
| | | @ApiModelProperty(value = "货品特征") |
| | | @TableId(value = "prd_mark", type = IdType.INPUT) |
| | | @TableField("prd_mark") |
| | | private String prdMark; |
| | |
| | | /** |
| | | * 仓库 |
| | | */ |
| | | @ApiModelProperty(value= "仓库") |
| | | @ApiModelProperty(value = "仓库") |
| | | private String wh; |
| | | |
| | | /** |
| | | * 日期 |
| | | */ |
| | | @ApiModelProperty(value= "日期") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "日期") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billdate; |
| | | |
| | | /** |
| | | * 状态:0(初始状态)、1(已接收)、2(异常) |
| | | */ |
| | | @ApiModelProperty(value= "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | @ApiModelProperty(value = "状态:0(初始状态)、1(已接收)、2(异常)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | @ApiModelProperty(value = "备用字段1") |
| | | private String temp1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | @ApiModelProperty(value = "备用字段2") |
| | | private String temp2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | @ApiModelProperty(value = "备用字段3") |
| | | private String temp3; |
| | | |
| | | public DetTb() {} |
| | | public LkDetTbBak() { |
| | | } |
| | | |
| | | public DetTb(String billNo,String prdNo,String iokindid,String addId,Double qty,String prdMark,String wh,Date billdate,Integer status,String temp1,String temp2,String temp3) { |
| | | 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; |
| | |
| | | // null // 备用字段3 |
| | | // ); |
| | | |
| | | public String getBilldate$(){ |
| | | if (Cools.isEmpty(this.billdate)){ |
| | | public String getBilldate$() { |
| | | if (Cools.isEmpty(this.billdate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.billdate); |
| | |
| | | package com.zy.ints.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | 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 |
| | |
| | | /** |
| | | * 品号 |
| | | */ |
| | | @ApiModelProperty(value= "品号") |
| | | @ApiModelProperty(value = "品号") |
| | | @TableId(value = "prd_no", type = IdType.INPUT) |
| | | @TableField("prd_no") |
| | | private String prdNo; |
| | |
| | | /** |
| | | * 品名 |
| | | */ |
| | | @ApiModelProperty(value= "品名") |
| | | @ApiModelProperty(value = "品名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | @ApiModelProperty(value = "单位") |
| | | private String ut; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | @ApiModelProperty(value = "规格") |
| | | private String spc; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value= "类型") |
| | | @ApiModelProperty(value = "类型") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value= "状态") |
| | | @ApiModelProperty(value = "状态") |
| | | private Integer status; |
| | | |
| | | public Prdt() {} |
| | | public Prdt() { |
| | | } |
| | | |
| | | public Prdt(String prdNo,String name,String ut,String spc,Integer type,Integer status) { |
| | | public Prdt(String prdNo, String name, String ut, String spc, Integer type, Integer status) { |
| | | this.prdNo = prdNo; |
| | | this.name = name; |
| | | this.ut = ut; |
New file |
| | |
| | | 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; |
| | | |
| | | 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 // 状态[非空] |
| | | // ); |
| | | |
| | | |
| | | } |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ErpSqlServer { |
| | | |
| | | |
| | | // 数据库连接 |
| | | // private Connection conn; |
| | | // 创建预编译语句对象,一般都是用这个而不用Statement |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扫描所有实力类属性里的TableField注解,并将里面的值作为column |
| | | * |
| | | * @param cls |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public <T> String selectFrontPart(Class<T> cls){ |
| | | public <T> String selectFrontPart(Class<T> cls) { |
| | | String tableName = cls.getDeclaredAnnotation(TableName.class).value(); |
| | | List<HashMap<String,String>> columnAndField = new ArrayList<>(); |
| | | List<HashMap<String, String>> columnAndField = new ArrayList<>(); |
| | | String sql = "SELECT "; |
| | | if (Cools.isEmpty(tableName)) { |
| | | return null; |
| | |
| | | for (Field f : allFields) { |
| | | if (Modifier.isFinal(f.getModifiers()) |
| | | || Modifier.isStatic(f.getModifiers()) |
| | | || Modifier.isTransient(f.getModifiers())){ |
| | | || Modifier.isTransient(f.getModifiers())) { |
| | | continue; |
| | | } |
| | | String column = null; |
| | |
| | | } |
| | | String name = f.getName(); |
| | | HashMap<String, String> container = new HashMap<>(); |
| | | container.put(column,name); |
| | | 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){ |
| | | if (i == columnAndField.size() - 1) { |
| | | for (String s : stringStringHashMap.keySet()) { |
| | | sql = sql + s + " AS " + stringStringHashMap.get(s); |
| | | } |
| | | }else { |
| | | } 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){ |
| | | |
| | | 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()){ |
| | | if (conditionSize == condition.keySet().size()) { |
| | | sql = sql + s + " = " + condition.get(s); |
| | | }else { |
| | | } 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){ |
| | | 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){ |
| | | return select(finalSQL, cls); |
| | | } |
| | | |
| | | public <T> List<T> selectAll(Class<T> cls) { |
| | | String sql = selectFrontPart(cls); |
| | | return select(sql,cls); |
| | | return select(sql, cls); |
| | | } |
| | | |
| | | public List<Map<String, Object>> select(String sql) { |
| | |
| | | return executeUpdate(sql); |
| | | } |
| | | |
| | | public <T> int delete(Class<T> cls, Map<String,String> condition) { |
| | | 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 finalSQL = addWhere(sql, condition); |
| | | return executeUpdate(finalSQL); |
| | | } |
| | | |
| | | public <T> int insert(Class<T> cls, Map<String,Object> condition){ |
| | | |
| | | 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 { |
| | | 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 { |
| | | 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; |
| | |
| | | Connection conn = null; |
| | | try { |
| | | conn = getConn(); |
| | | if(null != conn) |
| | | { |
| | | if (null != conn) { |
| | | pstm = conn.prepareStatement(sql); |
| | | } else { |
| | | log.error("更新ERP中间表失败===>>数据库连接conn为空"); |
| | |
| | | package com.zy.ints.task.scheduler; |
| | | |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.ints.entity.ErpDetTb; |
| | | 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.List; |
| | | |
| | | /** |
| | | * erp任务控制器 |
| | |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | @Autowired |
| | | private MatService matService; |
| | | /** |
| | | * 获取入出库订单信息 |
| | | */ |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InOrOutOrder() { |
| | | if (!erpEnabled) return; |
| | | String sqlSelecterpDetTb = "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 erp_det_tb where 1=1"; |
| | | String sqlUpDateerpDetTbOne = "update erp_det_tb set status=1 where prd_no="; |
| | | String sqlUpDateerpDetTbTwo = "update erp_det_tb set status=2 where prd_no="; |
| | | |
| | | try { |
| | | List<ErpDetTb> erpDetTbs = erpSqlServer.select(sqlSelecterpDetTb, ErpDetTb.class); |
| | | if (erpDetTbs.size() > 0){ |
| | | for (ErpDetTb erpDetTb:erpDetTbs){ |
| | | Integer status = erpDetTb.getStatus(); |
| | | if (status == 0){ |
| | | |
| | | }else if (status == 1){ |
| | | |
| | | }else if (status == 2){ |
| | | |
| | | }else { |
| | | |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.ints.task.scheduler; |
| | | |
| | | import com.zy.ints.entity.ErpLk; |
| | | 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.List; |
| | | |
| | | /** |
| | | * erp任务控制器 |
| | | * Created by vincent on 2020/11/27 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ErpLkScheduler { |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | /** |
| | | * 获取入出库订单信息 |
| | | */ |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InOrOutOrder() { |
| | | 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 sqlUpDateerpLkOne = "update bas_erp_lk set status=1 where prd_no="; |
| | | String sqlUpDateerpLkTwo = "update bas_erp_lk set status=2 where prd_no="; |
| | | |
| | | try { |
| | | List<ErpLk> erpLks = erpSqlServer.select(sqlSelecterpLk, ErpLk.class); |
| | | if (erpLks.size() > 0){ |
| | | for (ErpLk erpLk:erpLks){ |
| | | Integer status = erpLk.getStatus(); |
| | | if (status == 0){ |
| | | |
| | | }else if (status == 1){ |
| | | |
| | | }else if (status == 2){ |
| | | |
| | | }else { |
| | | |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | private ErpSqlServer erpSqlServer; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | /** |
| | | * 获取商品信息表资料 |
| | | */ |
| | |
| | | String sqlSelectPrdt = "select prd_no as prdNo,name,ut,spc,type,status from erp_prdt where 1=1"; |
| | | String sqlUpDatePrdtOne = "update erp_prdt set status=1 where prd_no="; |
| | | String sqlUpDatePrdtTwo = "update erp_prdt set status=2 where prd_no="; |
| | | Tag tag = tagService.selectByName("全部", 1); |
| | | 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); |
| | | matNew.setCreateTime(date); |
| | | matNew.setUpdateBy(9999L); |
| | | matNew.setUpdateTime(date); |
| | | if (matService.insert(matNew)){ |
| | | erpSqlServer.update(sqlUpDatePrdtOne+"'" + prdt.getPrdNo() + "'"); |
| | | }else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo+"'" + prdt.getPrdNo() + "'"); |
| | | 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); |
| | | matNew.setCreateTime(date); |
| | | matNew.setUpdateBy(9999L); |
| | | matNew.setUpdateTime(date); |
| | | if (matService.insert(matNew)) { |
| | | erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); |
| | | } else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); |
| | | } |
| | | } |
| | | } |
| | | }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() + "'"); |
| | | }else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo+"'" + prdt.getPrdNo() + "'"); |
| | | } 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() + "'"); |
| | | } else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); |
| | | } |
| | | } |
| | | } |
| | | }else if (type==3){ |
| | | Mat mat = matService.selectByMatnr(prdt.getPrdNo()); |
| | | if (!Cools.isEmpty(mat)){ |
| | | if (matService.deleteById(mat.getId())){ |
| | | erpSqlServer.update(sqlUpDatePrdtOne+"'" + prdt.getPrdNo() + "'"); |
| | | }else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo+"'" + prdt.getPrdNo() + "'"); |
| | | } else if (type == 3) { |
| | | Mat mat = matService.selectByMatnr(prdt.getPrdNo()); |
| | | if (!Cools.isEmpty(mat)) { |
| | | if (matService.deleteById(mat.getId())) { |
| | | erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); |
| | | } else { |
| | | erpSqlServer.update(sqlUpDatePrdtTwo + "'" + prdt.getPrdNo() + "'"); |
| | | } |
| | | } |
| | | } else { |
| | | |
| | | } |
| | | }else { |
| | | } 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); |
| | | |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("prd_no", "'" + prdt.getPrdNo() + "'"); |
| | | erpSqlServer.delete(Prdt.class, condition2); |
| | | } else if (prdt.getStatus() == 2) { |
| | | |
| | | } else { |
| | | |
| | | } |
| | | }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(Prdt.class, condition); |
| | | // |
| | | // HashMap<String, String> condition2 = new HashMap<>(); |
| | | // condition2.put("prd_no","'" + prdt.getPrdNo() + "'"); |
| | | // erpSqlServer.delete(Prdt.class,condition2); |
| | | }else if (prdt.getStatus()==2){ |
| | | |
| | | }else { |
| | | |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.ints.task.scheduler; |
| | | |
| | | import com.zy.ints.entity.LkDetTb; |
| | | 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.List; |
| | | |
| | | /** |
| | | * erp任务控制器 |
| | | * Created by vincent on 2020/11/27 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class LkDetTbScheduler { |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | /** |
| | | * 获取入出库订单信息 |
| | | */ |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InOrOutOrder() { |
| | | 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 sqlUpDatelkDetTbOne = "update lk_det_tb set status=1 where prd_no="; |
| | | String sqlUpDatelkDetTbTwo = "update lk_det_tb set status=2 where prd_no="; |
| | | |
| | | try { |
| | | List<LkDetTb> lkDetTbs = erpSqlServer.select(sqlSelectlkDetTb, LkDetTb.class); |
| | | if (lkDetTbs.size() > 0){ |
| | | for (LkDetTb lkDetTb:lkDetTbs){ |
| | | Integer status = lkDetTb.getStatus(); |
| | | if (status == 0){ |
| | | |
| | | }else if (status == 1){ |
| | | |
| | | }else if (status == 2){ |
| | | |
| | | }else { |
| | | |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |