Browse Source

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.5

jiawuxian 1 năm trước cách đây
mục cha
commit
e91c4bd094

+ 10 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/mapper/SafetyInspectMapper.java

@@ -18,9 +18,9 @@ import java.util.Map;
  */
 @Mapper
 public interface SafetyInspectMapper {
-   SafetyInspectVO selectAllByPath(@Param("orgPath")String orgPath,@Param("year") String year,@Param("orgType") Integer orgType);
+    SafetyInspectVO selectAllByPath(@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType);
 
-  SafetyInspectVO selectSelfByPath(@Param("cycle") Integer cycle,@Param("orgPath")String orgPath,@Param("year") String year,@Param("orgType") Integer orgType);
+    SafetyInspectVO selectSelfByPath(@Param("cycle") Integer cycle, @Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType);
 
     Page<SafetyInspectVO> report(@Param("page") Page<SafetyInspectVO> page, @Param("safetyInspectDTO") SafetyInspectDTO safetyInspectDTO);
 
@@ -28,16 +28,22 @@ public interface SafetyInspectMapper {
 
     /**
      * zic机构维度
+     *
      * @return
      */
-    Map orgDimension(@Param("orgPath") String orgPath,@Param("year") String year,@Param("orgType") Integer orgType,@Param("type")Integer type);
+    Map orgDimension(@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
+
+    Integer orgDimensionPlanInspectOrg(@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
+
+    Integer orgDimensionRealityInspectOrg(@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
 
     /**
      * zic隐患维度
+     *
      * @param orgPath
      * @param year
      * @param orgType
      * @return
      */
-    Map pitfallDimension (@Param("orgPath") String orgPath,@Param("year") String year,@Param("orgType") Integer orgType,@Param("type")Integer type);
+    Map pitfallDimension(@Param("orgPath") String orgPath, @Param("year") String year, @Param("orgType") Integer orgType, @Param("type") Integer type);
 }

+ 9 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/impl/SafetyInspectServiceImpl.java

@@ -72,9 +72,15 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
             SafetyInspectVO safetyInspectVOS = safetyInspectMapper.selectAllByPath(s.getPath(),safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType());
             //机构维度
             Map map = safetyInspectMapper.orgDimension(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),4);
-            safetyInspectVO.setPlanInspectOrg(Integer.valueOf(map.get("planInspectOrg").toString()));
-            safetyInspectVO.setRealityInspectOrg(Integer.valueOf(map.get("realityInspectOrg").toString()));
-            safetyInspectVO.setInspectCoverRate(map.get("inspectCoverRate").toString());
+            Integer planInspectOrg = safetyInspectMapper.orgDimensionPlanInspectOrg(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
+            Integer realityInspectOrg = safetyInspectMapper.orgDimensionRealityInspectOrg(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(), 4);
+            Double i = 0d;
+            if (planInspectOrg != 0 && realityInspectOrg != 0) {
+                i = (double) realityInspectOrg / planInspectOrg * 100;
+            }
+            safetyInspectVO.setPlanInspectOrg(planInspectOrg);
+            safetyInspectVO.setRealityInspectOrg(realityInspectOrg);
+            safetyInspectVO.setInspectCoverRate(String.format("%.2f", i) + "%");
             safetyInspectVO.setOrgName(s.getShortName());
             Map map1 = safetyInspectMapper.pitfallDimension(s.getPath(), safetyInspectDTO.getYear(), safetyInspectDTO.getOrgType(),4);
 

+ 46 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

@@ -107,7 +107,7 @@
     </select>
     <select id="orgDimension" resultType="java.util.Map">
         SELECT
-        COUNT( a.id ) AS planInspectOrg,
+        COUNT(distinct a.id ) AS planInspectOrg,
         IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityInspectOrg,
         IFNULL(
         CONCAT(
@@ -204,4 +204,49 @@
             AND b.type = #{orgType}
         </if>
     </select>
+    <select id="orgDimensionPlanInspectOrg" resultType="java.lang.Integer">
+        SELECT
+        COUNT(distinct a.org_id ) AS planInspectOrg
+        FROM
+        core_safety_task a
+        LEFT JOIN core_safecheck_plan b ON a.plan_id = b.id
+        LEFT JOIN sys_org c ON a.org_id = c.id
+        WHERE
+        a.deleted = 0
+        <if test="orgPath !=null and orgPath !=''">
+            and a.org_path like concat(#{orgPath},'%')
+        </if>
+        <if test="year !=null and year !=''">
+            AND a.ymd_year = #{year}
+        </if>
+        <if test="orgType !=null">
+            AND c.type = #{orgType}
+        </if>
+        <if test="type !=null">
+            and b.check_type=#{type}
+        </if>
+    </select>
+    <select id="orgDimensionRealityInspectOrg" resultType="java.lang.Integer">
+        SELECT
+        COUNT( DISTINCT a.org_id ) AS planInspectOrg
+        FROM
+        core_safety_task a
+        LEFT JOIN core_safecheck_plan b ON a.plan_id = b.id
+        LEFT JOIN sys_org c ON a.org_id = c.id
+        WHERE
+        a.deleted = 0
+        AND a.`status` =3
+        <if test="orgPath !=null and orgPath !=''">
+            and a.org_path like concat(#{orgPath},'%')
+        </if>
+        <if test="year !=null and year !=''">
+            AND a.ymd_year = #{year}
+        </if>
+        <if test="orgType !=null">
+            AND c.type = #{orgType}
+        </if>
+        <if test="type !=null">
+        and b.check_type=#{type}
+        </if>
+    </select>
 </mapper>

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

@@ -1168,28 +1168,7 @@ and a.org_path LIKE concat(#{orgPath}, '%')
           </if>
 
         ORDER BY
-            FIELD( `name`, '福州', '厦门', '漳州', '泉州', '莆田', '三明', '南平', '龙岩', '宁德' ),
-            FIELD(
-                    short_name,
-                    '福州农商行',
-                    '闽侯联社',
-                    '闽清联社',
-                    '永泰联社',
-                    '长乐农商银行',
-                    '福清汇通农商行',
-                    '平潭农商银行',
-                    '连江农商行',
-                    '罗源联社',
-                    '厦门农商行',
-                    '漳州农商银行',
-                    '龙梅农商银行',
-                    '云霄联社',
-                    '漳浦农商银行',
-                    '诏安联社',
-                    '长泰联社',
-                    '东山联社',
-                    '南靖联社'
-                )
+        sort
     </select>