From 0343073e12a23850bef7c2718950b995d1bd758e Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 31 Dec 2021 15:49:30 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=BF=97=E6=84=BF=E8=80=85=E5=88=97=E8=A1=A8agencyId?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/resi/VolunteerCommonFormDTO.java | 4 +- .../controller/ResiVolunteerController.java | 8 +-- .../epmet/service/VolunteerInfoService.java | 12 ++++- .../impl/VolunteerInfoServiceImpl.java | 51 ++++++++++++------- .../service/impl/VolunteerServiceImpl.java | 4 +- 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java index 9a5e2fdc7f..4a9973d735 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java @@ -20,9 +20,9 @@ public class VolunteerCommonFormDTO { private String customerId; /** - * 上级组织ID,使用PIDS like,查询该组织下所有志愿者,注意,是like 'agencyId:%' + * 组织ID */ - private String superiorAgencyId; + private String agencyId; private Integer pageNo = 0; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index ed5609eed3..39da0690af 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -141,8 +141,8 @@ public class ResiVolunteerController { Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); String customerId = input.getCustomerId(); - String superiorAgencyId = input.getSuperiorAgencyId(); - List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize, superiorAgencyId); + String agencyId = input.getAgencyId(); + List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize, agencyId); return new Result>().ok(l); } @@ -154,9 +154,9 @@ public class ResiVolunteerController { @PostMapping("count") public Result getVolunteerCount(@RequestBody VolunteerCommonFormDTO input) { String customerId = input.getCustomerId(); - String pidsPrefix = input.getSuperiorAgencyId(); + String agencyId = input.getAgencyId(); - Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId, pidsPrefix); + Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId, agencyId); return new Result().ok(volunteerCount); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index adf45e6437..f9db916bbe 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -95,12 +95,20 @@ public interface VolunteerInfoService extends BaseService { */ List queryListVolunteer(String customerId,String staffId,String userRealName); - List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId); + /** + * @param customerId + * @param pageNo + * @param pageSize + * @param agencyId 组织ID,使用PIDS like,查询该组织"及下级"所有志愿者 + * @return + */ + List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String agencyId); /** * 查询志愿者数量 * @param customerId + * @param agencyId 组织ID,查询该组织"及下级"下所有的志愿者 * @return */ - Integer getVolunteerCount(String customerId, String pidsPrefix); + Integer getVolunteerCount(String customerId, String agencyId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index de63c1f712..ee7f66bc8a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -359,24 +359,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId) { + public List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String agencyId) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); Optional.ofNullable(customerId).ifPresent(cid -> query.eq(VolunteerInfoEntity::getCustomerId, cid)); - Optional.ofNullable(superiorAgencyId).ifPresent(cid -> { - - // 需要查询agency的pids:id,通过这个字符串去匹配志愿者的Pids字段来查询 - String errorMsg = "【分页查询志愿者列表】失败"; - CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(superiorAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); - if (agencyInfo == null) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); - } - - String pidsAndAgencyIdPath = agencyInfo.getPids().concat(":").concat(superiorAgencyId); - if (pidsAndAgencyIdPath.startsWith(":")) { - pidsAndAgencyIdPath = pidsAndAgencyIdPath.replaceFirst(":", ""); - } - - query.likeRight(VolunteerInfoEntity::getPids, pidsAndAgencyIdPath); + Optional.ofNullable(agencyId).ifPresent(aid -> { + query.likeRight(VolunteerInfoEntity::getPids, getPidsByAgencyId(aid)); }); PageHelper.startPage(pageNo, pageSize); @@ -392,17 +379,43 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper<>(); Optional.ofNullable(customerId).ifPresent((cId) -> { query.eq(VolunteerInfoEntity::getCustomerId, cId); }); - Optional.ofNullable(pidsPrefix).ifPresent((pidsPrefixt) -> { - query.likeRight(VolunteerInfoEntity::getPids, pidsPrefixt); + Optional.ofNullable(agencyId).ifPresent((aid) -> { + query.likeRight(VolunteerInfoEntity::getPids, getPidsByAgencyId(aid)); }); return baseDao.selectCount(query); } + + /** + * 使用agencyId,获取pids(agencyPids:agencyId) + * @param agencyId + * @return + */ + private String getPidsByAgencyId(String agencyId) { + // 需要查询agency的pids:id,通过这个字符串去匹配志愿者的Pids字段来查询 + String errorMsg = "【分页查询志愿者列表】失败"; + CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + if (agencyInfo == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + + String pidsAndAgencyIdPath = agencyInfo.getPids().concat(":").concat(agencyId); + if (pidsAndAgencyIdPath.startsWith(":")) { + pidsAndAgencyIdPath = pidsAndAgencyIdPath.replaceFirst(":", ""); + } + + return pidsAndAgencyIdPath; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index 9aa05b6b27..a25f7d2ad7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -103,7 +103,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve String vcErrorMsg = "【志愿者分布】查询志愿者总数出错"; VolunteerCommonFormDTO volunteerCountForm = new VolunteerCommonFormDTO(); volunteerCountForm.setCustomerId(customerId); - volunteerCountForm.setSuperiorAgencyId(agencyId); + volunteerCountForm.setAgencyId(agencyId); Integer volunteerCount = getResultDataOrThrowsException(epmetHeartOpenFeignClient.getVolunteerCount(volunteerCountForm), ServiceConstant.EPMET_HEART_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), @@ -237,7 +237,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve private List listVolunteersByPage(String customerId, String agencyId, Integer pageNo, Integer pageSize) { VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO(); volunteerForm.setCustomerId(customerId); - volunteerForm.setSuperiorAgencyId(agencyId); + volunteerForm.setAgencyId(agencyId); volunteerForm.setPageNo(pageNo); volunteerForm.setPageSize(pageSize); From 9823f4948eb7cf1cbea64ac33db6c04514586530 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 31 Dec 2021 17:55:33 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BE=8B=E8=A1=8C=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E7=BB=9F=E8=AE=A1=20=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=85=88=E6=8C=89=E7=85=A7=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= =?UTF-8?q?=20=E5=85=A8=E9=87=8F=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatsStaffPatrolRecordDailyEntity.java | 5 ++ .../StatsStaffPatrolRecordDailyDTO.java | 5 ++ .../com/epmet/constant/ProjectConstant.java | 1 + .../main/java/com/epmet/dao/user/UserDao.java | 23 +++++---- .../StatsStaffPatrolRecordDailyEntity.java | 5 ++ .../biz/impl/BizDataStatsServiceImpl.java | 47 ++++++++++++------- .../com/epmet/service/user/UserService.java | 11 ++++- .../impl/StatsStaffPatrolServiceImpl.java | 2 + .../service/user/impl/UserServiceImpl.java | 13 +++++ .../user/StatsStaffPatrolRecordDailyDao.xml | 2 + .../main/resources/mapper/user/UserDao.xml | 10 +++- .../dto/result/PatrolRoutineWorkResult.java | 2 + .../StatsStaffPatrolRecordDailyEntity.java | 5 ++ 13 files changed, 103 insertions(+), 28 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java index 1c52ad1336..a90d80924a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java @@ -122,4 +122,9 @@ public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { */ private String latestPatrolStatus; + /** + * 例行工作次数 + */ + private Integer routineWorkCount; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java index 64d3eb84e4..1867462ff6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/StatsStaffPatrolRecordDailyDTO.java @@ -124,6 +124,11 @@ public class StatsStaffPatrolRecordDailyDTO implements Serializable { */ private String latestPatrolStatus; + /** + * 例行工作次数 + */ + private Integer routineWorkCount; + /** * 删除标识 0.未删除 1.已删除 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index ec417c1c60..1bb5176a49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -81,6 +81,7 @@ public interface ProjectConstant { * 项目来源于 工作端立项 */ String PROJECT_ORIGIN_AGENCY="agency"; + String PROJECT_ORIGIN_EVENT="resi_event"; /** * 自办 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 584bfdf64c..547cc164b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -3,6 +3,7 @@ package com.epmet.dao.user; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.result.PatrolRoutineWorkResult; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; @@ -35,14 +36,14 @@ public interface UserDao { CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询注册用户的总量与增量【新方法】 + * @Description 查询注册用户的总量与增量【新方法】 * @Param regOrPartiFlag * @Param gridIds * @Param targetDate * @author zxc * @date 2021/7/27 10:20 上午 */ - List selectResiTotalAndIncrByGridIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate,@Param("startDate")Date startDate); + List selectResiTotalAndIncrByGridIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate, @Param("startDate") Date startDate); /** * @param @@ -54,13 +55,13 @@ public interface UserDao { CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("targetDate") Date targetDate); /** - * @Description 查询党员的总量与增量【新方法】 + * @Description 查询党员的总量与增量【新方法】 * @Param targetDate * @Param regOrPartiFlag * @author zxc * @date 2021/7/27 5:08 下午 */ - List selectPartyTotalAndIncrNew(@Param("targetDate") Date targetDate,@Param("regOrPartiFlag") String regOrPartiFlag,@Param("startDate") Date startDate); + List selectPartyTotalAndIncrNew(@Param("targetDate") Date targetDate, @Param("regOrPartiFlag") String regOrPartiFlag, @Param("startDate") Date startDate); /** * @param @@ -72,7 +73,7 @@ public interface UserDao { CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询热心居民的总量与增量【新方法】 + * @Description 查询热心居民的总量与增量【新方法】 * @Param userIds 总注册用户 * @Param incrUserIds 增长注册用户 * @Param gridIds 网格IDS @@ -81,7 +82,7 @@ public interface UserDao { * @date 2021/7/27 1:31 下午 */ List selectWarmTotalAndIncrByGrids(@Param("userIds") List userIds, @Param("incrDailyUserIds") List incrDailyUserIds, @Param("gridIds") Set gridIds, - @Param("targetDate") Date targetDate,@Param("startDate") Date startDate,@Param("incrMonthlyUserIds") List incrMonthlyUserIds); + @Param("targetDate") Date targetDate, @Param("startDate") Date startDate, @Param("incrMonthlyUserIds") List incrMonthlyUserIds); /** * @param @@ -102,7 +103,7 @@ public interface UserDao { List selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询指定网格范围下单位时间内新增的注册用户Id【新方法】 + * @Description 查询指定网格范围下单位时间内新增的注册用户Id【新方法】 * @Param regOrPartiFlag * @Param gridIds * @Param targetDate @@ -110,10 +111,10 @@ public interface UserDao { * @date 2021/7/27 10:41 上午 */ List selectIncrUserIdsByGrids(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate, - @Param("startDate")Date startDate); + @Param("startDate") Date startDate); /** - * @Description 查询指定网格范围下单位时间内全部的注册用户Id【新方法】 + * @Description 查询指定网格范围下单位时间内全部的注册用户Id【新方法】 * @Param regOrPartiFlag * @Param gridIds * @Param targetDate @@ -141,7 +142,7 @@ public interface UserDao { Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); /** - * @Description 查询指定时间范围内注册/参与用户增量【新方法】 + * @Description 查询指定时间范围内注册/参与用户增量【新方法】 * @Param regOrPartiFlag * @Param gridIds * @Param startDate @@ -266,5 +267,7 @@ public interface UserDao { List getPatrolDetailList(MidPatrolFormDTO formDTO); List filterUserIds(@Param("userIds") List userIds, @Param("roleKey") String roleKey); + + List selectRoutineWorkListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java index 247d87f285..3340819a5b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/StatsStaffPatrolRecordDailyEntity.java @@ -123,5 +123,10 @@ public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { */ private String latestPatrolStatus; + /** + * 例行工作次数 + */ + private Integer routineWorkCount; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java index fbeb7a391f..145237ebdd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/biz/impl/BizDataStatsServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.constant.ProjectConstant; import com.epmet.dto.ProjectDTO; import com.epmet.dto.extract.form.BizDataFormDTO; import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; +import com.epmet.dto.result.PatrolRoutineWorkResult; import com.epmet.dto.user.result.CustomerGridStaffDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.StaffPatrolRecordResult; @@ -128,25 +129,29 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { //获取昨日的立项项目数 List yesterdayProjectList = projectService.selectProjectListByDateId(formDTO.getCustomerId(), formDTO.getDateId(), ProjectConstant.PROJECT_ORIGIN_AGENCY); + //获取昨日的例行工作数据 + List yesterdayWorkList = userService.selectRoutineWorkListByDateId(formDTO.getCustomerId(), formDTO.getDateId()); + //遍历网格员 设置其 巡查次数 巡查时常 上报项目数 yesterdayPatrolList.forEach(patrolRecord -> { String key = patrolRecord.getGrid().concat(patrolRecord.getStaffId()); StatsStaffPatrolRecordDailyDTO patrolRecordDailyDTO = yesterdayStatsMap.get(key); - if (patrolRecordDailyDTO != null) { - long total = (patrolRecord.getPatrolEndTime().getTime() - patrolRecord.getPatrolStartTime().getTime()) / 1000; - if (patrolRecordDailyDTO.getTotalTime() == null) { - patrolRecordDailyDTO.setTotalTime(NumConstant.ZERO); - } - patrolRecordDailyDTO.setTotalTime(patrolRecordDailyDTO.getTotalTime() + (int) total); - if (patrolRecordDailyDTO.getPatrolTotal() == null) { - patrolRecordDailyDTO.setPatrolTotal(NumConstant.ZERO); - } - patrolRecordDailyDTO.setPatrolTotal(patrolRecordDailyDTO.getPatrolTotal() + NumConstant.ONE); - //如果巡查记录时间小于统计里的最新的时间 则更新 - if (patrolRecordDailyDTO.getLatestPatrolTime() == null || patrolRecordDailyDTO.getLatestPatrolTime().getTime() < patrolRecord.getPatrolStartTime().getTime()) { - patrolRecordDailyDTO.setLatestPatrolTime(patrolRecord.getPatrolStartTime()); - patrolRecordDailyDTO.setLatestPatrolStatus(patrolRecord.getStatus()); - } + if (patrolRecordDailyDTO == null) { + return; + } + long total = (patrolRecord.getPatrolEndTime().getTime() - patrolRecord.getPatrolStartTime().getTime()) / NumConstant.ONE_THOUSAND; + if (patrolRecordDailyDTO.getTotalTime() == null) { + patrolRecordDailyDTO.setTotalTime(NumConstant.ZERO); + } + patrolRecordDailyDTO.setTotalTime(patrolRecordDailyDTO.getTotalTime() + (int) total); + if (patrolRecordDailyDTO.getPatrolTotal() == null) { + patrolRecordDailyDTO.setPatrolTotal(NumConstant.ZERO); + } + patrolRecordDailyDTO.setPatrolTotal(patrolRecordDailyDTO.getPatrolTotal() + NumConstant.ONE); + //如果巡查记录时间小于统计里的最新的时间 则更新 + if (patrolRecordDailyDTO.getLatestPatrolTime() == null || patrolRecordDailyDTO.getLatestPatrolTime().getTime() < patrolRecord.getPatrolStartTime().getTime()) { + patrolRecordDailyDTO.setLatestPatrolTime(patrolRecord.getPatrolStartTime()); + patrolRecordDailyDTO.setLatestPatrolStatus(patrolRecord.getStatus()); } }); //填充项目数 @@ -164,10 +169,19 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { return; } - recordDailyDTO.setReportProjectCount(recordDailyDTO.getReportProjectCount() + 1); + recordDailyDTO.setReportProjectCount(recordDailyDTO.getReportProjectCount() + NumConstant.ONE); } }); }); + yesterdayWorkList.forEach(work->{ + String key = work.getGridId().concat(work.getUserId()); + StatsStaffPatrolRecordDailyDTO patrolRecordDailyDTO = yesterdayStatsMap.get(key); + if (patrolRecordDailyDTO == null){ + return; + } + patrolRecordDailyDTO.setRoutineWorkCount(patrolRecordDailyDTO.getRoutineWorkCount() + NumConstant.ONE); + + }); Integer effectRow = statsStaffPatrolService.delAndInsertBatch(formDTO, insertList); log.debug("initStaffPatrolStats insert rows:{}", effectRow); @@ -227,6 +241,7 @@ public class BizDataStatsServiceImpl implements BizDataStatsService { record.setPatrolTotal(NumConstant.ZERO); record.setLatestPatrolStatus("end"); record.setReportProjectCount(NumConstant.ZERO); + record.setRoutineWorkCount(NumConstant.ZERO); record.setSourceType("internal"); record.setSourceCustomerId(record.getCustomerId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 1d0a500b0a..29e5e6d149 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -4,6 +4,7 @@ import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.org.result.OrgStaffDTO; +import com.epmet.dto.result.PatrolRoutineWorkResult; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; @@ -146,6 +147,14 @@ public interface UserService { List getPatrolRecordList(MidPatrolFormDTO formDTO); List getPatrolDetailList(MidPatrolFormDTO formDTO); - + List filterUserIds(List userIds, String roleKey); + + /** + * desc:根据客户id和日期获取 例行工作数据 + * @param customerId + * @param dateId + * @return + */ + List selectRoutineWorkListByDateId(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java index b07253b001..97bc67ed86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/StatsStaffPatrolServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.service.user.StatsStaffPatrolService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -30,6 +31,7 @@ public class StatsStaffPatrolServiceImpl implements StatsStaffPatrolService { @Autowired private StatsStaffPatrolRecordDailyDao statsStaffPatrolRecordDailyDao; + @Transactional(rollbackFor = Exception.class) @Override public Integer delAndInsertBatch(StaffPatrolStatsFormDTO formDTO, List insertList) { int delete = statsStaffPatrolRecordDailyDao.deleteInternal(formDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index a2d56125a6..f6c78dbfb0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; +import com.epmet.dto.result.PatrolRoutineWorkResult; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.*; @@ -1113,4 +1114,16 @@ public class UserServiceImpl implements UserService { public List filterUserIds(List userIds, String roleKey) { return userDao.filterUserIds(userIds, roleKey); } + + /** + * desc:根据客户id和日期获取 例行工作数据 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public List selectRoutineWorkListByDateId(String customerId, String dateId) { + return userDao.selectRoutineWorkListByDateId(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml index 3f6cda5d85..7e00ed10c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/StatsStaffPatrolRecordDailyDao.xml @@ -23,6 +23,7 @@ REPORT_PROJECT_COUNT, LATEST_PATROL_TIME, LATEST_PATROL_STATUS, + ROUTINE_WORK_COUNT, DEL_FLAG, REVISION, CREATED_BY, @@ -50,6 +51,7 @@ #{item.reportProjectCount}, #{item.latestPatrolTime}, #{item.latestPatrolStatus}, + #{item.routineWorkCount}, '0', 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index fa8b19cd6b..6e8e25fefa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -620,7 +620,7 @@ + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java index 5db6d41b24..d0040279cb 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java @@ -25,6 +25,8 @@ public class PatrolRoutineWorkResult implements Serializable { private String title; + private String userId; + /** * 一级工作类型 code */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java index 4f1a18347d..6a2ee8ab04 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java @@ -123,5 +123,10 @@ public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { */ private String latestPatrolStatus; + /** + * 例行工作次数 + */ + private Integer routineWorkCount; + } From 1d67fa09df0fd3ad6a891e2e13feaad22da417d4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 1 Jan 2022 12:15:51 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E5=87=BA=E6=9D=A5=20?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E6=97=A5=E5=BF=97=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/IndexServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 209e776ee7..948b543080 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; @@ -12,6 +13,7 @@ import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -31,6 +33,7 @@ import java.util.stream.Collectors; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:21 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexServiceImpl implements IndexService { @@ -118,6 +121,7 @@ public class IndexServiceImpl implements IndexService { List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(), monthBarchartFormDTO.getMonthId(), monthBarchartFormDTO.getCustomerId()); + log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartFormDTO)); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); @@ -161,6 +165,7 @@ public class IndexServiceImpl implements IndexService { }else{ _ymList=dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); } + log.info("monthBarchart _ymList return:{}", _ymList); //针对集合collect的游标 int cursor = NumConstant.ZERO; //针对X轴,数据集合不全则进行数据填充 @@ -176,6 +181,7 @@ public class IndexServiceImpl implements IndexService { continue ; } if(!StringUtils.equals(collect.get(cursor).getMonthId(),_ymList.get(i))){ + log.info("monthBarchart cursor not eq return:{}", _ymList.get(i)); //SET DEFAULT serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); @@ -192,6 +198,7 @@ public class IndexServiceImpl implements IndexService { //保持cursor不变 }else{ MonthBarchartResult data = collect.get(cursor); + log.info("monthBarchart collect.get return:{}", JSON.toJSONString(data)); //SET DATA serviceAbilityData.add(null == data.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : data.getServiceAbility()); partyDevAbilityData.add(null == data.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : data.getPartyDevAbility()); @@ -231,6 +238,7 @@ public class IndexServiceImpl implements IndexService { result.setServiceOriginScore(serviceOriginData); result.setPartyOriginScore(partyOriginData); result.setGovernOriginScore(governOriginData); + log.info("monthBarchart final result:{}", JSON.toJSONString(result)); return result; } From 32c92563b47f2d1436b120a3919e7d9fd207b581 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 1 Jan 2022 14:43:36 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86=2020?= =?UTF-8?q?2212=E4=B8=BA202112=20=E5=9B=A0=E4=B8=BA=E4=BB=96=E4=BB=AC?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/controller/screen/IndexController.java | 4 ++++ .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index dcf083d507..7e2885cdbd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -67,6 +67,10 @@ public class IndexController { //area_code升级,新增此参数 monthBarchartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); + String monthId = monthBarchartFormDTO.getMonthId(); + if ("202212".equals(monthId)){ + monthBarchartFormDTO.setCustomerId("202112"); + } return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 948b543080..8b89c8a2e0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -121,7 +121,7 @@ public class IndexServiceImpl implements IndexService { List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(), monthBarchartFormDTO.getMonthId(), monthBarchartFormDTO.getCustomerId()); - log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartFormDTO)); + log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartResults)); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); From 605c42b614baff85a1e9ed593d66e798c04f7808 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 1 Jan 2022 14:51:55 +0800 Subject: [PATCH 05/15] =?UTF-8?q?Revert=20"=E4=B8=B4=E6=97=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86=20202212=E4=B8=BA202112=20=E5=9B=A0=E4=B8=BA=E4=BB=96?= =?UTF-8?q?=E4=BB=AC=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 32c92563 --- .../epmet/datareport/controller/screen/IndexController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 7e2885cdbd..dcf083d507 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -67,10 +67,6 @@ public class IndexController { //area_code升级,新增此参数 monthBarchartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); - String monthId = monthBarchartFormDTO.getMonthId(); - if ("202212".equals(monthId)){ - monthBarchartFormDTO.setCustomerId("202112"); - } return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } From e6b830b56865ea942f5e956f34d3dc453f96280a Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 1 Jan 2022 14:53:48 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86=2020?= =?UTF-8?q?2212=E4=B8=BA202112=20=E5=9B=A0=E4=B8=BA=E4=BB=96=E4=BB=AC?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/controller/screen/IndexController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index dcf083d507..5824a1a9cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -67,6 +67,10 @@ public class IndexController { //area_code升级,新增此参数 monthBarchartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); + String monthId = monthBarchartFormDTO.getMonthId(); + if ("202212".equals(monthId)){ + monthBarchartFormDTO.setMonthId("202112"); + } return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } From 03133aab412eb95b3e482530c1c4a033a80d828a Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 1 Jan 2022 14:54:11 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86=2020?= =?UTF-8?q?2212=E4=B8=BA202112=20=E5=9B=A0=E4=B8=BA=E4=BB=96=E4=BB=AC?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E9=94=99=E8=AF=AF=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 8b89c8a2e0..948b543080 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -121,7 +121,7 @@ public class IndexServiceImpl implements IndexService { List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(), monthBarchartFormDTO.getMonthId(), monthBarchartFormDTO.getCustomerId()); - log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartResults)); + log.info("monthBarchart selectMonthBarchart return:{}", JSON.toJSONString(monthBarchartFormDTO)); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); From 8447b648b32e752492ed52717cf83283b493435e Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 4 Jan 2022 09:46:39 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E6=94=BE?= =?UTF-8?q?=E5=BC=80=E5=8C=BA=E5=9D=97=E9=93=BE=E4=BB=A3=E7=A0=81=E7=A1=AC?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/BlockChainProjectController.java | 8 ++++---- .../epmet/service/impl/BlockChainUploadServiceImpl.java | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/BlockChainProjectController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/BlockChainProjectController.java index 75701ac62a..2ec27b1e27 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/BlockChainProjectController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/BlockChainProjectController.java @@ -28,8 +28,8 @@ public class BlockChainProjectController { */ @PostMapping("create") public Result blockChainCreateProject(@RequestBody BlockChainCreateProjectFormDTO input) { - //ValidatorUtils.validateEntity(input); - //blockChainProjectService.blockChainCreateProject(input); + ValidatorUtils.validateEntity(input); + blockChainProjectService.blockChainCreateProject(input); return new Result(); } @@ -40,8 +40,8 @@ public class BlockChainProjectController { */ @PostMapping("process") public Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input) { - //ValidatorUtils.validateEntity(input); - //blockChainProjectService.blockChainProcessProject(input); + ValidatorUtils.validateEntity(input); + blockChainProjectService.blockChainProcessProject(input); return new Result(); } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java index c3afaa5341..718c5ea7ef 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java @@ -37,10 +37,6 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService { @Override public void send2BlockChain(ProjectEntity projectEntity, ProjectProcessEntity processEntity, List assignedStaffEntities, String projectStaffId) { - if (true) { - return; - } - // 1.项目主信息 BlockChainProjectFormDTO project = null; From 93340345fdeba172644b6f2bdffb333f19c7ed0e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 10:38:35 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/AppointmentRecordResultDTO.java | 3 +++ .../service/impl/IcPartyServiceCenterServiceImpl.java | 9 +++++++++ .../resources/mapper/IcMatterAppointmentRecordDao.xml | 1 + 3 files changed, 13 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java index c3024a6bbb..eadadbccce 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java @@ -40,6 +40,8 @@ public class AppointmentRecordResultDTO implements Serializable { */ private String remark; + private Boolean isCancel; + private String recordId; private String centerName; private String address; @@ -65,5 +67,6 @@ public class AppointmentRecordResultDTO implements Serializable { this.appointmentTime = new ArrayList<>(); this.recordId = ""; this.appointmentDate = ""; + this.isCancel = true; } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 4cd1e6dc3d..7be111352d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyServiceCenterConstant; import com.epmet.dao.IcMatterAppointmentRecordDao; @@ -487,6 +488,10 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, -1); + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ + r.setIsCancel(false); + } }); return result; } @@ -545,6 +550,10 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, -1); + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ + r.setIsCancel(false); + } } }); }); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml index 4270ac8b44..c76cdf619d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml @@ -67,5 +67,6 @@ AND ar.ORG_ID = #{orgId} AND ar.CREATED_BY = #{userId} AND ar.`STATUS` = 'appointing' + ORDER BY ar.APPOINTMENT_DATE \ No newline at end of file From 31b64a3551edaf8dcb11b6f175dbb5a7cf70f826 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 10:50:16 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcPartyServiceCenterServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 7be111352d..86a0634c16 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -488,7 +488,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(6, -1); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ r.setIsCancel(false); } @@ -550,7 +550,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(6, -1); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ r.setIsCancel(false); } From 29eb40106f59e2c371a5a265a8ad17f3246580ac Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 10:56:33 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcPartyServiceCenterServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 86a0634c16..82941db80b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -488,7 +488,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); + String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ r.setIsCancel(false); } @@ -550,7 +550,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); + String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ r.setIsCancel(false); } From 0d580d56255292ed1849fa8fd3c56f4bb60dec36 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 11:02:15 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcPartyServiceCenterServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 82941db80b..bc89172504 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -489,7 +489,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); - if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + endTime))){ r.setIsCancel(false); } }); @@ -551,7 +551,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); - if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + " " + endTime))){ + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + endTime))){ r.setIsCancel(false); } } From b068d038ff96a6141cfd141087f7cf4412045d24 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 11:14:55 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcPartyServiceCenterServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index bc89172504..9c8e1ba80f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -488,7 +488,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + endTime))){ r.setIsCancel(false); } @@ -550,7 +550,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl list = Arrays.asList(r.getTimeId().split(",")); list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); r.setAppointmentTime(time); - String endTime = time.get(time.size() - NumConstant.ONE).substring(7, 11); + String endTime = time.get(time.size() - NumConstant.ONE).substring(6, 11); if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + endTime))){ r.setIsCancel(false); } From b63bb8568149eaf8650a10c8adca84f545fb58f2 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 4 Jan 2022 13:28:27 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=8A=E9=93=BEuploadServiceIMpl=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BlockChainUploadServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java index 718c5ea7ef..5197b2a20b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.ProjectStaffDao; import com.epmet.dto.form.*; import com.epmet.entity.ProjectEntity; @@ -8,6 +9,7 @@ import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; import com.epmet.feign.EpmetThirdOpenFeignClient; import com.epmet.service.BlockChainUploadService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +23,7 @@ import java.util.stream.Collectors; * 区块链上链service实现 */ @Service +@Slf4j public class BlockChainUploadServiceImpl implements BlockChainUploadService { @Autowired @@ -129,20 +132,27 @@ public class BlockChainUploadServiceImpl implements BlockChainUploadService { handledStaff.setProjectId(handledStaffEntity.getProjectId()); } + Result result; if (project == null) { // 处理 BlockChainProcessProjectFormDTO processForm = new BlockChainProcessProjectFormDTO(); processForm.setProcess(process); processForm.setAssignedStaffs(assignedStaffs); processForm.setHandledStaff(handledStaff); - thirdOpenFeignClient.blockChainProcessProject(processForm); + result = thirdOpenFeignClient.blockChainProcessProject(processForm); } else { // 立项 BlockChainCreateProjectFormDTO createForm = new BlockChainCreateProjectFormDTO(); createForm.setProject(project); createForm.setProcess(process); createForm.setAssignedStaffs(assignedStaffs); - thirdOpenFeignClient.blockChainCreateProject(createForm); + result = thirdOpenFeignClient.blockChainCreateProject(createForm); + } + + if (result == null || !result.success()) { + log.error("项目处理信息,上链失败"); + } else { + log.info("项目处理信息,上链成功"); } } } From c07eeb02aec9f4d0d3e39894ab82590c3205c84c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 4 Jan 2022 13:33:31 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcMatterAppointmentRecordDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml index c76cdf619d..fb55a883d8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml @@ -18,6 +18,7 @@ SELECT ar.APPOINTMENT_NAME, ar.APPOINTMENT_PHONE, + ar.APPOINTMENT_Date, ar.REMARK, ar.TIME_ID, cm.MATTER_NAME,