Parcourir la source

aps-匹配技术要求需求增加优化

sucheng il y a 9 mois
Parent
commit
d6ed8ec3f2

+ 3 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsProductDetailDao.java

@@ -66,7 +66,7 @@ public interface ApsProductDetailDao extends BaseMapper<ApsProductDetailDo> {
 
     List<GetOldTechnicalRequirementRes> selectMyList(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("alloy") String alloy, @Param("alloystatus") String alloystatus, @Param("orderProductTypeId") String orderProductTypeId);
 
-    List<GetOldTechnicalRequirementRes> selectMyList1(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("alloy") String alloy);
-    List<GetOldTechnicalRequirementRes> selectMyList2(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("alloystatus") String alloystatus);
-    List<GetOldTechnicalRequirementRes> selectMyList3(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("orderProductTypeId") String orderProductTypeId);
+    List<GetOldTechnicalRequirementRes> selectMyList1(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("customId") String customId, @Param("alloy") String alloy);
+    List<GetOldTechnicalRequirementRes> selectMyList2(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("customId") String customId, @Param("alloystatus") String alloystatus);
+    List<GetOldTechnicalRequirementRes> selectMyList3(@Param("technicalRequirementId") String technicalRequirementId, @Param("id") String id, @Param("customId") String customId, @Param("orderProductTypeId") String orderProductTypeId);
 }

+ 7 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductDetailServiceImpl.java

@@ -622,13 +622,17 @@ public class ApsProductDetailServiceImpl extends ServiceImpl<ApsProductDetailDao
         if (ObjectUtil.isEmpty(orderDetail)) {
             return R.error("产品明细不能为空");
         }
+        String customId = req.getCustomId();
+        if (ObjectUtil.isEmpty(customId)) {
+            return R.error("客户ID不能为空");
+        }
         String alloy = orderDetail.getAlloy();
         String alloystatus = orderDetail.getAlloystatus();
 
 //        List<GetOldTechnicalRequirementRes> apsProductDetailDoList = this.baseMapper.selectMyList(technicalRequirementId, orderDetail.getId(), alloy, alloystatus, orderProductTypeId);
-        List<GetOldTechnicalRequirementRes> list1 = this.baseMapper.selectMyList1(technicalRequirementId, orderDetail.getId(), alloy);
-        List<GetOldTechnicalRequirementRes> list2 = this.baseMapper.selectMyList2(technicalRequirementId, orderDetail.getId(), alloystatus);
-        List<GetOldTechnicalRequirementRes> list3 = this.baseMapper.selectMyList3(technicalRequirementId, orderDetail.getId(), orderProductTypeId);
+        List<GetOldTechnicalRequirementRes> list1 = this.baseMapper.selectMyList1(technicalRequirementId, orderDetail.getId(),customId, alloy);
+        List<GetOldTechnicalRequirementRes> list2 = this.baseMapper.selectMyList2(technicalRequirementId, orderDetail.getId(),customId, alloystatus);
+        List<GetOldTechnicalRequirementRes> list3 = this.baseMapper.selectMyList3(technicalRequirementId, orderDetail.getId(),customId, orderProductTypeId);
 
         //合并三个list
         List<GetOldTechnicalRequirementRes> apsProductDetailDoList = new LinkedList<>();

+ 17 - 10
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProductDetailDao.xml

@@ -166,15 +166,18 @@
             apd.PRODUCTTYPEID AS 'producttypeid',
             apd.PRODUCTTYPE AS 'producttype',
             aptr.*
-        from aps_product_detail apd
-                 LEFT JOIN aps_production_technical_requirement aptr
-                           ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
-        where apd.DELETED = 0
+        from
+            aps_production_order apo
+                LEFT JOIN aps_product_detail apd ON apo.ID = apd.MAINID
+                LEFT JOIN aps_production_technical_requirement aptr ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
+        where apo.DELETED = 0
+          AND apd.DELETED = 0
           AND aptr.DELETED = 0
           AND apd.ID != #{id}
           AND aptr.ID != #{technicalRequirementId}
           AND aptr.ID is not null
           AND apd.ALLOY = #{alloy}
+          AND apo.CUSTOMID = #{customId}
     </select>
     <select id="selectMyList2" resultType="com.rongwei.bsentity.vo.GetOldTechnicalRequirementRes">
         select
@@ -184,15 +187,17 @@
             apd.PRODUCTTYPEID AS 'producttypeid',
             apd.PRODUCTTYPE AS 'producttype',
             aptr.*
-        from aps_product_detail apd
-                 LEFT JOIN aps_production_technical_requirement aptr
-                           ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
+        from
+            aps_production_order apo
+                LEFT JOIN aps_product_detail apd ON apo.ID = apd.MAINID
+                LEFT JOIN aps_production_technical_requirement aptr ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
         where apd.DELETED = 0
           AND aptr.DELETED = 0
           AND apd.ID != #{id}
           AND aptr.ID != #{technicalRequirementId}
           AND aptr.ID is not null
           AND apd.ALLOYSTATUS = #{alloystatus}
+          AND apo.CUSTOMID = #{customId}
     </select>
     <select id="selectMyList3" resultType="com.rongwei.bsentity.vo.GetOldTechnicalRequirementRes">
         select
@@ -202,14 +207,16 @@
             apd.PRODUCTTYPEID AS 'producttypeid',
             apd.PRODUCTTYPE AS 'producttype',
             aptr.*
-        from aps_product_detail apd
-                 LEFT JOIN aps_production_technical_requirement aptr
-                           ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
+        from
+            aps_production_order apo
+                LEFT JOIN aps_product_detail apd ON apo.ID = apd.MAINID
+                LEFT JOIN aps_production_technical_requirement aptr ON  FIND_IN_SET(apd.ID,aptr.ORDERDETAILIDS)
         where apd.DELETED = 0
           AND aptr.DELETED = 0
           AND apd.ID != #{id}
           AND aptr.ID != #{technicalRequirementId}
           AND aptr.ID is not null
           AND aptr.ORDERPRODUCTTYPEID = #{orderProductTypeId}
+          AND apo.CUSTOMID = #{customId}
     </select>
 </mapper>

+ 3 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/GetOldTechnicalRequirementReq.java

@@ -17,4 +17,7 @@ public class GetOldTechnicalRequirementReq {
 
     //产品明细详情
     private ApsProductDetailDo orderDetail;
+
+    //客户ID
+    private String customId;
 }