Browse Source

926早晨 定时备份

LT32820A 2 months ago
parent
commit
d9f45f9b92

+ 7 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/AppmanageController.java

@@ -189,4 +189,11 @@ public class AppmanageController {
         System.out.println("应用注册审核通过后续处理:"+formData);
         appInfoService.afterAppCheckPass(appid, formData);
     }
+
+    // 应用注册流程被撤销 后续处理(微服务调用)
+    @GetMapping("/afterAppCheckPass")
+    public <T> void afterUnsendAppRegisterFlow(@RequestParam("workID") long workID){
+        System.out.println("应用注册流程撤销后续处理:"+workID);
+        appInfoService.afterUnsendAppRegisterFlow(workID);
+    }
 }

+ 7 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/AppmanageEntity/AppUserInfoQueryParams.java

@@ -5,7 +5,7 @@ import lombok.Data;
 import java.util.List;
 
 /**
- * 功能描述
+ * 功能描述 : 查询应用用户信息参数
  *
  * @author: scott
  * @date: 2024年08月14日 PM 5:22
@@ -14,13 +14,17 @@ import java.util.List;
 public class AppUserInfoQueryParams {
     // 需过滤的用户id集合
     private List<String> filteruserids;
+    // 应用id
     private String appid;
+    // 部门(虽然是List,但是一般只有单个部门id)
     private List<String> dept;
+    // 角色(暂放)
     private String role;
+    // 用户名
     private List<String> realname;
     private List<String> username;
+    // 页码
     private Integer pageNo;
-
-    // 直接通过用户id集合查询用户信息集合(给注册应用信息时,表单一与表单四数据联动用)
+    // 直接通过用户id集合查询用户信息集合(暂放)
     private List<String> userids;
 }

+ 0 - 3
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppBaseInfoMapper.java

@@ -33,9 +33,6 @@ public interface AppBaseInfoMapper extends BaseMapper<AppBaseInfo> {
     @Select("SELECT username from sys_user where id = #{id}")
     String queryUsernameById(@Param("id") String id);
 
-    // 真删除基础信息(非逻辑删除)
-    @Delete("delete from app_base_info where id = #{id}")
-    void deleteAppInfoNotLogic(@Param("id") String id);
 
     @Update("<script>" +
             "UPDATE app_base_info " +

+ 39 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/AppCustomMapper.java

@@ -1,10 +1,12 @@
 package org.jeecg.modules.system.mapper;
 
+import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.system.entity.AppmanageEntity.AppBaseInfo;
 import org.jeecg.modules.system.entity.AppmanageEntity.AppUserInfo;
+import org.jeecg.modules.system.entity.SysPermission;
 
 import java.util.List;
 
@@ -34,5 +36,42 @@ public interface AppCustomMapper {
 
     String queryDepartIdByUserId(@Param("userId") String userId);
 
+    // 查询菜单是否已存在
+    @Select("SELECT * FROM sys_permission WHERE url = #{menuInfo}")
+    SysPermission queryUrlByUrl(@Param("menuInfo") String menuInfo);
 
+    // 真删除基础信息(非逻辑删除)
+    @Delete("delete from app_base_info where id = #{appid}")
+    void deleteAppBaseInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除文档信息(非逻辑删除)
+    @Delete("delete from app_doc_info where appid = #{appid}")
+    void deleteAppDocInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除环境信息(非逻辑删除)
+    @Delete("delete from app_env_info where appid = #{appid}")
+    void deleteAppEnvInfoNotLogic(@Param("appid") String appid);
+
+    // 真删除应用用户信息(非逻辑删除)
+    @Delete("delete from app_env_info where appid = #{appid}")
+    void deleteAppUserInfoNotLogic(@Param("appid") String appid);
+
+    @Select({
+            "SELECT CASE",
+            "WHEN FK_Flow = '021' THEN (",
+            "SELECT id FROM app_base_info_flow WHERE OID = #{workID}",
+            ")",
+            "WHEN FK_Flow = '022' THEN (",
+            "SELECT id FROM app_detail_info_workflow WHERE OID = #{workID}",
+            ")",
+            "ELSE NULL",
+            "END AS result",
+            "FROM wf_generworkflow",
+            "WHERE workID = #{workID}"
+    })
+    String getAppidByWorkID(@Param("workID") long workID);
+
+    // 通过应用id获取该应用注册类型
+    @Select("SELECT add_type FROM app_base_info WHERE id = #{appid}")
+    String queryAppRegisterTypeByAppid(@Param("appid") String appid);
 }

+ 2 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/AppCustomMapper.xml

@@ -50,4 +50,6 @@
     <select id="queryDepartIdByUserId" resultType="java.lang.String">
         SELECT dep_id FROM sys_user_depart WHERE user_id = #{userId}
     </select>
+
+
 </mapper>

+ 2 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/AppmanageService.java

@@ -67,5 +67,7 @@ public interface AppmanageService  {
     boolean isAppAdminOrDevOrOpe(String appid);
 
     <T> void afterAppCheckPass(String appid, T formData);
+
+    void afterUnsendAppRegisterFlow(long workID);
 }
 

+ 77 - 46
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/AppmanageServiceImpl.java

@@ -91,8 +91,6 @@ public class AppmanageServiceImpl implements AppmanageService {
     @Autowired
     private AppManageUtil appManageUtil;
 
-
-
     private final ReentrantLock lock = new ReentrantLock();
     private final String UNCHECK_TAG_BASE_PATH = "AppInfouncheckTag:";
 
@@ -117,7 +115,7 @@ public class AppmanageServiceImpl implements AppmanageService {
         appBaseInfo.setDelFlag(1);
         baseInfoMapper.insert(appBaseInfo);
 
-        // 提交至工作流的表单信息(将用户id换成用户账号,字典值换成字典文本
+        // 提交至工作流的表单信息(将用户id换成用户账号)
         AppBaseInfo sendCheck_appBaseInfo = appBaseInfo;
         sendCheck_appBaseInfo.setAdmin(customMapper.queryUsernameByUserId(appBaseInfo.getAdmin()));
         if (appBaseInfo.getDevelopUser()!=null)
@@ -128,19 +126,17 @@ public class AppmanageServiceImpl implements AppmanageService {
             sendCheck_appBaseInfo.setRequirementUser(customMapper.queryUsernameByUserId(appBaseInfo.getRequirementUser()));
         if (appBaseInfo.getBusinessUser()!=null)
             sendCheck_appBaseInfo.setBusinessUser(customMapper.queryUsernameByUserId(appBaseInfo.getBusinessUser()));
-//        sendCheck_appBaseInfo.setType(sysDictService.queryDictTextByKey("app_type", appBaseInfo.getType()));
-//        sendCheck_appBaseInfo.setStatus(sysDictService.queryDictTextByKey("app_status", appBaseInfo.getStatus()));
         AppDocInfo appDocInfo = appInfo.getAppDocInfoDTO();
         boolean hasEnvInfo = false;
         if (appInfo.getAppEnvInfoDTO()!=null) hasEnvInfo = appInfo.getAppEnvInfoDTO().size()>0;
+        boolean tag; // 流程发送结果标志
+        String appid = appBaseInfo.getId();
         // 简易注册模式下添加基础信息即可
         if (appBaseInfo.getAddType().equals("easy")){
-            boolean tag = appManageUtil.sendCheckWordFlow(sendCheck_appBaseInfo, "021", loginUser.getUsername(), "admin");
+             tag = appManageUtil.sendCheckWordFlow(sendCheck_appBaseInfo, "021", loginUser.getUsername(), "admin");
             // 发起流程失败则删除数据库内数据
-            if (tag){
-                return "提交成功";
-            } else {
-                baseInfoMapper.deleteAppInfoNotLogic(appBaseInfo.getId());
+            if (!tag){
+                customMapper.deleteAppBaseInfoNotLogic(appid);
                 return "提交失败";
             }
         }else {
@@ -152,10 +148,16 @@ public class AppmanageServiceImpl implements AppmanageService {
                 AppManageUtil appManageUtil = new AppManageUtil();
                 appRegisterWorkFlowFormEntity = appManageUtil.TransitionEnvInfoToAppRegisterWorkFlowForm(appRegisterWorkFlowFormEntity, appInfo.getAppEnvInfoDTO());
             }
-            appManageUtil.sendCheckWordFlow(appRegisterWorkFlowFormEntity, "022",loginUser.getUsername(),"admin");
+            tag = appManageUtil.sendCheckWordFlow(appRegisterWorkFlowFormEntity, "022", loginUser.getUsername(), "admin");
+            // 发起流程失败则删除数据库内数据
+            if (!tag){
+                customMapper.deleteAppBaseInfoNotLogic(appid);
+                customMapper.deleteAppDocInfoNotLogic(appid);
+                customMapper.deleteAppEnvInfoNotLogic(appid);
+                customMapper.deleteAppUserInfoNotLogic(appid);
+                return "提交失败";
+            }
         }
-        String appid = appBaseInfo.getId();
-
         // 添加应用用户信息
         appInfo.getUserInfo().forEach(userid -> {
             AppUserInfo userInfo = new AppUserInfo();
@@ -174,7 +176,6 @@ public class AppmanageServiceImpl implements AppmanageService {
         // 添加应用文档信息
         appDocInfo.setAppid(appid);
         docInfoMapper.insert(appDocInfo);
-
         return "提交成功";
     }
 
@@ -183,6 +184,7 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @param ids 应用id集合
      * @return
      */
