Bladeren bron

解决缺陷,调整ga38 导出Excel明显逻辑

zhulu 1 jaar geleden
bovenliggende
commit
d41c1903ed

+ 5 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysPhysicalDefenseConstruction.java

@@ -2,6 +2,8 @@ package com.xunmei.system.domain;
 
 import java.util.Date;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -48,11 +50,13 @@ public class SysPhysicalDefenseConstruction extends BaseEntity {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "达标日期")
+    @TableField(fill = FieldFill.UPDATE)
     private Date dateOfCompliance;
 
 
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ApiModelProperty(value = "计划达标日期")
+    @TableField(fill = FieldFill.UPDATE)
     private Date dateOfComplete;
 
     /**
@@ -85,6 +89,7 @@ public class SysPhysicalDefenseConstruction extends BaseEntity {
     private Long orgId;
 
     @ApiModelProperty(value = "未达标原因")
+    @TableField(fill = FieldFill.UPDATE)
     private String reason;
 
 

+ 11 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysPhysicalDefenseConstructionServiceImpl.java

@@ -2,6 +2,7 @@ package com.xunmei.system.service.impl;
 
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xunmei.common.core.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -112,6 +113,16 @@ public class SysPhysicalDefenseConstructionServiceImpl extends ServiceImpl<SysPh
     @Override
     public int updateSysPhysicalDefenseConstruction(SysPhysicalDefenseConstruction sysPhysicalDefenseConstruction) {
         sysPhysicalDefenseConstruction.setUpdateTime(DateUtils.getNowDate());
+        // 未达标需要将达标日期置为空
+        if(ObjectUtil.equal(sysPhysicalDefenseConstruction.getStandard(),"3"))
+        {
+            sysPhysicalDefenseConstruction.setDateOfCompliance(null);
+        }
+        else //达标后清空计划达标时间
+        {
+            sysPhysicalDefenseConstruction.setDateOfComplete(null);
+            sysPhysicalDefenseConstruction.setReason("");
+        }
         return sysPhysicalDefenseConstructionMapper.updateById(sysPhysicalDefenseConstruction);
     }
 

+ 9 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ComplianceStatusConverter.java

@@ -28,10 +28,16 @@ public class ComplianceStatusConverter implements Converter<String> {
 
     @Override
     public CellData convertToExcelData(String s, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
-        if ("1".equals(s)) {
-            return new CellData("达标");
-        }else {
+        if ("2021".equals(s)) {
+            return new CellData("2021");
+        }
+        else if ("2015".equals(s)) {
+            return new CellData("2015");
+        }
+        else if ("1".equals(s)) {
             return new CellData("未达标");
+        }else {
+            return new CellData("未上传");
         }
     }
 }

+ 76 - 42
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -814,46 +814,79 @@ and
 
     </select>
     <select id="selectConstructionDetail" resultType="com.xunmei.system.util.ConstructionDetailExport">
+<!--        SELECT-->
+<!--            a.org_id AS orgId,-->
+<!--            IFNULL( b.ownership, 0 ) AS ownership,-->
+<!--            IF-->
+<!--                (-->
+<!--                            IF-->
+<!--                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+-->
+<!--                            IF-->
+<!--                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,-->
+<!--                            1,-->
+<!--                            0-->
+<!--                ) AS complianceStatus,-->
+<!--            IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,-->
+<!--            IF-->
+<!--                (-->
+<!--                            IF-->
+<!--                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+-->
+<!--                            IF-->
+<!--                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,-->
+<!--                            NULL,-->
+<!--                            a.reason-->
+<!--                ) AS reason,-->
+<!--            IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ) AS completeDate,-->
+<!--            c.address as address,-->
+<!--            c.affiliated_area as city,-->
+<!--            c.affiliated_bank as orgName,-->
+<!--            c.short_name as networkName-->
+<!--        FROM-->
+<!--            sys_org c-->
+<!--            LEFT JOIN sys_org_physical_defense_construction a ON c.id=a.org_id-->
+<!--            LEFT JOIN sys_org_extend b ON a.org_id = b.org_id-->
+<!--        WHERE c.type=4-->
+<!--          and c.deleted = 0-->
+<!--          and c.is_lock = 0-->
+<!--          and a.type =1-->
+<!--          and c.path like concat(#{orgPath}, '%')-->
+<!--        GROUP BY-->
+<!--            a.org_id-->
         SELECT
-            a.org_id AS orgId,
-            IFNULL( b.ownership, 0 ) AS ownership,
-            IF
-                (
-                            IF
-                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+
-                            IF
-                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,
-                            1,
-                            0
-                ) AS complianceStatus,
-            IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,
-<!--            a.date_of_compliance AS complianceDate,-->
-            IF
-                (
-                            IF
-                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+
-                            IF
-                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,
-                            NULL,
-                            a.reason
-                ) AS reason,
-            IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ) AS completeDate,
-<!--            a.date_of_complete AS completeDate,-->
-            c.address as address,
-            c.affiliated_area as city,
-            c.affiliated_bank as orgName,
-            c.short_name as networkName
+        c.id AS orgId,
+        IFNULL( b.ownership, 0 ) AS ownership,
+        case when a.banking2021=1 then 2021 when a.banking2015=1 then 2015 when a.unGA38=1 then 1  else 0 end as complianceStatus,
+        IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,
+        IF
+        (
+        a.unGA38=1,
+        a.reason,
+        ''
+        ) AS reason,
+        IF( a.unGA38=1, IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ),'') AS completeDate,
+        c.address as address,
+        c.address as address,
+        c.affiliated_area as city,
+        c.affiliated_bank as orgName,
+        c.short_name as networkName
         FROM
-            sys_org_physical_defense_construction a
-                INNER JOIN sys_org c ON c.id=a.org_id
-                LEFT JOIN sys_org_extend b ON a.org_id = b.org_id
+        sys_org c
+        LEFT JOIN (select org_id,date_of_compliance,reason,date_of_complete,
+                        banking2021,
+                        if(banking2015 > 0 and banking2021 = 0, 1, 0) as banking2015,
+                        if(unGA38 >0 and banking2015 = 0 and banking2021 = 0, 1, 0) as unGA38
+                        from (SELECT org_id,Max(date_of_compliance) as date_of_compliance,reason,date_of_complete,
+                        sum(standard = 1) banking2021,
+                        sum(standard = 2) banking2015,
+                        sum(standard = 3) unGA38
+                        FROM sys_org_physical_defense_construction
+                        WHERE type = 1
+                        GROUP BY org_id) t1) a ON c.id = a.org_id
+        LEFT JOIN sys_org_extend b ON c.id = b.org_id
         WHERE c.type=4
-          and c.deleted = 0
-          and c.is_lock = 0
-          and a.type =1
-          and c.path like concat(#{orgPath}, '%')
-        GROUP BY
-            a.org_id
+        and c.deleted = 0
+        and c.is_lock = 0
+        and c.path like concat(#{orgPath}, '%')
     </select>
     <select id="getReachNumber" resultType="java.lang.Integer">
         select SUM(a.size) from (select org_id,if(count(*) > 0,1,0) as size from  sys_org_physical_defense_construction where standard in (1,2) and type = 1 GROUP BY org_id) a
@@ -982,10 +1015,10 @@ and
         from (
 
                  select
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls
                  from dual
              ) t
     </select>
@@ -1252,9 +1285,10 @@ and
         select count(*) from  sys_org a
         LEFT JOIN sys_org_extend b  on a.id = b.org_id
         WHERE 1=1
-          and (b.inner_count > 0 or b.outside_count > 0)
           and a.deleted = 0
           and a.is_lock = 0
+          and a.type = 4
+          and b.askari = 1
           and a.path LIKE concat( #{orgPath}, '%' )
     </select>
     <select id="getHeadSafeCheckNumber" resultType="java.lang.Integer">

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

@@ -50,7 +50,7 @@
 
     <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 o.is_lock != 1 and o.deleted = 0
+        where o.is_lock != 1 and o.deleted = 0 and o.type = 4
         <if test="type != null  and type != ''">
             and op.type = #{type}
         </if>