Selaa lähdekoodia

流程外部表单更新

fenghaifu 2 vuotta sitten
vanhempi
commit
2c1ee580ec

+ 82 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/entity/TbTableInfoOuter.java

@@ -0,0 +1,82 @@
+package org.jeecg.modules.activiti.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 外部表单
+ * @Author: jeecg-boot
+ * @Date:   2023-03-16
+ * @Version: V1.0
+ */
+@Data
+@TableName("tb_table_info_outer")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="tb_table_info_outer对象", description="外部表单")
+public class TbTableInfoOuter {
+    
+	/**id*/
+	@TableId(type = IdType.ID_WORKER_STR)
+    @ApiModelProperty(value = "id")
+	private String id;
+	/**表单名*/
+	@Excel(name = "表单名", width = 15)
+    @ApiModelProperty(value = "表单名")
+	private String text;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+    @ApiModelProperty(value = "修改人")
+	private String updateBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+	private String createBy;
+	/**路由名*/
+	@Excel(name = "路由名", width = 15)
+    @ApiModelProperty(value = "路由名")
+	private String routeName;
+	/**删除状态*/
+	@Excel(name = "删除状态", width = 15)
+    @ApiModelProperty(value = "删除状态")
+	@TableLogic
+	private String delFlag;
+	/**表单类型1PC端2钉钉端*/
+	@Excel(name = "表单类型1PC端2钉钉端", width = 15)
+    @ApiModelProperty(value = "表单类型1PC端2钉钉端")
+	private String type;
+	/**外部表单列表页面*/
+	@Excel(name = "外部表单列表页面", width = 15)
+    @ApiModelProperty(value = "外部表单列表页面")
+	private String listurl;
+	/**外部表单查看页面*/
+	@Excel(name = "外部表单查看页面", width = 15)
+    @ApiModelProperty(value = "外部表单查看页面")
+	private String viewurl;
+	/**外部表单审批回调页面*/
+	@Excel(name = "外部表单审批回调页面", width = 15)
+    @ApiModelProperty(value = "外部表单审批回调页面")
+	private String seturl;
+}

+ 17 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/mapper/TbTableInfoOuterMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.activiti.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.activiti.entity.TbTableInfoOuter;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 外部表单
+ * @Author: jeecg-boot
+ * @Date:   2023-03-16
+ * @Version: V1.0
+ */
+public interface TbTableInfoOuterMapper extends BaseMapper<TbTableInfoOuter> {
+
+}

+ 5 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/mapper/xml/TbTableInfoOuterMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.activiti.mapper.TbTableInfoOuterMapper">
+
+</mapper>

+ 14 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/service/ITbTableInfoOuterService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.activiti.service;
+
+import org.jeecg.modules.activiti.entity.TbTableInfoOuter;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 外部表单
+ * @Author: jeecg-boot
+ * @Date:   2023-03-16
+ * @Version: V1.0
+ */
+public interface ITbTableInfoOuterService extends IService<TbTableInfoOuter> {
+
+}

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

@@ -0,0 +1,19 @@
+package org.jeecg.modules.activiti.service.Impl;
+
+import org.jeecg.modules.activiti.entity.TbTableInfoOuter;
+import org.jeecg.modules.activiti.mapper.TbTableInfoOuterMapper;
+import org.jeecg.modules.activiti.service.ITbTableInfoOuterService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 外部表单
+ * @Author: jeecg-boot
+ * @Date:   2023-03-16
+ * @Version: V1.0
+ */
+@Service
+public class TbTableInfoOuterServiceImpl extends ServiceImpl<TbTableInfoOuterMapper, TbTableInfoOuter> implements ITbTableInfoOuterService {
+
+}

+ 178 - 16
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActBusinessController.java

@@ -21,12 +21,10 @@ import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.activiti.entity.*;
 import org.jeecg.modules.activiti.mapper.TbTableInfoMapper;
