瀏覽代碼

辊类型优化

DLC 6 月之前
父節點
當前提交
18c38b1288

+ 2 - 2
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsProcessOperationDao.java

@@ -111,7 +111,7 @@ public interface ApsProcessOperationDao extends BaseMapper<ApsProcessOperationDo
             "left join aps_process_operation o on e.MAINID=o.ID\n" +
             "set e.ROLLERID=#{rollerid},e.ROLLERTYPE=#{rollertype}\n" +
             "where e.DELETED='0' and o.BLANKID=#{blanckid} and IFNULL(o.LEVEL,'')>${level} \n" +
-            "\tand e.RESOURCEID=#{resourceid} and IFNULL(e.ROLLERID,#{option})=#{option}")
-    void updateZJProcessEqu(@Param("blanckid") String blanckid, @Param("resourceid") String resourceid, @Param("option") String option, @Param("rollerid") String rollerid, @Param("rollertype") String rollertype, @Param("level") String level);
+            "\tand e.RESOURCEID=#{resourceid} ${levelStr}")
+    void updateZJProcessEqu(@Param("blanckid") String blanckid, @Param("resourceid") String resourceid, @Param("levelStr") String levelStr, @Param("rollerid") String rollerid, @Param("rollertype") String rollertype, @Param("level") String level);
 
 }

+ 5 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationServiceImpl.java

@@ -1452,7 +1452,11 @@ public class ApsProcessOperationServiceImpl extends ServiceImpl<ApsProcessOperat
             List<ApsProcessOperationOutMaterDo> processOperationOutMaterDoList = apsProcessOperationOutMaterService.listByMap(map).stream().collect(Collectors.toList());
             if (changeZJEquDoList != null && changeZJEquDoList.size() > 0) {
                 for (ApsProcessOperationEquDo zjequ : changeZJEquDoList) {
-                    apsProcessOperationDao.updateZJProcessEqu(params.getBlankid(), zjequ.getResourceid(), zjequ.getRoption() == null ? "" : zjequ.getRoption(), zjequ.getRollerid(), zjequ.getRollertype(), params.getLevel());
+                    String levelStr = "";
+                    if (!zjequ.getRemark().equals("add")) {
+                        levelStr = String.format(" and IFNULL(e.ROLLERID,‘%s’)='%s'", zjequ.getRoption() == null ? "" : zjequ.getRoption());
+                    }
+                    apsProcessOperationDao.updateZJProcessEqu(params.getBlankid(), zjequ.getResourceid(), levelStr, zjequ.getRollerid(), zjequ.getRollertype(), params.getLevel());
                 }
             }