|
|
@@ -10,6 +10,7 @@ import com.lc.ibps.base.saas.token.ITenantTokenService;
|
|
|
import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
import com.lc.ibps.bpmn.api.IBpmInstService;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.cloud.message.util.MessageQueueProductorUtil;
|
|
|
import com.lc.ibps.org.party.persistence.dao.PartyUserCalendarDao;
|
|
|
import com.lc.ibps.org.party.persistence.entity.PartyUserCalendarPo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -22,6 +23,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.format.DateTimeParseException;
|
|
|
import java.util.*;
|
|
|
|
|
|
public class EquipmentMaintenancePlanJob extends AbstractJob {
|
|
|
@@ -165,10 +167,10 @@ public class EquipmentMaintenancePlanJob extends AbstractJob {
|
|
|
// 1917 设备检定校准改进
|
|
|
// insertRecordsFromTemplate("sbjdjzjl");
|
|
|
|
|
|
- // 2025-03-31 修改 不再新增校准记录,用计划记录开流程
|
|
|
+ // 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_ <= DATE_ADD(CURDATE(), INTERVAL 30 DAY) " +
|
|
|
- "AND a.ji_hua_ri_qi_ >= CURRENT_DATE AND a.shi_fou_guo_shen_='待处理'";
|
|
|
+ "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_='待处理''";
|
|
|
commonDao.execute(sql);
|
|
|
|
|
|
// 检定/校准计划与实施记录表_子表
|
|
|
@@ -239,11 +241,9 @@ 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_<=DATE_ADD(CURDATE(), INTERVAL 30 DAY) " +
|
|
|
- "and a.ji_hua_ri_qi_>=CURRENT_DATE and a.shi_fou_guo_shen_='待处理' ";
|
|
|
+ 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_='待处理' ";
|
|
|
fetchSql = String.format(fetchSql,tableName);
|
|
|
List<Map<String, Object>> list = (List<Map<String, Object>>) commonDao.query(fetchSql);
|
|
|
if (BeanUtils.isEmpty(list)) return;
|