luowei 1 rok temu
rodzic
commit
f6c2c226b4

+ 61 - 16
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/controller/CoreEvaluateTaskController.java

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
@@ -20,6 +21,7 @@ import com.xunmei.core.evaluate.service.ICoreEvaluateTaskService;
 import com.xunmei.core.evaluate.vo.CoreEvaluatePlanVO;
 import com.xunmei.core.evaluate.vo.CoreEvaluateTaskVO;
 import com.xunmei.core.reportForms.monitor.dto.MonitoringAccessDTO;
+import com.xunmei.core.reportForms.resumption.service.impl.ResumptionReportServiceImpl;
 import com.xunmei.core.retrieval.service.impl.CoreMonitoringRetrievalTaskServiceImpl;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.domain.SysOrg;
@@ -31,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
@@ -54,6 +57,9 @@ public class CoreEvaluateTaskController extends BaseController {
     private CoreMonitoringRetrievalTaskServiceImpl coreMonitoringRetrievalTaskService;
     @Resource
     private RemoteOrgService remoteOrgService;
+    @Autowired
+    private ResumptionReportServiceImpl resumptionReportService;
+
     /**
      * 查询外包评价任务列表
      */
@@ -68,7 +74,7 @@ public class CoreEvaluateTaskController extends BaseController {
      * 查询外包评价任务列表app
      */
     @ApiOperation(value = "查询评价任务列表app")
-    @RequiresPermissions("core:evaluateTask:list")
+
     @GetMapping("/appList")
     public TableDataInfo<CoreEvaluateTaskVO> appList(EvaluateTaskDTO coreEvaluateTask) {
         return coreEvaluateTaskService.selectAPPPage(coreEvaluateTask);
@@ -114,31 +120,71 @@ public class CoreEvaluateTaskController extends BaseController {
         AjaxResult ajaxResult = AjaxResult.success();
         SysOrg sysOrg = remoteOrgService.selectSysOrgById(evaluateTaskStatisticsDTO.getOrgId(), SecurityConstants.INNER);
         ajaxResult.put("orgName", sysOrg.getShortName());
+
         if (null != evaluateTaskStatisticsDTO.getPlanId()) {
             CoreEvaluatePlanVO coreEvaluatePlanVO = coreEvaluatePlanService.selectCoreEvaluatePlanById(evaluateTaskStatisticsDTO.getPlanId());
             LocalDate localDate = LocalDate.now();
             String dateTitle = null;
+            String year;
+            String month;
             try {
                 switch (coreEvaluatePlanVO.getEvaluateCycle()) {
                     case "0":
-                        dateTitle = localDate.getYear() + "年" + localDate.getMonthValue() + "月)";
-                        evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-" + localDate.getMonthValue() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
-                        String lastDay = coreMonitoringRetrievalTaskService.getLastDay(localDate.getYear(), localDate.getMonthValue(), "yyyy-MM-dd");
-                        evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                        if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
+                            evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-" + localDate.getMonthValue() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            String lastDay = coreMonitoringRetrievalTaskService.getLastDay(localDate.getYear(), localDate.getMonthValue(), "yyyy-MM-dd");
+                            evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            year = String.valueOf(localDate.getYear());
+                            month = String.valueOf(localDate.getMonthValue());
+                        } else {
+                            evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            String[] split = evaluateTaskStatisticsDTO.getSearchTime().split("-");
+                            String lastDay = coreMonitoringRetrievalTaskService.getLastDay(Integer.parseInt(split[0]), Integer.parseInt(split[1]), "yyyy-MM-dd");
+                            evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(lastDay + " 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            year = split[0];
+                            month = split[1];
+                        }
+                        dateTitle = year + "年" + month + "月)";
                         break;
                     case "1":
-                        DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
-                        DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
-                        evaluateTaskStatisticsDTO.setStartTime(beginOfQuarter);
-                        evaluateTaskStatisticsDTO.setEndTime(endOfQuarter);
-                        int month = localDate.getMonthValue();
-                        int quarter = (month - 1) / 3 + 1;
-                        dateTitle = localDate.getYear() + "年第" + quarter + "季度)";
+                        if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
+                            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
+                            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
+                            evaluateTaskStatisticsDTO.setStartTime(beginOfQuarter);
+                            evaluateTaskStatisticsDTO.setEndTime(endOfQuarter);
+                            int month1 = localDate.getMonthValue();
+                            int quarter = (month1 - 1) / 3 + 1;
+                            dateTitle = localDate.getYear() + "年第" + quarter + "季度)";
+                        } else {
+                            String[] split = evaluateTaskStatisticsDTO.getSearchTime().split("-");
+                            Integer s = Integer.valueOf(split[1]);
+                            String end = split[0] + "-" + (s + 2) + "-01";
+                            Date startTime = new Date();
+                            Date endTime = new Date();
+                            try {
+                                startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(evaluateTaskStatisticsDTO.getSearchTime() + "-01 00:00:00");
+                                String lastDay = resumptionReportService.getLastDay(end);
+                                endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(lastDay + " 23:59:59");
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                            evaluateTaskStatisticsDTO.setStartTime(startTime);
+                            evaluateTaskStatisticsDTO.setEndTime(endTime);
+                            Integer month1 = (Integer.valueOf(split[1]) - 1) / 3 + 1;
+                            dateTitle = split[0] + "年第" + month1 + "季度)";
+                        }
                         break;
                     default:
-                        evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
-                        evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(localDate.getYear() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
-                        dateTitle = localDate.getYear() + "年)";
+                        if (StringUtils.isEmpty(evaluateTaskStatisticsDTO.getSearchTime())) {
+                            evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(localDate.getYear() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(localDate.getYear() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            year = String.valueOf(localDate.getYear());
+                        } else {
+                            evaluateTaskStatisticsDTO.setStartTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-01-01 00:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            evaluateTaskStatisticsDTO.setEndTime(DateUtils.parseDate(evaluateTaskStatisticsDTO.getSearchTime() + "-12-31 23:59:59", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.SSS"));
+                            year = evaluateTaskStatisticsDTO.getSearchTime();
+                        }
+                        dateTitle = year + "年)";
                         break;
                 }
             } catch (Exception e) {
@@ -147,7 +193,6 @@ public class CoreEvaluateTaskController extends BaseController {
             ajaxResult.put("tittle", coreEvaluatePlanVO.getEvaluateName() + "(" + dateTitle);
         }
         ajaxResult.put(AjaxResult.DATA_TAG, coreEvaluateTaskService.statistics(evaluateTaskStatisticsDTO));
-
         return ajaxResult;
     }
 

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/dto/EvaluateTaskStatisticsDTO.java

@@ -28,4 +28,5 @@ public class EvaluateTaskStatisticsDTO {
     private Integer type;
     private Date startTime;
     private Date endTime;
+    private String searchTime;
 }

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluateTaskServiceImpl.java

@@ -211,6 +211,8 @@ public class CoreEvaluateTaskServiceImpl extends ServiceImpl<CoreEvaluateTaskMap
                 }
                 linkedHashMap.put("评价得分", total);
                 all += total;
+            }else {
+                linkedHashMap.put("评价得分", 0);
             }
             rows.add(linkedHashMap);
         }

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

@@ -124,6 +124,12 @@ public class MonitorAccessReportServiceImpl implements MonitorAccessReportServic
             monitoringAccessDTO.setOrgPath(s.getPath());
             MonitoringAccessVO monitoringAccessVO1 = monitorAccessReportMapper.selectAll(monitoringAccessDTO);
             String avg = monitorAccessReportMapper.avg(monitoringAccessDTO);
+            if (s.getType() == 4) {
+                integer = 1;
+                monitoringAccessDTO.setOrgId(s.getId());
+                monitoringAccessVO1 = monitorAccessReportMapper.selectAll(monitoringAccessDTO);
+                avg = monitorAccessReportMapper.avg(monitoringAccessDTO);
+            }
             monitoringAccessVO.setDuration(avg);
             monitoringAccessVO.setNetworkNumber(integer);
             monitoringAccessVO.setAccessRate(monitoringAccessVO1.getAccessRate());

+ 21 - 10
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -68,24 +68,34 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
                     sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
                 }
             }
-            resumptionDayVO.setCity(sysOrg1.getShortName().indexOf("地区行社")==-1?sysOrg1.getShortName().substring(0,2):sysOrg1.getShortName().split("地区行社")[0]);
+            resumptionDayVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             resumptionDayVO.setOrgName(o.getShortName());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
-            resumptionDayVO.setNetworkNumber(integer);
             //营业前
             ResumptionDayVO resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, null, resumptionDTO.getSearchTime(), o.getPath());
+            //营业中
+            ResumptionDayVO resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, null, resumptionDTO.getSearchTime(), o.getPath());
+            //后
+            ResumptionDayVO resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, null, resumptionDTO.getSearchTime(), o.getPath());
+            if (o.getType() == 4) {
+                integer = 1;
+                resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, o.getId(), resumptionDTO.getSearchTime(), o.getPath());
+                resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, o.getId(), resumptionDTO.getSearchTime(), o.getPath());
+                resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, o.getId(), resumptionDTO.getSearchTime(), o.getPath());
+            }
+
+            resumptionDayVO.setNetworkNumber(integer);
+
             resumptionDayVO.setFrontRate(resumptionDayVO1.getFrontRate());
             resumptionDayVO.setFrontAbnormalNumber(resumptionDayVO1.getFrontAbnormalNumber());
             resumptionDayVO.setFrontPlanNumber(resumptionDayVO1.getFrontPlanNumber());
             resumptionDayVO.setFrontRealityNumber(resumptionDayVO1.getFrontRealityNumber());
-            //营业中
-            ResumptionDayVO resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, null, resumptionDTO.getSearchTime(), o.getPath());
+
             resumptionDayVO.setCentreRate(resumptionDayVO2.getFrontRate());
             resumptionDayVO.setCentreAbnormalNumber(resumptionDayVO2.getFrontAbnormalNumber());
             resumptionDayVO.setCentrePlanNumber(resumptionDayVO2.getFrontPlanNumber());
             resumptionDayVO.setCentreRealityNumber(resumptionDayVO2.getFrontRealityNumber());
-            //后
-            ResumptionDayVO resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, null, resumptionDTO.getSearchTime(), o.getPath());
+
             resumptionDayVO.setAfterRate(resumptionDayVO3.getFrontRate());
             resumptionDayVO.setAfterAbnormalNumber(resumptionDayVO3.getFrontAbnormalNumber());
             resumptionDayVO.setAfterPlanNumber(resumptionDayVO3.getFrontPlanNumber());
@@ -97,6 +107,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             Integer totalAbnormal = resumptionDayVO3.getFrontAbnormalNumber() + resumptionDayVO2.getFrontAbnormalNumber() + resumptionDayVO1.getFrontAbnormalNumber();
             //总计已整改数量
             Integer totalRealityRectificationNumber = resumptionDayVO3.getTotalRealityRectificationNumber() + resumptionDayVO2.getTotalRealityRectificationNumber() + resumptionDayVO1.getTotalRealityRectificationNumber();
