Forráskód Böngészése

Merge remote-tracking branch 'origin/V0.0.9' into V0.0.9

jingyuanchao 1 éve
szülő
commit
800794c679

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/web/OrgInfoVo.java

@@ -13,4 +13,8 @@ public class OrgInfoVo {
     private int offlineCount;
     @ApiModelProperty("网点业务库数量")
     private int bankingStoreCount;
+
+    @ApiModelProperty("营业网点+中心业务库数量")
+    private int businessStoreCount;
+
 }

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/panel/service/impl/PanelServiceImpl.java

@@ -372,6 +372,7 @@ public class PanelServiceImpl implements PanelService {
 //                    fileLit.add(JSON.toJSONString(map));
 //                }
             }
+            resultList.sort(Comparator.comparing(SysLearningMaterialsPageVo::getUpdateTime).reversed());
             hashMap.put("index2", resultList);
         }
     }

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/board/AppCockpitMapper.xml

@@ -118,7 +118,7 @@
     </select>
 
     <select id="selectOrgBaseInfo" resultType="com.xunmei.core.board.dto.app.AppOrgBaseInfoDto">
-        SELECT count(0)                                                                        as total,
+        SELECT sum(if(o.type = 4 or o.type = 5, 1, 0))                                                                    as total,
                sum(if(oh.org_id is null, 1, 0))                                                as unreachedCount,
                sum(if(o.type = 4, 1, 0))                                                       as bankingCount,
                sum(if(o.type = 4 and oe.self_service_bank = 1, 1, 0))                          as onlineATMCount,