-import org.jeecg.modules.activiti.service.IActBusinessService;
-import org.jeecg.modules.activiti.service.IActReModelService;
-import org.jeecg.modules.activiti.service.ITbTableInfoPracticeService;
-import org.jeecg.modules.activiti.service.ITbTableInfoService;
+import org.jeecg.modules.activiti.service.*;
 import org.jeecg.modules.activiti.service.Impl.ActBusinessServiceImpl;
 import org.jeecg.modules.activiti.service.Impl.ActZprocessServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  *
@@ -71,6 +70,9 @@ public class ActBusinessController {
     @Autowired
     private IActReModelService iActReModelService;
 
+    @Autowired
+    private ITbTableInfoOuterService tbTableInfoOuterService;
+
     /*添加申请草稿状态*/
     @RequestMapping(value = "/add", method = RequestMethod.POST)
     public Result add(HttpServletRequest request, @RequestBody JsonContent jsonContent) throws IOException {
@@ -452,17 +454,20 @@ public class ActBusinessController {
     }
 
     /**
-    * @Author chenchuang
-    * @Description //TODO 外部项目用来调用的流程提交接口
-    * @Date 2021/11/26 10:52
-    * @Param [act]
-    * @return org.jeecg.common.api.vo.Result
-    */
-    @RequestMapping(value = "/external/apply", method = RequestMethod.POST)
-    public Result externalApply(ActBusiness act){
+     * @Author chenchuang
+     * @Description //TODO 外部项目用来调用的流程提交接口
+     * @Date 2021/11/26 10:52
+     * @Param [act]
+     * @return org.jeecg.common.api.vo.Result
+     * @modified by fhf 2023-03-22 外部表单提交,用户使用当前登录用户
+     *
+     */
+    @PostMapping(value = "/external/apply")
+    public Result externalApply(@RequestBody ActBusiness act){
         Result result=new Result();
         try {
             //获取审核人
+            /*
             ProcessNodeVo node = actZprocessService.getFirstNode(act.getProcDefId());
             ActBusiness actBusiness = new ActBusiness();
             actBusiness.setUserId(act.getExternalUsername());
@@ -475,10 +480,23 @@ public class ActBusinessController {
             actBusiness.setRouteName(act.getTableName());
             actBusinessService.save(actBusiness);
             submit(actBusiness,node);
+            result.success("操作成功");*/
+            LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+            ProcessNodeVo node = actZprocessService.getFirstNode(act.getProcDefId());
+            act.setPkOrg(sysUser.getPkOrg());//公司id
+            act.setExternalUsername(sysUser.getUsername());
+
+            String processInstanceId = actZprocessService.startProcess(act);
+            act.setProcInstId(processInstanceId);
+            act.setStatus(1);
+            act.setResult(1);
+            act.setApplyTime(new Date());
+            actBusinessService.updateById(act);
+
             result.success("操作成功");
         } catch (Exception e) {
             e.printStackTrace();
-            result.error500("操作失败");
+            result.error500("提交失败,错误信息:"+e.getMessage());
         }
         return result;
     }
@@ -657,18 +675,27 @@ public class ActBusinessController {
     }
 
     /**
-     * @desc 获取表单信息
+     * @desc 获取外部表单信息
      */
     @RequestMapping(value = "/getTableInfoList")
     @ResponseBody
     public Result<Object> listData(){
+        List<TbTableInfoOuter> tableInfoOuterList = tbTableInfoOuterService.list();
+        List<Map<String,Object>> retList = tableInfoOuterList.stream().map(item->{
+            Map<String,Object> mapItem = new Hashtable<>();
+            mapItem.put("text", item.getText());
+            mapItem.put("routeName", item.getRouteName());
+            mapItem.put("businessTable", item.getText());
+            return mapItem;
+        }).collect(Collectors.toList());
+        /*
         List<Map> list = new ArrayList();
         Map map = Maps.newHashMap();
         map.put("text", "合同表单");
         map.put("routeName", "外部表单contract-file");
         map.put("businessTable", "contract-file");
-        list.add(map);
-        return Result.ok(list);
+        list.add(map);*/
+        return Result.ok(retList);
     }
 
     /**
@@ -782,4 +809,139 @@ public class ActBusinessController {
 
         return sb2.toString();
     }
+
+    /**
+     * 添加外部申请草稿状态
+     * @Author fhf
+     * @Date 2023-03-22
+     * @param param - 固定参数type,其他参数外部表单提供,用于显示外部表单
+     * @return
+     */
+    @PostMapping(value = "/addOuter")
+    public Result addOuter(@RequestBody Map<String,Object> param)  {
+        Result result=new Result();
+        try {
+            /* 表单名称 */
+            String tableName = oConvertUtils.getString(param.get("type"));
+            QueryWrapper<TbTableInfoOuter> tableInfoOuterQueryWrapper = new QueryWrapper<>();
+            tableInfoOuterQueryWrapper.eq("text",tableName);
+            List<TbTableInfoOuter> tbTableInfoOuterList = tbTableInfoOuterService.list(tableInfoOuterQueryWrapper);
+            if (tbTableInfoOuterList.size() == 0){
+                result.error500("外部表单:"+tableName+"没有定义,申请失败!");
+                return result;
+            }
+            if (tbTableInfoOuterList.size() > 1){
+                result.error500("外部表单:"+tableName+"定义了"+tbTableInfoOuterList.size()+"个,超过了1个,申请失败");
+                return result;
+            }
+            TbTableInfoOuter tbTableInfoOuter = tbTableInfoOuterList.get(0);
+            if (oConvertUtils.isEmpty(tbTableInfoOuter.getRouteName()) ||
+                    !tbTableInfoOuter.getRouteName().startsWith("外部表单")
+            ){
+                result.error500("外部表单:"+tableName+"路由:"+tbTableInfoOuter.getRouteName()+"不是以'外部表单'开头,申请失败");
+                return result;
+            }
+            /* 获取ActZprocess,只能有一个,并且RouteName要以外部表单开头*/
+            QueryWrapper<ActZprocess> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("business_table", tableName);
+            queryWrapper.eq("latest", 1);
+            List<ActZprocess> actZprocessList = actZprocessService.list(queryWrapper);
+            if (actZprocessList.size() == 0){
+                result.error500("外部表单:"+tableName+"没有已部署的流程,申请失败!");
+                return result;
+            }
+            if (actZprocessList.size() > 1){
+                result.error500("外部表单:"+tableName+"部署了"+actZprocessList.size()+"个流程,超过了1个,申请失败");
+                return result;
+            }
+            ActZprocess actZprocess = actZprocessList.get(0);
+
+            /* 获取请求参数 */
+            JSONObject jsonObject = new JSONObject(param);
+
+            /* 判断是否已经有发起得流程 */
+            QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
+            practiceQueryWrapper.eq("text", tableName);
+            practiceQueryWrapper.eq("route_name", tbTableInfoOuter.getRouteName());
+            practiceQueryWrapper.eq("content", JSON.toJSONString(jsonObject));
+            List<TbTableInfoPractice> tableInfoPracticeList = tbTableInfoPracticeService.list(practiceQueryWrapper);
+            if (tableInfoPracticeList.size()>0){
+                QueryWrapper<ActBusiness> businessQueryWrapper = new QueryWrapper<>();
+                businessQueryWrapper.eq("table_id", tableInfoPracticeList.get(0).getId());
+                ActBusiness actBusiness = actBusinessService.getOne(businessQueryWrapper);
+                if (actBusiness == null){
+                    result.error500("数据校验失败,请联系管理员");
+                    return result;
+                }
+                if (oConvertUtils.isNotEmpty(actBusiness.getProcInstId())){
+                    result.error500("流程已发起,不能重复发起");
+                    return result;
+                }
+                actBusiness.setRouteName(tableInfoPracticeList.get(0).getRouteName());
+                result.success("发起申请成功");
+                result.setResult(actBusiness);
+            }else {
+                /*保存业务表单数据到数据库表*/
+                String tableId = IdUtil.simpleUUID();
+                TbTableInfoPractice tbTableInfoPractice = new TbTableInfoPractice(tableId, tableName, tableName,
+                        JSON.toJSONString(jsonObject),
+                        null, tbTableInfoOuter.getRouteName(), "", null, null,
+                        "1", tableId, tbTableInfoOuter.getType());
+                tbTableInfoPracticeService.save(tbTableInfoPractice);
+                // 保存至我的申请业务
+                LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+                String username = sysUser.getUsername();
+                ActBusiness actBusiness = new ActBusiness();
+                actBusiness.setUserId(username);
+                actBusiness.setTableId(tableId);
+                actBusiness.setProcDefId(actZprocess.getId());
+                String title = tableName;
+                actBusiness.setTitle(title);
+                actBusiness.setTableName(tableName);
+                actBusiness.setPkOrg(sysUser.getOrgCode());//公司id
+                actBusinessService.save(actBusiness);
+
+                QueryWrapper<ActBusiness> businessQueryWrapper = new QueryWrapper<>();
+                businessQueryWrapper.eq("table_id", tableId);
+                actBusiness = actBusinessService.getOne(businessQueryWrapper);
+                actBusiness.setRouteName(tbTableInfoOuter.getRouteName());
+
+                result.success("发起申请成功");
+                result.setResult(actBusiness);
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            result.error500("发起申请异常:"+ex.getMessage());
+        }
+        return result;
+    }
+
+    /**
+     * 获取显示的外部表单路径
+     * @Author fhf
+     * @Date 2023-03-23
+     * @param tableId - tb_table_info_practice 表 id
+     * @return
+     */
+    @GetMapping(value = "/external/getViewUrl")
+    public Result getViewUrl(@RequestParam(name="tableId", required = true) String tableId )  {
+        Result result=new Result();
+        try {
+            TbTableInfoPractice tableInfoPractice = tbTableInfoPracticeService.getById(tableId);
+            QueryWrapper<TbTableInfoOuter> tableInfoOuterQueryWrapper = new QueryWrapper<>();
+            tableInfoOuterQueryWrapper.eq("text", tableInfoPractice.getText());
+            TbTableInfoOuter tableInfoOuter = tbTableInfoOuterService.getOne(tableInfoOuterQueryWrapper);
+            String url = tableInfoOuter.getViewurl();
+            JSONObject param = JSON.parseObject(tableInfoPractice.getContent());
+            JSONObject retObj = new JSONObject();
+            retObj.put("url", url);
+            retObj.put("param", param);
+            result.success("获取成功");
+            result.setResult(retObj);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            result.error500("获取异常:"+ex.getMessage());
+        }
+        return result;
+    }
 }

+ 9 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActivitiProcessController.java

@@ -21,6 +21,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.activiti.entity.ActNode;
 import org.jeecg.modules.activiti.entity.ActZprocess;
 import org.jeecg.modules.activiti.entity.ProcessNodeVo;
@@ -97,6 +98,13 @@ public class ActivitiProcessController {
             //获取表单数据
             List<TbTableInfo> tableInfoList = tbTableInfoService.list(new QueryWrapper<TbTableInfo>().eq("del_flag","0").orderByAsc("create_time").groupBy("business_table"));
             for(ActZprocess actZprocess:list){
+                Optional<TbTableInfo> findOpt = tableInfoList.stream().filter(e-> oConvertUtils.getString(e.getBusinessTable()).equalsIgnoreCase(oConvertUtils.getString(actZprocess.getBusinessTable()))).findFirst();
+                if (findOpt.isPresent()){
+                    actZprocess.setBusinessTableName(findOpt.get().getText());
+                }else{  // 外部表单
+                    actZprocess.setBusinessTableName(actZprocess.getBusinessTable());
+                }
+                /*
                 //获取表单名称
                 if(tableInfoList!=null){
                     for(TbTableInfo tbTableInfo:tableInfoList){
@@ -104,7 +112,7 @@ public class ActivitiProcessController {
                             actZprocess.setBusinessTableName(tbTableInfo.getText());
                         }
                     }
-                }
+                }*/
             }
         }
         if (StrUtil.isNotBlank(request.getParameter("roles"))){ //过滤角色

+ 187 - 0
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/TbTableInfoOuterController.java

@@ -0,0 +1,187 @@
+package org.jeecg.modules.activiti.web;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.activiti.entity.TbTableInfoOuter;
+import org.jeecg.modules.activiti.service.ITbTableInfoOuterService;
+import java.util.Date;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+ /**
+ * @Description: 外部表单
+ * @Author: jeecg-boot
+ * @Date:   2023-03-16
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="外部表单")
+@RestController
+@RequestMapping("/activiti/tbTableInfoOuter")
+public class TbTableInfoOuterController extends JeecgController<TbTableInfoOuter, ITbTableInfoOuterService> {
+	@Autowired
+	private ITbTableInfoOuterService tbTableInfoOuterService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param tbTableInfoOuter
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-分页列表查询")
+	@ApiOperation(value="外部表单-分页列表查询", notes="外部表单-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(TbTableInfoOuter tbTableInfoOuter,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<TbTableInfoOuter> queryWrapper = QueryGenerator.initQueryWrapper(tbTableInfoOuter, req.getParameterMap());
+		Page<TbTableInfoOuter> page = new Page<TbTableInfoOuter>(pageNo, pageSize);
+		IPage<TbTableInfoOuter> pageList = tbTableInfoOuterService.page(page, queryWrapper);
+		return Result.ok(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param tbTableInfoOuter
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-添加")
+	@ApiOperation(value="外部表单-添加", notes="外部表单-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody TbTableInfoOuter tbTableInfoOuter) {
+		tbTableInfoOuter.setRouteName("外部表单$"+tbTableInfoOuter.getText());
+		tbTableInfoOuter.setType("1");
+		tbTableInfoOuterService.save(tbTableInfoOuter);
+		return Result.ok("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param tbTableInfoOuter
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-编辑")
+	@ApiOperation(value="外部表单-编辑", notes="外部表单-编辑")
+	@PutMapping(value = "/edit")
+	public Result<?> edit(@RequestBody TbTableInfoOuter tbTableInfoOuter) {
+		tbTableInfoOuterService.updateById(tbTableInfoOuter);
+		return Result.ok("编辑成功!");
+	}
+	
+	/**
+	 * 通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-通过id删除")
+	@ApiOperation(value="外部表单-通过id删除", notes="外部表单-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		tbTableInfoOuterService.removeById(id);
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	 * 批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-批量删除")
+	@ApiOperation(value="外部表单-批量删除", notes="外部表单-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.tbTableInfoOuterService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.ok("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "外部表单-通过id查询")
+	@ApiOperation(value="外部表单-通过id查询", notes="外部表单-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		TbTableInfoOuter tbTableInfoOuter = tbTableInfoOuterService.getById(id);
+		return Result.ok(tbTableInfoOuter);
+	}
+
+	 /**
+	  * 通过text查询
+	  *
+	  * @param text
+	  * @return
+	  */
+	 @AutoLog(value = "外部表单-通过text查询")
+	 @ApiOperation(value="外部表单-通过text查询", notes="外部表单-通过text查询")
+	 @GetMapping(value = "/queryByText")
+	 public Result<?> queryByText(@RequestParam(name="text",required=true) String text) {
+	 	QueryWrapper<TbTableInfoOuter> queryWrapper = new QueryWrapper<>();
+	 	queryWrapper.eq("text", text);
+	 	List<TbTableInfoOuter> tableInfoOuterList = tbTableInfoOuterService.list(queryWrapper);
+	 	if (tableInfoOuterList.size()>0){
+	 		return Result.ok(tableInfoOuterList.get(0));
+	    }
+	 	return Result.error("查找失败");
+	 }
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param tbTableInfoOuter
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, TbTableInfoOuter tbTableInfoOuter) {
+      return super.exportXls(request, tbTableInfoOuter, TbTableInfoOuter.class, "外部表单");
+  }
+
+  /**
+   * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      return super.importExcel(request, response, TbTableInfoOuter.class);
+  }
+
+}

+ 1 - 1
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -125,7 +125,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/diagram-viewer/**", "anon");
 		filterChainDefinitionMap.put("/editor-app/**", "anon");
 		filterChainDefinitionMap.put("/tbTableInfo/**","anon");
-		filterChainDefinitionMap.put("/actBusiness/external/**","anon");
+		//filterChainDefinitionMap.put("/actBusiness/external/**","anon");
 		filterChainDefinitionMap.put("/actTask/todo-list/**","anon");
 
 		//性能监控