jihs 3 年之前
父节点
当前提交
c970a34377

+ 13 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/mapper/TbTableInfoMapper.java

@@ -0,0 +1,13 @@
+package org.jeecg.modules.activiti.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface TbTableInfoMapper {
+    @Select("select * from tb_table_info")
+    List<Map> getList();
+}

+ 8 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/ITbTableInfoService.java

@@ -0,0 +1,8 @@
+package org.jeecg.modules.activiti.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ITbTableInfoService  {
+    List<Map> getList();
+}

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

@@ -0,0 +1,20 @@
+package org.jeecg.modules.activiti.service.Impl;
+
+import org.jeecg.modules.activiti.mapper.TbTableInfoMapper;
+import org.jeecg.modules.activiti.service.ITbTableInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class TbTableInfoServiceImpl implements ITbTableInfoService {
+    @Autowired
+    private TbTableInfoMapper tbTableInfoMapper;
+
+    @Override
+    public List<Map> getList() {
+        return tbTableInfoMapper.getList();
+    }
+}

+ 4 - 5
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -60,7 +60,6 @@ public class ActBusinessController {
         String procDefId = request.getParameter("procDefId");
         String procDeTitle = request.getParameter("procDeTitle");
         String tableName = request.getParameter("tableName");
-//        String tableId = request.getParameter("tableId");
         /*保存业务表单数据到数据库表*/
         String tableId = IdUtil.simpleUUID();
         actBusinessService.saveApplyForm(tableId,request);
@@ -188,7 +187,7 @@ public class ActBusinessController {
 
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         queryWrapper.eq(ActBusiness::getUserId,loginUser.getUsername());
-        List<ActBusiness> actBusinessList = actBusinessService.list(queryWrapper);
+             List<ActBusiness> actBusinessList = actBusinessService.list(queryWrapper);
 
         actBusinessList.forEach(e -> {
             if(StrUtil.isNotBlank(e.getProcDefId())){
@@ -214,7 +213,9 @@ public class ActBusinessController {
         return Result.ok(actBusinessList);
     }
 
-
+    /**
+     * @desc 获取表单信息
+     */
     @RequestMapping(value = "/getTableInfoList")
     @ResponseBody
     public Result<Object> listData(){
@@ -226,6 +227,4 @@ public class ActBusinessController {
         list.add(map);
         return Result.ok(list);
     }
-
-
 }

+ 35 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/TbTableInfoController.java

@@ -0,0 +1,35 @@
+package org.jeecg.modules.activiti.web;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.activiti.service.ITbTableInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/tbTableInfo")
+@Slf4j
+@Transactional
+public class TbTableInfoController {
+   @Autowired
+   private ITbTableInfoService tbTableInfoService;
+
+   @ResponseBody
+   @RequestMapping("/list")
+   public Result<Object> list(){
+       List<Map> list = tbTableInfoService.getList();
+       for(Map map : list){
+           String content = (String) map.get("content");
+           Object obj = JSONObject.parseObject(content);
+           map.put("content", obj);
+       }
+
+       return Result.ok(list);
+   }
+}