Ver código fonte

Merge remote-tracking branch 'origin/matser' into matser

wy 6 meses atrás
pai
commit
87d3ced53b

+ 10 - 3
ibps-provider-root/modules/provider-platform/src/main/java/com/lc/ibps/platform/plan/job/EquipmentMaintenancePlanJob.java

@@ -352,7 +352,8 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
         // 2025-04-10 修改  不再新增校准记录,用计划记录开流程
         String sql = "UPDATE t_mjsbjdxzjhzb a JOIN t_mjsbjdxzjh b ON a.parent_id_ = b.id_ SET a.marks_ = 'record' " +
                 "WHERE b.shi_fou_guo_shen_ = '已完成' and a.ji_hua_ri_qi_<>'' and a.ji_hua_ri_qi_ is not null " +
-                "AND a.ji_hua_ri_qi_ <= DATE_ADD(CURDATE(), INTERVAL 30 DAY) AND a.ji_hua_ri_qi_>= CURRENT_DATE AND a.shi_fou_guo_shen_='待处理'";
+                "AND a.ji_hua_ri_qi_ <= DATE_ADD(CURDATE(), INTERVAL 30 DAY) AND a.ji_hua_ri_qi_>= CURRENT_DATE AND a.shi_fou_guo_shen_='待处理' " +
+                "AND (a.dsrw_ is null or a.dsrw_ ='') ";
         commonDao.execute(sql);
 
         // 检定/校准计划与实施记录表_子表
@@ -533,7 +534,8 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
     protected void startWorkflow(String tableName, String formKey, String defKey) {
         String fetchSql = "SELECT a.id_ id_ FROM t_mjsbjdxzjhzb a inner join t_mjsbjdxzjh b on a.parent_id_=b.id_ " +
                 "where b.shi_fou_guo_shen_='已完成' and a.marks_ = 'record' and a.ji_hua_ri_qi_<>'' and a.ji_hua_ri_qi_ is not null " +
-                " and a.ji_hua_ri_qi_<=DATE_ADD(CURDATE(),INTERVAL 30 DAY) and a.ji_hua_ri_qi_>=CURRENT_DATE and a.shi_fou_guo_shen_='待处理' ";
+                " and a.ji_hua_ri_qi_<=DATE_ADD(CURDATE(),INTERVAL 30 DAY) and a.ji_hua_ri_qi_>=CURRENT_DATE and a.shi_fou_guo_shen_='待处理' " +
+                " AND (a.dsrw_ is null or a.dsrw_ ='') ";
         fetchSql = String.format(fetchSql,tableName);
         List<Map<String, Object>> list = (List<Map<String, Object>>) commonDao.query(fetchSql);
         if (BeanUtils.isEmpty(list)) return;
@@ -545,7 +547,12 @@ public class EquipmentMaintenancePlanJob  extends AbstractJob {
         }
         for (Map<String, Object> objectMap : list) {
             APIResult<String> result = bpmInstService.startFlowFromList(new String[]{(String) objectMap.get("id_")}, formKey, defKey);
-            result.getState();
+            int state = result.getState();
+            if("200".equals(String.valueOf(state))){
+                //已经推送过流程的数据防止重复推送,dsrw_=1 表示数据是t_dsrw推送的数据
+                String sql = "UPDATE t_mjsbjdxzjhzb SET dsrw_ = '2' where id_= '"+(String) objectMap.get("id_")+"' ";
+                commonDao.execute(sql);
+            }
         }
     }