@@ -164,7 +164,7 @@
         WHERE o.deleted = 0
           and o.is_lock = 0
           and o.path like concat(#{orgPath}, '%')
-           AND (o.type = 4 OR o.type = 5)
+           AND (o.type = 4 OR o.type = 5 OR o.type = 6)
 <!--        and o.type = 4-->
     </select>
     <select id="selectSyntheticResumption" resultType="com.xunmei.core.board.dto.app.AppSyntheticTaskCategoryDto">

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml

@@ -170,7 +170,8 @@
         select sum(if(o.type = 3, 1, 0))                                     as hangsheCount,
                sum(if(o.type = 4, 1, 0))                                     as bankingCount,
                sum(if(o.type = 5, 1, 0))                                     as offlineCount,
-               sum(if(o.type = 4 and oe.business_library =1, 1, 0)) as bankingStoreCount
+               sum(if(o.type = 4 and oe.business_library =1, 1, 0)) as bankingStoreCount,
+               sum(if((o.type = 4 and oe.business_library =1) OR o.type =6, 1, 0)) as businessStoreCount
         from sys_org o
                  LEFT JOIN sys_org_extend oe on o.id = oe.org_id
         WHERE o.deleted = 0

+ 18 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/dto/SysPhysicalDefenseConstructionDTO.java

@@ -0,0 +1,18 @@
+package com.xunmei.system.dto;
+
+import com.xunmei.system.domain.SysPhysicalDefenseConstruction;
+import lombok.Data;
+
+/**
+ * 机构物防建设对象 sys_org_physical_defense_construction
+ *
+ * @author xunmei
+ * @date 2023-08-16
+ */
+@Data
+public class SysPhysicalDefenseConstructionDTO extends SysPhysicalDefenseConstruction {
+    /**
+     * 机构路径
+     */
+    private String orgPath;
+}

+ 4 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysPhysicalDefenseConstructionMapper.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.xunmei.system.domain.SysPhysicalDefenseConstruction;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 机构物防建设Mapper接口
@@ -28,6 +30,8 @@ public interface SysPhysicalDefenseConstructionMapper extends BaseMapper<SysPhys
      */
      List<SysPhysicalDefenseConstruction> selectSysOrgPhysicalDefenseConstructionList(SysPhysicalDefenseConstruction sysPhysicalDefenseConstruction);
 
+    List<SysPhysicalDefenseConstructionDTO> selectListByPath(@Param("orgPath") String orgPath,@Param("type") int type);
+
     /**
      * 新增机构物防建设
      *

+ 67 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -29,8 +29,11 @@ import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
+import com.xunmei.system.domain.SysPhysicalDefenseConstruction;
 import com.xunmei.system.dto.SysOrgDto;
+import com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO;
 import com.xunmei.system.mapper.SysOrgMapper;
+import com.xunmei.system.mapper.SysPhysicalDefenseConstructionMapper;
 import com.xunmei.system.mapper.SysUserMapper;
 import com.xunmei.system.service.ISysOrgService;
 import com.xunmei.system.util.*;
@@ -63,6 +66,9 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     @Autowired
     private SysUserMapper sysUserMapper;
 
+    @Autowired
+    private SysPhysicalDefenseConstructionMapper sysPhysicalDefenseConstructionMapper;
+
     private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
         List<SysOrg> orgList = map.get(parentId);
         if (ObjectUtil.isNotEmpty(orgList)) {
@@ -153,14 +159,74 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
             sysOrgs = this.selectSysOrgByPathAndType(sysOrg.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
         }
 
+        List<SysOrg> allChildOrgs = this.selectSysOrgByPathAndType(sysOrg.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
+
+        List<SysPhysicalDefenseConstructionDTO> allOrgGA38Datas= sysPhysicalDefenseConstructionMapper.selectListByPath(sysOrg.getPath(),1);
+
         /**
          *根据查询机构机构,统计查询数据
          */
-        List<OrgPhysicalDefenseConstructionExport> excelData = getExcelData(sysOrgs);
+        List<OrgPhysicalDefenseConstructionExport> excelData = getExcelData(sysOrgs,allChildOrgs,allOrgGA38Datas);
         return excelData;
     }
 
     /**
+     *
+      * @param showOrgs
+     * @param allChildOrgs
+     * @param allOrgGA38Datas
+     * @return
+     */
+    private List<OrgPhysicalDefenseConstructionExport> getExcelData(List<SysOrg> showOrgs, List<SysOrg> allChildOrgs, List<SysPhysicalDefenseConstructionDTO> allOrgGA38Datas){
+        List<OrgPhysicalDefenseConstructionExport> data = new ArrayList<>();
+        OrgPhysicalDefenseConstructionExport export = null;
+        for (SysOrg s : showOrgs) {
+            export = baseMapper.complianceStatus(s.getPath());
+            export.setCity(s.getAffiliatedArea());
+            export.setOrgName(s.getAffiliatedBank());
+            Integer orgSize = allChildOrgs.stream().filter(x->x.getPath().startsWith(s.getPath())).collect(Collectors.toList()).size();  //baseMapper.selectNetworkNumberByPath(s.getPath());
+            Double avg = 0d;
+            if (orgSize != 0 || export.getReachNumber() != 0) {
+                avg = (double) export.getReachNumber() / orgSize * 100;
+            }
+            export.setReachRate(Double.valueOf(String.format("%.2f", avg)) + "%");
+            export.setNetworkNumber(orgSize);
+
+            //年度完成
+            LocalDate currentDate = LocalDate.now();
+            Date nowDate= DateUtil.beginOfDay(new Date());
+            String year = String.valueOf(currentDate.getYear());
+
+            Integer s1 =allOrgGA38Datas.stream().filter(x->x.getOrgPath().startsWith(s.getPath()) && year.equals(DateUtil.format(x.getDateOfCompliance(),"yyyy")) && "1".equals(x.getStandard())).collect(Collectors.toList()).size(); //baseMapper.rectificationStatus(s.getPath(), year);
+
+            Map<Long, List<SysPhysicalDefenseConstructionDTO>> orgGroupList = allOrgGA38Datas.stream().filter(x -> x.getOrgPath().startsWith(s.getPath())).collect(Collectors.groupingBy(ga38 -> ga38.getOrgId()));
+
+            AtomicInteger tempNewYeaTransformOldReachNumber=new  AtomicInteger();
+            AtomicInteger tempNewYeaTransformInconformityNumber=new  AtomicInteger();
+            orgGroupList.forEach((k,v)->{
+                // 今天达标 2021标
+                if(v.stream().anyMatch(x->"1".equals(x.getStandard()) && year.equals(DateUtil.format(x.getDateOfCompliance(),"yyyy"))))
+                {
+                    // 存在 2015 标
+                    if(v.stream().anyMatch(y->"2".equals(y.getStandard())))
+                    {
+                        tempNewYeaTransformOldReachNumber.incrementAndGet();
+                    }
+                    else{
+                        tempNewYeaTransformInconformityNumber.incrementAndGet();
+                    }
+                }
+            });
+            export.setNewYearReachNumber(s1);
+            export.setNewYeaTransformOldReachNumber(tempNewYeaTransformOldReachNumber.get());
+            export.setNewYeaTransformInconformityNumber(tempNewYeaTransformInconformityNumber.get());
+            data.add(export);
+        }
+
+        return data;
+    }
+
+    /**
      * 组装数据
      * @param orgs
      * @return

+ 10 - 6
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OrgPhysicalDefenseConstructionExport.java

@@ -20,38 +20,42 @@ public class OrgPhysicalDefenseConstructionExport {
     @ExcelProperty(value = "序号", index = 0)
     @TableField(exist = false)
     private String xh;
+
     @ExcelProperty(value = "地区", index = 1)
     private String city;
+
     @ExcelProperty(value = "行社", index = 2)
     private String orgName;
+
     @ExcelProperty(value = "网点数量", index = 3)
     @ApiModelProperty(value = "网点数量")
     private Integer networkNumber = 0;
-    @ExcelProperty(value = "营业网点达标率", index = 4)
 
+    @ExcelProperty(value = "营业网点达标率", index = 4)
     @ApiModelProperty(value = "营业网点达标率")
     private String reachRate;
-    @ExcelProperty(value = { "达标建设情况","符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量"}, index = 5)
 
+    @ExcelProperty(value = { "达标建设情况","符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量", "符合GA38-2015,GA38-2021网点合计数量"}, index = 5)
     @ApiModelProperty(value = "符合GA38-2015,GA38-2021网点合计数量")
     private Integer reachNumber = 0;
-    @ExcelProperty(value = {"达标建设情况","其中,符合GA38-2015网点数量"}, index = 6)
 
+    @ExcelProperty(value = {"达标建设情况","其中,符合GA38-2015网点数量"}, index = 6)
     @ApiModelProperty(value = "其中,符合GA38-2015网点数量")
     private Integer oldReachNumber = 0;
-    @ExcelProperty(value = {"达标建设情况","其中,符合GA38-2021网点数量"}, index = 7)
 
+    @ExcelProperty(value = {"达标建设情况","其中,符合GA38-2021网点数量"}, index = 7)
     @ApiModelProperty(value = "其中,符合GA38-2021网点数量")
     private Integer newReachNumber = 0;
+
     @ExcelProperty(value = {"年度已完成达标改造网点情况","已完成GA38-2021达标改造网点合计数量"}, index = 8)
     @ApiModelProperty(value = "已完成GA38-2021达标改造网点合计数量")
     private Integer newYearReachNumber = 0;
-    @ExcelProperty(value = {"年度已完成达标改造网点情况","其中,改造原有符合GA38-2015网点数量"}, index = 9)
 
+    @ExcelProperty(value = {"年度已完成达标改造网点情况","其中,改造原有符合GA38-2015网点数量"}, index = 9)
     @ApiModelProperty(value = "其中,改造原有符合GA38-2015网点数量")
     private Integer newYeaTransformOldReachNumber = 0;
-    @ExcelProperty(value = {"年度已完成达标改造网点情况","其中,改造未符合GA38-2015网点数量"}, index = 10)
 
+    @ExcelProperty(value = {"年度已完成达标改造网点情况","其中,改造未符合GA38-2015网点数量"}, index = 10)
     @ApiModelProperty(value = "其中,改造未符合GA38-2015网点数量")
     private Integer newYeaTransformInconformityNumber = 0;
 }

+ 9 - 4
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -735,16 +735,21 @@ and
         from (
                  select
                      b.id as org_id,
-                     if(SUM(IF(a.standard=1,1,0)) > 0 , 1, 0) as 'ga382021',
-                         if(SUM(IF(a.standard=2,1,0)) > 0 , 1, 0 ) as 'ga382015'
+                     if(a.banking2021 > 0 , 1, 0) as 'ga382021',
+                     if(a.banking2015 > 0 and a.banking2021 = 0 , 1, 0 ) as 'ga382015'
                  from sys_org b
-                          LEFT JOIN sys_org_physical_defense_construction a on a.org_id = b.id
+                          LEFT JOIN (SELECT org_id,
+                                            type,
+                                            sum(type = 1 and standard = 1) banking2021,
+                                            sum(type = 1 and standard = 2) banking2015
+                                     FROM sys_org_physical_defense_construction
+                                     WHERE type = 1
+                                     GROUP BY org_id) a on a.org_id = b.id
                  where 1=1
                    AND b.deleted = 0
                    AND b.is_lock = 0
                    AND b.type = 4
                    AND a.type = 1
-                   AND b.deleted = 0
                    AND b.path LIKE concat(#{orgPath}, '%')
                  GROUP BY b.id ) t
     </select>

+ 14 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysPhysicalDefenseConstructionMapper.xml

@@ -48,6 +48,20 @@
         </where>
     </select>
 
+    <select id="selectListByPath" resultType="com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO">
+        select op.*,o.path as orgPath from sys_org o INNER JOIN sys_org_physical_defense_construction op ON o.id = op.org_id
+        <where>
+            <if test="type != null  and type != ''">
+                and op.type = #{type}
+            </if>
+            <if test="orgPath != null  and orgPath != ''">
+                and o.path LIKE concat(#{orgPath}, '%')
+            </if>
+        </where>
+    </select>
+
+
+
     <select id="selectSysOrgPhysicalDefenseConstructionById" parameterType="Long"
             resultMap="SysOrgPhysicalDefenseConstructionResult">
             <include refid="selectSysOrgPhysicalDefenseConstructionVo"/>