whycq
2024-12-24 8d4dcb5760f6c7149039f236bf009a5e1ce18505
# 小车任务档code转为matnr
4个文件已修改
5个文件已添加
377 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/Mat.java 253 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastSta.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/MatMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MatService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MatServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/command/RgvCommand.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/StaProtocol.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MatMapper.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/Mat.java
New file
@@ -0,0 +1,253 @@
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_mat")
public class Mat 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= "")
    @TableField("tag_id")
    private Long tagId;
    @ApiModelProperty(value= "")
    private String matnr;
    @ApiModelProperty(value= "")
    private String maktx;
    @ApiModelProperty(value= "")
    private String name;
    @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;
    @ApiModelProperty(value= "")
    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;
    @ApiModelProperty(value= "")
    @TableField("be_batch")
    private Integer beBatch;
    @ApiModelProperty(value= "")
    @TableField("dead_time")
    private String deadTime;
    @ApiModelProperty(value= "")
    @TableField("dead_warn")
    private Integer deadWarn;
    @ApiModelProperty(value= "")
    private Integer source;
    @ApiModelProperty(value= "")
    private Integer inspect;
    @ApiModelProperty(value= "")
    private Integer danger;
    @ApiModelProperty(value= "")
    private Integer status;
    @ApiModelProperty(value= "")
    @TableField("create_by")
    private Long createBy;
    @ApiModelProperty(value= "")
    @TableField("create_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @ApiModelProperty(value= "")
    @TableField("update_by")
    private Long updateBy;
    @ApiModelProperty(value= "")
    @TableField("update_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @ApiModelProperty(value= "")
    private String memo;
    public Mat() {}
    public Mat(String uuid,Long tagId,String matnr,String maktx,String name,String specs,String model,String color,String brand,String unit,Double price,String sku,Double units,String barcode,String origin,String manu,String manuDate,String itemNum,Double safeQty,Double weight,Double length,Double volume,String threeCode,String supp,String suppCode,Integer beBatch,String deadTime,Integer deadWarn,Integer source,Integer inspect,Integer danger,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.uuid = uuid;
        this.tagId = tagId;
        this.matnr = matnr;
        this.maktx = maktx;
        this.name = name;
        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.status = status;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
    }
//    Mat mat = new Mat(
//            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,    //
//            null,    //
//            null,    //
//            null,    //
//            null,    // [非空]
//            null,    //
//            null,    //
//            null,    //
//            null,    //
//            null    //
//    );
    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);
    }
}
src/main/java/com/zy/asrs/entity/WrkMastSta.java
@@ -125,11 +125,11 @@
    @ApiModelProperty(value= "")
    @TableField("matnr1")
    private Integer matnr1;
    private String matnr1;
    @ApiModelProperty(value= "")
    @TableField("matnr2")
    private Integer matnr2;
    private String matnr2;
    @ApiModelProperty(value= "")
    @TableField("type2")
src/main/java/com/zy/asrs/mapper/MatMapper.java
New file
@@ -0,0 +1,14 @@
package com.zy.asrs.mapper;
import com.zy.asrs.entity.Mat;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.MatnrCode;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface MatMapper extends BaseMapper<Mat> {
    Mat selectByCode(String matnr);
}
src/main/java/com/zy/asrs/service/MatService.java
New file
@@ -0,0 +1,10 @@
package com.zy.asrs.service;
import com.zy.asrs.entity.Mat;
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.MatnrCode;
public interface MatService extends IService<Mat> {
    Mat selectByCode(String code);
}
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -96,6 +96,8 @@
    private MatnrCodeService matnrCodeService;
    @Autowired
    private WaitPakinService waitPakinService;
    @Autowired
    private MatService matService;
    @Value("${wms.url}")
    private String wmsUrl;
@@ -2775,8 +2777,8 @@
                short sta1 = 0;
                short souSta2 = 0;
                short sta2 = 0;
                Integer matnr = 0;
                Integer matnr2 = 0;
                String matnr = "0";
                String matnr2 = "0";
                String batch = "";
                String batch2 = "";
                short type = 0;
