|
|
@@ -1,14 +1,18 @@
|
|
|
package com.xunmei.core.reportForms.resumption.service.impl;
|
|
|
|
|
|
+import com.xunmei.common.core.constant.ErrorMsgConstants;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.security.utils.SecurityUtils;
|
|
|
import com.xunmei.core.reportForms.monitor.mapper.MonitorAccessReportMapper;
|
|
|
import com.xunmei.core.reportForms.resumption.dto.ResumptionDTO;
|
|
|
import com.xunmei.core.reportForms.resumption.mapper.ResumptionReportMapper;
|
|
|
import com.xunmei.core.reportForms.resumption.service.ResumptionReportService;
|
|
|
+import com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO;
|
|
|
import com.xunmei.core.reportForms.resumption.vo.ResumptionDayVO;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
+import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -34,20 +38,26 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
if (null == resumptionDTO.getOrgId()) {
|
|
|
resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
}
|
|
|
-//判断机构类型,如果机构类型大于行社,都展示行社数据
|
|
|
+ //判断机构类型,如果机构类型大于行社,都展示行社数据
|
|
|
SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
- List<SysOrg> sysOrgs = new ArrayList<>();
|
|
|
- if (sysOrg.getType() > 3) {
|
|
|
+ List<SysOrg> sysOrgs;
|
|
|
+ if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
|
|
|
sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
|
|
|
} else if (sysOrg.getType() == 3) {
|
|
|
sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 4, SecurityConstants.INNER);
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
- orgService.selectSysOrgByParentId(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
List<ResumptionDayVO> resumptionDayVOS = new ArrayList<>();
|
|
|
sysOrgs.forEach(o -> {
|
|
|
ResumptionDayVO resumptionDayVO = new ResumptionDayVO();
|
|
|
+ SysOrg sysOrg1;
|
|
|
+ if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
|
|
|
+ sysOrg1 = orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER);
|
|
|
+ } else {
|
|
|
+ sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
|
|
|
+ }
|
|
|
+ resumptionDayVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
|
|
|
resumptionDayVO.setOrgName(o.getShortName());
|
|
|
Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
|
|
|
resumptionDayVO.setNetworkNumber(integer);
|
|
|
@@ -70,8 +80,12 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
resumptionDayVO.setAfterPlanNumber(resumptionDayVO3.getFrontPlanNumber());
|
|
|
resumptionDayVO.setAfterRealityNumber(resumptionDayVO3.getFrontRealityNumber());
|
|
|
Integer totalPlan = resumptionDayVO3.getFrontPlanNumber() + resumptionDayVO2.getFrontPlanNumber() + resumptionDayVO1.getFrontPlanNumber();
|
|
|
+ //总计实际履职次数
|
|
|
Integer totalReality = resumptionDayVO3.getFrontRealityNumber() + resumptionDayVO2.getFrontRealityNumber() + resumptionDayVO1.getFrontRealityNumber();
|
|
|
+ //总计隐患问题数
|
|
|
Integer totalAbnormal = resumptionDayVO3.getFrontAbnormalNumber() + resumptionDayVO2.getFrontAbnormalNumber() + resumptionDayVO1.getFrontAbnormalNumber();
|
|
|
+ //总计已整改数量
|
|
|
+ Integer totalRealityRectificationNumber = resumptionDayVO3.getTotalRealityRectificationNumber() + resumptionDayVO2.getTotalRealityRectificationNumber() + resumptionDayVO1.getTotalRealityRectificationNumber();
|
|
|
resumptionDayVO.setTotalPlanNumber(totalPlan);
|
|
|
resumptionDayVO.setTotalRealityNumber(totalReality);
|
|
|
int i = 0;
|
|
|
@@ -80,8 +94,49 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
resumptionDayVO.setTotalRate(i + "%");
|
|
|
resumptionDayVO.setTotalAbnormalNumber(totalAbnormal);
|
|
|
+ int n = 0;
|
|
|
+ if (totalAbnormal != 0 && totalRealityRectificationNumber != 0) {
|
|
|
+ n = totalRealityRectificationNumber / totalAbnormal * 100;
|
|
|
+ }
|
|
|
+ resumptionDayVO.setTotalRealityRectificationRate(n + "%");
|
|
|
+ resumptionDayVO.setTotalRealityRectificationNumber(totalRealityRectificationNumber);
|
|
|
resumptionDayVOS.add(resumptionDayVO);
|
|
|
});
|
|
|
return resumptionDayVOS;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) {
|
|
|
+ if (null == resumptionDTO.getOrgId()) {
|
|
|
+ resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
+ }
|
|
|
+ //判断机构类型,如果机构类型大于行社,都展示行社数据
|
|
|
+ SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
+ List<SysOrg> sysOrgs;
|
|
|
+ if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
|
|
|
+ sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 3, SecurityConstants.INNER);
|
|
|
+ } else if (sysOrg.getType() == 3) {
|
|
|
+ sysOrgs = orgService.selectSysOrgByPathAndType(sysOrg.getPath(), 4, SecurityConstants.INNER);
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<IntrusionTestReportVO> intrusionTestReportVOList = new ArrayList<>(16);
|
|
|
+ sysOrgs.forEach(o -> {
|
|
|
+ IntrusionTestReportVO intrusionTestReportVO = new IntrusionTestReportVO();
|
|
|
+ SysOrg sysOrg1;
|
|
|
+ if (sysOrg.getType() < 3 || sysOrg.getShortName().endsWith("地区行社") || sysOrg.getType() == 9) {
|
|
|
+ sysOrg1 = orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER);
|
|
|
+ } else {
|
|
|
+ sysOrg1 = orgService.selectOrgById(orgService.selectOrgById(o.getParentId(), SecurityConstants.INNER).getParentId(), SecurityConstants.INNER);
|
|
|
+ }
|
|
|
+ IntrusionTestReportVO intrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(resumptionDTO.getSearchTime(), o.getPath());
|
|
|
+ BeanUtils.copyProperties(intrusionTestReportVO1, intrusionTestReportVO);
|
|
|
+ intrusionTestReportVO.setCity(sysOrg1.getShortName().split("地区行社")[0]);
|
|
|
+ intrusionTestReportVO.setOrgName(o.getShortName());
|
|
|
+ Integer integer = monitorAccessReportMapper.selectNetworkNumberByPath(o.getPath());
|
|
|
+ intrusionTestReportVO.setNetworkNumber(integer);
|
|
|
+ intrusionTestReportVOList.add(intrusionTestReportVO);
|
|
|
+ });
|
|
|
+ return intrusionTestReportVOList;
|
|
|
+ }
|
|
|
}
|