lxw
2022-09-02 54ddd9e7502bc090ffea51ef19cd30308390b4ba
修改产品
4个文件已修改
85 ■■■■■ 已修改文件
src/main/java/com/whyc/pojo/ProductBom.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/ProductBomService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetLinkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/ProductBom.java
@@ -24,46 +24,71 @@
    private Integer materialId;
    @ApiModelProperty("bom最新版本号,同时也是生效版本号(不存在小版本手动启用)")
    private Integer subVersion;
    @ApiModelProperty("结构件类型")
    @TableField(exist = false)
    private String type;
    @ApiModelProperty("类别")
    @TableField(exist = false)
    private String     category;
    @ApiModelProperty("子件编码")
    @TableField(exist = false)
    private String     subCode;
    @ApiModelProperty("子件名称")
    @TableField(exist = false)
    private String     subName;
    @ApiModelProperty("子件型号")
    @TableField(exist = false)
    private String     subModel;
    @ApiModelProperty("单位")
    @TableField(exist = false)
    private String     unit;
    @ApiModelProperty("子件数量")
    @TableField(exist = false)
    private Integer   quantity;
    @ApiModelProperty("生产商")
    @TableField(exist = false)
    private String     producer;
    @ApiModelProperty("封装类型/材质")
    @TableField(exist = false)
    private String     material;
    @ApiModelProperty("元件编号/料厚")
    @TableField(exist = false)
    private String     thickness;
    @ApiModelProperty("表面处理/物料详情")
    @TableField(exist = false)
    private String     surfaceDetail;
    @ApiModelProperty("备注")
    @TableField(exist = false)
    private String     notes;
    @TableField(exist = false)
    private String     pictureUrl;
    @TableField(exist = false)
    private String     fileUrl;
    @ApiModelProperty("上传人")
    private Long     upUserId;
    @ApiModelProperty("上传人名")
    @TableField(exist = false)
    private String     upUser;
    private Date    createDate;
    @ApiModelProperty("版本")
    @ApiModelProperty("产品版本")
    @TableField(exist = false)
    private Integer   version;
    @ApiModelProperty("工程图纸url")
    @TableField(exist = false)
    private String dwgUrl;
    @TableField(exist = false)
    private String     pictureUrl;
    @TableField(exist = false)
    private String     fileUrl;
    @TableField(exist = false)
    private Integer dwgExist;
@@ -208,13 +233,6 @@
        this.fileUrl = fileUrl;
    }
    public Long getUpUserId() {
        return upUserId;
    }
    public void setUpUserId(Long upUserId) {
        this.upUserId = upUserId;
    }
    public Date getCreateDate() {
        return createDate;
@@ -240,13 +258,6 @@
        this.dwgUrl = dwgUrl;
    }
    public String getUpUser() {
        return upUser;
    }
    public void setUpUser(String upUser) {
        this.upUser = upUser;
    }
    public List<Material> getMaterials() {
        return materials;
src/main/java/com/whyc/service/ProductBomService.java
@@ -118,7 +118,7 @@
            newBom.setThickness(newBomHis.getThickness());
            newBom.setType(newBomHis.getType());
            newBom.setUnit(newBomHis.getUnit());
            newBom.setUpUserId(newBomHis.getUpUserId());
            //newBom.setUpUserId(newBomHis.getUpUserId());
            //newBom.setVersion(newBomHis.getEVersion());
            newBomList.add(newBom);
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -322,7 +322,7 @@
                    bom.setThickness(approving.getThickness());
                    bom.setType(approving.getType());
                    bom.setUnit(approving.getUnit());
                    bom.setUpUserId(approving.getUpUserId());
                    //bom.setUpUserId(approving.getUpUserId());
                    bom.setVersion(nextVersion);
                    bomHistory.setProductId(productHistory.getId());
src/main/resources/mapper/ProductBomMapper.xml
@@ -115,6 +115,10 @@
    </select>
    <resultMap id="MaterialList" type="productBom">
        <id property="id" column="id"></id>
        <result property="productId" column="product_id"></result>
        <result property="materialId" column="material_id"></result>
        <result property="subVersion" column="sub_version"></result>
        <result property="version" column="version"></result>
        <result property="type" column="type"></result>
        <result property="category" column="category"></result>
        <result property="subCode" column="sub_code"></result>
@@ -126,29 +130,25 @@
        <result property="material" column="material"></result>
        <result property="thickness" column="thickness"></result>
        <result property="surfaceDetail" column="surface_detail"></result>
        <result property="notes" column="notes"></result>
        <result property="pictureUrl" column="picture_url"></result>
        <result property="fileUrl" column="file_url"></result>
        <result property="upUserId" column="up_user_id"></result>
        <result property="createDate" column="create_date"></result>
        <result property="version" column="version"></result>
        <result property="notes" column="notes"></result>
        <result property="dwgUrl" column="dwg_url"></result>
        <result property="fileUrl" column="file_url"></result>
        <result property="pictureUrl" column="picture_url"></result>
        <result property="parentCode" column="parent_code"></result>
        <result property="customCode" column="custom_code"></result>
        <collection property="materials" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Material" column="{parentCode=parent_code,customCode=custom_code,subCode=sub_code,version=version}" select="selectMaterial">
        <collection property="materials" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Material" column="{parentCode=parent_code,customCode=custom_code,materialId=material_id,version=version}" select="selectMaterial">
        </collection>
    </resultMap>
    <select id="getBomAndMaterial" resultMap="MaterialList" parameterType="java.lang.Integer">
        select distinct tb_product_bom.*
                      ,tb_product.parent_code,tb_product.custom_code
                      ,tb_Material.dwg_url,tb_Material.file_url,tb_Material.picture_url
                      ,tb_product.parent_code,tb_product.custom_code,tb_product.version
                      ,tb_Material.*
        from  db_doc.tb_product_bom,db_doc.tb_product,tb_Material
        where
            tb_product_bom.product_id = tb_product.id
            and
            tb_product_bom.version = tb_product.version
            and
            tb_Material.sub_code = tb_product_bom.sub_code
            tb_Material.id = tb_product_bom.material_id
            and
            tb_product.id = #{productId}
            and
@@ -160,7 +160,7 @@
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.parent_code=#{parentCode}
        and tb_material_product_history.custom_code=#{customCode}
        and tb_material_product_history.sub_code=#{subCode}
        and tb_material_product_history.sub_material_id=#{materialId}
        and tb_material_product_history.s_version&lt;=#{version}
        and tb_material_product_history.e_version>=#{version}
    </select>