Răsfoiți Sursa

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.2

jiawuxian 2 ani în urmă
părinte
comite
a1b6bb250a

+ 8 - 0
project_data/sql/0.0.3/soc/soc.sql

@@ -594,6 +594,14 @@ INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_paren
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (17, 'M37000000', NULL, NULL, 2, 'M46000000', NULL, NULL, NULL, NULL);
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (18, 'M38000000', NULL, NULL, 2, 'M47000000', NULL, NULL, NULL, NULL);
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (19, 'M41000000', 'M32000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+
+DELETE FROM sys_menu WHERE id IN(01720259442805620738,01717076927401005058,01717079254782545922);
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (01720259442805620738, '外包评价', 0, 1, 'core', NULL, NULL, 1, 0, 'M', '0', '0', 'core:send:list', '1', 'edit', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (01717076927401005058, '评价计划管理', 01720259442805620738, 1, 'resumption', 'resumptionEvaluate/evaluate/index', NULL, 1, 1, 'C', '0', '0', 'core:evaluatePlan:list', '1', 'excel', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES (01717079254782545922, '外包评价', 01720259442805620738, 2, 'wbpj', 'resumptionEvaluate/evaluatePlan/index', NULL, 1, 1, 'C', '0', '0', 'core:evaluateTask:list', '1', 'checkbox', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 -- 天气接口配置
 delete from sys_config where config_key='WEATHER_URL';
 INSERT INTO sys_config (config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES (191, '天气接口', 'WEATHER_URL', 'https://ali-weather.showapi.com', 'Y', NULL, now(), NULL, now(), NULL);

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/mapper/MonitorAccessReportMapper.java

@@ -15,8 +15,9 @@ import java.util.List;
  */
 @Mapper
 public interface MonitorAccessReportMapper {
-    Page<MonitoringAccessVO> report(@Param("page") Page<MonitoringAccessVO> page,@Param("monitoringAccessDTO")MonitoringAccessDTO monitoringAccessDTO);
+    Page<MonitoringAccessVO> report(@Param("page") Page<MonitoringAccessVO> page, @Param("monitoringAccessDTO") MonitoringAccessDTO monitoringAccessDTO);
 
     Integer selectNetworkNumberByPath(String orgPath);
+
     List<MonitoringAccessVO> selectAll(MonitoringAccessDTO monitoringAccessDTO);
 }

+ 4 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/MonitorAccessReportService.java

@@ -15,7 +15,10 @@ import java.util.List;
  */
 public interface MonitorAccessReportService {
     TableDataInfo<MonitoringAccessVO> report(MonitoringAccessDTO monitoringAccessDTO);
-    List<MonitoringAccessVO>selectAll(MonitoringAccessDTO monitoringAccessDTO);
+
+    List<MonitoringAccessVO> selectAll(MonitoringAccessDTO monitoringAccessDTO);
+
     void export(MonitoringAccessDTO monitoringAccessDTO, HttpServletResponse response) throws IOException;
+
     String getTitle(MonitoringAccessDTO monitoringAccessDTO);
 }

+ 19 - 8
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/monitor/service/impl/MonitorAccessReportServiceImpl.java

@@ -49,10 +49,24 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
         } else {
             page = new Page<>();
         }
-        if (null != monitoringAccessDTO.getOrgId()) {
-            SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
-            monitoringAccessDTO.setOrgPath(sysOrg.getPath());
+        int amount;
+        switch (monitoringAccessDTO.getCycle()) {
+            case "6":
+                amount = 365;
+                break;
+            case "3":
+                amount=30;
+                break;
+            default:
+                amount = 7;
+                break;
         }
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(new Date());
+        cal.add(Calendar.DATE, -amount);
+        Date time = cal.getTime();
+        monitoringAccessDTO.setStartTime(time);
+        monitoringAccessDTO.setEndTime(new Date());
         Page<MonitoringAccessVO> report = monitorAccessReportMapper.report(page, monitoringAccessDTO);
         report.getRecords().forEach(r -> {
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(r.getPath());
@@ -107,20 +121,17 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(monitoringAccessDTO.getOrgId(), SecurityConstants.INNER);
         String timeUnit = "年";
         int amount = 0;
-        LocalDate lastDayOfMonth;
         switch (monitoringAccessDTO.getCycle()) {
             case "2":
                 amount = 7;
                 timeUnit = "周";
                 break;
             case "3":
-                LocalDate currentDate = LocalDate.now();
-                lastDayOfMonth = currentDate.withDayOfMonth(currentDate.lengthOfMonth());
-                amount = lastDayOfMonth.getDayOfMonth() - currentDate.getDayOfMonth();
+                amount=30;
                 timeUnit = "月";
                 break;
             default:
-                amount = getDayNum(12);
+                amount = 365;
                 break;
         }
         Calendar cal = Calendar.getInstance();

+ 0 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/dto/SafetyInspectDTO.java

@@ -14,7 +14,6 @@ import java.util.Date;
 @Data
 public class SafetyInspectDTO extends BaseEntity {
     private Long orgId;
-
     private String year;
     private String orgPath;
 }

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/safetyInspect/service/SafetyInspectService.java

@@ -17,6 +17,8 @@ import java.util.List;
  */
 public interface SafetyInspectService {
     TableDataInfo<SafetyInspectVO> report(SafetyInspectDTO safetyInspectDTO);
+
     void export(SafetyInspectDTO safetyInspectDTO, HttpServletResponse response) throws IOException;
+
     List<SysOrg> selectAllOrg();
 }

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

@@ -44,10 +44,6 @@ public class SafetyInspectServiceImpl implements SafetyInspectService {
         } else {
             page = new Page<>();
         }
-        if (null==safetyInspectDTO.getOrgId()){
-            SysOrg sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
-            safetyInspectDTO.setOrgPath(sysOrg.getPath());
-        }
         Page<SafetyInspectVO> report = safetyInspectMapper.report(page, safetyInspectDTO);
         report.getRecords().forEach(r -> {
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(r.getPath());

+ 9 - 11
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/MonitorAccessReportMapper.xml

@@ -12,22 +12,20 @@
         SUM(
         IF
         ( a.`status` = 2, 1, 0 )) AS realityAccessNumber,
-        SUM(
+        CONCAT(SUM(
         IF
-        ( a.`status` = 2, 1, 0 ))/ COUNT( a.id ) AS accessRate
+        ( a.`status` = 2, 1, 0 ))/ COUNT( a.id )*100,'%') AS accessRate
         FROM
-        core_monitoring_retrieval_task a
-        LEFT JOIN sys_org b ON a.org_id = b.id
+        sys_org b
+        LEFT JOIN core_monitoring_retrieval_task a ON a.org_id = b.id
+        AND a.is_deleted = 0
         WHERE
-        a.is_deleted=0
-        <if test="monitoringAccessDTO.orgPath != null  and monitoringAccessDTO.orgPath != ''">
-            and     b.path like concat( #{monitoringAccessDTO.orgPath}, '%')
-        </if>
-        <if test="monitoringAccessDTO.cycle != null  and monitoringAccessDTO.cycle != ''">
-            AND a.cycle = #{monitoringAccessDTO.cycle}
+        b.deleted = 0
+        <if test="monitoringAccessDTO.orgId != null  and monitoringAccessDTO.orgId != ''">
+            AND b.parent_id=#{monitoringAccessDTO.orgId}
         </if>
         <if test="monitoringAccessDTO.startTime != null  and monitoringAccessDTO.endTime != null">
-            AND a.start_time >= #{monitoringAccessDTO.startTime} ANDa.end_time &lt;= #{monitoringAccessDTO.endTime}
+            AND a.start_time >= #{monitoringAccessDTO.startTime} AND a.end_time &lt;= #{monitoringAccessDTO.endTime}
         </if>
         GROUP BY
         b.id

+ 16 - 22
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/SafetyInspectMapper.xml

@@ -14,9 +14,9 @@
                     IF
                         ( `status` = 3, 1, 0 )) AS realityInspectNumber,
             SUM( exception_count ) AS pitfallNumber,
-            SUM(
-                    IF
-                        ( `status` = 3, 1, 0 ))/ COUNT( id ) AS inspectRate
+        CONCAT(	 SUM(
+        IF
+        ( `status` = 3, 1, 0 ))/ COUNT( id )*100,'%') AS inspectRate
         FROM
             core_safety_task
         WHERE
@@ -37,32 +37,26 @@
     </select>
     <select id="report" resultType="com.xunmei.core.reportForms.safetyInspect.vo.SafetyInspectVO">
         SELECT
-        org_path AS path,
-        org_name AS orgName,
-        COUNT( id ) AS planInspectNumber,
-        SUM(
-        IF
-        ( `status` = 3, 1, 0 )) AS realityInspectNumber,
-        SUM( exception_count ) AS pitfallNumber,
+        a.org_path AS path,
+        a.org_name AS orgName,
+        COUNT( a.id ) AS planInspectNumber,
         SUM(
         IF
-        ( `status` = 3, 1, 0 ))/ COUNT( id ) AS inspectRate
+        ( a.`status` = 3, 1, 0 )) AS realityInspectNumber,
+        SUM( a.exception_count ) AS pitfallNumber,
+        CONCAT( SUM( IF ( a.`status` = 3, 1, 0 ))/ COUNT( a.id )* 100, '%' ) AS inspectRate
         FROM
-        core_safety_task
+        core_safety_task a LEFT JOIN sys_org b ON a.org_id =b.id
         WHERE
-        deleted=0
-        <if test="safetyInspectDTO.orgId != null  and safetyInspectDTO.orgId != ''">
-            AND   org_id = #{safetyInspectDTO.orgId}
-        </if>
+        a.deleted=0
+      <if test="safetyInspectDTO.orgId != null  and safetyInspectDTO.orgId != ''">
+          AND b.parent_id = #{safetyInspectDTO.orgId}
+      </if>
         <if test="safetyInspectDTO.year != null  and safetyInspectDTO.year != ''">
-            AND   ymd_year = #{safetyInspectDTO.year}
-        </if>
-
-        <if test="safetyInspectDTO.orgPath != null  and safetyInspectDTO.orgPath != ''">
-            AND org_path like concat( #{safetyInspectDTO.orgPath}, '%')
+            AND   a.ymd_year = #{safetyInspectDTO.year}
         </if>
         GROUP BY
-        org_id
+        a.org_id
     </select>
     <select id="selectAllOrg" resultType="com.xunmei.system.api.domain.SysOrg">
         SELECT DISTINCT