lxw
2022-09-02 da389ae6f76dfd03550187e402603fd2b41ff8de
下载
3个文件已修改
69 ■■■■■ 已修改文件
src/main/java/com/whyc/pojo/ProductBomHistory.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetLinkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomHistoryMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/ProductBomHistory.java
@@ -24,43 +24,71 @@
    private Integer subSVersion;
    @ApiModelProperty("bom终止版本")
    private Integer subEVersion;
    @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;
    private Date    createDate;
    @TableField(exist = false)
    @ApiModelProperty("版本号")
    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)
    @ApiModelProperty(value = "关联的物料集合")
@@ -194,14 +222,6 @@
    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }
    public Long getUpUserId() {
        return upUserId;
    }
    public void setUpUserId(Long upUserId) {
        this.upUserId = upUserId;
    }
    public Date getCreateDate() {
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -342,7 +342,7 @@
                    bomHistory.setThickness(approving.getThickness());
                    bomHistory.setType(approving.getType());
                    bomHistory.setUnit(approving.getUnit());
                    bomHistory.setUpUserId(approving.getUpUserId());
                    //bomHistory.setUpUserId(approving.getUpUserId());
                    bomHistory.setVersion(nextVersion);
                    productBomHistoryList.add(bomHistory);
src/main/resources/mapper/ProductBomHistoryMapper.xml
@@ -18,7 +18,6 @@
        <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="dwgUrl" column="dwg_url"></result>
@@ -34,6 +33,11 @@
    <resultMap id="BomHistoryList" type="productBomHistory">
        <id property="id" column="id"></id>
        <result property="productId" column="product_id"></result>
        <result property="materialId" column="material_id"></result>
        <result property="subSVersion" column="sub_s_version"></result>
        <result property="subEVersion" column="sub_e_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>
@@ -48,25 +52,26 @@
        <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="dwgUrl" column="dwg_url"></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="getBomHistoryAndMaterial" resultMap="BomHistoryList">
        select distinct tb_product_bom_history.*
        ,tb_product_history.parent_model
        ,tb_product_history.version
        ,tb_product_history.parent_code,tb_product_history.custom_code
        ,tb_Material.dwg_url,tb_Material.file_url,tb_Material.picture_url
        ,tb_Material.*
        from  db_doc.tb_product_bom_history,db_doc.tb_product_history,tb_Material
        where
        tb_product_bom_history.product_id = tb_product_history.id
        and
        tb_product_bom_history.version = tb_product_history.version
        tb_product_bom_history.sub_s_version &lt;= tb_product_history.version
        and
        tb_Material.sub_code = tb_product_bom_history.sub_code
        tb_product_bom_history.sub_e_version >= tb_product_history.version
        and
        tb_Material.id = tb_product_bom_history.material_id
        and
        tb_product_history.id = #{productId}
        and
@@ -78,7 +83,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>