Parcourir la source

外部费用与前端联调

xuqiang il y a 1 an
Parent
commit
368fe6cbce

+ 26 - 17
platform/src/main/java/com/jzg/service/impl/JyxConfigServiceImpl.java

@@ -102,14 +102,14 @@ public class JyxConfigServiceImpl extends ServiceImpl<JyxConfigMapper, JyxConfig
             JyxConfigVo jyxConfigVo = BeanUtil.copyProperties(config, JyxConfigVo.class);
             JyxConfigVo jyxConfigVo = BeanUtil.copyProperties(config, JyxConfigVo.class);
             CompletableFuture<Void> blameFuture = CompletableFuture.runAsync(() -> {
             CompletableFuture<Void> blameFuture = CompletableFuture.runAsync(() -> {
                 try {
                 try {
-                    jyxConfigVo.setBlameList(selectBlameList(id));
+                    jyxConfigVo.setBlameList(selectBlameList(config.getId()));
                 } catch (Exception e) {
                 } catch (Exception e) {
                     log.error("加载 blameList 失败", e);
                     log.error("加载 blameList 失败", e);
                 }
                 }
             });
             });
             CompletableFuture<Void> settingFuture = CompletableFuture.runAsync(() -> {
             CompletableFuture<Void> settingFuture = CompletableFuture.runAsync(() -> {
                 try {
                 try {
-                    jyxConfigVo.setSettingList(selectSettingList(id));
+                    jyxConfigVo.setSettingList(selectSettingList(config.getId()));
                 } catch (Exception e) {
                 } catch (Exception e) {
                     log.error("加载 settingList 失败", e);
                     log.error("加载 settingList 失败", e);
                 }
                 }
@@ -161,30 +161,39 @@ public class JyxConfigServiceImpl extends ServiceImpl<JyxConfigMapper, JyxConfig
         try {
         try {
             List<JyxConfigVo> jyxConfigVos = Optional.ofNullable(jyxConfigMapper.jyxList(configParam)).orElse(Collections.emptyList());
             List<JyxConfigVo> jyxConfigVos = Optional.ofNullable(jyxConfigMapper.jyxList(configParam)).orElse(Collections.emptyList());
             if (StringUtils.isNotEmpty(configParam.getSeats()) || StringUtils.isNotEmpty(configParam.getParams())) {
             if (StringUtils.isNotEmpty(configParam.getSeats()) || StringUtils.isNotEmpty(configParam.getParams())) {
-                configParam.setParentId(ConstantsParent.PARENT_ID_ROOT);
-                List<JyxConfigVo> additionalConfigs = Optional.ofNullable(jyxConfigMapper.jyxList(configParam)).orElse(Collections.emptyList());
-                if (!additionalConfigs.isEmpty()) {
-                    Set<String> ids = additionalConfigs.stream().map(JyxConfigVo::getId).collect(Collectors.toSet());
-                    List<JyxConfigVo> parentConfigs = jyxConfigMapper.selectParentIds(new ArrayList<>(ids));
-                    jyxConfigVos.addAll(parentConfigs);
-                    jyxConfigVos = jyxConfigVos.stream().collect(collectingAndThen(
-                            toCollection(() -> new TreeSet<>(Comparator.comparing(JyxConfigVo::getId))), ArrayList::new
-                    ));
-                }
+
+                Set<String> ids = jyxConfigVos.stream().filter(v -> !ConstantsParent.PARENT_ID_ROOT.equals(v.getParentId())).map(JyxConfigVo::getParentId).collect(Collectors.toSet());
+                List<JyxConfigVo> parentConfigs = jyxConfigMapper.selectParentIds(new ArrayList<>(ids));
+                jyxConfigVos.addAll(parentConfigs);
+                jyxConfigVos = jyxConfigVos.stream().collect(collectingAndThen(
+                        toCollection(() -> new TreeSet<>(Comparator.comparing(JyxConfigVo::getId))), ArrayList::new
+                ));
+
+//                configParam.setParentId(ConstantsParent.PARENT_ID_ROOT);
+//                List<JyxConfigVo> additionalConfigs = Optional.ofNullable(jyxConfigMapper.jyxList(configParam)).orElse(Collections.emptyList());
+//                if (!additionalConfigs.isEmpty()) {
+//                    Set<String> ids = additionalConfigs.stream().map(JyxConfigVo::getId).collect(Collectors.toSet());
+//                    List<JyxConfigVo> parentConfigs = jyxConfigMapper.selectParentIds(new ArrayList<>(ids));
+//                    jyxConfigVos.addAll(parentConfigs);
+//                    jyxConfigVos = jyxConfigVos.stream().collect(collectingAndThen(
+//                            toCollection(() -> new TreeSet<>(Comparator.comparing(JyxConfigVo::getId))), ArrayList::new
+//                    ));
+//                }
             }
             }
             if (jyxConfigVos.isEmpty()) {
             if (jyxConfigVos.isEmpty()) {
                 return Collections.emptyList();
                 return Collections.emptyList();
             }
             }
-            Set<String> parentIds = jyxConfigVos.stream().map(JyxConfigVo::getParentId).collect(Collectors.toSet());
-            List<JyxConfigVo> jyxConfigs = Optional.ofNullable(jyxConfigMapper.selectIds(new ArrayList<>(parentIds))).orElse(Collections.emptyList());
+//            Set<String> parentIds = jyxConfigVos.stream().map(JyxConfigVo::getParentId).collect(Collectors.toSet());
+//            List<JyxConfigVo> jyxConfigs = Optional.ofNullable(jyxConfigMapper.selectIds(new ArrayList<>(parentIds))).orElse(Collections.emptyList());
             Map<String, List<JyxConfigVo>> childrenMap = jyxConfigVos.stream()
             Map<String, List<JyxConfigVo>> childrenMap = jyxConfigVos.stream()
                     .filter(vo -> !ConstantsParent.PARENT_ID_ROOT.equals(vo.getParentId()))
                     .filter(vo -> !ConstantsParent.PARENT_ID_ROOT.equals(vo.getParentId()))
                     .collect(Collectors.groupingBy(vo -> String.valueOf(vo.getParentId()), Collectors.mapping(Function.identity(), Collectors.toList())));
                     .collect(Collectors.groupingBy(vo -> String.valueOf(vo.getParentId()), Collectors.mapping(Function.identity(), Collectors.toList())));
-            List<JyxConfigVo> parentConfigs = BeanUtil.copyToList(jyxConfigs, JyxConfigVo.class);
-            parentConfigs.forEach(parentConfig -> {
+
+            List<JyxConfigVo> configVos = jyxConfigVos.stream().filter(parentConfig -> ConstantsParent.PARENT_ID_ROOT.equals(parentConfig.getParentId())).collect(Collectors.toList());
+            configVos.forEach(parentConfig -> {
                 parentConfig.setChildren(childrenMap.getOrDefault(String.valueOf(parentConfig.getId()), Collections.emptyList()));
                 parentConfig.setChildren(childrenMap.getOrDefault(String.valueOf(parentConfig.getId()), Collections.emptyList()));
             });
             });
-            return parentConfigs;
+            return configVos;
         } catch (Exception e) {
         } catch (Exception e) {
             // 记录日志或进行其他异常处理
             // 记录日志或进行其他异常处理
             e.printStackTrace();
             e.printStackTrace();

+ 3 - 0
platform/src/main/resources/application.yml

@@ -45,6 +45,9 @@ tenant:
     - ins_company_clause
     - ins_company_clause
     - ptl_agreement_attribution
     - ptl_agreement_attribution
     - ptl_agreement_url
     - ptl_agreement_url
+    - jyx_blame
+    - jyx_config
+    - jyx_setting
   ignoreLoginNames:
   ignoreLoginNames:
 
 
   ignoreFunction:
   ignoreFunction:

+ 1 - 1
platform/src/main/resources/mapper/JyxConfigMapper.xml

@@ -103,7 +103,7 @@
         left join jyx_setting js on jc.id = js.jyx_config_id
         left join jyx_setting js on jc.id = js.jyx_config_id
         <where>
         <where>
             <if test="ids != null and ids != ''">
             <if test="ids != null and ids != ''">
-                and jc.parent_id in
+                and jc.id in
                 <foreach collection="ids" item="id" open="(" separator="," close=")">
                 <foreach collection="ids" item="id" open="(" separator="," close=")">
                     #{id}
                     #{id}
                 </foreach>
                 </foreach>

+ 0 - 1
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostExternalController.java

@@ -4,7 +4,6 @@ package com.jzg.organization.controller;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.vo.CostExternalListVo;
 import com.jzg.commons.entity.vo.CostExternalListVo;
-import com.jzg.commons.request.RequestSingleParam;
 import com.jzg.organization.service.PtlAgreementCostExternalService;
 import com.jzg.organization.service.PtlAgreementCostExternalService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tag;

+ 5 - 2
tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml

@@ -145,8 +145,11 @@
             <if test="costParam.auditStatus != null and costParam.auditStatus != ''">
             <if test="costParam.auditStatus != null and costParam.auditStatus != ''">
                 AND ce.audit_status = #{costParam.auditStatus}
                 AND ce.audit_status = #{costParam.auditStatus}
             </if>
             </if>
-            <if test="costParam.validState != null and costParam.validState != ''">
-                AND ce.is_valid = #{costParam.validState}
+            <if test="costParam.validState == 0">
+                AND ce.failure_time &gt;= NOW()
+            </if>
+            <if test="costParam.validState == 1">
+                AND ce.failure_time &lt;= NOW()
             </if>
             </if>
             <if test="costParam.effectiveTime != null and costParam.effectiveTime.size() > 0">
             <if test="costParam.effectiveTime != null and costParam.effectiveTime.size() > 0">
                 AND ce.effective_time BETWEEN #{costParam.effectiveTime[0]} AND #{costParam.effectiveTime[1]}
                 AND ce.effective_time BETWEEN #{costParam.effectiveTime[0]} AND #{costParam.effectiveTime[1]}