@@ -3612,7 +3614,7 @@
                    WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N"));
                    if (Cools.isEmpty(waitPakin)) {
                        try {
                            CreateComb(barcode, staProtocol.getMatnr(),staProtocol.getWorkNo().intValue(),staProtocol.getBatch(),inSta);
                            CreateComb(barcode, staProtocol.getMatnr().toString(),staProtocol.getWorkNo().intValue(),staProtocol.getBatch(),inSta);
                        }catch (IOException e) {
                            throw new CoolException(e);
                        }
@@ -3683,7 +3685,7 @@
    }
    public void CreateComb(String barcode,Integer code,Integer wrkNo,String batch,DevpSlave.Sta inSta) throws IOException {
    public void CreateComb(String barcode,String code,Integer wrkNo,String batch,DevpSlave.Sta inSta) throws IOException {
        Double anfme = 0d;
        Double weight = 0d;
        String memo = "";
@@ -3692,7 +3694,7 @@
        if (Cools.isEmpty(wrkMastSta)){
            wrkMastSta = wrkMastStaService.selectOne(new EntityWrapper<WrkMastSta>().eq("wrk_no2", wrkNo));
            if (Cools.isEmpty(wrkMastSta)){
                if (code >0 && !Cools.isEmpty(batch)){
                if (!Cools.isEmpty(batch)){
                    anfme = 1d;
                }else {
                    throw new  CoolException("未找到对应的任务信息");
@@ -3711,15 +3713,17 @@
            weight = wrkMastSta.getWeight();
            memo = wrkMastSta.getMemo();
        }
        MatnrCode matnrCode = matnrCodeService.selectByCode(code);
        if (Cools.isEmpty(matnrCode)){
        ////
//        MatnrCode matnrCode = matnrCodeService.selectByCode(code);
        Mat mat = matService.selectByCode(code);
        if (Cools.isEmpty(mat)){
            throw new  CoolException("未找到对应的物料信息");
        }
        CombParam combParam = new CombParam();
        ArrayList<CombParam.CombMat> combMats = new ArrayList<>();
        CombParam.CombMat combMat = new CombParam.CombMat();
        combParam.setBarcode(barcode);
        combMat.setMatnr(matnrCode.getMatnr());
        combMat.setMatnr(mat.getMatnr());
        combMat.setBatch(batch);
        combMat.setAnfme(anfme);
        combMat.setWeight(weight);
src/main/java/com/zy/asrs/service/impl/MatServiceImpl.java
New file
@@ -0,0 +1,17 @@
package com.zy.asrs.service.impl;
import com.zy.asrs.entity.MatnrCode;
import com.zy.asrs.mapper.MatMapper;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.service.MatService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service("matService")
public class MatServiceImpl extends ServiceImpl<MatMapper, Mat> implements MatService {
    @Override
    public Mat selectByCode(String code) {
        return this.baseMapper.selectByCode(code);
    }
}
src/main/java/com/zy/core/model/command/RgvCommand.java
@@ -53,9 +53,9 @@
    @JSONField(serialize = false)
    private RgvTaskModeType taskModeType;
    private Integer matnr;
    private String matnr;
    private Integer matnr2;
    private String matnr2;
    private Short type;
    private  Short type2;
src/main/java/com/zy/core/model/protocol/StaProtocol.java
@@ -25,7 +25,7 @@
    // ----------------------------------------------------------------
    // 物料代码
    private Integer matnr;
    private String matnr;
    private String batch;
    private Double anfme;
    private Double anfme2;
src/main/resources/mapper/MatMapper.xml
New file
@@ -0,0 +1,53 @@
<?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.MatMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.Mat">
        <id column="id" property="id" />
        <result column="uuid" property="uuid" />
        <result column="tag_id" property="tagId" />
        <result column="matnr" property="matnr" />
        <result column="maktx" property="maktx" />
        <result column="name" property="name" />
        <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="status" property="status" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="memo" property="memo" />
    </resultMap>
    <select id="selectByCode" resultMap="BaseResultMap">
        select * from man_mat
        where matnr = #{matnr}
    </select>
</mapper>