whycxzp
2022-08-26 9f6446d5af8baedd9f6ac42ebd1b8b4efe771c61
更新
2个文件已修改
23 ■■■■■ 已修改文件
src/main/java/com/whyc/service/WorksheetMainService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WorksheetMainMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/WorksheetMainService.java
@@ -646,7 +646,10 @@
         //判断是哪种类型的审批,返回不同的类型 具体数据
        Integer type = getInfoById(id).getType();
        if(type.intValue() == EnumWorksheetType.ProductBom.getType()) {
            return mainMapper.getLinkList(id);
            WorksheetMain main = mainMapper.getLinkList(id);
            List<ProductBomApproving> pbaList = approvingService.getList(main.getProductApproving().getId());
            main.getProductApproving().setBomApprovingList(pbaList);
            return main;
        }else if(type.intValue() == EnumWorksheetType.Material.getType()){
            return mainMapper.getLinkListWithMaterials(id);
        }else{ //物料-产品
src/main/resources/mapper/WorksheetMainMapper.xml
@@ -34,8 +34,14 @@
        </collection>
    </resultMap>
    <resultMap id="Map_WorksheetMain2" type="WorksheetMain" extends="Map_WorksheetMain">
        <collection property="productApproving" ofType="ProductBomApproving">
        <association property="productApproving" javaType="ProductApproving">
            <id column="id" property="id"/>
            <result column="parent_code" property="parentCode"/>
            <result column="parent_name" property="parentName"/>
            <result column="parent_model" property="parentModel"/>
            <result column="notes" property="notes"/>
            <result column="custom_code" property="customCode"/>
            <!--<result column="parent_code" property="parentCode"/>
            <result column="parent_name" property="parentName"/>
            <result column="parent_model" property="parentModel"/>
            <result column="type" property="type"/>
@@ -53,10 +59,10 @@
            <result column="picture_url" property="pictureUrl"/>
            <result column="file_url" property="fileUrl"/>
            <result column="dwg_url" property="dwgUrl"/>
            <result column="create_date" property="createDate"/>
            <result column="create_date" property="createDate"/>-->
            <!--<result column="update_date" property="updateDate"/>
            <result column="parent_version" property="parentVersion"/>-->
        </collection>
        </association>
    </resultMap>
    <resultMap id="Map_WorksheetMain3" type="WorksheetMain" extends="Map_WorksheetMain">
        <collection property="mApprovingList" ofType="MaterialApproving">
@@ -115,14 +121,14 @@
    <select id="getLinkList" resultMap="Map_WorksheetMain2">
        SELECT
            m.id mid,m.title,m.description,m.file,m.create_user_id,m.begin_time,m.end_time,m.level,m.status,m.end_reason,m.type mType,
            l.id lid,l.parent_id,deal_user_id,deal_type,deal_desc,deal_reason,link_file,link_status,enable_archive,create_time,deal_time,
            b.*
            l.id lid,l.parent_id,deal_user_id,deal_type,deal_desc,deal_reason,link_file,link_status,enable_archive,l.create_time,deal_time,
            pa.id,pa.parent_code,pa.parent_name,pa.parent_model,pa.notes,pa.custom_code
        FROM
            tb_worksheet_main m
        LEFT JOIN
            tb_worksheet_link l ON m.id = l.main_id
        LEFT JOIN
            tb_product_bom_approving b ON m.id = b.main_id
            tb_product_approving pa ON m.id = pa.main_id
        WHERE
        m.id = #{id}
    </select>