Просмотр исходного кода

[bug-4296]体系运行记录-修改表单保存后事务说明没有改变

gaozl 11 месяцев назад
Родитель
Сommit
ee136ce442

+ 48 - 48
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/quartz/job/SaticScheduleTask.java

@@ -1,48 +1,48 @@
-package com.lc.ibps.components.quartz.job;
-
-import com.lc.ibps.base.db.util.TableMetaUtil;
-import com.lc.ibps.sysdata.services.impl.CronNotifyServiceImpl;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @title: ncq
- * 定时任务执行
- * @date 2020/12/1515:54
- */
-
-@Component
-@Async
-public class SaticScheduleTask {
-
-    private String sql = "UPDATE " +
-            "  t_dsrw c " +
-            "  JOIN " +
-            "    (SELECT " +
-            "      id_ " +
-            "    FROM" +
-            "      t_dsrw a " +
-            "    WHERE a.ding_shi_ren_wu_l in('订单提醒','付款提醒','逾期提醒','报告提醒','定时任务提醒') and a.ren_wu_zhuang_tai = '未结束' " +
-            "      AND NOW() > a.ren_wu_shi_jian_ " +
-            "      AND (" +
-            "        a.shi_fou_chong_fu_ != '是' " +
-            "        OR a.shi_fou_chong_fu_ IS NULL" +
-            "      )) b " +
-            "    ON c.id_ = b.id_ SET ren_wu_zhuang_tai = '已完成' ";
-
-    @Scheduled(cron = " 0 0 2 * * ?")
-    public void configureTasks() {
-        JdbcTemplate jdbcTemplate = TableMetaUtil.getJdbcTemplateByDsAlias("dataSource_default");
-        //暂时处理:提醒需等待处理完成才关闭
-        int[] a = jdbcTemplate.batchUpdate(sql);//客户交往记录
-        System.out.println("update result:"+a);
-    }
-
-
-}
+//package com.lc.ibps.components.quartz.job;
+//
+//import com.lc.ibps.base.db.util.TableMetaUtil;
+//import com.lc.ibps.sysdata.services.impl.CronNotifyServiceImpl;
+//import org.springframework.jdbc.core.JdbcTemplate;
+//import org.springframework.scheduling.annotation.Async;
+//import org.springframework.scheduling.annotation.Scheduled;
+//import org.springframework.stereotype.Component;
+//
+//import javax.annotation.Resource;
+//import java.util.List;
+//import java.util.Map;
+//
+///**
+// * @title: ncq
+// * 定时任务执行
+// * @date 2020/12/1515:54
+// */
+//
+//@Component
+//@Async
+//public class SaticScheduleTask {
+//
+//    private String sql = "UPDATE " +
+//            "  t_dsrw c " +
+//            "  JOIN " +
+//            "    (SELECT " +
+//            "      id_ " +
+//            "    FROM" +
+//            "      t_dsrw a " +
+//            "    WHERE a.ding_shi_ren_wu_l in('订单提醒','付款提醒','逾期提醒','报告提醒','定时任务提醒') and a.ren_wu_zhuang_tai = '未结束' " +
+//            "      AND NOW() > a.ren_wu_shi_jian_ " +
+//            "      AND (" +
+//            "        a.shi_fou_chong_fu_ != '是' " +
+//            "        OR a.shi_fou_chong_fu_ IS NULL" +
+//            "      )) b " +
+//            "    ON c.id_ = b.id_ SET ren_wu_zhuang_tai = '已完成' ";
+//
+//    @Scheduled(cron = " 0 0 2 * * ?")
+//    public void configureTasks() {
+//        JdbcTemplate jdbcTemplate = TableMetaUtil.getJdbcTemplateByDsAlias("dataSource_default");
+//        //暂时处理:提醒需等待处理完成才关闭
+//        int[] a = jdbcTemplate.batchUpdate(sql);//客户交往记录
+//        System.out.println("update result:"+a);
+//    }
+//
+//
+//}

+ 4 - 0
ibps-provider-root/modules/provider-form/pom.xml

@@ -145,6 +145,10 @@
 			<groupId>javax</groupId>
 			<artifactId>javaee-api</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>com.lc.ibps.bpmn</groupId>
+			<artifactId>ibps-bpmn-biz</artifactId>
+		</dependency>
 		
 		<dependency>
 			<groupId>org.springframework.boot</groupId>

+ 28 - 4
ibps-provider-root/modules/provider-form/src/main/java/com/lc/ibps/form/provider/DataTemplateProvider.java

@@ -14,14 +14,19 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
-import com.lc.ibps.base.framework.table.ICommonDao;
+import com.lc.ibps.bpmn.api.cmd.ProcInstCmd;
+import com.lc.ibps.bpmn.api.define.IBpmDefineReader;
+import com.lc.ibps.bpmn.api.model.define.IBpmProcDefine;
+import com.lc.ibps.bpmn.api.model.define.IBpmProcExtendDefine;
 import com.lc.ibps.bpmn.api.service.BpmProcInstService;
+import com.lc.ibps.bpmn.domain.BpmInstHis;
+import com.lc.ibps.bpmn.persistence.entity.BpmInstHisPo;
+import com.lc.ibps.bpmn.repository.BpmInstHisRepository;
+import com.lc.ibps.bpmn.repository.BpmInstRepository;
 import com.lc.ibps.components.poi.excel.entity.enmus.ExcelType;
 import com.lc.ibps.components.poi.excel.export.styler.ExcelExportStylerColorImpl;
-import com.lc.ibps.components.poi.excel.export.styler.ExcelExportStylerDefaultImpl;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.slf4j.event.Level;
@@ -145,7 +150,13 @@ public class DataTemplateProvider extends GenericProvider implements IDataTempla
 	private BoInstanceTxService boInstanceTxService;
 
 	@Resource
-	private ICommonDao<?> commonDao;
+	private BpmInstRepository bpmInstRepository;
+
+	@Resource
+	private BpmInstHisRepository bpmInstHisRepository;
+
+	@Resource
+	private IBpmDefineReader bpmDefineReader;
 
 	@ApiOperation(value = "数据模版列表(分页条件查询)数据", notes = "数据模版列表(分页条件查询)数据")
 	@Override
@@ -1536,6 +1547,19 @@ public class DataTemplateProvider extends GenericProvider implements IDataTempla
 
 			// 保存数据
 			BoResultVo resultVo = boInstanceService.save(saveType, dataObject);
+			BpmInstHisPo bpmInstHisPo = bpmInstHisRepository.getByBizKey(dataTemplateRequestVo.getPk());
+			if (BeanUtils.isNotEmpty(bpmInstHisPo)){
+				IBpmProcDefine<IBpmProcExtendDefine> processDef = bpmDefineReader.getBpmProcDefine(bpmInstHisPo.getProcDefId());
+				ProcInstCmd procInstCmd = null;
+				procInstCmd.setCurUserName(ContextUtil.getCurrentUserId());
+				procInstCmd.setBusinessKey(dataTemplateRequestVo.getPk());
+				procInstCmd.setBusData(dataTemplateRequestVo.getData());
+				String subject = bpmInstRepository.getSubject(processDef,procInstCmd,null);
+				BpmInstHis instHis = bpmInstHisRepository.newInstance();
+				bpmInstHisPo.setSubject(subject);
+				instHis.save(bpmInstHisPo);
+			}
+
 			result.addVariable("id", resultVo.getResultId());
 			result.setMessage(I18nUtil.getMessage("com.lc.ibps.form.provider.DataTemplateProvider.saveFormDataVo"));
 		} catch (Exception e) {