+    @Transactional
     @Override
     public Boolean deleteAppInfo(String[] ids) {
         // 需先判断用户是否拥有所删除的应用信息的权限(平台管理员-应用管理员)
@@ -238,7 +240,7 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @return
      */
     @Override
-    public Boolean editBaseInfo(AppBaseInfo baseInfo) throws Exception {
+    public Boolean editBaseInfo(AppBaseInfo baseInfo) {
 
         int i = baseInfoMapper.updateById(baseInfo);
         // 保存成功解除反审核状态
@@ -246,6 +248,11 @@ public class AppmanageServiceImpl implements AppmanageService {
         return i>0;
     }
 
+    /**
+     * 修改应用环境信息
+     * @param editEnvInfoEntity
+     * @return
+     */
     @Transactional
     @Override
     public Boolean editEnvInfo(AppEditEnvInfoEntity editEnvInfoEntity) {
@@ -350,7 +357,7 @@ public class AppmanageServiceImpl implements AppmanageService {
      * @param key 模糊查询关键字
      * @param type 应用类型
      * @param status 应用状态
-     * @param userid 用户id
+     * @param userid 用户id (暂放)
      * @return 应用基础信息集合
      */
 
@@ -372,7 +379,6 @@ public class AppmanageServiceImpl implements AppmanageService {
             appBaseInfoS.add(baseInfo);
         });
         redisUtil.set("appManagerInfo", appManagerInfo, 60*60*24);
-        // 使用 Collections.sort() 方法进行排序
 
         return appBaseInfoS;
 //        if(userid!=null){
@@ -409,9 +415,10 @@ public class AppmanageServiceImpl implements AppmanageService {
      */
     @Override
     public List<AppEnvInfo> queryEnvInfoByAppId(String appid) {
+        // 该用户是否可以查看当前应用的应用信息
         List<AppEnvInfo> envInfos = envInfoMapper.
-                selectList(new QueryWrapper<AppEnvInfo>().eq("appid", appid));
-        return envInfos;
+                    selectList(new QueryWrapper<AppEnvInfo>().eq("appid", appid));
+            return envInfos;
     }
 
     @Override
@@ -429,7 +436,6 @@ public class AppmanageServiceImpl implements AppmanageService {
      * 应用用户查询功能
      * @return
      */
-
     @Override
     public AppEditUserInfoEntity queryAppUser(AppUserInfoQueryParams queryParams) {
         List<Map<String, Object>> appUserInfos = new ArrayList<>();
@@ -454,15 +460,15 @@ public class AppmanageServiceImpl implements AppmanageService {
 
                 // 判断当前用户是否可进行编辑操作
                 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-                String managerId = "";
-                Map<String, String> appManagerInfo = new HashMap<>();
-                appManagerInfo = (Map<String, String>) redisUtil.get("appManagerInfo");
+                String managerId;
+                Map<String, String> appManagerUserInfo; // 应用管理员信息
                 // 先从 redis 查询应用管理员信息,如果为空,则查询数据库
-                if (appManagerInfo == null) {
+                appManagerUserInfo = (Map<String, String>) redisUtil.get("appManagerInfo");
+                if (appManagerUserInfo == null) {
                     AppBaseInfo baseInfoPO = baseInfoMapper.selectById(queryParams.getAppid());
                     managerId = baseInfoPO.getAdmin();
                 }else {
-                    managerId = appManagerInfo.get(queryParams.getAppid());
+                    managerId = appManagerUserInfo.get(queryParams.getAppid());
                 }
                 editUserInfoEntity.setIsEdit(loginUser.getId().equals(managerId));
                 AppBaseInfo appBaseInfo = baseInfoMapper.selectById(queryParams.getAppid());
@@ -470,12 +476,12 @@ public class AppmanageServiceImpl implements AppmanageService {
                 appUserInfos.forEach(map -> {
                     String roleNameInfo = appManageUtil.baseInfoToUserInfoRoles(appBaseInfo, (String) map.get("id"));
                     List<String> roleIds = sysUserRoleService.listByAppId(queryParams.getAppid(), (String) map.get("id"));
-
+                    // 查询角色名信息
                     if (!roleIds.isEmpty()){
-                        // 查询角色名信息
                         QueryWrapper<SysRole> sysRoleQueryWrapper = new QueryWrapper<>();
                         sysRoleQueryWrapper.select("role_name").in("id", roleIds);
                         List<SysRole> sysRoles = sysRoleMapper.selectList(sysRoleQueryWrapper);
+                        // 角色信息拼接
                         if (!sysRoles.isEmpty()&&!roleNameInfo.isEmpty()){
                             roleNameInfo =roleNameInfo +", "+ sysRoles.stream()
                                     .map(SysRole::getRoleName)
@@ -489,7 +495,7 @@ public class AppmanageServiceImpl implements AppmanageService {
                     map.put("roles", roleNameInfo);
                 });
             }
-        }else { // 作为添加表单时的查询(查询全部用户), 角色分配用户时亦使用
+        }else { // 作为添加表单时的查询(查询全部用户)
             appUserInfos = sysUserService.userComplexCondition(queryParams.getUserids(),
                     queryParams.getUsername(),
                     queryParams.getRealname(),
@@ -497,7 +503,7 @@ public class AppmanageServiceImpl implements AppmanageService {
                     queryParams.getFilteruserids(),
                     queryParams.getPageNo());
         }
-        // 如果查询到的用户不为空,则取appUserInfos最后一个值为total值,并将appUserInfos最后一个值删除
+        // 如果查询到的用户不为空,则取appUserInfos最后一个值为total值(分页使用),并将appUserInfos最后一个值删除
         if (!appUserInfos.isEmpty()){
             editUserInfoEntity.setTotal((Integer) appUserInfos.get(appUserInfos.size()-1).get("total"));
             appUserInfos.remove(appUserInfos.size()-1);
@@ -609,6 +615,8 @@ public class AppmanageServiceImpl implements AppmanageService {
     public boolean isAppAdminOrDevOrOpe(String appid) {
         // 获取当前登录用户
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // 如果是平台管理员
+        if (loginUser.getUsername().equals("admin")) return true;
         AppBaseInfo baseInfo = baseInfoMapper.selectById(appid);
         if (baseInfo!=null){
             if (baseInfo.getAdmin().equals(loginUser.getId())) return true;
@@ -619,10 +627,12 @@ public class AppmanageServiceImpl implements AppmanageService {
         return false;
     }
 
-    // 判断当前用户是否有编辑当前信息的权限
+    // 判断当前用户是否为当前应用的应用管理员
     public boolean hasEditCurrentInfoPermission(String appid){
         // 获取当前登录用户
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        // 如果是平台管理员
+        if (loginUser.getUsername().equals("admin")) return true;
         // 查询基础信息的应用管理员id,比较是否和当前登录用户一致
         QueryWrapper<AppBaseInfo> baseInfoPOQueryWrapper = new QueryWrapper<>();
         baseInfoPOQueryWrapper.select("admin").eq("id", appid);
@@ -654,7 +664,7 @@ public class AppmanageServiceImpl implements AppmanageService {
     }
 
 
-    // 应用审核通过后一系列创建应用一级菜单、默认角色、授权操作(完整注册时)
+    // 应用审核通过后续处理
     public <T> void afterAppCheckPass(String appid, T formData) {
         AppBaseInfo appBaseInfo = baseInfoMapper.queryAppBaseInfoById(appid);
         appManageUtil.CompareOldAppBaseInfoAndNewAppBaseInfo(appBaseInfo, formData);
@@ -670,12 +680,12 @@ public class AppmanageServiceImpl implements AppmanageService {
         // 设置消息模板编码
         message.setTemplateCode("app_examineAndapprove");
         Map<String, String> templateParam = new HashMap<>();
-        templateParam.put("resultText","通过");
+        templateParam.put("resultText","应用"+appBaseInfo.getName()+"注册审核通过");
         message.setTemplateParam(templateParam);
         sysBaseApi.sendTemplateAnnouncement(message);
 
 
-        // 判断该信息是否为完整注册
+        // 该信息为完整注册时,通过审核后添加默认角色、菜单权限、菜单信息
         if (appBaseInfo.getAddType().equals("full")){
             // 添加默认角色信息
             SysRole role = new SysRole();
@@ -683,6 +693,7 @@ public class AppmanageServiceImpl implements AppmanageService {
             role.setRoleCode("default");  // 设置角色编码
             role.setAppName(appBaseInfo.getName()) ;  // 设置角色的应用名称
             role.setRoleName(appBaseInfo.getName()+"_默认用户角色");  // 设置角色名
+            role.setDescription(appBaseInfo.getName()+"默认角色");  // 设置备注
             sysRoleService.save(role);  // 添加角色
 
             // 获取角色编码
@@ -701,19 +712,39 @@ public class AppmanageServiceImpl implements AppmanageService {
             sysUserController.addSysUserRole(sysUserRoleVO);
 
             // 创建该应用的一级菜单
-            SysPermission sysPermission = new SysPermission();
-            sysPermission.setName(appBaseInfo.getName());
-            sysPermission.setAppId(appid);
-            sysPermission.setUrl(appBaseInfo.getMenuInfo());
-            // 设置组件(即 菜单路径去掉第一个 "/")
-            String component = sysPermission.getUrl().replaceFirst("^/", "");
-            sysPermission.setComponent(component);
-            sysPermission.setMenuType(0);
-            sysPermission.setRoute(true);
-            sysPermissionService.addPermission(sysPermission);
-
-            // 授予应用默认角色访问一级菜单权限
-            sysRolePermissionService.saveRolePermission(roleid, sysPermission.getId(),"");
+            // 首先判断菜单是否已存在
+            SysPermission hassysPermission = customMapper.queryUrlByUrl(appBaseInfo.getMenuInfo());
+            if (hassysPermission == null){
+                SysPermission sysPermission = new SysPermission();
+                sysPermission.setName(appBaseInfo.getName());
+                sysPermission.setAppId(appid);
+                sysPermission.setUrl(appBaseInfo.getMenuInfo());
+                // 设置组件(即 菜单路径去掉第一个 "/")
+                String component = sysPermission.getUrl().replaceFirst("^/", "");
+                sysPermission.setComponent(component);
+                sysPermission.setMenuType(0);
+                sysPermission.setRoute(true);
+                sysPermissionService.addPermission(sysPermission);
+                // 授予应用默认角色访问一级菜单权限
+                sysRolePermissionService.saveRolePermission(roleid, sysPermission.getId(),"");
+            }else {
+                // 授予应用默认角色访问一级菜单权限
+                sysRolePermissionService.saveRolePermission(roleid, hassysPermission.getId(),"");
+            }
+        }
+    }
+
+    // 应用注册 撤销后续处理(删除插入的数据)
+    @Override
+    public void afterUnsendAppRegisterFlow(long workID) {
+        // 通过workID获取应用id
+        String appid = customMapper.getAppidByWorkID(workID);
+        String addType = customMapper.queryAppRegisterTypeByAppid(appid);
+        customMapper.deleteAppBaseInfoNotLogic(appid);
+        if (addType.equals("full")){
+            customMapper.deleteAppDocInfoNotLogic(appid);
+            customMapper.deleteAppEnvInfoNotLogic(appid);
+            customMapper.deleteAppUserInfoNotLogic(appid);
         }
     }
 }

+ 4 - 3
jeecg-boot/jflow-core/src/main/java/bp/difference/client/SystemClient.java

@@ -1,10 +1,7 @@
 package bp.difference.client;
 
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
 @FeignClient(value = "jeecg-system")
@@ -14,4 +11,8 @@ public interface SystemClient {
     @GetMapping("/sys/applicationInfo/afterAppCheckPass")
     <T> void afterAppCheckPass(@RequestParam("appid") String appid,
                            @RequestParam("formData") T formData);
+
+    // 注册应用流程撤销 后续处理的微服务调用
+    @GetMapping("/sys/applicationInfo/afterUnsendAppRegisterFlow")
+    void afterUnsendAppRegisterFlow(@RequestParam("workID") long workID);
 }

+ 29 - 2
jeecg-boot/jflow-core/src/main/java/bp/wf/Dev2Interface.java

@@ -1,6 +1,7 @@
 package bp.wf;
 
 import bp.da.*;
+import bp.difference.client.SystemClient;
 import bp.en.*;
 import bp.port.*;
 import bp.port.Dept;
@@ -11,6 +12,11 @@ import bp.wf.template.*;
 import bp.difference.*;
 import bp.wf.template.sflow.*;
 import bp.wf.port.*;
+import org.jeecg.common.config.mqtoken.UserTokenContext;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.SpringContextUtils;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
@@ -5894,10 +5900,9 @@ c	*/
 			}
 			unSendToNode = DBAccess.RunSQLReturnValInt(currNode, 0);
 		}
-
+		MicroserviceCall(workID);
 		WorkUnSend unSend = new WorkUnSend(flowNo, workID, unSendToNode, fid);
 		unSend.UnSendToNode = unSendToNode;
-
 		return unSend.DoUnSend();
 	}
 
@@ -15037,4 +15042,26 @@ c	*/
 
 		return tk.getMyPK();
 	}
+
+	public static String getTemporaryToken() {
+		RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
+		//模拟登录生成临时Token
+		//参数说明:第一个参数是用户名、第二个参数是密码的加密串
+		String token = JwtUtil.sign("??", "??");
+		// 设置Token缓存有效时间为 5 分钟
+		redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+		redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
+		return token;
+	}
+
+	private static void MicroserviceCall(long workID){
+		String fk_flow = DBAccess.RunSQLReturnString("SELECT FK_Flow FROM wf_generworkflow WHERE WorkID = "+workID);
+		UserTokenContext.setToken(getTemporaryToken());
+		SystemClient systemClient = BeanUtils.getBean(SystemClient.class);
+		System.out.println("拿到的流程编号:"+fk_flow);
+		if (fk_flow.equals("021")||fk_flow.equals("022")){
+			systemClient.afterUnsendAppRegisterFlow(workID);
+		}
+		UserTokenContext.remove();
+	}
 }

+ 31 - 4
jeecg-boot/jflow-core/src/main/java/bp/wf/httphandler/WF_MyView.java

@@ -1,6 +1,7 @@
 package bp.wf.httphandler;
 
 import bp.da.*;
+import bp.difference.client.SystemClient;
 import bp.sys.*;
 import bp.web.*;
 import bp.port.*;
@@ -9,6 +10,11 @@ import bp.wf.template.*;
 import bp.difference.*;
 import bp.*;
 import bp.wf.*;
+import org.jeecg.common.config.mqtoken.UserTokenContext;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.SpringContextUtils;
 
 import java.net.URLEncoder;
 import java.util.*;
@@ -596,6 +602,8 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 				gwl.SetPara("ToEmps", "");
 				gwl.Update();
 			}
+			// 撤销后续处理
+
 			return "撤销成功";
 		}
 		//获取用户当前所在的节点
@@ -703,11 +711,7 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 				return true;
 			}
 		}
-
-
 			///#endregion 基本权限控制.
-
-
 			///#region 按照部门控制.
 		//本部门可见.
 		if (viewEn.getPMyDept() == true)
@@ -1672,5 +1676,28 @@ public class WF_MyView extends bp.difference.handler.DirectoryPageBase
 			return "err@" + ex.getMessage();
 		}
 	}
+	public static String getTemporaryToken() {
+		RedisUtil redisUtil = SpringContextUtils.getBean(RedisUtil.class);
+		//模拟登录生成临时Token
+		//参数说明:第一个参数是用户名、第二个参数是密码的加密串
+		String token = JwtUtil.sign("??", "??");
+		// 设置Token缓存有效时间为 5 分钟
+		redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+		redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 5 * 60 * 1000);
+		return token;
+	}
+
+//	private void MicroserviceCall(){
+//		UserTokenContext.setToken(getTemporaryToken());
+//		String tag = this.rptGe.getRow().GetValStrByKey("workFlowType");
+//		switch (tag){
+//			case "App_Register":  // 应用注册审批流程
+//				SystemClient systemClient = BeanUtils.getBean(SystemClient.class);
+//				String appid = this.rptGe.getRow().GetValStrByKey("id");
+//				systemClient.afterAppCheckPass(appid, this.rptGe.getRow());
+//				break;
+//		}
+//		UserTokenContext.remove();
+//	}
 
 }

+ 1 - 1
jeecgboot-vue3/src/utils/http/axios/index.ts

@@ -261,7 +261,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
         // authenticationScheme: 'Bearer',
         authenticationScheme: '',
         //接口超时设置
-        timeout: 10 * 1000,
+        timeout: 50 * 1000,
         // 基础接口地址
         // baseURL: globSetting.apiUrl,
         headers: { 'Content-Type': ContentTypeEnum.JSON },

+ 1 - 0
jeecgboot-vue3/src/views/appmanage/addForm/Step4.vue

@@ -576,6 +576,7 @@ export default defineComponent({
      emit('add', addForm_newlyUserData.value)
      modalVisible.value=false
      data.value = []
+     addForm_newlyUserData.value = []
    }
 
     /**

+ 3 - 3
jeecgboot-vue3/src/views/appmanage/addForm/data.tsx

@@ -242,7 +242,7 @@ export const step2Schemas: FormSchema[] = [
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {
@@ -362,7 +362,7 @@ export const step2_1Schemas: FormSchema[] = [
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {
@@ -482,7 +482,7 @@ export const step2_2Schemas: FormSchema[] = [
     },
   },
   {
-    field: 'dataBaseInfo',
+    field: 'databaseInfo',
     component: 'Input',
     label: '数据库信息',
     colProps: {

+ 11 - 0
jeecgboot-vue3/src/views/integrityAppRegister/Demo.vue

@@ -0,0 +1,11 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+  <h1>完整应用注册示例一页面</h1>
+</template>
+
+<style scoped lang="less">
+
+</style>