Merge remote-tracking branch 'origin/devlop' into devlop
13个文件已修改
1 文件已重命名
1 文件已复制
15个文件已添加
New file |
| | |
| | | package com.vincent.rsf.openApi.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title PlatformProperties |
| | | * @description |
| | | * @create 2025/3/7 09:48 |
| | | */ |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "platform.rcs") |
| | | public class PlatformProperties { |
| | | |
| | | /** |
| | | * 接口host |
| | | */ |
| | | private String host; |
| | | /** |
| | | * 端口号 |
| | | */ |
| | | private String port; |
| | | |
| | | /** |
| | | * 接口链接前缀 |
| | | */ |
| | | private String prePath; |
| | | |
| | | |
| | | public String getBaseUrl() { |
| | | return this.host + ":" + this.port + "/" + this.prePath; |
| | | } |
| | | |
| | | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "platform.wms") |
| | | public class WmsApi { |
| | | /** |
| | | * rcs调用路径 |
| | | */ |
| | | private String host; |
| | | |
| | | /**rcs调用端口**/ |
| | | private String port; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.openApi.entity.params.RcsPubTaskParams; |
| | | import com.vincent.rsf.openApi.entity.params.SyncRcsLocsParam; |
| | | import com.vincent.rsf.openApi.service.WmsRcsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | */ |
| | | @ApiOperation("RCS库位信息同步") |
| | | @PostMapping("/sync/locs") |
| | | public R syncLocsToWms() { |
| | | wmsRcsService.syncLocs(); |
| | | return R.ok(); |
| | | public R syncLocsToWms(@RequestBody SyncRcsLocsParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return R.ok().add(wmsRcsService.syncLocs(params)); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.vincent.rsf.openApi.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_loc") |
| | | public class Loc implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 库区标识 |
| | | */ |
| | | @ApiModelProperty(value= "库区标识") |
| | | private Long areaId; |
| | | |
| | | /** |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | private String code; |
| | | |
| | | /** |
| | | * 仓库标识 |
| | | */ |
| | | @ApiModelProperty(value= "仓库标识") |
| | | private Long warehouseId; |
| | | |
| | | /** |
| | | * 库位类型(*) H: 高库位 M: 中库位 L: 低库位 |
| | | */ |
| | | @ApiModelProperty(value= "库位类型(*) H: 高库位 M: 中库位 L: 低库位 ") |
| | | @TableField("`type`") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("库位类型(*)[man_loc_type]") |
| | | @TableField(exist = false) |
| | | private List<Long> typeIds; |
| | | |
| | | /** |
| | | * 虚拟库位 |
| | | */ |
| | | @ApiModelProperty(value= "虚拟库位") |
| | | private Short flagLogic; |
| | | |
| | | /** |
| | | * 功能属性 |
| | | */ |
| | | @ApiModelProperty(value= "功能属性") |
| | | private String fucAtrrs; |
| | | |
| | | /** |
| | | * 容器编码 |
| | | */ |
| | | @ApiModelProperty(value= "容器编码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 存放单位 |
| | | */ |
| | | @ApiModelProperty(value= "存放单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 长 |
| | | */ |
| | | @ApiModelProperty(value= "长") |
| | | @TableField("`length`") |
| | | private Double length; |
| | | |
| | | /** |
| | | * 高 |
| | | */ |
| | | @ApiModelProperty(value= "高") |
| | | private Double height; |
| | | |
| | | /** |
| | | * 宽 |
| | | */ |
| | | @ApiModelProperty(value= "宽") |
| | | private Double width; |
| | | /** |
| | | * 排 |
| | | */ |
| | | @ApiModelProperty(value= "排") |
| | | @TableField("`row`") |
| | | private Integer row; |
| | | |
| | | /** |
| | | * 设备号 |
| | | */ |
| | | @ApiModelProperty(value= "设备号") |
| | | private Integer deviceNo; |
| | | |
| | | /** |
| | | * 列 |
| | | */ |
| | | @ApiModelProperty(value= "列") |
| | | private Integer col; |
| | | |
| | | /** |
| | | * 层 |
| | | */ |
| | | @ApiModelProperty(value= "层") |
| | | private Integer lev; |
| | | |
| | | /** |
| | | * 巷道 |
| | | */ |
| | | @ApiModelProperty(value= "巷道") |
| | | @TableField("`channel`") |
| | | private Integer channel; |
| | | |
| | | /** |
| | | * 最大零件数 |
| | | */ |
| | | @ApiModelProperty(value= "最大零件数") |
| | | private Integer maxParts; |
| | | |
| | | /** |
| | | * 最大包装数 |
| | | */ |
| | | @ApiModelProperty(value= "最大包装数") |
| | | private Integer maxPack; |
| | | |
| | | /** |
| | | * 库位使用状态 O: 空库 D: 空板 R: 预约出库 S: 预约入库 X: 禁用 F: 在库 |
| | | */ |
| | | @ApiModelProperty(value= "库位使用状态 O: 空库 D: 空板 R: 预约出库 S: 预约入库 X: 禁用 F: 在库 ") |
| | | private String useStatus; |
| | | |
| | | /** |
| | | * 是否标签管理 |
| | | */ |
| | | @ApiModelProperty(value= "是否标签管理") |
| | | private Short flagLabelMange; |
| | | |
| | | /** |
| | | * 属性 |
| | | */ |
| | | @ApiModelProperty(value= "属性") |
| | | private String locAttrs; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | @TableField("`status`") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @ApiModelProperty(value= "租户") |
| | | private Integer tenantId; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Loc() {} |
| | | |
| | | public Loc(Long areaId, String code, Long warehouseId, String type, Short flagLogic, String fucAtrrs, String barcode, String unit, Double length, Double height, Double width, Integer row, Integer col, Integer lev, Integer channel, Integer maxParts, Integer maxPack, String useStatus, Short flagLabelMange, String locAttrs, Integer status, Integer deleted, Integer tenantId, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.areaId = areaId; |
| | | this.code = code; |
| | | this.warehouseId = warehouseId; |
| | | this.type = type; |
| | | this.flagLogic = flagLogic; |
| | | this.fucAtrrs = fucAtrrs; |
| | | this.barcode = barcode; |
| | | this.unit = unit; |
| | | this.length = length; |
| | | this.height = height; |
| | | this.width = width; |
| | | this.row = row; |
| | | this.col = col; |
| | | this.lev = lev; |
| | | this.channel = channel; |
| | | this.maxParts = maxParts; |
| | | this.maxPack = maxPack; |
| | | this.useStatus = useStatus; |
| | | this.flagLabelMange = flagLabelMange; |
| | | this.locAttrs = locAttrs; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Loc loc = new Loc( |
| | | // 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, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | |
| | | |
| | | public String getUseStatus$(){ |
| | | if (null == this.useStatus){ return null; } |
| | | switch (this.useStatus){ |
| | | case "O": |
| | | return " 空库"; |
| | | case "D": |
| | | return " 空板"; |
| | | case "R": |
| | | return " 预约出库"; |
| | | case "S": |
| | | return " 预约入库"; |
| | | case "X": |
| | | return " 禁用"; |
| | | case "F": |
| | | return " 在库"; |
| | | default: |
| | | return String.valueOf(this.useStatus); |
| | | } |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | public Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.openApi.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.DateUtils; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_loc_item") |
| | | public class LocItem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 主单ID |
| | | */ |
| | | @ApiModelProperty(value= "主单ID") |
| | | private Long locId; |
| | | |
| | | |
| | | @ApiModelProperty("库位编码") |
| | | private String locCode; |
| | | |
| | | /** |
| | | * 单据ID |
| | | */ |
| | | @ApiModelProperty(value= "单据ID") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value= "单据类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 订单明细id |
| | | */ |
| | | @ApiModelProperty(value= "订单明细id") |
| | | private Long orderItemId; |
| | | |
| | | /** |
| | | * 业务类型 |
| | | */ |
| | | @ApiModelProperty(value= "业务类型") |
| | | private Short wkType; |
| | | |
| | | /** |
| | | * 物料ID |
| | | */ |
| | | @ApiModelProperty(value= "物料ID") |
| | | private Long matnrId; |
| | | |
| | | /** |
| | | * 平台标识(行号) |
| | | */ |
| | | @ApiModelProperty(value = "平台标识(行号)") |
| | | private String platItemId; |
| | | |
| | | @ApiModelProperty("客户订单号") |
| | | private String platOrderCode; |
| | | |
| | | @ApiModelProperty("工单号") |
| | | private String platWorkCode; |
| | | |
| | | @ApiModelProperty("项目号") |
| | | private String projectCode; |
| | | |
| | | @ApiModelProperty("出库数量") |
| | | @TableField(exist = false) |
| | | private Double outQty; |
| | | |
| | | @ApiModelProperty("巷道") |
| | | @TableField(exist = false) |
| | | private Integer channel; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnrCode; |
| | | |
| | | /** |
| | | * 物料跟踪码 |
| | | */ |
| | | @ApiModelProperty(value= "物料跟踪码") |
| | | private String trackCode; |
| | | |
| | | /** |
| | | * 库存单位 |
| | | */ |
| | | @ApiModelProperty(value= "库存单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | |
| | | @ApiModelProperty("执行数量") |
| | | private Double workQty; |
| | | |
| | | |
| | | @ApiModelProperty("完成数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 库存批次 |
| | | */ |
| | | @ApiModelProperty(value= "库存批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String spec; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 字段索引 |
| | | */ |
| | | @ApiModelProperty(value= "字段索引") |
| | | private String fieldsIndex; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | @ApiModelProperty("托盘码") |
| | | @TableField(exist = false) |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @ApiModelProperty(value= "租户") |
| | | private Integer tenantId; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty("供应商ID") |
| | | private Long splrId; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | @TableField(exist = false) |
| | | private Long sourceId; |
| | | |
| | | @TableField(exist = false) |
| | | private Long source; |
| | | |
| | | @TableField(exist = false) |
| | | private String sourceCode; |
| | | |
| | | @ApiModelProperty("出站口") |
| | | @TableField(exist = false) |
| | | private String siteNo; |
| | | |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public LocItem() {} |
| | | |
| | | public LocItem(Long locId, Long orderId, String type, Long orderItemId, Short wkType, Long matnrId, String maktx, String matnrCode, String trackCode, String unit, Double anfme, String batch, String splrBatch, String spec, String model, String fieldsIndex, Integer status, Integer deleted, Integer tenantId, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.locId = locId; |
| | | this.orderId = orderId; |
| | | this.type = type; |
| | | this.orderItemId = orderItemId; |
| | | this.wkType = wkType; |
| | | this.matnrId = matnrId; |
| | | this.maktx = maktx; |
| | | this.matnrCode = matnrCode; |
| | | this.trackCode = trackCode; |
| | | this.unit = unit; |
| | | this.anfme = anfme; |
| | | this.batch = batch; |
| | | this.splrBatch = splrBatch; |
| | | this.spec = spec; |
| | | this.model = model; |
| | | this.fieldsIndex = fieldsIndex; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // LocItem locItem = new LocItem( |
| | | // null, // 主单IDs |
| | | // null, // 单据ID |
| | | // null, // 单据类型 |
| | | // null, // 订单明细id |
| | | // null, // 业务类型 |
| | | // null, // 物料ID |
| | | // null, // 物料名称 |
| | | // null, // 物料编码 |
| | | // null, // 物料跟踪码 |
| | | // null, // 库存单位 |
| | | // null, // 数量 |
| | | // null, // 库存批次 |
| | | // null, // 供应商批次 |
| | | // null, // 规格 |
| | | // null, // 型号 |
| | | // null, // 字段索引 |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public Double getReviseQty() { |
| | | return this.anfme; |
| | | } |
| | | |
| | | 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 Integer getDeadTime() { |
| | | if (null == this.createTime){ return null; } |
| | | return DateUtils.diff(createTime, new Date()); |
| | | } |
| | | |
| | | |
| | | 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); |
| | | } |
| | | |
| | | public Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public static String pubTask = "/api/open/bus/submit"; |
| | | |
| | | public static String syncLocs = "/api/open/loc/sync"; |
| | | |
| | | } |
File was renamed from rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/CommonResponse.java |
| | |
| | | package com.vincent.rsf.openApi.entity; |
| | | package com.vincent.rsf.openApi.entity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ryan |
New file |
| | |
| | | package com.vincent.rsf.openApi.entity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SyncLocsDto", description = "库位同步Dto") |
| | | public class SyncLocsDto { |
| | | |
| | | private Integer zoneId; |
| | | |
| | | private String locNo; |
| | | |
| | | private Integer locSts; |
| | | |
| | | private Integer row; |
| | | |
| | | private Integer bay; |
| | | |
| | | private Integer lev; |
| | | |
| | | private String barcode; |
| | | |
| | | private String zpallet; |
| | | |
| | | private String locType; |
| | | |
| | | private String zoneId$; |
| | | |
| | | private String locType$; |
| | | |
| | | private String locSts$; |
| | | |
| | | private Integer statusBool; |
| | | |
| | | private String locStsEl; |
| | | |
| | | private String status$; |
| | | } |
| | |
| | | @ApiModelProperty("任务类型{LOC_TO_LOC: 移库, LOC_TO_STA: 出库, STA_TO_LOC: 入库, STA_TO_STA: 站点间搬运}") |
| | | private String taskType; |
| | | |
| | | @ApiModelProperty("任务号") |
| | | private String seqNum; |
| | | |
| | | @ApiModelProperty("起始库位") |
| | | private String oriLoc; |
| | | |
New file |
| | |
| | | package com.vincent.rsf.openApi.entity.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SyncRcsLocsParam", description = "同步库位参数") |
| | | public class SyncRcsLocsParam implements Serializable { |
| | | |
| | | @ApiModelProperty("当前页") |
| | | private Integer current; |
| | | |
| | | @ApiModelProperty("条目数") |
| | | private Integer pageSize; |
| | | |
| | | @ApiModelProperty("库位号") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty("库位状态") |
| | | private String locSts; |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.openApi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vincent.rsf.openApi.entity.LocItem; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocItemMapper extends BaseMapper<LocItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.openApi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vincent.rsf.openApi.entity.Loc; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocMapper extends BaseMapper<Loc> { |
| | | |
| | | } |
| | |
| | | package com.vincent.rsf.openApi.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.openApi.entity.Loc; |
| | | import com.vincent.rsf.openApi.entity.LocItem; |
| | | import com.vincent.rsf.openApi.entity.dto.SyncLocsDto; |
| | | import com.vincent.rsf.openApi.entity.params.RcsPubTaskParams; |
| | | import com.vincent.rsf.openApi.entity.params.SyncRcsLocsParam; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface WmsRcsService { |
| | | public interface WmsRcsService extends IService<Loc> { |
| | | |
| | | R pubTasks(RcsPubTaskParams params); |
| | | |
| | |
| | | |
| | | R callBackEvent(Map<String, Object> params); |
| | | |
| | | void syncLocs(); |
| | | List<SyncLocsDto> syncLocs(SyncRcsLocsParam params); |
| | | } |
| | |
| | | package com.vincent.rsf.openApi.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.cfg.CoercionAction; |
| | | import com.fasterxml.jackson.databind.cfg.CoercionInputShape; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.openApi.entity.CommonResponse; |
| | | import com.vincent.rsf.openApi.config.PlatformProperties; |
| | | import com.vincent.rsf.openApi.entity.Loc; |
| | | import com.vincent.rsf.openApi.entity.dto.CommonResponse; |
| | | import com.vincent.rsf.openApi.entity.constant.RcsConstant; |
| | | import com.vincent.rsf.openApi.entity.dto.SyncLocsDto; |
| | | import com.vincent.rsf.openApi.entity.params.RcsPubTaskParams; |
| | | import com.vincent.rsf.openApi.entity.params.SyncRcsLocsParam; |
| | | import com.vincent.rsf.openApi.mapper.LocMapper; |
| | | import com.vincent.rsf.openApi.service.WmsRcsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service("wmsRcsServiceImpl") |
| | | public class WmsRcsServiceImpl implements WmsRcsService { |
| | | @Service("wmsRcsService") |
| | | public class WmsRcsServiceImpl extends ServiceImpl<LocMapper, Loc> implements WmsRcsService { |
| | | |
| | | // @Autowired |
| | | // private RemotesInfoProperties.RcsApi rcsApi; |
| | | @Autowired |
| | | private PlatformProperties rcsApi; |
| | | |
| | | @Autowired |
| | | private PlatformProperties.WmsApi wmsApi; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | /**RCS基础配置链接*/ |
| | | // private final String rcsUrl = rcsApi.getHost() + rcsApi.getPort(); |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(timeout = 60, rollbackFor = Exception.class) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R pubTasks(RcsPubTaskParams params) { |
| | | log.info("任务下发,请求地址: {}, 请求参数: {}", "" + RcsConstant.pubTask, JSONObject.toJSONString(params)); |
| | | /**RCS基础配置链接*/ |
| | | String rcsUrl = rcsApi.getHost() + ":" + rcsApi.getPort() + RcsConstant.pubTask; |
| | | log.info("任务下发,请求地址: {}, 请求参数: {}", rcsUrl , JSONObject.toJSONString(params)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | headers.add("api-version", "v2.0"); |
| | | HttpEntity httpEntity = new HttpEntity(params, headers); |
| | | ResponseEntity<String> exchange = restTemplate.exchange("rcsUrl" + RcsConstant.pubTask, HttpMethod.POST, httpEntity, String.class); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("任务下发后,响应结果: {}", exchange); |
| | | if (Objects.isNull(exchange.getBody())) { |
| | | throw new CoolException("任务下发失败!!"); |
| | |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | return R.ok(result); |
| | | return R.ok(); |
| | | } else { |
| | | throw new CoolException("任务下发失败!!"); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R cancelTasks(Map<String, Object> params) { |
| | | return null; |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public R callBackEvent(Map<String, Object> params) { |
| | | return null; |
| | | String rcsUrl = wmsApi.getHost() + ":" + wmsApi.getPort() + RcsConstant.pubTask; |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public void syncLocs() { |
| | | ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1); |
| | | scheduled.scheduleWithFixedDelay(new Runnable() { |
| | | int current = 1; |
| | | @Override |
| | | public void run() { |
| | | log.info("<UNK>{}<UNK>", current); |
| | | current ++; |
| | | log.info("{}", current); |
| | | public List<SyncLocsDto> syncLocs(SyncRcsLocsParam params) { |
| | | return syncRcsLocs(params); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/28 |
| | | * @description: 拉取RCS库位,同步至本地 |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<SyncLocsDto> syncRcsLocs(SyncRcsLocsParam params) { |
| | | /**RCS基础配置链接*/ |
| | | String rcsUrl = rcsApi.getHost() + ":" + rcsApi.getPort() + RcsConstant.syncLocs; |
| | | log.info("任务下发,请求地址: {}, 请求参数: {}", rcsUrl , JSONObject.toJSONString(params)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | headers.add("api-version", "v2.0"); |
| | | HttpEntity httpEntity = new HttpEntity(params, headers); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("任务下发后,响应结果: {}", exchange); |
| | | if (Objects.isNull(exchange.getBody())) { |
| | | throw new CoolException("任务下发失败!!"); |
| | | } else { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.coercionConfigDefaults() |
| | | .setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty); |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | JSONObject jsonObject = JSONObject.parseObject(exchange.getBody()).getJSONObject("data"); |
| | | List<SyncLocsDto> array = JSONArray.parseArray(jsonObject.getJSONArray("records").toJSONString(), SyncLocsDto.class); |
| | | log.info("records结果: {}", array); |
| | | return array; |
| | | } else { |
| | | throw new CoolException("任务下发失败!!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | }, 3, 3, TimeUnit.SECONDS); |
| | | } |
| | | } |
| | | } |
| | |
| | | multipart: |
| | | maxFileSize: 100MB |
| | | maxRequestSize: 100MB |
| | | jmx: |
| | | enabled: false |
| | | mail: |
| | | from: t1731253606@163.com |
| | | host: smtp.163.com |
| | | port: 465 |
| | | username: t1731253606@163.com |
| | | password: FCqETysH8TfuPqkY |
| | | properties: |
| | | mail: |
| | | smtp: |
| | | auth: true |
| | | ssl: true |
| | | connectiontimeout: 5000 |
| | | timeout: 5000 |
| | | socketFactory: |
| | | class: javax.net.ssl.SSLSocketFactory |
| | | redis: |
| | | host: 127.0.0.1 |
| | | password: xltys1995 |
| | |
| | | |
| | | #平台接口信息配置(如:ERP, QMS, WCS等) |
| | | platform: |
| | | #企业ERP平台 |
| | | erp: |
| | | #localhost |
| | | host: http://127.0.0.1 |
| | | #端口号 |
| | | port: 8080 |
| | | #接品链接前缀 |
| | | pre-path: rsf-server |
| | | #接口明细 |
| | | api: |
| | | #质检上报接口 |
| | | notify-inspect: /report/inspect |
| | | #RCS链接 |
| | | rcs: |
| | | #链接 |
| | | host: http://192.168.4.84 |
| | | #端口 |
| | | port: 8088 |
| | | |
| | | #仓库功能参数配置 |
| | | stock: |
| | | #是否允许打印货物标签, 默认允许打印,也可由供应商提供标签 |
| | | flagPrinter: false |
| | | #是否自动生成ASN单(默认:是),为『否』则开启PO单手动生成ASN单功能 |
| | | flagAutoAsn: false |
| | | #质检功能 是否校验上架(默认:是),是否校验收货(默认:否) |
| | | inspect: |
| | | #判断是后检验合格后,才允许上架 |
| | | flagAvailable: true |
| | | #判断是否校验合格后,才允许收货 |
| | | flagReceiving: false |
| | | wms: |
| | | #链接 |
| | | host: http://127.0.0.1 |
| | | #端口 |
| | | port: 8080 |
| | |
| | | id-type: auto |
| | | logic-delete-value: 1 |
| | | logic-not-delete-value: 0 |
| | | super: |
| | | pwd: xltys1995 |
| | | |
| | | logging: |
| | | file: |
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.vincent.rsf.openApi.mapper.LocItemMapper"> |
| | | |
| | | </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.vincent.rsf.openApi.mapper.LocMapper"> |
| | | |
| | | </mapper> |
| | |
| | | @Autowired |
| | | private WcsService wcsService; |
| | | |
| | | // @Autowired |
| | | // private WmsRcsService wmsRcsService; |
| | | |
| | | @ApiOperation(value = "wcs生成入库任务接口") |
| | | @PostMapping("/create/in/task") |
| | |
| | | } |
| | | InTaskMsgDto msgDto = wcsService.createInTask(param); |
| | | return R.ok(msgDto); |
| | | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "agv取货完成接口") |
| | |
| | | |
| | | /** |
| | | * 接收WCS调度,回传执行状态 |
| | | * //TODO 1. 拣料出库,再入库执行,修改状态为199.任务完成 并记录入库站点(源站点),添加任务号参数 |
| | | * |
| | | * TODO 1. 拣料出库,再入库执行,修改状态为199.任务完成 并记录入库站点(源站点),添加任务号参数 |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | @OperationLog("RCS库位信息同步") |
| | | @PostMapping("/sync/locs") |
| | | public R syncLocsToWms() { |
| | | |
| | | return R.ok(); |
| | | // return wmsRcsService.syncLocs(); |
| | | return wcsService.syncLocsToWms(); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/28 |
| | | * @description: RCS上报异常信息 |
| | | * @version 1.0 |
| | | */ |
| | | @ApiOperation("RCS上报异常执行信息") |
| | | @OperationLog("RCS上报异常执行信息") |
| | | @PostMapping("/receive/ex/msg") |
| | | public R receiveExMsg() { |
| | | return wcsService.receiveExMsg(); |
| | | } |
| | | |
| | | |
| | | } |
copy from rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/CommonResponse.java
copy to rsf-server/src/main/java/com/vincent/rsf/server/api/entity/CommonResponse.java
File was copied from rsf-open-api/src/main/java/com/vincent/rsf/openApi/entity/CommonResponse.java |
| | |
| | | package com.vincent.rsf.openApi.entity; |
| | | package com.vincent.rsf.server.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/27 |
| | | * @description: 通用响应结果 |
| | | * @version 1.0 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "CommonResponse", description = "通用响应结果 ") |
| | |
| | | @ApiModelProperty("响应结果") |
| | | private Object data; |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.constant; |
| | | |
| | | public class RcsConstant { |
| | | |
| | | public static String pubTask = "/rsf-open-api/rcs/pub/task"; |
| | | |
| | | public static String syncLocs = "/rsf-open-api/rcs/sync/locs"; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.dto; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SyncLocsDto", description = "库位同步Dto") |
| | | public class SyncLocsDto implements Serializable { |
| | | |
| | | private Integer zoneId; |
| | | |
| | | private String locNo; |
| | | |
| | | private String locSts; |
| | | |
| | | private Integer row; |
| | | |
| | | private Integer bay; |
| | | |
| | | private Integer lev; |
| | | |
| | | private String barcode; |
| | | |
| | | private String zpallet; |
| | | |
| | | private String locType; |
| | | |
| | | private String zoneId$; |
| | | |
| | | private String locType$; |
| | | |
| | | private String locSts$; |
| | | |
| | | private Integer statusBool; |
| | | |
| | | private String locStsEl; |
| | | |
| | | private String status$; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "SyncRcsLocsParam", description = "同步库位参数") |
| | | public class CommonRequest implements Serializable { |
| | | |
| | | @ApiModelProperty("当前页") |
| | | private Integer current; |
| | | |
| | | @ApiModelProperty("条目数") |
| | | private Integer pageSize; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ExMsgParams", description = "异常上报参数") |
| | | public class ExMsgParams { |
| | | |
| | | private String seqNum; |
| | | |
| | | @ApiModelProperty("事件类型: {START: 下发成功, OTBIN: 取货成功, END: 放货成功}") |
| | | private String eventType; |
| | | |
| | | @ApiModelProperty("小车编号 ") |
| | | private String robotCode; |
| | | |
| | | @ApiModelProperty("容器码") |
| | | private String zpallet; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.params; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "WcsTaskParams", description = "任务下发参数") |
| | | public class WcsTaskParams implements Serializable { |
| | | |
| | | @ApiModelProperty("批次") |
| | | private String batch; |
| | | |
| | | @ApiModelProperty("任务明细") |
| | | private List<TaskItemParam> taskList; |
| | | } |
| | | |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "TaskItem", description = "任务列表") |
| | | class TaskItemParam { |
| | | |
| | | @ApiModelProperty("任务类型{LOC_TO_LOC: 移库, LOC_TO_STA: 出库, STA_TO_LOC: 入库, STA_TO_STA: 站点间搬运}") |
| | | private String taskType; |
| | | |
| | | @ApiModelProperty("任务号") |
| | | private String seqNum; |
| | | |
| | | @ApiModelProperty("起始库位") |
| | | private String oriLoc; |
| | | |
| | | @ApiModelProperty("起始站点") |
| | | private String oriSta; |
| | | |
| | | @ApiModelProperty("目标库位") |
| | | private String destLoc; |
| | | |
| | | @ApiModelProperty("目标站点") |
| | | private String destSta; |
| | | |
| | | @ApiModelProperty("托盘码") |
| | | private String zpallet; |
| | | |
| | | @ApiModelProperty("优先级") |
| | | private Integer priority; |
| | | } |
| | |
| | | package com.vincent.rsf.server.api.service; |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto; |
| | | import com.vincent.rsf.server.api.controller.erp.params.TaskInParam; |
| | | import com.vincent.rsf.server.api.entity.params.WcsTaskParams; |
| | | |
| | | public interface WcsService { |
| | | InTaskMsgDto createInTask(TaskInParam param); |
| | |
| | | void agvTaskPickUpComplete(TaskInParam param); |
| | | |
| | | InTaskMsgDto getLocNo(TaskInParam param) throws Exception; |
| | | |
| | | R syncLocsToWms(); |
| | | } |
| | |
| | | package com.vincent.rsf.server.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.cfg.CoercionAction; |
| | | import com.fasterxml.jackson.databind.cfg.CoercionInputShape; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.config.RemotesInfoProperties; |
| | | import com.vincent.rsf.server.api.entity.CommonResponse; |
| | | import com.vincent.rsf.server.api.entity.constant.RcsConstant; |
| | | import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto; |
| | | import com.vincent.rsf.server.api.entity.dto.LocTypeDto; |
| | | import com.vincent.rsf.server.api.controller.erp.params.TaskInParam; |
| | | import com.vincent.rsf.server.api.entity.dto.SyncLocsDto; |
| | | import com.vincent.rsf.server.api.entity.params.CommonRequest; |
| | | import com.vincent.rsf.server.api.entity.params.WcsTaskParams; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.api.service.WcsService; |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.manager.enums.LocStsType; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class WcsServiceImpl implements WcsService { |
| | | @Autowired |
| | |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Autowired |
| | | private RemotesInfoProperties.RcsApi rcsApi; |
| | | |
| | | |
| | | @Override |
| | |
| | | //根据立库类型获取获取库位 |
| | | if (warehouseArea.getType().equals(WarehType.WAREHOUSE_TYPE_CRN.val)) { |
| | | //堆垛机 |
| | | dto = getLocNoCrn(param.getOrgLoc(),deviceBind, warehouseArea.getId(), param.getSourceStaNo(), matnr, batch, locTypeDto, 0, param.getIoType()); |
| | | dto = getLocNoCrn(param.getOrgLoc(), deviceBind, warehouseArea.getId(), param.getSourceStaNo(), matnr, batch, locTypeDto, 0, param.getIoType()); |
| | | |
| | | } else if (warehouseArea.getType().equals(WarehType.WAREHOUSE_TYPE_FOUR_DIRECTIONS.val)) { |
| | | //四向库 |
| | | } else { |
| | | } else { |
| | | //CTU 库以及其它 |
| | | dto = getLocNoCtu(deviceBind, warehouseArea.getId(), param.getSourceStaNo(), matnr, batch, locTypeDto, 0, param.getIoType()); |
| | | } |
| | | return dto; |
| | | } |
| | | |
| | | private InTaskMsgDto getLocNoCrn(String orgLoc,DeviceBind deviceBind, Long area, Integer sourceStaNo, String matnr, String batch, LocTypeDto locTypeDto, int times, Integer ioType) { |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/28 |
| | | * @description: Wcs库位同步 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R syncLocsToWms() { |
| | | /**RCS基础配置链接*/ |
| | | CommonRequest params = new CommonRequest(); |
| | | params.setPageSize(100); |
| | | ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1); |
| | | scheduled.scheduleWithFixedDelay(new Runnable() { |
| | | int current = 1; |
| | | @Override |
| | | public void run() { |
| | | params.setCurrent(current); |
| | | List<SyncLocsDto> dtos = syncLocs(params); |
| | | if (dtos.isEmpty()) { |
| | | scheduled.shutdown(); |
| | | } |
| | | dtos.forEach(dto -> { |
| | | Loc loc = new Loc(); |
| | | loc.setCode(dto.getLocNo()) |
| | | .setBarcode(dto.getBarcode()) |
| | | .setRow(dto.getRow()) |
| | | .setLev(dto.getLev()) |
| | | .setId(null) |
| | | .setAreaId(41L) |
| | | .setWarehouseId(27L) |
| | | .setCol(dto.getBay()) |
| | | .setType(dto.getLocType()) |
| | | .setStatus(dto.getStatusBool()) |
| | | .setUseStatus(LocStsType.getLocSts(dto.getLocSts())); |
| | | if (!locService.save(loc)) { |
| | | scheduled.shutdown(); |
| | | throw new CoolException("WCS库位同步失败!!"); |
| | | } |
| | | }); |
| | | current++; |
| | | } |
| | | }, 1, 1, TimeUnit.SECONDS); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private List<SyncLocsDto> syncLocs(CommonRequest params) { |
| | | String rcsUrl = rcsApi.getHost() + ":" + rcsApi.getPort() + RcsConstant.syncLocs; |
| | | log.info("任务下发,请求地址: {}, 请求参数: {}", rcsUrl, JSONObject.toJSONString(params)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | headers.add("api-version", "v2.0"); |
| | | HttpEntity httpEntity = new HttpEntity(params, headers); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(rcsUrl, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("任务下发后,响应结果: {}", exchange); |
| | | if (Objects.isNull(exchange.getBody())) { |
| | | throw new CoolException("任务下发失败!!"); |
| | | } else { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.coercionConfigDefaults() |
| | | .setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsEmpty); |
| | | try { |
| | | CommonResponse result = objectMapper.readValue(exchange.getBody(), CommonResponse.class); |
| | | if (result.getCode() == 200) { |
| | | JSONObject jsonObject = JSONObject.parseObject(exchange.getBody()).getJSONObject("data"); |
| | | return JSONArray.parseArray(jsonObject.getJSONArray("records").toJSONString(), SyncLocsDto.class); |
| | | } else { |
| | | throw new CoolException("任务下发失败!!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private InTaskMsgDto getLocNoCrn(String orgLoc, DeviceBind deviceBind, Long area, Integer sourceStaNo, String matnr, String batch, LocTypeDto locTypeDto, int times, Integer ioType) { |
| | | if (Cools.isEmpty(matnr)) { //物料号 |
| | | matnr = ""; |
| | | } |
| | |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(locMast2)) { |
| | | if (null != orgMoveLoc){ |
| | | if (null != orgMoveLoc) { |
| | | if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { |
| | | break; |
| | | } |
| | |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(locMast2)) { |
| | | if (null != orgMoveLoc){ |
| | | if (null != orgMoveLoc) { |
| | | if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { |
| | | break; |
| | | } |
| | |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(locMast2)) { |
| | | if (null != orgMoveLoc){ |
| | | if (null != orgMoveLoc) { |
| | | if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { |
| | | break; |
| | | } |
| | |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(locMast2)) { |
| | | if (null != orgMoveLoc){ |
| | | if (null != orgMoveLoc) { |
| | | if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { |
| | | break; |
| | | } |
| | |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(locMast2)) { |
| | | if (null != orgMoveLoc){ |
| | | if (null != orgMoveLoc) { |
| | | if (!locMast2.getChannel().equals(orgMoveLoc.getChannel())) { |
| | | break; |
| | | } |
| | |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times < rowCount * 2) { |
| | | times = times + 1; |
| | | return getLocNoCrn(orgLoc,deviceBind, area, sourceStaNo, matnr, batch, locTypeDto, times, ioType); |
| | | return getLocNoCrn(orgLoc, deviceBind, area, sourceStaNo, matnr, batch, locTypeDto, times, ioType); |
| | | |
| | | } |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (locTypeDto.getLocType1() < 3) { |
| | | int i = locTypeDto.getLocType1() + 1; |
| | | locTypeDto.setLocType1(i); |
| | | return getLocNoCrn(orgLoc,deviceBind, area, sourceStaNo, matnr, batch, locTypeDto, 0, ioType); |
| | | return getLocNoCrn(orgLoc, deviceBind, area, sourceStaNo, matnr, batch, locTypeDto, 0, ioType); |
| | | } |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | |
| | | |
| | | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.config.BeanPostProcessor; |
| | |
| | | |
| | | return docket; |
| | | } |
| | | |
| | | @Bean |
| | | public Docket rcsDocket() { |
| | | Docket docket = new Docket(DocumentationType.OAS_30) |
| | | .apiInfo(apiInfo()) |
| | | .enable("dev".equals(active)) |
| | | .groupName("RCS任务调度") |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage("com.vincent.rsf.openApi.controller")) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | |
| | | return docket; |
| | | } |
| | | |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | |
| | | package com.vincent.rsf.server.manager.enums;
|
| | |
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.vincent.rsf.framework.common.SpringUtils;
|
| | | import com.vincent.rsf.framework.exception.CoolException;
|
| | |
|
| | | public enum LocStsType {
|
| | |
|
| | | //空板
|
| | |
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | // public long val() {
|
| | | // LocStsService service = SpringUtils.getBean(LocStsService.class);
|
| | | // LocSts locSts = service.getOne(new LambdaQueryWrapper<LocSts>().eq(LocSts::getLocSts, this.toString()));
|
| | | // if (locSts == null) {
|
| | | // throw new CoolException("LocStsType Error!");
|
| | | // }
|
| | | // return locSts.getId();
|
| | | // }
|
| | |
|
| | | public static LocStsType get(String el) {
|
| | | for (LocStsType value : LocStsType.values()) {
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * @author Ryan
|
| | | * @date 2025/8/28
|
| | | * @description: RCS库位状态转换
|
| | | * @version 1.0
|
| | | */
|
| | | public static String getLocSts(String val) {
|
| | | if (val.equals(RcsLocStsType.LOC_STS_TYPE_D.type)) {
|
| | | return LocStsType.LOC_STS_TYPE_D.type;
|
| | | } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_F.type)) {
|
| | | return LocStsType.LOC_STS_TYPE_F.type;
|
| | | } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_S.type)) {
|
| | | return LocStsType.LOC_STS_TYPE_S.type;
|
| | | } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_R.type)) {
|
| | | return LocStsType.LOC_STS_TYPE_R.type;
|
| | | } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_X.type)) {
|
| | | return LocStsType.LOC_STS_TYPE_X.type;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.vincent.rsf.server.manager.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/8/28 |
| | | * @description: RCS库位状态类型 |
| | | * @version 1.0 |
| | | */ |
| | | public enum RcsLocStsType { |
| | | //空板 |
| | | LOC_STS_TYPE_D("15", "IDLE"), |
| | | //在库 |
| | | LOC_STS_TYPE_F("16","STOCK"), |
| | | //禁用 |
| | | LOC_STS_TYPE_X("19","DISABLED"), |
| | | //入库预约 |
| | | LOC_STS_TYPE_S("17","PAKIN"), |
| | | //出库预约 |
| | | LOC_STS_TYPE_R("18", "PAKOUT"), |
| | | ; |
| | | |
| | | public String type; |
| | | |
| | | public String desc; |
| | | |
| | | RcsLocStsType(String type, String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | } |
| | |
| | | notify-inspect: /report/inspect |
| | | rcs: |
| | | #链接 |
| | | host: http://192.168.4.84 |
| | | host: http://127.0.0.1 |
| | | #端口 |
| | | port: 8088 |
| | | port: 8081 |
| | | |
| | | #仓库功能参数配置 |
| | | stock: |