Merge remote-tracking branch 'origin/xgmFlasrs' into xgmFlasrs
| | |
| | | .springBeans |
| | | .sts4-cache |
| | | |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | src/test |
| | | |
| | | ### NetBeans ### |
| | | /nbproject/private/ |
| | |
| | | <artifactId>truelicense-core</artifactId> |
| | | <version>1.33</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | |
| | | public R statis(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | System.out.println(JSONObject.toJSON(param)); |
| | | Page<StockStatisDTO> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, StockStatisDTO.class)); |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | |
| | | private String docName; |
| | | |
| | | /** |
| | | * 类型编码 |
| | | */ |
| | | @ApiModelProperty(value= "类型编码") |
| | | @TableField("doc_code") |
| | | private String docCode; |
| | | |
| | | /** |
| | | * 入库 1: 入库 0: 非入库 |
| | | */ |
| | | @ApiModelProperty(value= "入库 1: 入库 0: 非入库 ") |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | |
| | | @TableField("store_max_date") |
| | | private Integer storeMaxDate; |
| | | |
| | | /** |
| | | * 外部主键 |
| | | */ |
| | | // @TableField("auto_id") |
| | | // private Integer autoId; |
| | | // /** |
| | | // * 订单号 |
| | | // */ |
| | | // @TableField("out_order_no") |
| | | // private String outOrderNo; |
| | | // |
| | | // /** |
| | | // * 炉号\客户图号 |
| | | // */ |
| | | // @TableField("lu_hao") |
| | | // private String luHao; |
| | | // |
| | | // /** |
| | | // * 工单号 |
| | | // */ |
| | | // @TableField("pg_no") |
| | | // private String sPgNO; |
| | | |
| | | @TableField("temp1") |
| | | private String temp1; |
| | | |
| | | @TableField("temp2") |
| | | private String temp2; |
| | | |
| | | @TableField("temp3") |
| | | private String temp3; |
| | | |
| | | |
| | | |
| | | public Mat() {} |
| | | |
| | | public Mat(String uuid,Long tagId,String matnr,String maktx,String name,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double length,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | |
| | | * 客户编号 |
| | | */ |
| | | @ApiModelProperty(value= "客户编号") |
| | | private Long cstmr; |
| | | private String cstmr; |
| | | |
| | | /** |
| | | * 客户 |
| | |
| | | |
| | | public Order() {} |
| | | |
| | | public Order(String uuid,String orderNo,String orderTime,Long docType,Long itemId,String itemName,Long allotItemId,String defNumber,String number,Long cstmr,String cstmrName,String tel,String operMemb,Double totalFee,Double discount,Double discountFee,Double otherFee,Double actFee,Integer payType,String salesman,Integer accountDay,Integer postFeeType,Double postFee,Date payTime,Date sendTime,String shipName,String shipCode,Long settle,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public Order(String uuid,String orderNo,String orderTime,Long docType,Long itemId,String itemName,Long allotItemId,String defNumber,String number,String cstmr,String cstmrName,String tel,String operMemb,Double totalFee,Double discount,Double discountFee,Double otherFee,Double actFee,Integer payType,String salesman,Integer accountDay,Integer postFeeType,Double postFee,Date payTime,Date sendTime,String shipName,String shipCode,Long settle,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.uuid = uuid; |
| | | this.orderNo = orderNo; |
| | | this.orderTime = orderTime; |
| | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @ApiModelProperty(value = "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 订单内码 |
| | | */ |
| | | @ApiModelProperty(value= "订单内码") |
| | | @ApiModelProperty(value = "订单内码") |
| | | @TableField("order_id") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @ApiModelProperty(value = "单据编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value = "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 作业数量 |
| | | * |
| | | * 入库 : 组托完成,组托档、工作档、入库完成数量 |
| | | * 出库 : 工作档、出库完成数量 |
| | | * <p> |
| | | * 入库 : 组托完成,组托档、工作档、入库完成数量 |
| | | * 出库 : 工作档、出库完成数量 |
| | | */ |
| | | @ApiModelProperty(value= "作业数量") |
| | | @ApiModelProperty(value = "作业数量") |
| | | @TableField("work_qty") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 完成数量 |
| | | * |
| | | * 入库 : qty 👆 |
| | | * 出库 : qty 👆 |
| | | * <p> |
| | | * 入库 : qty 👆 |
| | | * 出库 : qty 👆 |
| | | */ |
| | | @ApiModelProperty(value= "完成数量") |
| | | @ApiModelProperty(value = "完成数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 商品编码 |
| | | */ |
| | | @ApiModelProperty(value= "商品编码") |
| | | @ApiModelProperty(value = "商品编码") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | @ApiModelProperty(value = "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | @ApiModelProperty(value = "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | @ApiModelProperty(value = "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | @ApiModelProperty(value = "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | @ApiModelProperty(value = "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | @ApiModelProperty(value = "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | @ApiModelProperty(value = "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | @ApiModelProperty(value = "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | @ApiModelProperty(value = "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | @ApiModelProperty(value = "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | @ApiModelProperty(value = "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | @ApiModelProperty(value = "厂家") |
| | | private String manu; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @ApiModelProperty(value = "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @ApiModelProperty(value = "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @ApiModelProperty(value = "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | @ApiModelProperty(value = "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | @ApiModelProperty(value = "长度") |
| | | private Double length; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | @ApiModelProperty(value = "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @ApiModelProperty(value = "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | @ApiModelProperty(value = "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @ApiModelProperty(value = "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 是否批次 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | @ApiModelProperty(value = "是否批次 1: 是 0: 否 ") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @ApiModelProperty(value = "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | | * 预警天数 |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @ApiModelProperty(value = "预警天数") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 、、宜科: 是否确认 1: 确认 2: 未确认 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | @ApiModelProperty(value = "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | @ApiModelProperty(value = "要求检验 1: 是 0: 否 ") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | @ApiModelProperty(value = "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | @ApiModelProperty(value = "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @ApiModelProperty(value = "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @ApiModelProperty(value = "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @ApiModelProperty(value = "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | @ApiModelProperty(value = "备注") |
| | | private String memo; |
| | | |
| | | public OrderDetl() {} |
| | | @TableField("i_no") |
| | | private Integer iNO; |
| | | |
| | | /** |
| | | * 外部主键 |
| | | */ |
| | | @TableField("auto_id") |
| | | private Integer autoId; |
| | | |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | @TableField("ware_id") |
| | | private String wareId; |
| | | |
| | | @TableField("ware_name") |
| | | private String wareName; |
| | | |
| | | @TableField("packing") |
| | | private String packing; |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | @TableField("temp1") |
| | | private String temp1; |
| | | |
| | | @TableField("temp2") |
| | | private String temp2; |
| | | |
| | | @TableField("temp3") |
| | | private String temp3; |
| | | |
| | | @TableField("pro_type") |
| | | private String proType; |
| | | |
| | | public OrderDetl() { |
| | | } |
| | | |
| | | public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.orderId = orderId; |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public String getOrderId$(){ |
| | | public String getOrderId$() { |
| | | OrderService service = SpringUtils.getBean(OrderService.class); |
| | | Order order = service.selectById(this.orderId); |
| | | if (!Cools.isEmpty(order)){ |
| | | if (!Cools.isEmpty(order)) { |
| | | return String.valueOf(order.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | | public String getBeBatch$() { |
| | | if (null == this.beBatch) { |
| | | return null; |
| | | } |
| | | switch (this.beBatch) { |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | public String getSource$() { |
| | | if (null == this.source) { |
| | | return null; |
| | | } |
| | | switch (this.source) { |
| | | case 1: |
| | | return "制造"; |
| | | case 2: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getInspect$(){ |
| | | if (null == this.inspect){ return null; } |
| | | switch (this.inspect){ |
| | | public String getInspect$() { |
| | | if (null == this.inspect) { |
| | | return null; |
| | | } |
| | | switch (this.inspect) { |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | public String getDanger$() { |
| | | if (null == this.danger) { |
| | | return null; |
| | | } |
| | | switch (this.danger) { |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | public String getStatus$() { |
| | | if (null == this.status) { |
| | | return null; |
| | | } |
| | | switch (this.status) { |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | public String getCreateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | public String getCreateTime$() { |
| | | if (Cools.isEmpty(this.createTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | public String getUpdateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | public String getUpdateTime$() { |
| | | if (Cools.isEmpty(this.updateTime)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getQty$(){ |
| | | if (getAnfme().equals(getQty())){ |
| | | public String getQty$() { |
| | | if (getAnfme().equals(getQty())) { |
| | | return "已完成"; |
| | | } |
| | | return "未完成"; |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class StockStatisDTO { |
| | | private String matnr; |
| | | private String maktx; |
| | | private String itemCode; |
| | | private int lkQty; |
| | | private int erpQty; |
| | | private String itemBatch; |
| | | private String specs; |
| | | } |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<LocDetl> selectLocDetlUnilateralMoveShuttleY(@Param("matnr")String matnr,@Param("batch")String batch,@Param("grade")String grade); |
| | | List<LocDetl> selectLocDetlUnilateralMoveShuttleN(@Param("matnr")String matnr,@Param("batch")String batch,@Param("grade")String grade); |
| | | |
| | | |
| | | |
| | | |
| | | List<StockStatisDTO> asrsAndErpList(Map<String, Object> condition); |
| | | |
| | | long asrsAndErpCount(Map<String, Object> condition); |
| | | } |
| | |
| | | int increaseQtyByOrderNo(@Param("orderNo")String orderNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("qty")Double qty); |
| | | |
| | | int increaseWorkQty(@Param("orderId")Long orderId, @Param("matnr")String matnr, @Param("batch")String batch, @Param("workQty")Double workQty); |
| | | |
| | | |
| | | List<OrderDetl> listByOrderNo(@Param("orderNo") String orderNo); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<String> getSameDetlToday(String matnr, String batch, Integer start, Integer end); |
| | | |
| | | Page<LocDetl> getStockStatis(Page<LocDetl> page); |
| | | Page<StockStatisDTO> getStockStatis(Page<StockStatisDTO> page); |
| | | |
| | | Double getSumAnfme(String matnr); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | boolean increaseWorkQty(Long orderId, String matnr, String batch, Double workQty); |
| | | |
| | | List<OrderDetl> selectItem(String orderNo); |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | |
| | | |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockStatis(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatis(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisCount(page.getCondition())); |
| | | public Page<StockStatisDTO> getStockStatis(Page<StockStatisDTO> page) { |
| | | System.out.println(JSONObject.toJSON(page)); |
| | | page.setRecords(baseMapper.asrsAndErpList(page.getCondition())); |
| | | page.setTotal(baseMapper.asrsAndErpCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderDetl> selectItem(String orderNo) { |
| | | return this.baseMapper.listByOrderNo(orderNo); |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(orderId, matnr, batch); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.common.DateUtils; |
| | | import lombok.SneakyThrows; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.lang.reflect.Modifier; |
| | | |
| | | public class EntityToMapConverter { |
| | | @SneakyThrows |
| | | public static Map<String, Object> entityToMapWithRandomValues(Object entity) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Field[] fields = entity.getClass().getDeclaredFields(); |
| | | Random random = new Random(); |
| | | |
| | | for (Field field : fields) { |
| | | if (Modifier.isStatic(field.getModifiers()) || Modifier.isFinal(field.getModifiers())) { |
| | | // Ignore static or final fields |
| | | continue; |
| | | } |
| | | field.setAccessible(true); |
| | | String fieldName = field.getName(); |
| | | Object fieldValue = field.get(entity); |
| | | |
| | | // Set random values based on type |
| | | if (field.getType() == String.class) { |
| | | map.put(fieldName, "'" + generateRandomString(10) + "'"); |
| | | } else if (field.getType() == Integer.class || field.getType() == int.class) { |
| | | map.put(fieldName, random.nextInt(1000)); |
| | | } else if (field.getType() == Long.class || field.getType() == long.class) { |
| | | map.put(fieldName, random.nextLong() % 1000L); |
| | | } else if (field.getType() == Float.class || field.getType() == float.class) { |
| | | map.put(fieldName, random.nextFloat() * 1000f); |
| | | } else if (field.getType() == Double.class || field.getType() == double.class) { |
| | | map.put(fieldName, random.nextDouble() * 1000d); |
| | | } else if (field.getType() == Boolean.class || field.getType() == boolean.class) { |
| | | map.put(fieldName, random.nextBoolean()); |
| | | } else if (field.getType() == BigDecimal.class) { |
| | | map.put(fieldName, new BigDecimal(random.nextDouble() * 1000d)); |
| | | } else if (field.getType() == Date.class) { |
| | | map.put(fieldName, "'" + DateUtils.convert(new Date()) + "'"); |
| | | } else { |
| | | // For other types, you might want to handle them specifically or skip them |
| | | continue; |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | private static String generateRandomString(int length) { |
| | | String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
| | | StringBuilder sb = new StringBuilder(length); |
| | | for (int i = 0; i < length; i++) { |
| | | sb.append(characters.charAt(new Random().nextInt(characters.length()))); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.service.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"; |
| | | // } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.common.service.erp; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.core.common.Cools; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import lombok.SneakyThrows; |
| | | 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 static final int CONNECTION_TIMEOUT_SECONDS = 10; // 连接超时 |
| | | |
| | | private static final int QUERY_TIMEOUT_SECONDS = 30; // 查询超时 |
| | | |
| | | public static void main(String[] args) { |
| | | ErpSqlServer erpSqlServer = new ErpSqlServer(); |
| | | // 查 |
| | | // String sql = "select ise.* from InStockBillEntry ise left join InStockbill isb on isb.FInterID = ise.FInterID where 1=1"; |
| | | // List<InStockBillEntry> list = erpSqlServer.select(sql, InStockBillEntry.class); |
| | | // 改 / 删 |
| | | // sql = "update InStockBill set Fflag_finish = 1 where FBillNo = ''{0}''"; |
| | | // sql = MessageFormat.format(sql, "123456"); |
| | | // erpSqlServer.update(sql); |
| | | |
| | | HashMap<String, Object> stringStringHashMap = new HashMap<>(); |
| | | stringStringHashMap.put("BillNo", "'1231312'"); |
| | | stringStringHashMap.put("test", "'1231312'"); |
| | | stringStringHashMap.put("BilhahahlNo", "'1231312'"); |
| | | stringStringHashMap.put("B21312illNo", "'1231312'"); |
| | | stringStringHashMap.put("testnum", 100); |
| | | erpSqlServer.insert(InDetTB.class, stringStringHashMap); |
| | | } |
| | | |
| | | // 数据库连接 |
| | | // private Connection conn; |
| | | // 创建预编译语句对象,一般都是用这个而不用Statement |
| | | 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) { |
| | | //用最笨的方法转换,也可以用下面的process方法(还没有写全) |
| | | list.add(JSONObject.parseObject(JSONObject.toJSONString(entity), cls)); |
| | | //list.add(Cools.conver(entity, cls)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @SneakyThrows |
| | | public <T> void process(Map<String, Object> entity, Class<T> cls) { |
| | | for (Map.Entry<String, Object> entry : entity.entrySet()) { |
| | | String fieldName = entry.getKey(); |
| | | Object value = entry.getValue(); |
| | | |
| | | Field field = cls.getDeclaredField(fieldName); |
| | | field.setAccessible(true); |
| | | |
| | | if (value instanceof Integer && field.getType() == int.class || field.getType() == Integer.class) { |
| | | field.setInt(cls, (Integer) value); |
| | | } else if (value instanceof String && field.getType() == String.class) { |
| | | field.set(cls, value); |
| | | } |
| | | // 其他类型可以类似处理 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 扫描所有实力类属性里的TableField注解,并将里面的值作为column |
| | | * |
| | | * @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); |
| | | |
| | | pstm.setQueryTimeout(QUERY_TIMEOUT_SECONDS); |
| | | |
| | | 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); |
| | | |
| | | pstm.setQueryTimeout(QUERY_TIMEOUT_SECONDS); |
| | | |
| | | 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); |
| | | |
| | | pstm.setQueryTimeout(QUERY_TIMEOUT_SECONDS); |
| | | |
| | | } else { |
| | | log.error("更新ERP中间表失败===>>数据库连接conn为空"); |
| | | log.error("更新ERP中间表失败===>>" + sql); |
| | | } |
| | | return pstm.executeUpdate(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("更新ERP中间表失败1===>>" + sql); |
| | | log.error("更新ERP中间表失败1===>>" + 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(); |
| | | |
| | | DriverManager.setLoginTimeout(CONNECTION_TIMEOUT_SECONDS); |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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 lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName("erp_InCancelTB") |
| | | public class InCancelTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | @TableField(value = "AutoId") |
| | | @ApiModelProperty(value = "") |
| | | private Integer AutoId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | |
| | | // InCancelTB inCancelTB = new InCancelTB( |
| | | // null, // [非空] |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | public String getBillNo() { |
| | | return BillNo; |
| | | } |
| | | |
| | | public void setBillNo(String BillNo) { |
| | | this.BillNo = BillNo; |
| | | } |
| | | |
| | | public Date getMakeDate() { |
| | | return MakeDate; |
| | | } |
| | | |
| | | public String getMakeDate$() { |
| | | if (Cools.isEmpty(this.MakeDate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.MakeDate); |
| | | } |
| | | |
| | | public void setMakeDate(Date MakeDate) { |
| | | this.MakeDate = MakeDate; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Data |
| | | @TableName("erp_InDetTB") |
| | | public class InDetTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | /** |
| | | * erp行唯一码 |
| | | */ |
| | | @ApiModelProperty(value = "erp行唯一码") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String ItemId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String WareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("temp1") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("temp2") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("temp3") |
| | | private String temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("erp_InHedTB") |
| | | public class InHedTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | /** |
| | | * StockIn:采购入库 |
| | | * ProductIn:成品入库单 |
| | | * ItemMoveIn:调拨入库 |
| | | * ItemSwitchIn:形态转换入库 |
| | | * CheckMoreIn:盘盈入库单 |
| | | */ |
| | | // @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("BillDate") |
| | | private Date BillDate; |
| | | |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | /** |
| | | * 供应商、部门ID |
| | | */ |
| | | @ApiModelProperty(value = "供应商、部门ID") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | /** |
| | | * 供应商、部门名称 |
| | | */ |
| | | @TableField("ObjectName") |
| | | @ApiModelProperty(value = "供应商、部门名称") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String Temp3; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | // @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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 lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName("erp_ItemTB") |
| | | public class ItemTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "ItemId", type = IdType.INPUT) |
| | | @TableField("ItemId") |
| | | private String ItemId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @TableField("ItemName") |
| | | @ApiModelProperty(value = "") |
| | | private String ItemName; |
| | | |
| | | @TableField("ItemSpc") |
| | | @ApiModelProperty(value = "") |
| | | private String ItemSpc; |
| | | |
| | | @TableField("ItemPic") |
| | | private String itemPic; |
| | | |
| | | @TableField("ItemUnit") |
| | | @ApiModelProperty(value = "") |
| | | private String ItemUnit; |
| | | |
| | | /** |
| | | * 毛坯、半成品、成品 |
| | | */ |
| | | @TableField("ItemKind") |
| | | @ApiModelProperty(value = "毛坯、半成品、成品") |
| | | private String ItemKind; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String Remark; |
| | | |
| | | /** |
| | | * 00:新增 22:删除 |
| | | */ |
| | | @ApiModelProperty(value = "00:新增 22:删除") |
| | | @TableField("Flag") |
| | | private String Flag; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.fff") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String Temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.MakeDate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.MakeDate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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_OutCancelTB") |
| | | public class OutCancelTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.MakeDate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.MakeDate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("erp_OutDetTB") |
| | | public class OutDetTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String ItemId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String proType; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | // @ApiModelProperty(value= "") |
| | | // @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | // @TableField("DelDate") |
| | | // private Date delDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.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.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("erp_OutHedTB") |
| | | public class OutHedTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | |
| | | @TableField("BillDate") |
| | | // @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date BillDate; |
| | | |
| | | /** |
| | | * SendMatOut:发料出库 |
| | | * OtherOut:其它出库单 |
| | | * ItemMoveOut:调拨出库 |
| | | * ItemSwitchOut:形态转换出库 |
| | | * CheckLossOut:盘盈出库单 |
| | | */ |
| | | @ApiModelProperty(value = "SendMatOut:发料出库 ") |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | @ApiModelProperty(value = "部门ID") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | @ApiModelProperty(value = "部门名称") |
| | | @TableField("ObjectName") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String Temp3; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InCancelTB; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInCancelScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Autowired |
| | | private ERPInOrOutCancelService inMS; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InCancelScheduler() { |
| | | log.info("InCancelScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlInCancelTB = "select * from erp_InCancelTB where LKName='中扬二期'"; |
| | | List<InCancelTB> ins = erpSqlServer.select(sqlInCancelTB, InCancelTB.class); |
| | | for (InCancelTB in : ins) { |
| | | System.out.println(in); |
| | | com.zy.third.lk.entity.InCancelTB lkCancel = inMS.tryCancel(in.getBillNo()); |
| | | if (lkCancel != null) { |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + in.getBillNo() + "'"); |
| | | int delete = erpSqlServer.delete(InCancelTB.class, condition); |
| | | if (delete > 0) { |
| | | log.info("将入库取消通知单删除成功,{}", lkCancel.getBillNo()); |
| | | } else { |
| | | log.error("将入库取消通知单删除失败,{}", lkCancel.getBillNo()); |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + lkCancel.getBillNo() + "'"); |
| | | content.put("opFlag", lkCancel.getOpFlag()); |
| | | int insert = erpSqlServer.insert(com.zy.third.lk.entity.InCancelTB.class, content); |
| | | if (insert > 0) { |
| | | log.info("将入库取消通知单写入成功,{}", lkCancel.getBillNo()); |
| | | } else { |
| | | log.error("将入库取消通知单写入失败,{}", lkCancel.getBillNo()); |
| | | } |
| | | } else { |
| | | log.error("将入库取消通知单写入失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import com.zy.third.erp.entity.InHedTB; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库单据 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInHedTBScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | |
| | | @Autowired |
| | | private ERPInOrOutService inMS; |
| | | |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InHedTBScheduler() { |
| | | log.info("InHedTBScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlInHed = "select * from erp_InHedTB where LKName='中扬二期'"; |
| | | List<InHedTB> inHeds = erpSqlServer.select(sqlInHed, InHedTB.class); |
| | | if (!inHeds.isEmpty()) { |
| | | for (InHedTB inHed : inHeds) { |
| | | System.out.println(inHed); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<InDetTB> inDetTBS = erpSqlServer.selectList(InDetTB.class, condition); |
| | | HashMap<String, Object> hedAndDet = new HashMap<>(); |
| | | hedAndDet.put("hed", inHed); |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createInOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_InHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public void move(HashMap<String, Object> hedAndDet) { |
| | | InHedTB hed = (InHedTB) hedAndDet.get("hed"); |
| | | ArrayList<InDetTB> dets = (ArrayList<InDetTB>) hedAndDet.get("det"); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + hed.getBillNo() + "'"); |
| | | erpSqlServer.delete(InHedTB.class, condition); |
| | | |
| | | for (InDetTB det : dets) { |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("BillNo", "'" + det.getBillNo() + "'"); |
| | | condition2.put("iNo", String.valueOf(det.getINO())); |
| | | erpSqlServer.delete(InDetTB.class, condition2); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInOrOutCancelService { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | public com.zy.third.lk.entity.InCancelTB tryCancel(String orderNo) { |
| | | com.zy.third.lk.entity.InCancelTB lkCancel = new com.zy.third.lk.entity.InCancelTB(); |
| | | |
| | | List<Order> targets = orderService.selectList(new EntityWrapper<Order>() |
| | | .eq("order_no",orderNo)); |
| | | log.info("要取消的订单:{}", targets); |
| | | if (targets.isEmpty()) { |
| | | lkCancel.setBillNo(orderNo); |
| | | //erp方要求,订单找不到,返回1 |
| | | lkCancel.setOpFlag(1); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } else { |
| | | //默认订单id不能重复 |
| | | Order order = targets.get(0); |
| | | List<OrderDetl> detlList = orderDetlService.selectItem(order.getOrderNo()); |
| | | log.info("要取消的订单详情:{}", detlList); |
| | | Optional<OrderDetl> any = detlList.stream().filter(s -> s.getQty().compareTo(0D) > 0).findAny(); |
| | | if (order.getSettle() > 1L || any.isPresent()) { |
| | | lkCancel.setBillNo(orderNo); |
| | | lkCancel.setOpFlag(2); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } |
| | | orderService.addToLogTable(order); |
| | | orderService.delete(new EntityWrapper<Order>() |
| | | .eq("order_no", order.getOrderNo())); |
| | | detlList.stream().forEach(d -> orderDetlService.addToLogTable(d)); |
| | | orderDetlService.delete(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", order.getOrderNo())); |
| | | lkCancel.setBillNo(orderNo); |
| | | lkCancel.setOpFlag(1); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import com.zy.third.erp.entity.InHedTB; |
| | | import com.zy.third.erp.entity.OutDetTB; |
| | | import com.zy.third.erp.entity.OutHedTB; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInOrOutService { |
| | | |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean createInOrder(InHedTB inHedTB, List<InDetTB> inDetTBs) { |
| | | Order order = orderService.selectByNo(inHedTB.getBillNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | | if (order.getSettle() > 1L) { |
| | | throw new CoolException(inHedTB.getBillNo() + "正在出库,无法修改单据"); |
| | | } |
| | | orderService.remove(order.getId()); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindID(), Boolean.FALSE); |
| | | Date now = new Date(); |
| | | // 单据主档 |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | inHedTB.getBillNo(), // 订单编号 |
| | | DateUtils.convert(inHedTB.getBillDate()), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | inHedTB.getObjectId(), // 客户编号 |
| | | inHedTB.getObjectName(), // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | inHedTB.getMakeDate(), // 修改时间 |
| | | inHedTB.getRemark() // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | for (InDetTB outDetTB : inDetTBs) { |
| | | Mat mat = matService.selectByMatnr(outDetTB.getItemCode()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(outDetTB.getItemCode() + "编号商品检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setOrderNo(outDetTB.getBillNo()); |
| | | orderDetl.setOutOrderNo(outDetTB.getOrderNo()); |
| | | orderDetl.setAutoId(outDetTB.getAutoId()); |
| | | orderDetl.setLuHao(outDetTB.getLuHao()); |
| | | orderDetl.setSpecs(outDetTB.getSPgNO()); |
| | | orderDetl.setPacking(outDetTB.getPacking()); |
| | | orderDetl.setWareId(outDetTB.getWareId()); |
| | | orderDetl.setWareName(outDetTB.getWareName()); |
| | | orderDetl.setBatch(outDetTB.getItemBatch()); |
| | | orderDetl.setAnfme(outDetTB.getMainNum()); |
| | | orderDetl.setINO(outDetTB.getINO()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setTemp1(outDetTB.getTemp1()); |
| | | orderDetl.setTemp2(outDetTB.getTemp2()); |
| | | orderDetl.setTemp3(outDetTB.getTemp3()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setThreeCode(outDetTB.getDetId() + ""); |
| | | orderDetl.setCreateBy(9527L); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(9527L); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean createOutOrder(OutHedTB inHedTB, List<OutDetTB> inDetTBs) { |
| | | Order order = orderService.selectByNo(inHedTB.getBillNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | | if (order.getSettle() > 1L) { |
| | | throw new CoolException(inHedTB.getBillNo() + "正在出库,无法修改单据"); |
| | | } |
| | | orderService.remove(order.getId()); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindID(), Boolean.FALSE); |
| | | Date now = new Date(); |
| | | // 单据主档 |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | inHedTB.getBillNo(), // 订单编号 |
| | | DateUtils.convert(inHedTB.getBillDate()), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | inHedTB.getObjectId(), // 客户编号 |
| | | inHedTB.getObjectName(), // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | inHedTB.getMakeDate(), // 修改时间 |
| | | inHedTB.getRemark() // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | for (OutDetTB outDetTB : inDetTBs) { |
| | | Mat mat = matService.selectByMatnr(outDetTB.getItemCode()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(outDetTB.getItemCode() + "编号商品检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setOrderNo(outDetTB.getBillNo()); |
| | | orderDetl.setOutOrderNo(outDetTB.getOrderNo()); |
| | | orderDetl.setAutoId(outDetTB.getAutoId()); |
| | | orderDetl.setLuHao(outDetTB.getLuHao()); |
| | | orderDetl.setSpecs(outDetTB.getSPgNO()); |
| | | orderDetl.setPacking(outDetTB.getPacking()); |
| | | orderDetl.setWareId(outDetTB.getWareId()); |
| | | orderDetl.setWareName(outDetTB.getWareName()); |
| | | orderDetl.setBatch(outDetTB.getItemBatch()); |
| | | orderDetl.setAnfme(outDetTB.getMainNum()); |
| | | orderDetl.setINO(outDetTB.getINO()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setTemp1(outDetTB.getTemp1()); |
| | | orderDetl.setTemp2(outDetTB.getTemp2()); |
| | | orderDetl.setTemp3(outDetTB.getTemp3()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setThreeCode(outDetTB.getDetId() + ""); |
| | | orderDetl.setCreateBy(9527L); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(9527L); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.ItemTB; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 物料档案 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ERPItemScheduler { |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Autowired |
| | | private ERPItemService erpItemService; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void ItemScheduler() { |
| | | log.info("ItemScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlItemTB = "select * from erp_ItemTB where LKName='中扬二期'"; |
| | | List<ItemTB> itemTBS = erpSqlServer.select(sqlItemTB, ItemTB.class); |
| | | if (itemTBS != null && itemTBS.size() > 0) { |
| | | for (ItemTB itemTB : itemTBS) { |
| | | System.out.println(itemTB); |
| | | //00代表新增 |
| | | if (itemTB.getFlag().equals("00")) { |
| | | erpItemService.addToMainDatabase(itemTB); |
| | | } |
| | | //22代表删除 |
| | | if (itemTB.getFlag().equals("22")) { |
| | | erpItemService.deleteFromMainDatabase(itemTB); |
| | | } |
| | | moveToBak(itemTB); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 数据库里有触发器,当item表的数据被删除时,会自动向item_bak添加,不用卸载代码里 |
| | | * |
| | | * @param itemTB |
| | | */ |
| | | //将数据从主表移动到bak表里 |
| | | private void moveToBak(ItemTB itemTB) { |
| | | erpSqlServer.update("delete from erp_ItemTB where LKName='中扬二期' and ItemId = '" + itemTB.getItemId() + "'"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.mapper.MatMapper; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import com.zy.third.erp.entity.ItemTB; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPItemService { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private TagService tagService; |
| | | |
| | | @Autowired |
| | | private TagMapper tagMapper; |
| | | |
| | | @Autowired |
| | | private MatMapper matMapper; |
| | | |
| | | /** |
| | | * 将物料中间表数据同步到立库物料基础数据,如果没有则插入,如果有则更新 |
| | | * |
| | | * @param itemTB,物料实体类 |
| | | */ |
| | | protected void addToMainDatabase(ItemTB itemTB) { |
| | | Date now = new Date(); |
| | | Mat mat = matService.selectByMatnr(itemTB.getItemId()); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | Tag priTag = null; |
| | | if (!Cools.isEmpty(itemTB.getItemKind())) { |
| | | priTag = tagService.selectByName(itemTB.getItemKind(), 2); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(top.getId()); |
| | | priTag = new Tag( |
| | | null, // 编号 |
| | | itemTB.getItemKind(), // 名称 |
| | | top.getId(), // 父级 |
| | | top.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 2, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(priTag) == 0) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | priTag = tagService.selectByName(itemTB.getItemKind(), 2); |
| | | mat = sync(mat, itemTB); |
| | | |
| | | mat.setTagId(priTag.getId()); |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } else { |
| | | log.info("同步新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } else { |
| | | mat = sync(mat, itemTB); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", itemTB.getItemId()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Mat sync(Mat mat, ItemTB itemTB) { |
| | | mat.setUuid(itemTB.getItemId()); |
| | | mat.setMatnr(itemTB.getItemCode()); |
| | | mat.setMaktx(itemTB.getItemName()); |
| | | mat.setSpecs(itemTB.getItemSpc()); |
| | | mat.setUnit(itemTB.getItemUnit()); |
| | | mat.setMemo(itemTB.getRemark()); |
| | | mat.setCreateTime(itemTB.getMakeDate()); |
| | | mat.setTemp1(itemTB.getTemp1()); |
| | | mat.setTemp2(itemTB.getTemp2()); |
| | | mat.setTemp3(itemTB.getTemp3()); |
| | | return mat; |
| | | } |
| | | |
| | | /** |
| | | * 删除ASRS物料通知档数据 |
| | | * |
| | | * @param itemTB,物料实体类 |
| | | */ |
| | | protected void deleteFromMainDatabase(ItemTB itemTB) { |
| | | EntityWrapper<Mat> matCodeEntityWrapper = new EntityWrapper<>(); |
| | | matCodeEntityWrapper.eq("matnr", itemTB.getItemCode()); |
| | | matMapper.delete(matCodeEntityWrapper); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InCancelTB; |
| | | import com.zy.third.erp.entity.OutCancelTB; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPOutCancelScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Autowired |
| | | private ERPInOrOutCancelService inMS; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InCancelScheduler() { |
| | | log.info("InCancelScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlInCancelTB = "select * from erp_OutCancelTB where LKName='中扬二期'"; |
| | | List<OutCancelTB> ins = erpSqlServer.select(sqlInCancelTB, OutCancelTB.class); |
| | | for (OutCancelTB in : ins) { |
| | | System.out.println(in); |
| | | com.zy.third.lk.entity.InCancelTB lkCancel = inMS.tryCancel(in.getBillNo()); |
| | | if (lkCancel != null) { |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + in.getBillNo() + "'"); |
| | | int delete = erpSqlServer.delete(InCancelTB.class, condition); |
| | | if (delete > 0) { |
| | | log.info("将入库取消通知单删除成功,{}", lkCancel.getBillNo()); |
| | | } else { |
| | | log.error("将入库取消通知单删除失败,{}", lkCancel.getBillNo()); |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + lkCancel.getBillNo() + "'"); |
| | | content.put("opFlag", lkCancel.getOpFlag()); |
| | | int insert = erpSqlServer.insert(com.zy.third.lk.entity.InCancelTB.class, content); |
| | | if (insert > 0) { |
| | | log.info("将入库取消通知单写入成功,{}", lkCancel.getBillNo()); |
| | | } else { |
| | | log.error("将入库取消通知单写入失败,{}", lkCancel.getBillNo()); |
| | | } |
| | | } else { |
| | | log.error("将入库取消通知单写入失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.OutDetTB; |
| | | import com.zy.third.erp.entity.OutHedTB; |
| | | 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 org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库单据 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ERPOutHedTBScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | |
| | | @Autowired |
| | | private ERPInOrOutService inMS; |
| | | |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void OutHedTBScheduler() { |
| | | log.info("OutHedTBScheduler开始了"); |
| | | if (!erpEnabled) return; |
| | | String sqlInHed = "select * from erp_OutHedTB where LKName='中扬二期'"; |
| | | List<OutHedTB> inHeds = erpSqlServer.select(sqlInHed, OutHedTB.class); |
| | | if (!inHeds.isEmpty()) { |
| | | for (OutHedTB inHed : inHeds) { |
| | | System.out.println(inHed); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<OutDetTB> inDetTBS = erpSqlServer.selectList(OutDetTB.class, condition); |
| | | HashMap<String, Object> hedAndDet = new HashMap<>(); |
| | | hedAndDet.put("hed", inHed); |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createOutOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public void move(HashMap<String, Object> hedAndDet) { |
| | | OutHedTB hed = (OutHedTB) hedAndDet.get("hed"); |
| | | ArrayList<OutDetTB> dets = (ArrayList<OutDetTB>) hedAndDet.get("det"); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + hed.getBillNo() + "'"); |
| | | erpSqlServer.delete(OutHedTB.class, condition); |
| | | for (OutDetTB det : dets) { |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("BillNo", "'" + det.getBillNo() + "'"); |
| | | condition2.put("iNo", String.valueOf(det.getINO())); |
| | | erpSqlServer.delete(OutDetTB.class, condition2); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @NoArgsConstructor |
| | | @Data |
| | | @TableName("vwErpLKStorage") |
| | | public class ErpLKStorage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String itemId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String itemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemName") |
| | | private String itemName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemSpc") |
| | | private String itemSpc; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemUnit") |
| | | private String itemUnit; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ProType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String itemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("NumIs") |
| | | private Double numis; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName("lk_InCancelTB") |
| | | public class InCancelTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField(value = "BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("opFlag") |
| | | private Integer opFlag; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date MakeDate; |
| | | |
| | | |
| | | public String getMakeDate$() { |
| | | if (Cools.isEmpty(this.MakeDate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.MakeDate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Data |
| | | @TableName("LK_InDetTB") |
| | | public class InDetTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String ItemId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("lk_InDetTB_bak") |
| | | public class InDetTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer autoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String itemid; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String temp3; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @TableField("DelDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date DelDate; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Data |
| | | @TableName("lk_InHedTB") |
| | | public class InHedTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @TableField("BillDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billDate; |
| | | |
| | | /** |
| | | * StockIn:采购入库 |
| | | * ProductIn:OutHedTB |
| | | * ItemMoveIn:调拨入库 |
| | | * ItemSwitchIn:形态转换入库 |
| | | * CheckMoreIn:盘盈入库单 |
| | | */ |
| | | @ApiModelProperty(value = "StockIn:采购入库 ") |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | /** |
| | | * 供应商、部门ID |
| | | */ |
| | | @ApiModelProperty(value = "供应商、部门ID") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | /** |
| | | * 供应商、部门名称 |
| | | */ |
| | | @ApiModelProperty(value = "供应商、部门名称") |
| | | @TableField("ObjectName") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String Remark; |
| | | |
| | | @TableField("WareId") |
| | | private String WareId; |
| | | |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String Temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @TableField("bPass") |
| | | private Boolean bPass; |
| | | |
| | | @TableField("bStartIn") |
| | | private Boolean bStartIn; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("lk_InHedTB_bak") |
| | | public class InHedTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer autoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @TableField("BillDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billDate; |
| | | |
| | | /** |
| | | * StockIn:采购入库 |
| | | * ProductIn:成品入库单 |
| | | * ItemMoveIn:调拨入库 |
| | | * ItemSwitchIn:形态转换入库 |
| | | * CheckMoreIn:盘盈入库单 |
| | | */ |
| | | @ApiModelProperty(value = "StockIn:采购入库 ") |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | /** |
| | | * 供应商、部门ID |
| | | */ |
| | | @ApiModelProperty(value = "供应商、部门ID") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | /** |
| | | * 供应商、部门名称 |
| | | */ |
| | | @ApiModelProperty(value = "供应商、部门名称") |
| | | @TableField("ObjectName") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @TableField("DelDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date delDate; |
| | | |
| | | |
| | | @TableField("bPass") |
| | | private Boolean bPass; |
| | | |
| | | @TableField("bStartIn") |
| | | private Boolean bStartIn; |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("lk_OutDetTB") |
| | | public class OutDetTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String itemid; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String WareId; |
| | | |
| | | @TableField("WareName") |
| | | private String WareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("DelDate") |
| | | private Date delDate; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @TableName("lk_OutDetTB_bak") |
| | | @Data |
| | | public class OutDetTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("iNo") |
| | | private Integer iNO; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("DetId") |
| | | private Integer detId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemId") |
| | | private String itemid; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemCode") |
| | | private String ItemCode; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ItemBatch") |
| | | private String ItemBatch; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("proType") |
| | | private String protype; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("OrderNo") |
| | | private String OrderNo; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("MainNum") |
| | | private Double MainNum; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String WareId; |
| | | |
| | | @TableField("WareName") |
| | | private String WareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String Temp3; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @TableField("DelDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date delDate; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField("FactArea") |
| | | private String FactArea; |
| | | /** |
| | | * 供应商\客户ID |
| | | */ |
| | | @TableField("Packing") |
| | | private String Packing; |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @TableField("sColor") |
| | | private String sColor; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("LuHao") |
| | | private String LuHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("sPgNO") |
| | | private String sPgNO; |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("lk_OutHedTB") |
| | | public class OutHedTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableId(value = "BillNo", type = IdType.INPUT) |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @TableField("BillDate") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date billDate; |
| | | |
| | | /** |
| | | * SendMatOut:发料出库 |
| | | * OtherOut:其它出库单 |
| | | * ItemMoveOut:调拨出库 |
| | | * ItemSwitchOut:形态转换出库 |
| | | * CheckLossOut:盘盈出库单 |
| | | */ |
| | | @ApiModelProperty(value = "SendMatOut:发料出库 ") |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ObjectName") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String remark; |
| | | |
| | | @TableField("WareId") |
| | | private String wareId; |
| | | |
| | | @TableField("WareName") |
| | | private String wareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String temp3; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | |
| | | @TableField("bPass") |
| | | private Boolean bPass; |
| | | |
| | | @TableField("bStartIn") |
| | | private Boolean bStartIn; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @TableName("lk_OutHedTb_bak") |
| | | public class OutHedTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "AutoId", type = IdType.AUTO) |
| | | private Integer AutoId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("BillNo") |
| | | private String BillNo; |
| | | |
| | | @TableField("BillDate") |
| | | private Date billDate; |
| | | |
| | | /** |
| | | * SendMatOut:发料出库 |
| | | * OtherOut:其它出库单 |
| | | * ItemMoveOut:调拨出库 |
| | | * ItemSwitchOut:形态转换出库 |
| | | * CheckLossOut:盘盈出库单 |
| | | */ |
| | | @ApiModelProperty(value = "SendMatOut:发料出库 ") |
| | | @TableField("IoKindID") |
| | | private String IoKindID; |
| | | |
| | | @TableField("IoKindName") |
| | | private String ioKindName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ObjectId") |
| | | private String ObjectId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("ObjectName") |
| | | private String ObjectName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Remark") |
| | | private String Remark; |
| | | |
| | | @TableField("WareId") |
| | | private String WareId; |
| | | |
| | | @TableField("WareName") |
| | | private String WareName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp1") |
| | | private String Temp1; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp2") |
| | | private String Temp2; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @TableField("Temp3") |
| | | private String Temp3; |
| | | |
| | | |
| | | @ApiModelProperty(value = "") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField("MakeDate") |
| | | private Date makedate; |
| | | |
| | | @TableField("DelDate") |
| | | private Date delDate; |
| | | |
| | | @TableField("bPass") |
| | | private Boolean bPass; |
| | | |
| | | @TableField("bStartIn") |
| | | private Boolean bStartIn; |
| | | |
| | | |
| | | public String getMakedate$() { |
| | | if (Cools.isEmpty(this.makedate)) { |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.makedate); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.third.lk.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.lk.entity.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 入库更新完成回报 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class LKInTBScheduler { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void pakinOrderComplete() { |
| | | log.info("开始入库更新完成回报"); |
| | | // 所有订单 |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); |
| | | DocType docType; |
| | | for (Order order : orders) { |
| | | System.out.println(order); |
| | | docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType == null) { |
| | | log.error("该订单类型不存在:" + order.getDocType()); |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | if (docType.getPakin() == 1) { |
| | | //入库单 |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | insertInDet(orderDetl); |
| | | } |
| | | insertInHed(order); |
| | | } else { |
| | | //出库单 |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | insertOutDet(orderDetl); |
| | | } |
| | | insertOutHed(order); |
| | | } |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 将入库单的信息插入到ERP表 |
| | | * |
| | | * @param orderDetl |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertInDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_InDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTB> inDets = erpSqlServer.select(sqlInDetTb, InDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_InDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTBBak> inDetBaks = erpSqlServer.select(sqlInDetTbBak, InDetTBBak.class); |
| | | if (!inDets.isEmpty() || !inDetBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | | return true; |
| | | } |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | Map<String, Object> content = getMap(orderDetl); |
| | | int insert = erpSqlServer.insert(InDetTB.class, content); |
| | | |
| | | if (insert == 1) { |
| | | log.info("入库单表身回传成功:{}", content); |
| | | return true; |
| | | } else { |
| | | log.error("入库回传失败,实体类打印:{}", content); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的详情信息插入到ERP表 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertInHed(Order order) { |
| | | String sqlInHedTb = "select * from lk_InHedTB where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<InHedTB> outHeds = erpSqlServer.select(sqlInHedTb, InHedTB.class); |
| | | String sqlInHedTbBak = "select * from lk_InHedTB_Bak where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<InHedTBBak> inHedBaks = erpSqlServer.select(sqlInHedTbBak, InHedTBBak.class); |
| | | if (!outHeds.isEmpty() || !inHedBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表头已存在:" + order.getOrderNo()); |
| | | return true; |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + order.getOrderNo() + "'"); |
| | | content.put("IoKindID", "'" + order.getDocType() + "'"); |
| | | content.put("ObjectId", "'" + order.getCstmr() + "'"); |
| | | content.put("ObjectName", "'" + order.getCstmrName() + "'"); |
| | | content.put("Remark", "'" + order.getMemo() + "'"); |
| | | content.put("LKName", "'中扬二期'"); |
| | | int insert = erpSqlServer.insert(InHedTB.class, content); |
| | | String sql = "UPDATE lk_InHedTB SET bPass = 1, LKName='中扬二期' WHERE BillNo = '" + order.getOrderNo() + "'"; |
| | | int update = erpSqlServer.update(sql); |
| | | if (update == 1) { |
| | | log.info("入库单表头回传成功:" + content); |
| | | return true; |
| | | } else { |
| | | log.error("入库单表头回传失败:" + content); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的信息插入到ERP表 |
| | | * |
| | | * @param orderDetl |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertOutDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_OutDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTB> inDets = erpSqlServer.select(sqlInDetTb, OutDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_OutDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTBBak> inDetBaks = erpSqlServer.select(sqlInDetTbBak, OutDetTBBak.class); |
| | | if (!inDets.isEmpty() || !inDetBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | | return true; |
| | | } |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | Map<String, Object> content = getMap(orderDetl); |
| | | int insert = erpSqlServer.insert(InDetTB.class, content); |
| | | |
| | | if (insert == 1) { |
| | | log.info("入库单表身回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库回传失败,实体类打印:" + content.toString()); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的详情信息插入到ERP表 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertOutHed(Order order) { |
| | | String sqlInHedTb = "select * from lk_OutHedTB where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<OutHedTB> outHeds = erpSqlServer.select(sqlInHedTb, OutHedTB.class); |
| | | String sqlInHedTbBak = "select * from lk_OutHedTB_Bak where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<OutHedTBBak> inHedBaks = erpSqlServer.select(sqlInHedTbBak, OutHedTBBak.class); |
| | | if (!outHeds.isEmpty() || !inHedBaks.isEmpty()) { |
| | | log.error("该单号料号中间表表头已存在:" + order.getOrderNo()); |
| | | return true; |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + order.getOrderNo() + "'"); |
| | | content.put("IoKindID", "'" + order.getDocType() + "'"); |
| | | content.put("ObjectId", "'" + order.getCstmr() + "'"); |
| | | content.put("ObjectName", "'" + order.getCstmrName() + "'"); |
| | | content.put("Remark", "'" + order.getMemo() + "'"); |
| | | content.put("LKName", "'中扬二期'"); |
| | | int insert = erpSqlServer.insert(OutHedTB.class, content); |
| | | String sql = "UPDATE lk_OutHedTB SET bPass = 1, LKName='中扬二期' WHERE BillNo = '" + order.getOrderNo() + "'"; |
| | | int update = erpSqlServer.update(sql); |
| | | if (update == 1) { |
| | | log.info("入库单表头回传成功:" + content); |
| | | return true; |
| | | } else { |
| | | log.error("入库单表头回传失败:" + content); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private Map<String, Object> getMap(OrderDetl orderDetl) { |
| | | Map<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + orderDetl.getOrderNo() + "'"); |
| | | content.put("iNO", "'" + orderDetl.getINO() + "'"); |
| | | content.put("detId", orderDetl.getThreeCode()); |
| | | content.put("ItemId", "'" + orderDetl.getThreeCode() + "'"); |
| | | content.put("ItemCode", "'" + orderDetl.getMatnr() + "'"); |
| | | content.put("ItemBatch", "'" + orderDetl.getBatch() + "'"); |
| | | content.put("proType", "'" + orderDetl.getProType() + "'"); |
| | | content.put("remark", "'" + orderDetl.getMemo() + "'"); |
| | | content.put("OrderNo", "'" + orderDetl.getOutOrderNo() + "'"); |
| | | content.put("MainNum", orderDetl.getQty()); |
| | | content.put("WareId", "'" + orderDetl.getWareId() + "'"); |
| | | content.put("WareName", "'" + orderDetl.getWareName() + "'"); |
| | | content.put("Packing", "'" + orderDetl.getPacking() + "'"); |
| | | content.put("LuHao", "'" + orderDetl.getLuHao() + "'"); |
| | | content.put("sPgNO", "'" + orderDetl.getSPgNO() + "'"); |
| | | content.put("temp1", "'" + orderDetl.getTemp1() + "'"); |
| | | content.put("temp2", "'" + orderDetl.getTemp2() + "'"); |
| | | content.put("temp3", "'" + orderDetl.getTemp3() + "'"); |
| | | content.put("LKName", "'中扬二期'"); |
| | | return content; |
| | | } |
| | | } |
New file |
| | |
| | | ALTER TABLE [dbo].[man_mat] ADD [temp1] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_mat] ADD [temp2] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_mat] ADD [temp3] varchar(255) NULL |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_order] ALTER COLUMN [cstmr] varchar(50) NULL |
| | | |
| | | ALTER TABLE [dbo].[man_order_log] ALTER COLUMN [cstmr] varchar(50) NULL |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [auto_id] int NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [out_order_no] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [lu_hao] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [ware_id] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [ware_name] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [packing] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [pg_no] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [temp1] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [temp2] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [temp3] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [pro_type] varchar(255) NULL |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'外部主键id', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'auto_id' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'订单号 ', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'out_order_no' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'炉号\客户图号', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'lu_hao' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'仓库ID', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'ware_id' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'仓库', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'ware_name' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'供应商\客户ID', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'packing' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'工单号', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'pg_no' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'备用字段', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'temp1' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'备用字段', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'temp2' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'备用字段', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'temp3' |
| | | GO |
| | | |
| | | EXEC sp_addextendedproperty |
| | | 'MS_Description', N'属性', |
| | | 'SCHEMA', N'dbo', |
| | | 'TABLE', N'man_order_detl', |
| | | 'COLUMN', N'pro_type' |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [auto_id] int NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [out_order_no] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [lu_hao] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [ware_id] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [ware_name] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [packing] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [pg_no] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [temp1] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [temp2] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [temp3] varchar(255) NULL |
| | | GO |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [pro_type] varchar(255) NULL |
| | | GO |
| | | |
| | | |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_doc_type] ADD [doc_code] varchar(255) NULL |
| | | |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl] ADD [i_no] int NULL |
| | | |
| | | |
| | | ALTER TABLE [dbo].[man_order_detl_log] ADD [i_no] int NULL |
| | |
| | | acctID: "647e849ab6fa0f" |
| | | username: "llw" |
| | | password: "666666" |
| | | lcid: 2052 |
| | | lcid: 2052 |
| | | |
| | | #ERP接口 |
| | | enabled: true |
| | | # enabled: false |
| | | #查看ERP中间表间隔 |
| | | refreshtime: 0/5 * * * * ? |
| | | db: |
| | | driver_class_name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=XDLinkLK2 |
| | | username: sa |
| | | password: sa@123 |
| | |
| | | order by row1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <resultMap id="stockStatisDTO" type="com.zy.asrs.entity.StockStatisDTO"> |
| | | <id column="matnr" property="matnr" /> |
| | | <id column="maktx" property="maktx" /> |
| | | <id column="specs" property="specs" /> |
| | | <id column="asrsQty" property="lkQty" /> |
| | | <id column="erpQty" property="erpQty" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="asrsAndErpList" resultMap="stockStatisDTO"> |
| | | SELECT * FROM( |
| | | SELECT ROW_NUMBER ( ) OVER ( ORDER BY d.matnr ) AS row, * FROM ( |
| | | SELECT * FROM asr_show_diff WHERE 1 = 1 |
| | | <if test="different != null and different "> |
| | | and asrsQty = erpQty |
| | | </if> |
| | | <if test="matnr != null"> |
| | | AND matnr like #{matnr} |
| | | </if> |
| | | <if test="maktx != null"> |
| | | AND maktx like #{maktx} |
| | | </if> |
| | | <if test="specs != null"> |
| | | AND specs like #{specs} |
| | | </if> |
| | | ) d ) e WHERE 1=1 and e.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="asrsAndErpCount" resultType="java.lang.Long"> |
| | | SELECT count(*) FROM asr_show_diff WHERE 1 = 1 and asrsQty != erpQty |
| | | <if test="matnr != null"> |
| | | AND matnr like #{matnr} |
| | | </if> |
| | | <if test="maktx != null"> |
| | | AND maktx like #{maktx} |
| | | </if> |
| | | <if test="specs != null"> |
| | | AND specs like #{specs} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | </choose> |
| | | </update> |
| | | |
| | | |
| | | <select id="listByOrderNo" resultMap="BaseResultMap"> |
| | | select * from man_order_detl |
| | | where 1=1 |
| | | and order_no = #{orderNo} |
| | | </select> |
| | | </mapper> |
| | |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnx" placeholder="产品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="产品规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input name="different" type="checkbox" lay-skin="switch" value="true" lay-text="显示差异|显示全部" lay-filter="different" > |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <fieldset class="layui-elem-field"> |
| | | <legend>总计数量</legend> |
| | | <div class="layui-field-box" id="countNum"> |
| | | 请稍等 |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <fieldset class="layui-elem-field">--> |
| | | <!-- <legend>总计数量</legend>--> |
| | | <!-- <div class="layui-field-box" id="countNum">--> |
| | | <!-- 请稍等--> |
| | | <!-- </div>--> |
| | | <!-- </fieldset>--> |
| | | <!-- </div>--> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <!-- 表格 --> |