|
|
@@ -1,5 +1,6 @@
|
|
|
package com.xunmei.core.reportForms.resumption.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
@@ -68,6 +69,10 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
} else {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
+ if (ObjectUtil.isAllNotEmpty(resumptionDTO.getStartTime(),resumptionDTO.getEndTime())){
|
|
|
+ resumptionDTO.setStartTime(DateUtil.beginOfDay(resumptionDTO.getStartTime()));
|
|
|
+ resumptionDTO.setEndTime(DateUtil.endOfDay(resumptionDTO.getEndTime()));
|
|
|
+ }
|
|
|
List<ResumptionDayVO> resumptionDayVOS = new ArrayList<>();
|
|
|
// sysOrgs.forEach(o -> {
|
|
|
// ResumptionDayVO resumptionDayVO = new ResumptionDayVO();
|
|
|
@@ -169,20 +174,20 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
ResumptionDayVO resumptionDayVO1 = null;
|
|
|
ResumptionDayVO resumptionDayVO2 = null;
|
|
|
ResumptionDayVO resumptionDayVO3 = null;
|
|
|
-
|
|
|
+ //planType: 1/2/3对应营业前中后
|
|
|
if (org.getType() != 4) {
|
|
|
//营业前
|
|
|
- resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, null, resumptionDTO.getSearchTime(), org.getPath());
|
|
|
+ resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO, 1, null, org.getPath());
|
|
|
//营业中
|
|
|
- resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, null, resumptionDTO.getSearchTime(), org.getPath());
|
|
|
+ resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO, 2, null, org.getPath());
|
|
|
//后
|
|
|
- resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, null, resumptionDTO.getSearchTime(), org.getPath());
|
|
|
+ resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO, 3, null, org.getPath());
|
|
|
}
|
|
|
if (org.getType() == 4) {
|
|
|
integer = 1;
|
|
|
- resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 1, org.getId(), resumptionDTO.getSearchTime(), null);
|
|
|
- resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 2, org.getId(), resumptionDTO.getSearchTime(), null);
|
|
|
- resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO.getCycle(), 3, org.getId(), resumptionDTO.getSearchTime(), null);
|
|
|
+ resumptionDayVO1 = resumptionReportMapper.selectReport(resumptionDTO, 1, org.getId(), null);
|
|
|
+ resumptionDayVO2 = resumptionReportMapper.selectReport(resumptionDTO, 2, org.getId(), null);
|
|
|
+ resumptionDayVO3 = resumptionReportMapper.selectReport(resumptionDTO, 3, org.getId(), null);
|
|
|
}
|
|
|
|
|
|
resumptionDayVO.setNetworkNumber(integer);
|
|
|
@@ -258,7 +263,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException , ExecutionException, InterruptedException, TimeoutException{
|
|
|
+ public void intrusionTestExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException, ExecutionException, InterruptedException, TimeoutException {
|
|
|
String orgName = null;
|
|
|
if (null != resumptionDTO.getOrgId()) {
|
|
|
SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
@@ -276,9 +281,9 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
intrusionTestReportVO.setOrderNum(i + 1);
|
|
|
}
|
|
|
String baseHeaderName = "报警测试情况表";
|
|
|
- String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
|
|
|
- String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
|
|
|
- String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
|
|
|
+ String startStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getStartTime());
|
|
|
+ String endStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getEndTime());
|
|
|
+ String header = baseHeaderName + "(" + startStr + "至" + endStr + ")";
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
|
|
|
@@ -290,7 +295,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
+ public List<IntrusionTestReportVO> intrusionTest(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
if (null == resumptionDTO.getOrgId()) {
|
|
|
resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
}
|
|
|
@@ -361,19 +366,17 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
return intrusionTestReportVOList;
|
|
|
}
|
|
|
|
|
|
- private IntrusionTestReportVO getOneIntrusionTestData(SysOrg o,ResumptionDTO resumptionDTO){
|
|
|
+ private IntrusionTestReportVO getOneIntrusionTestData(SysOrg o, ResumptionDTO resumptionDTO) {
|
|
|
IntrusionTestReportVO resultVo = new IntrusionTestReportVO();
|
|
|
- IntrusionTestReportVO tempIntrusionTestReportVO1 =null;
|
|
|
- Integer networkNumber =null;
|
|
|
- Map map =null;
|
|
|
+ IntrusionTestReportVO tempIntrusionTestReportVO1 = null;
|
|
|
+ Integer networkNumber = null;
|
|
|
+ Map map = null;
|
|
|
|
|
|
- if(o.getType()==4)
|
|
|
- {
|
|
|
- networkNumber =1;
|
|
|
+ if (o.getType() == 4) {
|
|
|
+ networkNumber = 1;
|
|
|
tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(o.getId(), resumptionDTO, null);
|
|
|
map = resumptionReportMapper.selectIntrusionTestAbnormalNumber(o.getId(), resumptionDTO, null);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
networkNumber = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
|
|
|
tempIntrusionTestReportVO1 = resumptionReportMapper.selectIntrusionTestReport(null, resumptionDTO, o.getPath());
|
|
|
//隐患
|
|
|
@@ -394,7 +397,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException,ExecutionException, InterruptedException, TimeoutException {
|
|
|
+ public void standbyPowerExport(ResumptionDTO resumptionDTO, HttpServletResponse response) throws IOException, ExecutionException, InterruptedException, TimeoutException {
|
|
|
String orgName = null;
|
|
|
if (null != resumptionDTO.getOrgId()) {
|
|
|
SysOrg sysOrg = orgService.selectSysOrgById(resumptionDTO.getOrgId(), SecurityConstants.INNER);
|
|
|
@@ -425,7 +428,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception,ExecutionException, InterruptedException, TimeoutException {
|
|
|
+ public List<LhSelfBankInspectionReport> serviceBank(ResumptionDTO resumptionDTO) throws Exception, ExecutionException, InterruptedException, TimeoutException {
|
|
|
if (null == resumptionDTO.getOrgId()) {
|
|
|
resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
|
|
|
}
|
|
|
@@ -474,8 +477,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
completableFutureList.add(future);
|
|
|
// intrusionTestReportVOList.add(future.get(5, TimeUnit.SECONDS));
|
|
|
}
|
|
|
- if(completableFutureList.size()>0)
|
|
|
- {
|
|
|
+ if (completableFutureList.size() > 0) {
|
|
|
CompletableFuture<Void> allQueries = CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0]));
|
|
|
allQueries.get(15L, TimeUnit.SECONDS);
|
|
|
completableFutureList.forEach(x -> {
|
|
|
@@ -492,7 +494,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException{
|
|
|
+ public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
/* if (null != resumptionDTO.getSearchTime()) {
|
|
|
String[] split = resumptionDTO.getSearchTime().split("-");
|
|
|
Integer s = Integer.valueOf(split[1]);
|
|
|
@@ -575,23 +577,21 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
return intrusionTestReportVOList;
|
|
|
}
|
|
|
|
|
|
- private IntrusionTestReportVO getOneOrgStandByPower(SysOrg o,ResumptionDTO resumptionDTO)
|
|
|
- {
|
|
|
+ private IntrusionTestReportVO getOneOrgStandByPower(SysOrg o, ResumptionDTO resumptionDTO) {
|
|
|
IntrusionTestReportVO resultVo = new IntrusionTestReportVO();
|
|
|
- IntrusionTestReportVO tempIntrusionTestReportVO1 =null;
|
|
|
- Integer networkNumber =null;
|
|
|
- Map map =null;
|
|
|
+ IntrusionTestReportVO tempIntrusionTestReportVO1 = null;
|
|
|
+ Integer networkNumber = null;
|
|
|
+ Map map = null;
|
|
|
|
|
|
if (o.getType() == 4) {
|
|
|
networkNumber = 1;
|
|
|
map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(o.getId(), resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), null);
|
|
|
tempIntrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
networkNumber = monitorAccessReportMapper.selectOrgNumByPathAndType(o.getPath(), OrgTypeEnum.YINGYE_WANGDIAN.getCode());
|
|
|
tempIntrusionTestReportVO1 = resumptionReportMapper.selectStandbyPower(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
|
|
|
//隐患
|
|
|
- map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
|
|
|
+ map = resumptionReportMapper.selectStandbyPowerAbnormalNumber(null, resumptionDTO.getStartTime(), resumptionDTO.getEndTime(), o.getPath());
|
|
|
}
|
|
|
|
|
|
BeanUtils.copyProperties(tempIntrusionTestReportVO1, resultVo);
|
|
|
@@ -604,7 +604,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
resultVo.setNetworkNumber(networkNumber);
|
|
|
resultVo.setCity(o.getAffiliatedArea());
|
|
|
resultVo.setOrgName(o.getShortName());
|
|
|
- return resultVo;
|
|
|
+ return resultVo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -632,22 +632,22 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
String baseHeaderName = "离行式自助银行巡检情况表";
|
|
|
- String startStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getStartTime());
|
|
|
- String endStr = DateUtils.parseDateToStr("yyyy-MM",resumptionDTO.getEndTime());
|
|
|
- String header = baseHeaderName + "(" + startStr + "至"+endStr+")";
|
|
|
+ String startStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getStartTime());
|
|
|
+ String endStr = DateUtils.parseDateToStr("yyyy-MM", resumptionDTO.getEndTime());
|
|
|
+ String header = baseHeaderName + "(" + startStr + "至" + endStr + ")";
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
String fileName = URLEncoder.encode("【" + orgName + "】-" + baseHeaderName + DateHelper.getDateString(new Date()), "UTF-8");
|
|
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
|
|
Class clazz;
|
|
|
- if (showOrgName){
|
|
|
+ if (showOrgName) {
|
|
|
List<LhSelfBankInspectionReportNameVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNameVo.class);
|
|
|
clazz = LhSelfBankInspectionReportNameVo.class;
|
|
|
// 调用EasyExcel的导出方法
|
|
|
EasyExcel.write(response.getOutputStream(), clazz)
|
|
|
.registerWriteHandler(new ValueCellWriteHandler(header))
|
|
|
.sheet(baseHeaderName).doWrite(list);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<LhSelfBankInspectionReportNumVo> list = BeanHelper.copyProperties(report, LhSelfBankInspectionReportNumVo.class);
|
|
|
clazz = LhSelfBankInspectionReportNumVo.class;
|
|
|
// 调用EasyExcel的导出方法
|
|
|
@@ -657,12 +657,6 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|