+            //总计应履职次数
             resumptionDayVO.setTotalPlanNumber(totalPlan);
             resumptionDayVO.setTotalRealityNumber(totalReality);
             Double i = 0d;
@@ -143,7 +154,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
     }
 
     @Override
-    public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response)throws IOException {
+    public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException {
         String orgName = null;
         if (null != resumptionDTO.getOrgId()) {
             SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
@@ -197,7 +208,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(resumptionDTO.getSearchTime(), o.getPath());
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
-            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社")==-1?sysOrg1.getShortName().substring(0,2):sysOrg1.getShortName().split("地区行社")[0]);
+            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             intrusionTestReportVO.setOrgName(o.getShortName());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
             intrusionTestReportVO.setNetworkNumber(integer);
@@ -259,7 +270,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectServiceBankReport(resumptionDTO.getSearchTime(), o.getPath());
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
-            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社")==-1?sysOrg1.getShortName().substring(0,2):sysOrg1.getShortName().split("地区行社")[0]);
+            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             intrusionTestReportVO.setOrgName(o.getShortName());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
             intrusionTestReportVO.setNetworkNumber(integer);
@@ -310,7 +321,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
             BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
-            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社")==-1?sysOrg1.getShortName().substring(0,2):sysOrg1.getShortName().split("地区行社")[0]);
+            intrusionTestReportVO.setCity(sysOrg1.getShortName().indexOf("地区行社") == -1 ? sysOrg1.getShortName().substring(0, 2) : sysOrg1.getShortName().split("地区行社")[0]);
             intrusionTestReportVO.setOrgName(o.getShortName());
             Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
             intrusionTestReportVO.setNetworkNumber(integer);

+ 6 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/MonitorAccessReportMapper.xml

@@ -50,6 +50,9 @@
         <if test="orgPath != null  and orgPath != ''">
             and     a.org_path like concat( #{orgPath}, '%')
         </if>
+          <if test="orgId !=null">
+              and a.org_id =#{orgId}
+          </if>
         <if test="cycle != null  and cycle != ''">
             AND a.cycle = #{cycle}
         </if>
@@ -69,6 +72,9 @@
         <if test="orgPath != null  and orgPath != ''">
             and     b.org_path like concat( #{orgPath}, '%')
         </if>
+          <if test="orgId !=null">
+              and b.org_id=#{orgId}
+          </if>
         <if test="startDate != null  and endDate != null">
             AND b.start_time >= #{startDate} AND b.end_time &lt;= #{endDate}
         </if>

+ 1 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/reportForms/ResumptionReportMapper.xml

@@ -48,6 +48,7 @@
         <if test="orgPath !=null">
             and a.org_path  like concat(#{orgPath},'%')
         </if>
+
     </select>
     <select id="planRectification" resultType="java.lang.Integer">
         SELECT

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

@@ -1163,7 +1163,10 @@ and a.org_path LIKE concat(#{orgPath}, '%')
         WHERE
             type = #{type}
           AND deleted = 0
-          AND path LIKE concat(#{path}, '%')
+          <if test="path != null">
+              AND path LIKE concat(#{path}, '%')
+          </if>
+
         ORDER BY
             FIELD( `name`, '福州', '厦门', '漳州', '泉州', '莆田', '三明', '南平', '龙岩', '宁德' ),
             FIELD(