|
@@ -350,18 +350,18 @@ public class ActBusinessController {
|
|
|
// }
|
|
|
|
|
|
TbTableInfoPractice tbTableInfoPractice = tbTableInfoPracticeService.getById(actBusiness.getTableId());
|
|
|
- if (tbTableInfoPractice == null){
|
|
|
- sbErro.append(actBusiness.getTitle()+"practice表获取失败,请联系管理员;");
|
|
|
- continue;
|
|
|
- }
|
|
|
- // 删除关联业务表
|
|
|
- if (oConvertUtils.getString(tbTableInfoPractice.getRouteName()).indexOf("外部表单")==-1){
|
|
|
+ if (tbTableInfoPractice == null ||
|
|
|
+ oConvertUtils.getString(tbTableInfoPractice.getRouteName()).indexOf("外部表单")==-1){
|
|
|
+ // 删除关联业务表
|
|
|
actBusinessService.deleteBusiness(actBusiness.getTableName(), actBusiness.getTableId());
|
|
|
+ // 删除act_z_business
|
|
|
+ actBusinessService.removeById(id);
|
|
|
+ }else {
|
|
|
+ // 删除tb_table_info_practice
|
|
|
+ tbTableInfoPracticeService.removeById(tbTableInfoPractice.getId());
|
|
|
+ // 删除act_z_business
|
|
|
+ actBusinessService.removeById(id);
|
|
|
}
|
|
|
- // 删除tb_table_info_practice
|
|
|
- tbTableInfoPracticeService.removeById(tbTableInfoPractice.getId());
|
|
|
- // 删除act_z_business
|
|
|
- actBusinessService.removeById(id);
|
|
|
}
|
|
|
return Result.ok("删除成功");
|
|
|
}
|
|
@@ -506,23 +506,53 @@ public class ActBusinessController {
|
|
|
act.setApplyTime(new Date());
|
|
|
actBusinessService.updateById(act);
|
|
|
|
|
|
- // 获取外部表单回调
|
|
|
+ // 获取TbTableInfoOuter
|
|
|
QueryWrapper<TbTableInfoOuter> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("text", act.getTableName());
|
|
|
TbTableInfoOuter tableInfoOuter = tbTableInfoOuterService.getOne(queryWrapper);
|
|
|
- if (tableInfoOuter != null && oConvertUtils.isNotEmpty(tableInfoOuter.getSeturl())){
|
|
|
+ // 获取tableInfoPractice
|
|
|
+ TbTableInfoPractice tableInfoPractice = null;
|
|
|
+ if (tableInfoOuter != null) {
|
|
|
QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
|
|
|
practiceQueryWrapper.eq("id", act.getTableId());
|
|
|
- TbTableInfoPractice tableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
|
|
|
- if (tableInfoPractice != null) {
|
|
|
- JSONObject jsonObject = JSON.parseObject(tableInfoPractice.getContent());
|
|
|
- jsonObject.put("actionUser", sysUser.getRealname());
|
|
|
- jsonObject.put("actionTime", DateUtils.date2Str(DateUtils.datetimeFormat.get()));
|
|
|
- jsonObject.put("action", "提交");
|
|
|
- HttpUtils.sendJsonPost(tableInfoOuter.getSeturl(), jsonObject);
|
|
|
+ tableInfoPractice = tbTableInfoPracticeService.getOne(practiceQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取表单流程定义的表单业务数据,写入tb_table_info_practice。模式是多个字段逗号分割
|
|
|
+ StringBuilder sbExtraInfo = new StringBuilder();
|
|
|
+ ActZprocess actZprocess = actZprocessService.getById(act.getProcDefId());
|
|
|
+ String pattern = oConvertUtils.getString(actZprocess.getDescription());
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern) && pattern.startsWith("(") && pattern.endsWith(")") && tableInfoPractice != null){
|
|
|
+ pattern = pattern.replace("(","").replace(")","");
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern)){
|
|
|
+ String[] arr = pattern.split(",");
|
|
|
+ JSONObject json = JSON.parseObject(tableInfoPractice.getContent());
|
|
|
+ for (String str : arr){
|
|
|
+ if (json.containsKey(str)){
|
|
|
+ if (sbExtraInfo.length()>0){
|
|
|
+ sbExtraInfo.append(" ");
|
|
|
+ }
|
|
|
+ sbExtraInfo.append(json.get(str));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sbExtraInfo.length()>0){
|
|
|
+ tableInfoPractice.setExtraInfo(sbExtraInfo.toString());
|
|
|
+ tbTableInfoPracticeService.updateById(tableInfoPractice);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 获取外部表单回调
|
|
|
+
|
|
|
+ if (tableInfoOuter != null && oConvertUtils.isNotEmpty(tableInfoOuter.getSeturl()) && tableInfoPractice != null) {
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSON.parseObject(tableInfoPractice.getContent());
|
|
|
+ jsonObject.put("actionUser", sysUser.getRealname());
|
|
|
+ jsonObject.put("actionTime", DateUtils.date2Str(DateUtils.datetimeFormat.get()));
|
|
|
+ jsonObject.put("action", "提交");
|
|
|
+ HttpUtils.sendJsonPost(tableInfoOuter.getSeturl(), jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
result.success("操作成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|