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-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)); } 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 24e0ab52a4..b69407cc04 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轴,数据集合不全则进行数据填充 @@ -178,6 +183,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); @@ -194,6 +200,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()); @@ -233,6 +240,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; } 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-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-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..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 @@ -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, 11); + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + 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, 11); + if (LocalDateTime.now().isBefore(LocalDateTime.parse(r.getAppointmentDate() + "T" + 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..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, @@ -67,5 +68,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 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..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 @@ -37,10 +40,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; @@ -133,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("项目处理信息,上链成功"); } } } 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; + }