jihs 3 سال پیش
والد
کامیت
b6f26bf7ab

+ 20 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/TbTableInfoController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.activiti.entity.TbTableInfo;
 import org.jeecg.modules.activiti.service.ITbTableInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 @RestController
@@ -36,7 +39,7 @@ public class TbTableInfoController {
     }
 
     /**
-     * @desc
+     * @desc 新增
      */
     @PostMapping("/add")
     public Result<Object> add(@RequestBody TbTableInfo tbTableInfo){
@@ -54,4 +57,20 @@ public class TbTableInfoController {
             return Result.ok("新增成功");
         }
     }
+
+    /**
+     * @desc 条件查询
+     */
+    @RequestMapping("/query")
+    public Result<Object> query(String businessTable){
+           QueryWrapper<TbTableInfo> queryWrapper = new QueryWrapper<TbTableInfo>().eq("business_table", businessTable);
+
+           TbTableInfo tableInfo = tbTableInfoService.getOne(queryWrapper);
+           if(tableInfo==null) {
+             return Result.error("未找到实体");
+            }
+            Object obj = JSONObject.parseObject(tableInfo.getContent());
+            tableInfo.setJsonContent(obj);
+        return Result.ok(tableInfo);
+    }
 }