New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_api_log") |
| | | public class ApiLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 日志编号 |
| | | */ |
| | | @ApiModelProperty(value= "日志编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 名称空间 |
| | | */ |
| | | @ApiModelProperty(value= "名称空间") |
| | | private String namespace; |
| | | |
| | | /** |
| | | * 接口地址 |
| | | */ |
| | | @ApiModelProperty(value= "接口地址") |
| | | private String url; |
| | | |
| | | /** |
| | | * 平台密钥 |
| | | */ |
| | | @ApiModelProperty(value= "平台密钥") |
| | | private String appkey; |
| | | |
| | | /** |
| | | * 时间戳 |
| | | */ |
| | | @ApiModelProperty(value= "时间戳") |
| | | private String timestamp; |
| | | |
| | | /** |
| | | * 客户端IP |
| | | */ |
| | | @ApiModelProperty(value= "客户端IP") |
| | | @TableField("client_ip") |
| | | private String clientIp; |
| | | |
| | | /** |
| | | * 请求内容 |
| | | */ |
| | | @ApiModelProperty(value= "请求内容") |
| | | private String request; |
| | | |
| | | /** |
| | | * 响应内容 |
| | | */ |
| | | @ApiModelProperty(value= "响应内容") |
| | | private String response; |
| | | |
| | | /** |
| | | * 异常内容 |
| | | */ |
| | | @ApiModelProperty(value= "异常内容") |
| | | private String err; |
| | | |
| | | /** |
| | | * 结果 1: 成功 0: 失败 |
| | | */ |
| | | @ApiModelProperty(value= "结果 1: 成功 0: 失败 ") |
| | | private Integer result; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public ApiLog() {} |
| | | |
| | | public ApiLog(String uuid,String namespace,String url,String appkey,String timestamp,String clientIp,String request,String response,String err,Integer result,Integer status,Date createTime,Date updateTime,String memo) { |
| | | this.uuid = uuid; |
| | | this.namespace = namespace; |
| | | this.url = url; |
| | | this.appkey = appkey; |
| | | this.timestamp = timestamp; |
| | | this.clientIp = clientIp; |
| | | this.request = request; |
| | | this.response = response; |
| | | this.err = err; |
| | | this.result = result; |
| | | this.status = status; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // ApiLog apiLog = new ApiLog( |
| | | // null, // 日志编号 |
| | | // null, // 名称空间 |
| | | // null, // 接口地址 |
| | | // null, // 平台密钥 |
| | | // null, // 时间戳 |
| | | // null, // 客户端IP |
| | | // null, // 请求内容 |
| | | // null, // 响应内容 |
| | | // null, // 异常内容 |
| | | // null, // 结果 |
| | | // null, // 状态 |
| | | // null, // 添加时间 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getResult$(){ |
| | | if (null == this.result){ return null; } |
| | | switch (this.result){ |
| | | case 1: |
| | | return "成功"; |
| | | case 0: |
| | | return "失败"; |
| | | default: |
| | | return String.valueOf(this.result); |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /* |
| | | * Created by Monkey D. Luffy on 2023.07.19 |
| | | * */ |
| | | @Data |
| | | public class SingleMountUnstackingCompleteParam { |
| | | private String barcode;// 是 字符串 托盘码 |
| | | private String boxType;// 是 字符串 码垛木箱类型(同一托盘一种类型) |
| | | private String palletizingNo;// 是 字符串 码垛木箱类型(同一托盘一种类型) 废弃 |
| | | private String createTime;// 是 字符串 创建时间 |
| | | private String uuid;// 是 字符串 时间戳 |
| | | private Integer staStart;// 是 字符串 起始站点(托盘所在站点) |
| | | private Integer staEnd;// 是 字符串 目标站点(拆垛目的站点) |
| | | private List<MatList> matList;// 是 列表 拆垛剩余货物信息(可以为空) |
| | | |
| | | @Data |
| | | public static class MatList{ |
| | | private String position;// 是 字符串 木箱码垛位置 |
| | | private boolean unstackingEnd;// 尾箱标识(最后一托为true,其他为false) |
| | | private String boxNo;// 是 字符串 木箱编号(唯一字段,出库依据,出库时按照木箱编号出库) |
| | | } |
| | | |
| | | public SingleMountUnstackingCompleteParam(){} |
| | | |
| | | public SingleMountUnstackingCompleteParam(WrkMast wrkMast, List<WrkDetl> wrkDetlList){ |
| | | Date now = new Date(); |
| | | this.barcode=wrkMast.getBarcode(); |
| | | this.boxType=wrkDetlList.get(0).getBrand(); |
| | | createTime=now.toString(); |
| | | uuid=String.valueOf(now.getTime()); |
| | | List<MatList> matLists=new ArrayList<>(); |
| | | if (wrkMast.getStaNo()==118 || wrkMast.getStaNo()==120){ |
| | | for (WrkDetl wrkDetl:wrkDetlList){ |
| | | if (wrkDetl.getOrigin().equals("1")) continue; |
| | | MatList matList = new MatList(); |
| | | matList.setBoxNo(wrkDetl.getBatch()); |
| | | matList.setPosition(wrkDetl.getOrigin()); |
| | | matList.setUnstackingEnd(false); |
| | | matLists.add(matList); |
| | | } |
| | | for (WrkDetl wrkDetl:wrkDetlList){ |
| | | if (wrkDetl.getOrigin().equals("2")) continue; |
| | | MatList matList = new MatList(); |
| | | matList.setBoxNo(wrkDetl.getBatch()); |
| | | matList.setPosition(wrkDetl.getOrigin()); |
| | | matList.setUnstackingEnd(false); |
| | | matLists.add(matList); |
| | | } |
| | | }else { |
| | | for (WrkDetl wrkDetl:wrkDetlList){ |
| | | if (wrkDetl.getOrigin().equals("2")) continue; |
| | | MatList matList = new MatList(); |
| | | matList.setBoxNo(wrkDetl.getBatch()); |
| | | matList.setPosition(wrkDetl.getOrigin()); |
| | | matList.setUnstackingEnd(false); |
| | | matLists.add(matList); |
| | | } |
| | | for (WrkDetl wrkDetl:wrkDetlList){ |
| | | if (wrkDetl.getOrigin().equals("1")) continue; |
| | | MatList matList = new MatList(); |
| | | matList.setBoxNo(wrkDetl.getBatch()); |
| | | matList.setPosition(wrkDetl.getOrigin()); |
| | | matList.setUnstackingEnd(false); |
| | | matLists.add(matList); |
| | | } |
| | | } |
| | | |
| | | this.matList = matLists; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.common.utils.Synchro; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_wrk_detl_single") |
| | | public class WrkDetlSingle implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableField("wrk_no") |
| | | private Long wrkNo; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value= "工作时间") |
| | | @TableField("io_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date ioTime; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 商品编号 |
| | | */ |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | private String manu; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | private Double length; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 是否批次 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | | * 预警天数 |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("roll_up") |
| | | private Long rollUp; |
| | | |
| | | public WrkDetlSingle() {} |
| | | |
| | | public WrkDetlSingle(Long wrkNo,Date ioTime,Double anfme,String zpallet,String matnr,String maktx,String batch,String orderNo,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,Long modiUser,Date modiTime,Long appeUser,Date appeTime,String memo,Long rollUp) { |
| | | this.wrkNo = wrkNo; |
| | | this.ioTime = ioTime; |
| | | this.anfme = anfme; |
| | | this.zpallet = zpallet; |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.batch = batch; |
| | | this.orderNo = orderNo; |
| | | this.specs = specs; |
| | | this.model = model; |
| | | this.color = color; |
| | | this.brand = brand; |
| | | this.unit = unit; |
| | | this.price = price; |
| | | this.sku = sku; |
| | | this.units = units; |
| | | this.barcode = barcode; |
| | | this.origin = origin; |
| | | this.manu = manu; |
| | | this.manuDate = manuDate; |
| | | this.itemNum = itemNum; |
| | | this.safeQty = safeQty; |
| | | this.weight = weight; |
| | | this.length = length; |
| | | this.volume = volume; |
| | | this.threeCode = threeCode; |
| | | this.supp = supp; |
| | | this.suppCode = suppCode; |
| | | this.beBatch = beBatch; |
| | | this.deadTime = deadTime; |
| | | this.deadWarn = deadWarn; |
| | | this.source = source; |
| | | this.inspect = inspect; |
| | | this.danger = danger; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | this.memo = memo; |
| | | this.rollUp = rollUp; |
| | | } |
| | | |
| | | // WrkDetlSingle wrkDetlSingle = new WrkDetlSingle( |
| | | // null, // 工作号[非空] |
| | | // null, // 工作时间 |
| | | // null, // 数量 |
| | | // null, // 托盘条码 |
| | | // null, // 商品编号[非空] |
| | | // null, // 商品名称 |
| | | // null, // 批号 |
| | | // null, // 单据编号 |
| | | // null, // 规格 |
| | | // null, // 型号 |
| | | // null, // 颜色 |
| | | // null, // 品牌 |
| | | // null, // 单位 |
| | | // null, // 单价 |
| | | // null, // sku |
| | | // null, // 单位量 |
| | | // null, // 条码 |
| | | // null, // 产地 |
| | | // null, // 厂家 |
| | | // null, // 生产日期 |
| | | // null, // 品项数 |
| | | // null, // 安全库存量 |
| | | // null, // 重量 |
| | | // null, // 长度 |
| | | // null, // 体积 |
| | | // null, // 三方编码 |
| | | // null, // 供应商 |
| | | // null, // 供应商编码 |
| | | // null, // 是否批次 |
| | | // null, // 保质期 |
| | | // null, // 预警天数 |
| | | // null, // 制购 |
| | | // null, // 要求检验 |
| | | // null, // 危险品 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 备注 |
| | | // null // |
| | | // ); |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.beBatch); |
| | | } |
| | | } |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | case 1: |
| | | return "制造"; |
| | | case 2: |
| | | return "采购"; |
| | | case 3: |
| | | return "外协"; |
| | | default: |
| | | return String.valueOf(this.source); |
| | | } |
| | | } |
| | | |
| | | public String getInspect$(){ |
| | | if (null == this.inspect){ return null; } |
| | | switch (this.inspect){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.inspect); |
| | | } |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.danger); |
| | | } |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ApiLogMapper extends BaseMapper<ApiLog> { |
| | | int clearWeekBefore(); |
| | | } |
| | |
| | | |
| | | int updateIoTime(@Param("workNo") Integer workNo, @Param("ioTime") Date ioTime); |
| | | |
| | | List<WrkDetl> selectByWrkNo(Integer wrkNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.WrkDetlSingle; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WrkDetlSingleMapper extends BaseMapper<WrkDetlSingle> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface ApiLogService extends IService<ApiLog> { |
| | | void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success); |
| | | |
| | | boolean clearWeekBefore(); |
| | | } |
| | |
| | | |
| | | boolean updateIoTime(Integer workNo, Date ioTime); |
| | | |
| | | List<WrkDetl> selectByWrkNo(Integer wrkNo); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.WrkDetlSingle; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WrkDetlSingleService extends IService<WrkDetlSingle> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.mapper.ApiLogMapper; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Slf4j |
| | | @Service("apiLogService") |
| | | public class ApiLogServiceImpl extends ServiceImpl<ApiLogMapper, ApiLog> implements ApiLogService { |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Async |
| | | @Override |
| | | public void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success) { |
| | | Date now = new Date(); |
| | | ApiLog apiLog = new ApiLog( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 日志编号 |
| | | namespace, // 名称空间 |
| | | url, // 接口地址 |
| | | appkey, // 平台密钥 |
| | | String.valueOf(now.getTime()), // 时间戳 |
| | | ip, // 客户端IP |
| | | request, // 请求内容 |
| | | response, |
| | | null, // 异常内容 |
| | | success?1:0 , // 结果 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!this.insert(apiLog)) { |
| | | log.error("接口调用日志保存失败!"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean clearWeekBefore() { |
| | | return this.baseMapper.clearWeekBefore() > 0; |
| | | } |
| | | |
| | | } |
| | |
| | | return this.baseMapper.updateIoTime(workNo, ioTime) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkDetl> selectByWrkNo(Integer wrkNo) { |
| | | return this.baseMapper.selectByWrkNo(wrkNo); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.WrkDetlSingleMapper; |
| | | import com.zy.asrs.entity.WrkDetlSingle; |
| | | import com.zy.asrs.service.WrkDetlSingleService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("wrkDetlSingleService") |
| | | public class WrkDetlSingleServiceImpl extends ServiceImpl<WrkDetlSingleMapper, WrkDetlSingle> implements WrkDetlSingleService { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.MessageFormat; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/4 |
| | | */ |
| | | @Slf4j |
| | | public abstract class AbstractHandler<T> { |
| | | |
| | | public final ReturnT<T> SUCCESS = new ReturnT<>(200, null); |
| | | public final ReturnT<T> FAIL = new ReturnT<>(500, null); |
| | | |
| | | // protected abstract ReturnT<T> start(); |
| | | |
| | | protected void exceptionHandle(String errorMsg){ |
| | | log.error(errorMsg); |
| | | exceptionHandle(errorMsg, (Object) null); |
| | | } |
| | | |
| | | protected void exceptionHandle(String errorMsg, Object... args){ |
| | | log.error(errorMsg); |
| | | throw new CoolException(MessageFormat.format(errorMsg, args)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.ReportToDismantleTheStackHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Created by Monkey D. Luffy on 2023.07.25 |
| | | * 徐工汉云..............以下.............上饶江铜.............拆垛信息上传 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ReportToDismantleTheStackScheduler { |
| | | |
| | | @Autowired |
| | | private ReportToDismantleTheStackHandler reportToDismantleTheStackHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){//拆垛信息上传 |
| | | int[] staNos =new int[]{118,119,120,121}; |
| | | for (int staNo : staNos){ |
| | | try{ |
| | | ReturnT<String> result = reportToDismantleTheStackHandler.start(staNo); |
| | | if (result.getCode()==200){ |
| | | break; |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("站点"+staNo+"拆垛信息上传处理失败,异常信息:"+e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task.core; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | | */ |
| | | public class AsrsException extends RuntimeException { |
| | | |
| | | public AsrsException(Throwable e) { |
| | | super(e); |
| | | } |
| | | |
| | | public AsrsException(String message) { |
| | | super(message); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task.core; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | | */ |
| | | public class ReturnT<T> implements Serializable { |
| | | |
| | | public static final long serialVersionUID = 42L; |
| | | public static final int SUCCESS_CODE = 200; |
| | | public static final int FAIL_CODE = 500; |
| | | private int code; |
| | | private String msg; |
| | | private T content; |
| | | |
| | | public ReturnT() { |
| | | } |
| | | |
| | | public ReturnT(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public ReturnT(T content) { |
| | | this.code = 200; |
| | | this.content = content; |
| | | } |
| | | |
| | | public boolean isSuccess(){ |
| | | return this.code == 200; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return this.code; |
| | | } |
| | | |
| | | public ReturnT<T> setCode(int code) { |
| | | this.code = code; |
| | | return this; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return this.msg; |
| | | } |
| | | |
| | | public ReturnT<T> setMsg(String msg) { |
| | | this.msg = msg; |
| | | return this; |
| | | } |
| | | |
| | | public T getContent() { |
| | | return this.content; |
| | | } |
| | | |
| | | public ReturnT<T> setContent(T content) { |
| | | this.content = content; |
| | | return this; |
| | | } |
| | | |
| | | public String toString() { |
| | | return "ReturnT [code=" + this.code + ", msg=" + this.msg + ", content=" + this.content + "]"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | //package com.zy.asrs.task.core; |
| | | // |
| | | //import com.zy.asrs.task.handler.WorkLogHandler; |
| | | //import com.zy.asrs.task.handler.WorkMastHandler; |
| | | //import com.zy.system.service.ConfigService; |
| | | //import org.slf4j.Logger; |
| | | //import org.slf4j.LoggerFactory; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | // |
| | | //import javax.annotation.PostConstruct; |
| | | //import javax.annotation.PreDestroy; |
| | | // |
| | | ///** |
| | | // * 单线程模式 ( 已弃用 ) |
| | | // * 任务中心调度器 |
| | | // * Created by vincent on 2020/7/4 |
| | | // */ |
| | | ////@Component |
| | | //@Deprecated |
| | | //public class WcsDispatcher { |
| | | // |
| | | // private static final Logger log = LoggerFactory.getLogger(WcsDispatcher.class); |
| | | // private Thread thread; |
| | | // |
| | | // @Autowired |
| | | // private WorkMastHandler workMastHandler; |
| | | // @Autowired |
| | | // private WorkLogHandler workLogHandler; |
| | | // @Autowired |
| | | // private ConfigService configService; |
| | | // |
| | | // @PostConstruct |
| | | // private void start(){ |
| | | // thread = new Thread(() -> { |
| | | // while (!Thread.currentThread().isInterrupted()) { |
| | | // try { |
| | | // Thread.sleep(3000); |
| | | // |
| | | //// workMastHandler.start(); |
| | | //// |
| | | //// workLogHandler.start(); |
| | | // |
| | | // } catch (Exception e) { |
| | | // log.error("Exception", e); |
| | | // } |
| | | // } |
| | | // }); |
| | | // thread.start(); |
| | | // log.info("任务中心调度器已启动......"); |
| | | // } |
| | | // |
| | | // @PreDestroy |
| | | // public void shutDown(){ |
| | | // if (thread != null) |
| | | // thread.interrupt(); |
| | | // log.info("任务中心调度器已停止......"); |
| | | // } |
| | | // |
| | | //} |
New file |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by Monkey D. Luffy on 2023.07.25 |
| | | * 徐工汉云..............以下.............上饶江铜.............拆垛信息上传 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional |
| | | public class ReportToDismantleTheStackHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkDetlSingleService wrkDetlSingleService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | // @Value("${srHangJia.url}") |
| | | private String erpUrl = "192.168.18.229:16126"; |
| | | // @Value("${srHangJia.reportOutPath}") |
| | | private String reportOutPath = "api/DepalletizingInfo/Post"; |
| | | |
| | | public ReturnT<String> start(int staNo) { |
| | | try { |
| | | Date now = new Date(); |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | Integer staOther = getStaOther(staNo); |
| | | Integer staEnd = getStaEnd(staNo); |
| | | if (staOther==0) return FAIL; |
| | | |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { |
| | | return FAIL; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | StaProtocol staProtocolOther = devpThread.getStation().get(staOther); |
| | | if (staProtocolOther == null) { |
| | | return FAIL; |
| | | } else { |
| | | staProtocolOther = staProtocolOther.clone(); |
| | | } |
| | | |
| | | |
| | | StaProtocol staProtocolEnd = devpThread.getStation().get(staEnd); |
| | | if (staProtocolEnd == null) { |
| | | return FAIL; |
| | | } else { |
| | | staProtocolEnd = staProtocolEnd.clone(); |
| | | } |
| | | |
| | | |
| | | BasDevp basDevpOther = basDevpService.selectById(staOther); |
| | | if (Cools.isEmpty(basDevpOther) || basDevpOther.getReportSign()==1){ |
| | | return FAIL; |
| | | } |
| | | |
| | | |
| | | BasDevp basDevpEnd = basDevpService.selectById(staEnd); |
| | | if (!basDevpEnd.getLoading().equals("Y") || !basDevpEnd.getAutoing().equals("Y") || !basDevpEnd.getInEnable().equals("Y")){ |
| | | return FAIL; |
| | | } |
| | | if (!staProtocolEnd.isLoading() || !staProtocolEnd.isAutoing() || !staProtocolEnd.isInEnable() ){ |
| | | return FAIL; |
| | | } |
| | | |
| | | if ((basDevpEnd.getWrkNo()<9900 && basDevpEnd.getWrkNo()!=0 ) || basDevpEnd.getWrkNo()>10000 || basDevpEnd.getReportSign()!=0){ |
| | | return FAIL; |
| | | } |
| | | if ((staProtocolEnd.getWorkNo()<9900 && staProtocolEnd.getWorkNo()!=0 ) || staProtocolEnd.getWorkNo()>10000){ |
| | | return FAIL; |
| | | } |
| | | |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("io_type", 202).eq("source_sta_no", staEnd).eq("wrk_sts",51L)); |
| | | if (!Cools.isEmpty(wrkMast1)) return FAIL; |
| | | if (!Cools.isEmpty(basDevp) && basDevp.getAutoing().equals("Y") && basDevp.getWrkNo()!=0){ //上传前工作号跟电控约定为9992中控(桁架):码垛完成下发入库信息(你可以自定义) |
| | | if (staProtocol.isAutoing() && staProtocol.getWorkNo()!=0){ |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo())); |
| | | if (Cools.isEmpty(wrkMast) || Cools.isEmpty(wrkMast.getSheetNo()) || !wrkMast.getSheetNo().equals("0")){ |
| | | return FAIL; |
| | | } |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | if (Cools.isEmpty(wrkDetls) || wrkDetls.isEmpty()){ |
| | | return FAIL; |
| | | } |
| | | List<WrkDetl> wrkDetlList = new ArrayList<>(); |
| | | String signOne = ""; |
| | | String signTwo = ""; |
| | | for (WrkDetl wrkDetl:wrkDetls){ |
| | | if (wrkDetl.getOrigin().equals("1") && signOne.equals("")){ |
| | | wrkDetlList.add(wrkDetl); |
| | | signOne = "1"; |
| | | } else if (wrkDetl.getOrigin().equals("2") && signTwo.equals("")){ |
| | | wrkDetlList.add(wrkDetl); |
| | | signTwo = "2"; |
| | | } |
| | | if (!signOne.equals("") && !signTwo.equals("")){ |
| | | break; |
| | | } |
| | | } |
| | | SingleMountUnstackingCompleteParam singleMountUnstackingCompleteParam = new SingleMountUnstackingCompleteParam(wrkMast,wrkDetlList); |
| | | singleMountUnstackingCompleteParam.setStaStart(staNo); |
| | | singleMountUnstackingCompleteParam.setStaEnd(staEnd); |
| | | // result = null; |
| | | // if (true){ |
| | | // return FAIL; |
| | | // } |
| | | log.error("上传机械臂时,站点状态:"+JSON.toJSONString(basDevpEnd)); |
| | | log.error("上传机械臂时,工作号:"+JSON.toJSONString(wrkMast)); |
| | | ReturnT<String> result = postMesData(reportOutPath,singleMountUnstackingCompleteParam); |
| | | // System.out.println(result); |
| | | // if (true){ |
| | | // for (WrkDetl wrkDetl:wrkDetls){ |
| | | // WrkDetlSingle wrkDetlSingle = new WrkDetlSingle(); |
| | | // wrkDetlSingle.sync(wrkDetl); |
| | | // wrkDetlSingle.setWrkNo(wrkDetl.getWrkNo().longValue()); |
| | | // wrkDetlSingleService.insert(wrkDetlSingle); |
| | | // } |
| | | // wrkMast.setSheetNo("1"); |
| | | // wrkMastService.updateById(wrkMast); |
| | | // basDevp.setReportSign(1); |
| | | // basDevpService.updateById(basDevp); |
| | | // basDevpEnd.setReportSign(1); |
| | | // basDevpService.updateById(basDevp); |
| | | // return SUCCESS; |
| | | // } |
| | | if (result.getCode()==200){ |
| | | Date nowOne = new Date(); |
| | | Date nowTwo = now; |
| | | for (WrkDetl wrkDetl:wrkDetls){ |
| | | if (wrkDetl.getOrigin().equals("1")){ |
| | | now = nowOne; |
| | | } else if (wrkDetl.getOrigin().equals("2")){ |
| | | now = nowTwo; |
| | | } |
| | | WrkDetlSingle wrkDetlSingle = new WrkDetlSingle(); |
| | | wrkDetlSingle.sync(wrkDetl); |
| | | wrkDetlSingle.setWrkNo(wrkDetl.getWrkNo().longValue()); |
| | | wrkDetlSingle.setIoTime(now); |
| | | wrkDetlSingleService.insert(wrkDetlSingle); |
| | | } |
| | | wrkMast.setSheetNo("1"); |
| | | wrkMastService.updateById(wrkMast); |
| | | basDevp.setReportSign(1); |
| | | basDevpService.updateById(basDevp); |
| | | basDevpEnd.setReportSign(1); |
| | | basDevpService.updateById(basDevpEnd); |
| | | |
| | | return SUCCESS; |
| | | }else { |
| | | log.error("拆垛信息上传失败"); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("异常!!!"+e); |
| | | return FAIL; |
| | | } |
| | | return FAIL; |
| | | } |
| | | |
| | | private ReturnT<String> postMesData(String erpPath,Object combParam){ |
| | | if(combParam != null){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(erpUrl) |
| | | .setPath(erpPath) |
| | | .setJson(JSON.toJSONString(combParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("Code")==200) { |
| | | success = true; |
| | | } else { |
| | | log.error("拆垛信息上传请求接口失败!!!url:{};request:{};response:{}"+erpUrl+erpPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException("上报erp系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "上报桁架系统", |
| | | erpUrl + erpPath, |
| | | null, |
| | | erpUrl, |
| | | JSON.toJSONString(combParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public Integer getStaOther(Integer staNo){ |
| | | switch (staNo){ |
| | | case 118: |
| | | return 119; |
| | | case 119: |
| | | return 118; |
| | | case 120: |
| | | return 121; |
| | | case 121: |
| | | return 120; |
| | | default: |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public Integer getStaEnd(Integer staNo){ |
| | | switch (staNo){ |
| | | case 118: |
| | | case 119: |
| | | return 131; |
| | | case 120: |
| | | case 121: |
| | | return 135; |
| | | default: |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | public boolean isReportSign(StaProtocol staProtocol){ |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoadingSuper() && !staProtocol.isLoading()){ |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | // generator.table="sys_host"; |
| | | // sqlserver |
| | | generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | generator.url="localhost:1433;databasename=xjhsasrs"; |
| | | generator.url="192.168.4.15:1433;databasename=srjtasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_bas_rgv_err_log"; |
| | | generator.table="man_api_log"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | |
| | | generator.controller = false; |
New file |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import com.core.exception.CoolException; |
| | | |
| | | import java.beans.BeanInfo; |
| | | import java.beans.Introspector; |
| | | import java.beans.PropertyDescriptor; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/1 |
| | | */ |
| | | public class Synchro { |
| | | |
| | | public static void Copy(Object source, Object dest) { |
| | | try { |
| | | BeanInfo sourceBean = Introspector.getBeanInfo(source.getClass(),Object.class); |
| | | PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); |
| | | BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(),Object.class); |
| | | PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); |
| | | for (PropertyDescriptor propertyDescriptor : sourceProperty) { |
| | | for (PropertyDescriptor descriptor : destProperty) { |
| | | if (propertyDescriptor.getName().equals(descriptor.getName()) && propertyDescriptor.getPropertyType() == descriptor.getPropertyType()) { |
| | | Method readMethod = propertyDescriptor.getReadMethod(); |
| | | Method writeMethod = descriptor.getWriteMethod(); |
| | | if (null != writeMethod && null != readMethod) { |
| | | writeMethod.invoke(dest, readMethod.invoke(source)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new CoolException("属性复制失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://192.168.18.4:49977;databasename=srjtasrs |
| | | # username: sa |
| | | # password: sa@123 |
| | | url: jdbc:sqlserver://127.0.0.1:49977;databasename=srjtasrs |
| | | url: jdbc:sqlserver://192.168.18.4:49977;databasename=srjtasrs |
| | | username: sa |
| | | password: sa@123 |
| | | # url: jdbc:sqlserver://127.0.0.1:49977;databasename=srjtasrs |
| | | # username: sa |
| | | # password: sa@123 |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;databasename=srjtasrs |
| | | # username: sa |
| | | # password: sa@123 |
| | |
| | | enable: false |
| | | |
| | | wms: |
| | | url: 127.0.0.1:8080/jtwms |
| | | url: 192.168.18.4:8080/jtwms |
| | | |
| | | # 下位机配置 |
| | | wcs-slave: |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.ApiLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.ApiLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="namespace" property="namespace" /> |
| | | <result column="url" property="url" /> |
| | | <result column="appkey" property="appkey" /> |
| | | <result column="timestamp" property="timestamp" /> |
| | | <result column="client_ip" property="clientIp" /> |
| | | <result column="request" property="request" /> |
| | | <result column="response" property="response" /> |
| | | <result column="err" property="err" /> |
| | | <result column="result" property="result" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <delete id="clearWeekBefore"> |
| | | delete from man_api_log |
| | | where 1=1 |
| | | and datediff(week,create_time,getdate()) >= 1 |
| | | and result != 1 |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | and wrk_no = #{workNo} |
| | | </update> |
| | | |
| | | <select id="selectByWrkNo" resultMap="BaseResultMap"> |
| | | select * from asr_wrk_detl where 1=1 and wrk_no = #{wrkNo} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.WrkDetlSingleMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkDetlSingle"> |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="model" property="model" /> |
| | | <result column="color" property="color" /> |
| | | <result column="brand" property="brand" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="price" property="price" /> |
| | | <result column="sku" property="sku" /> |
| | | <result column="units" property="units" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="origin" property="origin" /> |
| | | <result column="manu" property="manu" /> |
| | | <result column="manu_date" property="manuDate" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="safe_qty" property="safeQty" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="length" property="length" /> |
| | | <result column="volume" property="volume" /> |
| | | <result column="three_code" property="threeCode" /> |
| | | <result column="supp" property="supp" /> |
| | | <result column="supp_code" property="suppCode" /> |
| | | <result column="be_batch" property="beBatch" /> |
| | | <result column="dead_time" property="deadTime" /> |
| | | <result column="dead_warn" property="deadWarn" /> |
| | | <result column="source" property="source" /> |
| | | <result column="inspect" property="inspect" /> |
| | | <result column="danger" property="danger" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="roll_up" property="rollUp" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |