4 Комити 5320408602 ... 5bdad6d3b1

Аутор SHA1 Порука Датум
  gufj 5bdad6d3b1 Merge remote-tracking branch 'origin/dev/1.0.0-evosynth' into dev/1.0.0-evosynth пре 3 месеци
  gufj 8d42e27592 fix: 流程开发 пре 3 месеци
  liuc 5b6e80fb64 fix: 流程优化 пре 3 месеци
  liuc 157867b3cb fix: 流程优化 пре 3 месеци

+ 7 - 0
bound-link-api/blink-base/src/main/java/com/wx/blink/base/module/support/dict/controller/DictController.java

@@ -74,4 +74,11 @@ public class DictController extends SupportBaseController {
     }
 
 
+    @GetMapping("/dict/category/query1")
+    @NoNeedLogin
+    public ResponseDTO<String> allDictQuery1(){
+        return dictCacheService.allDictQuery1();
+    }
+
+
 }

+ 9 - 0
bound-link-api/blink-base/src/main/java/com/wx/blink/base/module/support/dict/dao/DictValueDao.java

@@ -50,4 +50,13 @@ public interface DictValueDao extends BaseMapper<DictValueEntity> {
      *
      */
     DictValueEntity selectByCode(@Param("dictKeyId") String dictKeyId,@Param("valueCode") String valueCode, @Param("deletedFlag") Boolean deletedFlag);
+
+
+    void updateDictKeyId(@Param("dictKeyId") String dictKeyId,@Param("dictKeyId1") String dictKeyId1);
+
+
+    void updateDictKey(@Param("dictKeyId")String dictKeyId,@Param("dictKeyId1") String dictKeyId1);
+
+
+    void updateid(@Param("dictValueId") String dictValueId,@Param("id") String id);
 }

+ 15 - 4
bound-link-api/blink-base/src/main/java/com/wx/blink/base/module/support/dict/service/DictCacheService.java

@@ -1,8 +1,8 @@
 package com.wx.blink.base.module.support.dict.service;
 
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import com.google.common.collect.Lists;
-import lombok.extern.slf4j.Slf4j;
 import com.wx.blink.base.common.domain.ResponseDTO;
 import com.wx.blink.base.common.util.BlinkBeanUtil;
 import com.wx.blink.base.module.support.dict.dao.DictKeyDao;
@@ -10,9 +10,11 @@ import com.wx.blink.base.module.support.dict.dao.DictValueDao;
 import com.wx.blink.base.module.support.dict.domain.entity.DictKeyEntity;
 import com.wx.blink.base.module.support.dict.domain.entity.DictValueEntity;
 import com.wx.blink.base.module.support.dict.domain.vo.DictValueVO;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
@@ -26,7 +28,6 @@ import java.util.stream.Collectors;
  *
  * @Author 云畅联: admin
  * @Date 2022/5/26 19:40:55
- *
  */
 @Slf4j
 @Service
@@ -133,9 +134,19 @@ public class DictCacheService {
      *
      * @param
      * @return
-     * */
-    public ResponseDTO<ConcurrentHashMap<String, List<DictValueVO>>> allDictQuery(){
+     */
+    public ResponseDTO<ConcurrentHashMap<String, List<DictValueVO>>> allDictQuery() {
         return ResponseDTO.ok(DICT_CACHE);
     }
 
+    @Transactional
+    public ResponseDTO<String> allDictQuery1() {
+        List<DictValueEntity> dictKeyValueList = dictValueDao.selectByDeletedFlag(false);
+        for (int i = 0; i < dictKeyValueList.size(); i++) {
+            DictValueEntity dictValueEntity = dictKeyValueList.get(i);
+            String id = RandomUtil.randomString(32);
+            dictValueDao.updateid(dictValueEntity.getDictValueId(),id);
+        }
+        return null;
+    }
 }

+ 11 - 0
bound-link-api/blink-base/src/main/resources/mapper/support/DictValueMapper.xml

@@ -41,4 +41,15 @@
         select * from mate_dict_value where dict_key_id = #{dictKeyId} and deleted_flag = #{deletedFlag}
     </select>
 
+    <update id="updateDictKeyId">
+        update mate_dict_value set dict_key_id = #{dictKeyId1} where dict_value_id  = #{dictKeyId}
+    </update>
+
+    <update id="updateDictKey">
+        update mate_dict_key set dict_key_id = #{dictKeyId1} where dict_key_id =  #{dictKeyId}
+    </update>
+
+    <update id="updateid">
+        update mate_dict_value set dict_value_id = #{id} where dict_value_id  = #{dictValueId}
+    </update>
 </mapper>

+ 3 - 1
bound-link-api/sa-flow-api/src/main/java/com/cloud/sa/service/FlowUniversalService.java

@@ -1,5 +1,6 @@
 package com.cloud.sa.service;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.cloud.sa.flow.commom.domain.common.EngineParams;
@@ -64,10 +65,11 @@ public class FlowUniversalService {
         flowEnteredParam.setFlowVersion(flowVersion);
         flowEnteredParam.setBizObjectid(bizObjectid);
         flowEnteredParam.setTaskid(taskId);
+        String token = StpUtil.getTokenValue();
         Thread thread = new Thread(() -> {
             try {
                 Thread.sleep(10000);
-                StHttpRequest.postHttpClient("http://localhost:" + port + "/bpm/core/instance/autosubmit", JSON.toJSONString(flowEnteredParam));
+                StHttpRequest.postHttpClient("http://localhost:" + port + "/bpm/core/instance/autosubmit", JSON.toJSONString(flowEnteredParam),token);
             } catch (Exception e) {
             }
         });

+ 5 - 4
bound-link-api/sa-flow-common/src/main/java/com/cloud/sa/flow/commom/common/Request/StHttpRequest.java

@@ -18,7 +18,7 @@ import java.io.IOException;
  * @date 2024/6/20 19:16
  */
 public class StHttpRequest {
-    public static String postHttpClient(String path, String json) throws Exception {
+    public static String postHttpClient(String path, String json,String token) throws Exception {
         CloseableHttpClient httpClient = HttpClients.createDefault();
         String uri = path;
         try {
@@ -28,7 +28,7 @@ public class StHttpRequest {
             entity.setContentType("application/json"); // 设置请求的内容类型
             httpPost.setEntity(entity);
             // 添加请求头
-            httpPost.addHeader("X-Access-Token", StpUtil.getTokenValue()); // 添加eventId请求头
+            httpPost.addHeader("X-Access-Token", token);
             // 执行请求并获取响应
             CloseableHttpResponse response = httpClient.execute(httpPost);
             try {
@@ -46,13 +46,14 @@ public class StHttpRequest {
         }
         return null;
     }
-    public static String getHttpClient(String path) throws Exception {
+
+    public static String getHttpClient(String path,String token) throws Exception {
         CloseableHttpClient httpClient = HttpClients.createDefault();
         String uri = path;
         try {
             HttpGet httpGet = new HttpGet(uri); // 替换为你的目标URL
             // 添加请求头
-            httpGet.addHeader("X-Access-Token", StpUtil.getTokenValue()); // 添加eventId请求头
+            httpGet.addHeader("X-Access-Token", token);
             // 执行请求并获取响应
             CloseableHttpResponse response = httpClient.execute(httpGet);
             try {

+ 6 - 6
bound-link-api/sa-flow-common/src/main/java/com/cloud/sa/flow/commom/common/system/StUserInfo.java

@@ -32,6 +32,9 @@ public class StUserInfo {
     }
 
     public static String getUserCode() {
+        if (StString.isNotEmpty(threadLocalValueUserCode.get())) {
+            return threadLocalValueUserCode.get();
+        }
         Object userDetails = getLoginUser();
         if (userDetails != null) {
             try {
@@ -46,13 +49,13 @@ public class StUserInfo {
                 throw new RuntimeException(e);
             }
         }
-        if (StString.isNotEmpty(threadLocalValueUserCode.get())) {
-            return threadLocalValueUserCode.get();
-        }
         return StGlobalConstant.ADMIN_USER_CODE;
     }
 
     public static String getUserName() {
+        if (StString.isNotEmpty(threadLocalValueUserName.get())) {
+            return threadLocalValueUserName.get();
+        }
         Object userDetails = getLoginUser();
         if (userDetails != null) {
             try {
@@ -67,9 +70,6 @@ public class StUserInfo {
                 throw new RuntimeException(e);
             }
         }
-        if (StString.isNotEmpty(threadLocalValueUserName.get())) {
-            return threadLocalValueUserName.get();
-        }
         return StGlobalConstant.ADMIN_USER_CODE;
     }
 

+ 1 - 0
bound-link-api/sa-flow-common/src/main/java/com/cloud/sa/flow/commom/domain/common/StGlobalConstant.java

@@ -57,6 +57,7 @@ public class StGlobalConstant {
      * 根据部门或者人的编码,找到岗位:$GetPostByCode([人/部门],'岗位名称')
      */
     public static final String GetPostByCode = "$GetPostByCode";
+    public static final String GetByMethod = "$GetByMethod";
 
 
     public static final String StThreadPoolTaskExecutor = "StThreadPoolTaskExecutor";

+ 4 - 3
bound-link-api/sa-flow-common/src/main/java/com/cloud/sa/flow/commom/service/setting/StSettingService.java

@@ -1,5 +1,6 @@
 package com.cloud.sa.flow.commom.service.setting;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -131,9 +132,9 @@ public class StSettingService {
                         }
                     }
                 }
-                String httpClient = StHttpRequest.getHttpClient(url);
-                List<Map<String, String>> resultList= new ArrayList<>();
-                if(httpClient!=null  ){
+                String httpClient = StHttpRequest.getHttpClient(url, StpUtil.getTokenValue());
+                List<Map<String, String>> resultList = new ArrayList<>();
+                if (httpClient != null) {
                     JSONArray jsonArray = JSONArray.parseArray(httpClient);
                     resultList = jsonArray.stream()
                             .map(obj -> {