jihs hace 3 años
padre
commit
2eb804d873

+ 0 - 1
jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java

@@ -273,5 +273,4 @@ public interface ISysBaseAPI {
 
 
 	public List<String> getDepartByUsername(String username);
-
 }

+ 0 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/TbTableInfo.java

@@ -1,6 +1,5 @@
 package org.jeecg.modules.activiti.entity;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;

+ 6 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/TbTableInfoPractice.java

@@ -1,7 +1,6 @@
 package org.jeecg.modules.activiti.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -68,4 +67,10 @@ public class TbTableInfoPractice {
         this.isInitial = isInitial;
         this.businessTableId = businessTableId;
     }
+
+
+    public TbTableInfoPractice(String id, String content) {
+        this.id = id;
+        this.content = content;
+    }
 }

+ 7 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/mapper/TbTableInfoPracticeMapper.java

@@ -0,0 +1,7 @@
+package org.jeecg.modules.activiti.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.activiti.entity.TbTableInfoPractice;
+
+public interface TbTableInfoPracticeMapper extends BaseMapper<TbTableInfoPractice> {
+}

+ 12 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/ITbTableInfoPracticeService.java

@@ -0,0 +1,12 @@
+package org.jeecg.modules.activiti.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.activiti.entity.TbTableInfoPractice;
+
+/**
+ * @Author ${user}
+ * @Date ${date}
+ * @desc
+ */
+public interface ITbTableInfoPracticeService extends IService<TbTableInfoPractice> {
+}

+ 11 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/Impl/TbTableInfoPracticeServiceImpl.java

@@ -0,0 +1,11 @@
+package org.jeecg.modules.activiti.service.Impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.activiti.entity.TbTableInfoPractice;
+import org.jeecg.modules.activiti.mapper.TbTableInfoPracticeMapper;
+import org.jeecg.modules.activiti.service.ITbTableInfoPracticeService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TbTableInfoPracticeServiceImpl extends ServiceImpl<TbTableInfoPracticeMapper, TbTableInfoPractice> implements ITbTableInfoPracticeService {
+}

+ 33 - 2
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -13,6 +13,7 @@ import org.activiti.engine.TaskService;
 import org.activiti.engine.task.Task;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
+import org.checkerframework.checker.units.qual.Area;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.LoginUser;
@@ -20,6 +21,10 @@ import org.jeecg.modules.activiti.entity.ActBusiness;
 import org.jeecg.modules.activiti.entity.ActZprocess;
 import org.jeecg.modules.activiti.entity.ActivitiConstant;
 import org.jeecg.modules.activiti.entity.ProcessNodeVo;
+import org.jeecg.modules.activiti.entity.TbTableInfo;
+import org.jeecg.modules.activiti.entity.TbTableInfoPractice;
+import org.jeecg.modules.activiti.service.ITbTableInfoPracticeService;
+import org.jeecg.modules.activiti.service.ITbTableInfoService;
 import org.jeecg.modules.activiti.service.Impl.ActBusinessServiceImpl;
 import org.jeecg.modules.activiti.service.Impl.ActZprocessServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,6 +62,11 @@ public class ActBusinessController {
     private RuntimeService runtimeService;
     @Autowired
     ISysBaseAPI sysBaseAPI;
+    @Autowired
+    private ITbTableInfoService tbTableInfoService;
+    @Autowired
+    private ITbTableInfoPracticeService tbTableInfoPracticeService;
+
     /*添加申请草稿状态*/
     @RequestMapping(value = "/add", method = RequestMethod.POST)
     public Result add(HttpServletRequest request) throws IOException {
@@ -65,13 +75,23 @@ public class ActBusinessController {
             String procDefId = request.getParameter("procDefId");
             String procDeTitle = request.getParameter("procDeTitle");
             String tableName = request.getParameter("tableName");
+            String josonContent = request.getParameter("jsonContent");
+            /*保存业务表单数据到数据库表*/
+            String tableId = IdUtil.simpleUUID();
+            List<TbTableInfo> tableInfoList = tbTableInfoService.list(new LambdaQueryWrapper<TbTableInfo>().eq(TbTableInfo::getBusinessTable, tableName));
+            for(TbTableInfo tbTableInfo:tableInfoList){
+                //申请保存后的表单json
+                tbTableInfoPracticeService.save(new TbTableInfoPractice(IdUtil.simpleUUID(), tbTableInfo.getBusinessTable(), tbTableInfo.getText(),
+                        StringUtils.isNotBlank(josonContent) ? josonContent : tbTableInfo.getContent(),
+                        tbTableInfo.getPkOrg(), tbTableInfo.getRouteName(), tbTableInfo.getStepMemo(), tbTableInfo.getProcessId(), tbTableInfo.getTaskNodeId(),
+                        tbTableInfo.getIsInitial(), tableId));
+            }
             //获取审核人
             ProcessNodeVo node = actZprocessService.getFirstNode(procDefId);
 //            if(node.getUsers()==null||node.getUsers().size()<=0){
 //                result.error500("流程审核人没关联");
 //            }
-            /*保存业务表单数据到数据库表*/
-            String tableId = IdUtil.simpleUUID();
+
             actBusinessService.saveApplyForm(tableId,request);
             // 保存至我的申请业务
             LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -153,6 +173,17 @@ public class ActBusinessController {
         /*保存业务表单数据到数据库表*/
         String tableId = request.getParameter("tableId");
         String tableName = request.getParameter("tableName");
+        String jsonContent = request.getParameter("jsonContent");
+        if(StringUtils.isNotBlank(jsonContent)){
+            List<TbTableInfoPractice> list = tbTableInfoPracticeService.list(new LambdaQueryWrapper<TbTableInfoPractice>()
+                    .eq(TbTableInfoPractice::getBusinessTableId, tableId));
+            for(TbTableInfoPractice tbTableInfoPractice : list) {
+                //修改申请保存后的表单json
+                tbTableInfoPracticeService.updateById(new TbTableInfoPractice(tbTableInfoPractice.getId(), jsonContent));
+            }
+        }
+
+
         Map<String, Object> map = actBusinessService.getApplyForm(tableId, tableName);
         String tableNameb = null;
         String tableNameChildren = null;

+ 1 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/SysBaseApiImpl.java

@@ -29,6 +29,7 @@ import org.jeecg.common.util.SpringContextUtils;
 import org.jeecg.common.util.SysAnnmentTypeEnum;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.common.util.oss.OssBootUtil;
+import org.jeecg.modules.activiti.entity.TbTableInfo;
 import org.jeecg.modules.message.entity.SysMessageTemplate;
 import org.jeecg.modules.message.service.ISysMessageTemplateService;
 import org.jeecg.modules.message.websocket.WebSocket;
@@ -640,5 +641,4 @@ public class SysBaseApiImpl implements ISysBaseAPI {
 	public List<String> getDepartByUsername(String username) {
 		return sysDepartService.getDepartByUsername(username);
 	}
-
 }