From 12bcd65af093bbba8af555650aebec9ed5318938 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Jun 2021 14:33:00 +0800 Subject: [PATCH 01/52] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E6=95=B0=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=80=E5=88=97=E3=80=82=E8=84=9A=E6=9C=AC=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.19__add_gridMemberToalColumn.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql new file mode 100644 index 0000000000..5d470eaec9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_gridMemberToalColumn.sql @@ -0,0 +1,4 @@ +-- 为了平阴大屏,显示网格员数,screen_user_total_data 新增GRID_MEMBER_TOTAL + +-- epmet_evaluation_index 、 epmet_data_statistical_display 库执行以下: +ALTER TABLE screen_user_total_data ADD COLUMN `GRID_MEMBER_TOTAL` INT ( 11 ) NOT NULL DEFAULT '0' COMMENT '06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数' AFTER PROJECT_TOTAL; \ No newline at end of file From 21e5d95b4c534b4bd8481fe9d1e627fa4614c5e3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 3 Jun 2021 14:34:27 +0800 Subject: [PATCH 02/52] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=88=90=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=8E=92=E8=A1=8Cbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/BizPointUserTotalDetailServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java index 1e3563fb6d..d2a37797fa 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointUserTotalDetailServiceImpl.java @@ -214,7 +214,7 @@ public class BizPointUserTotalDetailServiceImpl extends BaseServiceImpl { //楼院小组显示昵称,支部小组显示姓名 if (("ordinary").equals(group.getData().getGroupType())) { - item.setName(user.getNickname()); + item.setName(StringUtils.isBlank(user.getNickname()) ? StrConstant.EPMETY_STR : user.getNickname()); } else { item.setName(StrConstant.EPMETY_STR); if (StringUtils.isNotBlank(user.getSurname())){ From d0c4a4d8354b1efe21e1ebb6294ef9834d6e5d74 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Jun 2021 15:10:49 +0800 Subject: [PATCH 03/52] =?UTF-8?q?screen=5Fuser=5Ftotal=5Fdata=E6=96=B0?= =?UTF-8?q?=E5=A2=9EGRID=5FMEMBER=5FTOTAL=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E6=95=B0=E6=8A=BD=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/org/result/OrgStaffDTO.java | 29 +++++++++++++++++ .../com/epmet/controller/DemoController.java | 7 ++++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 9 ++++++ .../main/java/com/epmet/dao/user/UserDao.java | 8 +++++ .../screen/ScreenUserTotalDataEntity.java | 4 +++ .../service/org/CustomerAgencyService.java | 9 ++++++ .../org/impl/CustomerAgencyServiceImpl.java | 13 ++++++++ ...reenCentralZoneDataExtractServiceImpl.java | 29 ++++++++++++----- .../com/epmet/service/user/UserService.java | 10 ++++++ .../service/user/impl/UserServiceImpl.java | 19 +++++++++++ .../screen/ScreenUserTotalDataDao.xml | 2 ++ .../mapper/org/StatsCustomerAgencyDao.xml | 32 +++++++++++++++++++ .../main/resources/mapper/user/UserDao.xml | 25 +++++++++++++++ 13 files changed, 188 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/OrgStaffDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/OrgStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/OrgStaffDTO.java new file mode 100644 index 0000000000..bfaea6a0fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/OrgStaffDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 返回每个网格、每个组织下,工作人员的userId + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/3 9:49 + */ +@Data +public class OrgStaffDTO implements Serializable { + + /** + * 组织id或者网格id + */ + private String orgId; + /** + * agency or grid + */ + private String orgType; + /** + * 当前组织或者当前网格下的: + */ + private List staffIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index b47d3cc8ef..794b1b707d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -109,6 +109,8 @@ public class DemoController { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @GetMapping("testAlarm") public void testAlarm() { @@ -870,4 +872,9 @@ public class DemoController { return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); } + @PostMapping("centralZoneDataHub") + public Result Test(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 05a85d3d7c..210882908f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -3,6 +3,7 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,4 +34,12 @@ public interface StatsCustomerAgencyDao extends BaseDao { List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + /** + * 获取每个组织、每个网格下工作人员userId集合 + * + * @param customerId + * @return com.epmet.dto.org.result.OrgStaffResultDTO + */ + List selectOrgStaffIds(String customerId); } 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 411452caeb..e48dc81ab3 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 @@ -141,5 +141,13 @@ public interface UserDao { * @date 2021.03.08 17:16 */ List selectScreenProjectData(@Param("list") List list); + + /** + * 根据工作员用户id, 返回这些人当中多少个网格员 + * + * @param staffIds + * @return int + */ + int selectGridManagerTotal(@Param("customerId")String customerId,@Param("staffIds")List staffIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java index c41ef72cc3..4843a44a24 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java @@ -95,4 +95,8 @@ public class ScreenUserTotalDataEntity extends BaseEpmetEntity { */ private Integer projectTotal; + /** + * 06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数 + */ + private Integer gridMemberTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index b3aa943ada..92516e516b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -1,6 +1,7 @@ package com.epmet.service.org; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; import java.util.Date; @@ -20,4 +21,12 @@ public interface CustomerAgencyService { List selectCustomerAreaCodeById(List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + /** + * 获取每个组织、每个网格下工作人员userId集合 + * + * @param customerId + * @return com.epmet.dto.org.result.OrgStaffResultDTO + */ + List queryOrgStaffIds(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 8a8fae83b8..5bcfd88550 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.org.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -50,4 +51,16 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public CustomerAgencyEntity getRootAgencyInfo(String customerId) { return customerAgencyDao.getRootAgencyInfo(customerId); } + + /** + * 获取每个组织、每个网格下工作人员userId集合 + * + * @param customerId + * @return com.epmet.dto.org.result.OrgStaffResultDTO + */ + @Override + public List queryOrgStaffIds(String customerId) { + List resultList=customerAgencyDao.selectOrgStaffIds(customerId); + return resultList; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index feceadf83d..d096430868 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -4,14 +4,16 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.stats.*; +import com.epmet.dao.stats.FactAgencyProjectDailyDao; +import com.epmet.dao.stats.FactGroupGridDailyDao; +import com.epmet.dao.stats.FactIssueGridDailyDao; import com.epmet.dao.stats.topic.FactTopicTotalGridDailyDao; - - - import com.epmet.dao.stats.user.FactRegUserGridDailyDao; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.stats.ScreenCentralZoneDataExtractService; +import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,7 +45,10 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon private FactIssueGridDailyDao factIssueGridDailyDao; @Autowired private FactAgencyProjectDailyDao factAgencyProjectDailyDao; - + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private UserService userService; private final String ORG_LEVEL_AGENCY = "agency"; private final String ORG_LEVEL_GRID = "grid"; @@ -155,6 +160,10 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon Map projectMap = agencyProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal)); projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal))); + //For:06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数 + List orgStaffDTOList=customerAgencyService.queryOrgStaffIds(customerId); + Map gridManagerMap=userService.queryOrgGridManager(customerId,orgStaffDTOList); + result.forEach(o -> { String orgId = o.getOrgId(); Integer count = groupMap.get(orgId); @@ -169,10 +178,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon count = projectMap.get(orgId); o.setProjectTotal(null == count ? NumConstant.ZERO : count); o.setDataEndTime(dimId); - }); - - + //For:06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数 + if(gridManagerMap.containsKey(orgId)){ + o.setGridMemberTotal(gridManagerMap.get(orgId)); + }else{ + o.setGridMemberTotal(NumConstant.ZERO); + } + }); return result; } } 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 36229bfbb2..b7cab26df1 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 @@ -2,6 +2,7 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; @@ -84,4 +85,13 @@ public interface UserService { * @date 2021.03.08 17:16 */ List fillScreenProjectData(List list); + + /** + * 返回每个组织或者每个网格下的网格员数量 + * + * @param customerId + * @param orgStaffDTOList + * @return com.epmet.dto.user.OrgGridManagerTotalDTO + */ + Map queryOrgGridManager(String customerId,List orgStaffDTOList); } 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 b5594541a6..fc40a2e5fd 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 @@ -8,6 +8,7 @@ import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; @@ -755,4 +756,22 @@ public class UserServiceImpl implements UserService { return collection; } + /** + * 返回每个组织或者每个网格下的网格员数量 + * + * @param customerId + * @param orgStaffDTOList + * @return com.epmet.dto.user.OrgGridManagerTotalDTO + */ + @Override + public Map queryOrgGridManager(String customerId,List orgStaffDTOList) { + Map resultMap=new HashMap<>(); + for (OrgStaffDTO orgStaffDTO : orgStaffDTOList) { + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(orgStaffDTO.getStaffIds())){ + resultMap.put(orgStaffDTO.getOrgId(),userDao.selectGridManagerTotal(customerId,orgStaffDTO.getStaffIds())); + } + } + return resultMap; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index 4e228f3fed..8b205de7ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -75,6 +75,7 @@ TOPIC_TOTAL, ISSUE_TOTAL, PROJECT_TOTAL, + GRID_MEMBER_TOTAL, DEL_FLAG, REVISION, CREATED_BY, @@ -97,6 +98,7 @@ #{item.topicTotal}, #{item.issueTotal}, #{item.projectTotal}, + #{item.gridMemberTotal}, 0, 0, 'CRAWLER_ROBOT', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index d5ead92c47..5dc44f074c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -125,4 +125,36 @@ and ca.pid='0' and ca.CUSTOMER_ID=#{customerId} + + + + + + + + + + \ No newline at end of file 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 f30740e0ee..51db8980fc 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 @@ -532,4 +532,29 @@ user_id = #{project.linkName} + + + From 981863afb7e72da021976e480636aeb1dc6ad5f5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 3 Jun 2021 21:36:44 +0800 Subject: [PATCH 04/52] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=90=91=E4=B8=8A=E6=B1=87=E8=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dao/org/StatsCustomerAgencyDao.java | 19 +++++++++++- .../org/impl/CustomerAgencyServiceImpl.java | 15 ++++++++- ...reenCentralZoneDataExtractServiceImpl.java | 2 ++ .../mapper/org/StatsCustomerAgencyDao.xml | 31 ++++++++++++------- 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 210882908f..47f0e3da95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -41,5 +41,22 @@ public interface StatsCustomerAgencyDao extends BaseDao { * @param customerId * @return com.epmet.dto.org.result.OrgStaffResultDTO */ - List selectOrgStaffIds(String customerId); + List selectGridStaffIds(String customerId); + + /** + * 根据客户id下,查询所有的组织 + * + * @param customerId + * @return com.epmet.entity.org.CustomerAgencyEntity + */ + List selectListByCustomerId(@Param("customerId")String customerId); + + /** + * 查询agency下面的网格员,注意:向上汇聚的, + * + * @param agencyId + * @param customerId + * @return java.lang.String + */ + List selectAgencyStaffIds(@Param("customerId") String customerId,@Param("agencyId")String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 5bcfd88550..3a3d8b4511 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -60,7 +60,20 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { */ @Override public List queryOrgStaffIds(String customerId) { - List resultList=customerAgencyDao.selectOrgStaffIds(customerId); + List resultList=new ArrayList<>(); + List list=customerAgencyDao.selectListByCustomerId(customerId); + for(CustomerAgencyEntity agencyEntity:list){ + List agencyStaffIds=customerAgencyDao.selectAgencyStaffIds(customerId,agencyEntity.getId()); + if(!CollectionUtils.isEmpty(agencyStaffIds)){ + OrgStaffDTO agencyStaffDTO=new OrgStaffDTO(); + agencyStaffDTO.setOrgId(agencyEntity.getId()); + agencyStaffDTO.setOrgType("agency"); + agencyStaffDTO.setStaffIds(agencyStaffIds); + resultList.add(agencyStaffDTO); + } + } + List gridStaffIds=customerAgencyDao.selectGridStaffIds(customerId); + resultList.addAll(gridStaffIds); return resultList; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index d096430868..ff368ab5da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -161,7 +161,9 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon projectMap.putAll(gridProject.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getProjectTotal))); //For:06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数 + //先查询各个组织,各个网格下的用户id集合 List orgStaffDTOList=customerAgencyService.queryOrgStaffIds(customerId); + //再查询这些人当中多少个网格员 Map gridManagerMap=userService.queryOrgGridManager(customerId,orgStaffDTOList); result.forEach(o -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 5dc44f074c..46039b48a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -134,7 +134,7 @@ - SELECT csg.GRID_ID AS orgId, 'grid' AS orgType, @@ -144,17 +144,26 @@ WHERE csg.DEL_FLAG = '0' AND csg.CUSTOMER_ID = #{customerId} - UNION ALL - SELECT - csa.AGENCY_ID AS orgId, - 'agency' AS orgType, - csa.USER_ID AS staffId - FROM - customer_staff_agency csa - WHERE - csa.DEL_FLAG = '0' - AND csa.CUSTOMER_ID = #{customerId} ORDER BY orgType asc,orgId ASC + + + + \ No newline at end of file From 3d7acb2ac7a8675515c044c55fb7f100c1095c98 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 4 Jun 2021 14:52:18 +0800 Subject: [PATCH 05/52] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 3 ++ .../extract/FactOriginGroupMainDailyDao.xml | 19 ++++++---- .../extract/FactOriginGroupMemberDailyDao.xml | 38 +++++++++++-------- .../extract/FactOriginIssueMainDailyDao.xml | 19 ++++++---- .../extract/FactOriginProjectMainDailyDao.xml | 38 ++++++++++++------- .../extract/FactOriginTopicMainDailyDao.xml | 19 ++++++---- 6 files changed, 85 insertions(+), 51 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 72a5501eb8..0bf1504b81 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1011,6 +1011,9 @@ public class DataStatsServiceImpl implements DataStatsService { public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { //获取组织级别 DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId()); + if (null == agency) { + return new PartyMemberVanguardRankResultDTO(); + } //组织排行 List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); //网格排行 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index eeec0fa8e5..21df7f9a68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -352,16 +352,19 @@ SELECT - a.AGENCY_ID, + da.ID AS AGENCY_ID, COUNT( DISTINCT MEMBER_ID ) AS "sum", IFNULL( b.partyCount, 0 ) AS "count" FROM - fact_origin_group_member_daily a - LEFT JOIN - (SELECT - AGENCY_ID, - COUNT( DISTINCT MEMBER_ID ) AS partyCount - FROM fact_origin_group_member_daily - WHERE IS_PARTY = 1 - AND CUSTOMER_ID = #{customerId} - AND DATE_ID <= #{dateId} - GROUP BY AGENCY_ID - ) b ON a.AGENCY_ID = b.AGENCY_ID - WHERE a.CUSTOMER_ID = #{customerId} - AND a.DATE_ID <= #{dateId} + dim_agency da + INNER JOIN fact_origin_group_member_daily a ON a.PIDS LIKE CONCAT( '%', da.ID, '%' ) + AND a.CUSTOMER_ID = #{customerId} + AND a.DATE_ID <= #{dateId} + LEFT JOIN ( + SELECT + agency.ID AS AGENCY_ID, + COUNT( DISTINCT MEMBER_ID ) AS partyCount + FROM + dim_agency agency + INNER JOIN fact_origin_group_member_daily member ON member.PIDS LIKE CONCAT( '%', agency.ID, '%' ) + AND member.IS_PARTY = 1 + AND member.CUSTOMER_ID = #{customerId} + AND member.DATE_ID <= #{dateId} + WHERE + agency.CUSTOMER_ID = #{customerId} + GROUP BY + agency.ID + ) b ON da.ID = b.AGENCY_ID + WHERE + da.CUSTOMER_ID = #{customerId} GROUP BY - a.AGENCY_ID + da.ID SELECT + scj.ID, IFNULL(avg( scj.JOIN_TOTAL ),0) AS total, IFNULL(ROUND( avg( scj.AVG_JOIN ), 1 ),0) AS averageJoin, IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) AS monthIncr, From 05d723349bf711efedcb7db0adedaee09fe15b3a Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 4 Jun 2021 15:42:08 +0800 Subject: [PATCH 07/52] dev_bugfix_ljj --- .../screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java index cb4e514556..94e4f20546 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -15,7 +15,7 @@ import java.math.BigDecimal; public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { private static final long serialVersionUID = -8830240350298414599L; - private String id, + private String id; private Integer total; From 7b561fb3b62410fd8d68a07101e862632c5ea200 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 4 Jun 2021 16:40:53 +0800 Subject: [PATCH 08/52] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=98=AF=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=20=E6=89=80=E4=BB=A5=E5=85=B3=E8=81=94grid=E5=8D=B3?= =?UTF-8?q?=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenIndexDataMonthlyDao.xml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 15a410753b..26c21cd8b1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -238,19 +238,9 @@ FROM screen_index_data_monthly dm INNER JOIN screen_org_rank_data rd ON dm.org_id = rd.org_id - - - - INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = dm.CUSTOMER_ID AND org.GRID_ID = dm.ORG_ID AND org.DEL_FLAG = '0' - - - INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = dm.CUSTOMER_ID AND org.AGENCY_ID = dm.ORG_ID AND org.DEL_FLAG = '0' - - - INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = dm.CUSTOMER_ID AND org.DEPT_ID = dm.ORG_ID AND org.DEL_FLAG = '0' - - - + + INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = dm.CUSTOMER_ID AND org.GRID_ID = dm.ORG_ID AND org.DEL_FLAG = '0' + AND dm.month_id = rd.month_id WHERE dm.del_flag = '0' From 14d5ef825a20b10e84626770516e88d742ccc81e Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 13:17:48 +0800 Subject: [PATCH 09/52] =?UTF-8?q?sql=E5=8A=A0=E5=BC=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datastats/DatsStatsDao.xml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index fafc989776..e16730136c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -360,18 +360,18 @@ SELECT orgId, orgName, - GROUP_COUNT, - GROUP_RATIO, - GROUP_MEMBER_COUNT, - GROUP_MEMBER_RATIO, - TOPIC_COUNT, - TOPIC_RATIO, - ISSUE_COUNT, - ISSUE_RATIO, - PROJECT_COUNT, - PROJECT_RATIO, - PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO + ifnull(GROUP_COUNT,0), + ifnull(GROUP_RATIO,0), + ifnull(GROUP_MEMBER_COUNT,0), + ifnull(GROUP_MEMBER_RATIO,0), + ifnull(TOPIC_COUNT,0), + ifnull(TOPIC_RATIO,0), + ifnull(ISSUE_COUNT,0), + ifnull(ISSUE_RATIO,0), + ifnull(PROJECT_COUNT,0), + ifnull(PROJECT_RATIO,0), + ifnull(PROJECT_CLOSED_COUNT,0), + ifnull(PROJECT_CLOSED_RATIO,0) FROM ( SELECT @@ -654,4 +654,4 @@ ORDER BY problem_resolved_count DESC - \ No newline at end of file + From fd10b15cbbf9cebfcf6da02c5b1a9b9465af8cbd Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 13:23:56 +0800 Subject: [PATCH 10/52] =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=8A=A0=E5=BC=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/datastats/impl/DataStatsServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 0bf1504b81..b61338b163 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1044,6 +1044,9 @@ public class DataStatsServiceImpl implements DataStatsService { } private BigDecimal transform(BigDecimal count) { + if (count == null){ + count = NumConstant.ZERO_DECIMAL; + } return count.multiply(new BigDecimal(NumConstant.ONE_HUNDRED) ).setScale(NumConstant.ONE, RoundingMode.HALF_UP); } From 1f6e7ed3cfaf09775d161f5b5bf4003cce263123 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 13:28:27 +0800 Subject: [PATCH 11/52] =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=8A=A0=E5=BC=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datastats/DatsStatsDao.xml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index e16730136c..57d9edebc8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -403,18 +403,18 @@ SELECT orgId, orgName, - GROUP_COUNT, - GROUP_RATIO, - GROUP_MEMBER_COUNT, - GROUP_MEMBER_RATIO, - TOPIC_COUNT, - TOPIC_RATIO, - ISSUE_COUNT, - ISSUE_RATIO, - PROJECT_COUNT, - PROJECT_RATIO, - PROJECT_CLOSED_COUNT, - PROJECT_CLOSED_RATIO + ifnull(GROUP_COUNT,0), + ifnull(GROUP_RATIO,0), + ifnull(GROUP_MEMBER_COUNT,0), + ifnull(GROUP_MEMBER_RATIO,0), + ifnull(TOPIC_COUNT,0), + ifnull(TOPIC_RATIO,0), + ifnull(ISSUE_COUNT,0), + ifnull(ISSUE_RATIO,0), + ifnull(PROJECT_COUNT,0), + ifnull(PROJECT_RATIO,0), + ifnull(PROJECT_CLOSED_COUNT,0), + ifnull(PROJECT_CLOSED_RATIO,0) FROM ( SELECT From 675d0574bff68e35b14e376ae90a9e3137c3497f Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 13:38:03 +0800 Subject: [PATCH 12/52] =?UTF-8?q?=E7=BB=88=E4=BA=8E=E6=89=BE=E5=88=B0?= =?UTF-8?q?=E7=B2=BE=E9=AB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PartyMemberVanguardDetailResultDTO.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java index ad1d27d9e6..39e833c4b1 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java @@ -30,7 +30,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 党员建组数 */ - private Integer groupCount; + private Integer groupCount = 0; /** * 党员建组数占比 */ @@ -38,7 +38,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 组内党员人数 */ - private Integer groupMemberCount; + private Integer groupMemberCount = 0; /** * 组内党员人数占比 */ @@ -46,7 +46,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 党员发布话题数 */ - private Integer topicCount; + private Integer topicCount = 0; /** * 党员发布话题数占比 */ @@ -54,7 +54,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 党员发布话题转议题数 */ - private Integer issueCount; + private Integer issueCount = 0; /** * 党员发布话题转议题数占比 */ @@ -62,7 +62,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 党员发布话题转项目数 */ - private Integer projectCount; + private Integer projectCount = 0; /** * 党员发布话题转项目数占比 */ @@ -70,7 +70,7 @@ public class PartyMemberVanguardDetailResultDTO implements Serializable { /** * 党员发布话题转项目结案数 */ - private Integer projectClosedCount; + private Integer projectClosedCount = 0; /** * 党员发布话题转项目结案数占比 */ From f3aa032462b433adb048fcc4f8b88bedf2a57df2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 19:53:56 +0800 Subject: [PATCH 13/52] =?UTF-8?q?sql=20=E8=B5=B7=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datastats/DatsStatsDao.xml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 57d9edebc8..d31325b4f4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -360,18 +360,18 @@ SELECT orgId, orgName, - ifnull(GROUP_COUNT,0), - ifnull(GROUP_RATIO,0), - ifnull(GROUP_MEMBER_COUNT,0), - ifnull(GROUP_MEMBER_RATIO,0), - ifnull(TOPIC_COUNT,0), - ifnull(TOPIC_RATIO,0), - ifnull(ISSUE_COUNT,0), - ifnull(ISSUE_RATIO,0), - ifnull(PROJECT_COUNT,0), - ifnull(PROJECT_RATIO,0), - ifnull(PROJECT_CLOSED_COUNT,0), - ifnull(PROJECT_CLOSED_RATIO,0) + ifnull(GROUP_COUNT,0), GROUP_COUNT + ifnull(GROUP_RATIO,0), GROUP_RATIO + ifnull(GROUP_MEMBER_COUNT,0), GROUP_MEMBER_COUNT + ifnull(GROUP_MEMBER_RATIO,0), GROUP_MEMBER_RATIO + ifnull(TOPIC_COUNT,0), TOPIC_COUNT + ifnull(TOPIC_RATIO,0), TOPIC_RATIO + ifnull(ISSUE_COUNT,0), ISSUE_COUNT + ifnull(ISSUE_RATIO,0), ISSUE_RATIO + ifnull(PROJECT_COUNT,0), PROJECT_COUNT + ifnull(PROJECT_RATIO,0), PROJECT_RATIO + ifnull(PROJECT_CLOSED_COUNT,0), PROJECT_CLOSED_COUNT + ifnull(PROJECT_CLOSED_RATIO,0) PROJECT_CLOSED_RATIO FROM ( SELECT @@ -403,18 +403,18 @@ SELECT orgId, orgName, - ifnull(GROUP_COUNT,0), - ifnull(GROUP_RATIO,0), - ifnull(GROUP_MEMBER_COUNT,0), - ifnull(GROUP_MEMBER_RATIO,0), - ifnull(TOPIC_COUNT,0), - ifnull(TOPIC_RATIO,0), - ifnull(ISSUE_COUNT,0), - ifnull(ISSUE_RATIO,0), - ifnull(PROJECT_COUNT,0), - ifnull(PROJECT_RATIO,0), - ifnull(PROJECT_CLOSED_COUNT,0), - ifnull(PROJECT_CLOSED_RATIO,0) + ifnull(GROUP_COUNT,0), GROUP_COUNT + ifnull(GROUP_RATIO,0), GROUP_RATIO + ifnull(GROUP_MEMBER_COUNT,0), GROUP_MEMBER_COUNT + ifnull(GROUP_MEMBER_RATIO,0), GROUP_MEMBER_RATIO + ifnull(TOPIC_COUNT,0), TOPIC_COUNT + ifnull(TOPIC_RATIO,0), TOPIC_RATIO + ifnull(ISSUE_COUNT,0), ISSUE_COUNT + ifnull(ISSUE_RATIO,0), ISSUE_RATIO + ifnull(PROJECT_COUNT,0), PROJECT_COUNT + ifnull(PROJECT_RATIO,0), PROJECT_RATIO + ifnull(PROJECT_CLOSED_COUNT,0), PROJECT_CLOSED_COUNT + ifnull(PROJECT_CLOSED_RATIO,0) PROJECT_CLOSED_RATIO FROM ( SELECT From 1c895a9712705a4ead0f49013600f2172bad5405 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 5 Jun 2021 20:02:15 +0800 Subject: [PATCH 14/52] =?UTF-8?q?=E6=88=91=E4=B9=9F=E6=98=AF=E6=97=A0?= =?UTF-8?q?=E6=95=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/datastats/DatsStatsDao.xml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index d31325b4f4..fb5757da88 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -360,17 +360,17 @@ SELECT orgId, orgName, - ifnull(GROUP_COUNT,0), GROUP_COUNT - ifnull(GROUP_RATIO,0), GROUP_RATIO - ifnull(GROUP_MEMBER_COUNT,0), GROUP_MEMBER_COUNT - ifnull(GROUP_MEMBER_RATIO,0), GROUP_MEMBER_RATIO - ifnull(TOPIC_COUNT,0), TOPIC_COUNT - ifnull(TOPIC_RATIO,0), TOPIC_RATIO - ifnull(ISSUE_COUNT,0), ISSUE_COUNT - ifnull(ISSUE_RATIO,0), ISSUE_RATIO - ifnull(PROJECT_COUNT,0), PROJECT_COUNT - ifnull(PROJECT_RATIO,0), PROJECT_RATIO - ifnull(PROJECT_CLOSED_COUNT,0), PROJECT_CLOSED_COUNT + ifnull(GROUP_COUNT,0) AS GROUP_COUNT, + ifnull(GROUP_RATIO,0) AS GROUP_RATIO, + ifnull(GROUP_MEMBER_COUNT,0) AS GROUP_MEMBER_COUNT, + ifnull(GROUP_MEMBER_RATIO,0) AS GROUP_MEMBER_RATIO, + ifnull(TOPIC_COUNT,0) AS TOPIC_COUNT, + ifnull(TOPIC_RATIO,0) AS TOPIC_RATIO, + ifnull(ISSUE_COUNT,0) AS ISSUE_COUNT, + ifnull(ISSUE_RATIO,0) AS ISSUE_RATIO, + ifnull(PROJECT_COUNT,0) AS PROJECT_COUNT, + ifnull(PROJECT_RATIO,0) AS PROJECT_RATIO, + ifnull(PROJECT_CLOSED_COUNT,0) AS PROJECT_CLOSED_COUNT, ifnull(PROJECT_CLOSED_RATIO,0) PROJECT_CLOSED_RATIO FROM ( @@ -403,18 +403,18 @@ SELECT orgId, orgName, - ifnull(GROUP_COUNT,0), GROUP_COUNT - ifnull(GROUP_RATIO,0), GROUP_RATIO - ifnull(GROUP_MEMBER_COUNT,0), GROUP_MEMBER_COUNT - ifnull(GROUP_MEMBER_RATIO,0), GROUP_MEMBER_RATIO - ifnull(TOPIC_COUNT,0), TOPIC_COUNT - ifnull(TOPIC_RATIO,0), TOPIC_RATIO - ifnull(ISSUE_COUNT,0), ISSUE_COUNT - ifnull(ISSUE_RATIO,0), ISSUE_RATIO - ifnull(PROJECT_COUNT,0), PROJECT_COUNT - ifnull(PROJECT_RATIO,0), PROJECT_RATIO - ifnull(PROJECT_CLOSED_COUNT,0), PROJECT_CLOSED_COUNT - ifnull(PROJECT_CLOSED_RATIO,0) PROJECT_CLOSED_RATIO + ifnull(GROUP_COUNT,0) AS GROUP_COUNT, + ifnull(GROUP_RATIO,0) AS GROUP_RATIO, + ifnull(GROUP_MEMBER_COUNT,0) AS GROUP_MEMBER_COUNT, + ifnull(GROUP_MEMBER_RATIO,0) AS GROUP_MEMBER_RATIO, + ifnull(TOPIC_COUNT,0) AS TOPIC_COUNT, + ifnull(TOPIC_RATIO,0) AS TOPIC_RATIO, + ifnull(ISSUE_COUNT,0) AS ISSUE_COUNT, + ifnull(ISSUE_RATIO,0) AS ISSUE_RATIO, + ifnull(PROJECT_COUNT,0) AS PROJECT_COUNT, + ifnull(PROJECT_RATIO,0) AS PROJECT_RATIO, + ifnull(PROJECT_CLOSED_COUNT,0) AS PROJECT_CLOSED_COUNT, + ifnull(PROJECT_CLOSED_RATIO,0) AS PROJECT_CLOSED_RATIO FROM ( SELECT From b2d66946e4dce3e60f9906b2bdec66f2aa89b1ee Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 7 Jun 2021 09:02:30 +0800 Subject: [PATCH 15/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-aggregator/data-aggregator-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index e339e39885..71880e1591 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -446,7 +446,7 @@ - epmet_data_statistical_user + epmet_data_statistical EpmEt-db-UsEr From 002d6371c00cf0efc710e46cc05954f17c3b4a6e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 7 Jun 2021 09:47:19 +0800 Subject: [PATCH 16/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/govproject/ProjectDTO.java | 15 ++++++++++++ .../entity/govproject/ProjectEntity.java | 15 ++++++++++++ .../epmet/entity/project/ProjectEntity.java | 15 ++++++++++++ .../main/java/com/epmet/dto/ProjectDTO.java | 15 ++++++++++++ .../dto/form/ProjectApprovalFormDTO.java | 6 +++++ .../dto/result/ProjectDetailResultDTO.java | 13 ++++++++++ .../java/com/epmet/entity/ProjectEntity.java | 15 ++++++++++++ .../service/impl/ProjectServiceImpl.java | 3 +++ .../service/impl/ProjectTraceServiceImpl.java | 3 +++ .../V0.0.13__alter_project_location.sql | 24 +++++++++++++++++++ .../src/main/resources/mapper/ProjectDao.xml | 3 +++ 11 files changed, 127 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java index e94e2e9ad7..1a7f37a932 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java @@ -90,6 +90,21 @@ public class ProjectDTO implements Serializable { */ private String orgIdPath; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java index 5cdf2cde3b..45ea76b9d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java @@ -83,4 +83,19 @@ public class ProjectEntity extends BaseEpmetEntity { */ private String orgIdPath; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java index 15c533efc3..b0103e2883 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java @@ -80,4 +80,19 @@ public class ProjectEntity extends BaseEpmetEntity { */ private String orgIdPath; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java index 6ba33ec68a..4aeebf8c47 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java @@ -90,6 +90,21 @@ public class ProjectDTO implements Serializable { */ private String orgIdPath; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java index c79613963f..d269a4aeaa 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java @@ -28,6 +28,12 @@ public class ProjectApprovalFormDTO implements Serializable { @NotBlank(message = "内部备注不能为空",groups = {ProjectApprovalFormDTO.ApprovalCategory.class}) @Length(max=1000,message = "内部备注不能超过1000位",groups = {ProjectApprovalFormDTO.ApprovalCategory.class}) private String internalRemark; + //定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + private String locateAddress; + //定位经度 + private String locateLongitude; + //定位纬度 + private String locateDimension; public interface ApprovalCategory extends CustomerClientShowGroup {} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java index ebffaef4d7..1491ee95c6 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java @@ -73,6 +73,19 @@ public class ProjectDetailResultDTO implements Serializable { */ private List platformIds; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + /** + * 定位经度 + * */ + private String locateLongitude; + /** + * 定位纬度 + * */ + private String locateDimension; + public ProjectDetailResultDTO() { this.processable = false; this.isSend = false; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java index 444eebee06..cbdd5c31e7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java @@ -83,4 +83,19 @@ public class ProjectEntity extends BaseEpmetEntity { */ private String orgIdPath; + /** + * 定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + * */ + private String locateAddress; + + /** + * 定位经度 + * */ + private String locateLongitude; + + /** + * 定位纬度 + * */ + private String locateDimension; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index d5e6f7a08a..2d3c544ad5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1011,6 +1011,9 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectTraceS projectEntity.setBackGround(formDTO.getBackGround()); projectEntity.setStatus(ProjectConstant.PENDING); projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); + projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); + projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude()); + projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension()); projectService.insert(projectEntity); //3-2.项目进展表新增第一个节点数据 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql new file mode 100644 index 0000000000..fd3b7ffcfa --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql @@ -0,0 +1,24 @@ +ALTER TABLE `project` +ADD COLUMN `LOCATE_ADDRESS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置]' AFTER `ORG_ID_PATH`, +ADD COLUMN `LOCATE_LONGITUDE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '定位经度' AFTER `LOCATE_ADDRESS`, +ADD COLUMN `LOCATE_DIMENSION` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '定位维度' AFTER `LOCATE_LONGITUDE`; + + + +UPDATE + project a, + ( + SELECT + locate_address a, + locate_longitude b, + locate_dimension c, + issue_id d + FROM epmet_resi_group.resi_topic + ) b +SET + a.locate_address = b.a, + a.locate_longitude = b.b, + a.locate_dimension = b.c +WHERE + a.origin = 'issue' +AND a.origin_id = b.d \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 879dc9904a..82233c7b68 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -128,6 +128,9 @@ p.ORIGIN AS "origin", p.ORIGIN_ID AS "originId", p.STATUS AS "projectStatus", + p.locate_address AS "locateAddress", + p.locate_longitude AS "locateLongitude", + p.locate_dimension AS "locateDimension", IFNULL(pp.PUBLIC_REPLY, '无') AS "publicReply", IFNULL(pp.INTERNAL_REMARK, '无') AS "internalRemark" FROM project p From 0bbb169dcd6a055025769bece8a0301be6dde7f4 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 7 Jun 2021 12:07:05 +0800 Subject: [PATCH 17/52] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=BD=93?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=A2=AB=E5=88=A0=E9=99=A4=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=A7=E7=BB=AD=E5=9C=A8=E6=AD=A4=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=93=8D=E4=BD=9C=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/AccessServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 25afa314fa..09727f5e56 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -453,6 +453,9 @@ public class AccessServiceImpl implements AccessService { } CustomerAgencyDTO belongAgency = belongAgencyRst.getData(); + if (belongAgency == null || belongAgency.getId() == null) { + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode(), "操作权限不足,用户所属的组织信息不存在"); + } //Result agencyByStaffRst = govOrgFeignClient.getAgencyByStaff(staffId); //if (!agencyByStaffRst.success()) { @@ -467,11 +470,15 @@ public class AccessServiceImpl implements AccessService { // 2.拿到当前所处机关单位信息 Result currAgencyRst = govOrgFeignClient.getAgencyById(currAgencyId); - CustomerAgencyDTO currAgencyDto = currAgencyRst.getData(); - if (!currAgencyRst.success() || currAgencyDto == null) { + if (!currAgencyRst.success()) { throw new RenException(String.format("根据当前机构id[%s]查询pids失败:%s", currAgencyId, currAgencyRst.getMsg())); } + CustomerAgencyDTO currAgencyDto = currAgencyRst.getData(); + if (currAgencyDto == null || currAgencyDto.getId() == null) { + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode(), "操作权限不足,当前组织信息不存在"); + } + // 获取机关单位中的角色 // 目前一个人只在一个单位下,所以不动态查询,如果后面需要一个人在多个单位,再改这里 //List roleDTOS = queryGovStaffRoles(staffId, belongAgency.getId()); From c7c8cd0ab4c3fd72f153074da609abb07b003662 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 7 Jun 2021 13:32:25 +0800 Subject: [PATCH 18/52] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1=20?= =?UTF-8?q?=E5=88=86=E7=B1=BB=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IssueProjectCategoryDictServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 6e61017ed1..9236ff80a5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -503,15 +503,15 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl list){ - String result = ""; + StringBuilder r = new StringBuilder(); if (!CollectionUtils.isEmpty(list)){ list.forEach(l -> { - result.concat(l.getCategoryName()).concat(","); + r.append(l.getCategoryName()).append(","); }); } - if (StringUtils.isEmpty(result)){ - return result; + if (StringUtils.isEmpty(r.toString())){ + return r.toString(); } - return result.substring(NumConstant.ZERO,result.length()-NumConstant.ONE); + return r.toString().substring(NumConstant.ZERO,r.length()-NumConstant.ONE); } } From 996dbd50c48f603a017a7e23f68ea77e46137436 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 7 Jun 2021 14:31:40 +0800 Subject: [PATCH 19/52] =?UTF-8?q?user=E5=92=8Cagg=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E5=9F=BA=E7=A1=80=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/epmetuser/StaffPatrolDetailDTO.java | 131 ++++++++++++++++++ .../dto/epmetuser/StaffPatrolRecordDTO.java | 121 ++++++++++++++++ .../dao/epmetuser/StaffPatrolDetailDao.java | 34 +++++ .../dao/epmetuser/StaffPatrolRecordDao.java | 34 +++++ .../epmetuser/StaffPatrolDetailEntity.java | 101 ++++++++++++++ .../epmetuser/StaffPatrolRecordEntity.java | 91 ++++++++++++ .../epmetuser/StaffPatrolDetailService.java | 33 +++++ .../epmetuser/StaffPatrolRecordService.java | 32 +++++ .../impl/StaffPatrolDetailServiceImpl.java | 41 ++++++ .../impl/StaffPatrolRecordServiceImpl.java | 42 ++++++ .../mapper/epmetuser/StaffPatrolDetailDao.xml | 9 ++ .../mapper/epmetuser/StaffPatrolRecordDao.xml | 7 + .../com/epmet/dao/StaffPatrolDetailDao.java | 33 +++++ .../com/epmet/dao/StaffPatrolRecordDao.java | 33 +++++ .../epmet/entity/StaffPatrolDetailEntity.java | 101 ++++++++++++++ .../epmet/entity/StaffPatrolRecordEntity.java | 91 ++++++++++++ .../service/StaffPatrolDetailService.java | 32 +++++ .../service/StaffPatrolRecordService.java | 33 +++++ .../impl/StaffPatrolDetailServiceImpl.java | 37 +++++ .../impl/StaffPatrolRecordServiceImpl.java | 36 +++++ .../resources/mapper/StaffPatrolDetailDao.xml | 29 ++++ .../resources/mapper/StaffPatrolRecordDao.xml | 27 ++++ 22 files changed, 1128 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java new file mode 100644 index 0000000000..def0db685a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolDetailDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java new file mode 100644 index 0000000000..be8e0300f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffPatrolRecordDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..bb2247f220 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolDetailDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.epmetuser; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..9b26421034 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.epmetuser; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..c74f88b459 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolDetailEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..f15187a712 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java new file mode 100644 index 0000000000..2463f47a0c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolDetailService.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService extends BaseService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java new file mode 100644 index 0000000000..c2cfcdd450 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StaffPatrolRecordService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..fad170f41f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolDetailDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolDetailEntity; +import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +@Service +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..f245db7138 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; +import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; +import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +@Service +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..c06344967c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolDetailDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..f8fa69fada --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..844e0d0036 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..61f5769af4 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.StaffPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..fbc81edd1a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolDetailEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..2eed573090 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java new file mode 100644 index 0000000000..ff79804e27 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolDetailService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService extends BaseService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java new file mode 100644 index 0000000000..ae347f87e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.StaffPatrolRecordEntity; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..591e95c093 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.StaffPatrolDetailDao; +import com.epmet.entity.StaffPatrolDetailEntity; +import com.epmet.service.StaffPatrolDetailService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..aa6f7c5571 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.StaffPatrolRecordDao; +import com.epmet.entity.StaffPatrolRecordEntity; +import com.epmet.service.StaffPatrolRecordService; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..235ad55597 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..c57b356e99 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 3d2371853d22e8b094108fd15a2dd79284423a81 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 7 Jun 2021 14:34:38 +0800 Subject: [PATCH 20/52] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/StaffPatrolDetailDTO.java | 131 ++++++++++++++++++ .../com/epmet/dto/StaffPatrolRecordDTO.java | 121 ++++++++++++++++ .../user/StaffPatrolDetailController.java | 20 +++ .../user/StaffPatrolRecordController.java | 21 +++ .../dao/user/StaffPatrolDetailDao.java | 33 +++++ .../dao/user/StaffPatrolRecordDao.java | 33 +++++ .../entity/user/StaffPatrolDetailEntity.java | 101 ++++++++++++++ .../entity/user/StaffPatrolRecordEntity.java | 91 ++++++++++++ .../user/StaffPatrolDetailService.java | 14 ++ .../user/StaffPatrolRecordService.java | 14 ++ .../impl/StaffPatrolDetailServiceImpl.java | 20 +++ .../impl/StaffPatrolRecordServiceImpl.java | 21 +++ .../mapper/user/StaffPatrolDetailDao.xml | 6 + .../mapper/user/StaffPatrolRecordDao.xml | 6 + 14 files changed, 632 insertions(+) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java new file mode 100644 index 0000000000..a5f33265d5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolDetailDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java new file mode 100644 index 0000000000..ef6b517d61 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/StaffPatrolRecordDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +public class StaffPatrolRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java new file mode 100644 index 0000000000..c527606726 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -0,0 +1,20 @@ +package com.epmet.datareport.controller.user; + +import com.epmet.datareport.service.user.StaffPatrolDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@RestController +@RequestMapping("staffpatroldetail") +public class StaffPatrolDetailController { + + @Autowired + private StaffPatrolDetailService staffPatrolDetailService; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java new file mode 100644 index 0000000000..90a99c3d64 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolRecordController.java @@ -0,0 +1,21 @@ +package com.epmet.datareport.controller.user; + +import com.epmet.datareport.service.user.StaffPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@RestController +@RequestMapping("staffpatrolrecord") +public class StaffPatrolRecordController { + + @Autowired + private StaffPatrolRecordService staffPatrolRecordService; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java new file mode 100644 index 0000000000..80feec8810 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java new file mode 100644 index 0000000000..c282d4e98d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface StaffPatrolRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java new file mode 100644 index 0000000000..fd00e1b58f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolDetailEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_detail") +public class StaffPatrolDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * staff_patrol_record.ID + */ + private String staffPatrolRecId; + + /** + * 前端给的序号 + */ + private Integer serialNum; + + /** + * 上传时间,后台自动插入该时间 + */ + private Date uploadTime; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 速度,单位m/s;开始和结束时默认0 + */ + private String speed; + + /** + * 位置的精确度 + */ + private String accuracy; + + /** + * 高度,单位米 + */ + private String altitude; + + /** + * 垂直经度,单位m + */ + private String verticalaccuracy; + + /** + * 水平经度,单位m + */ + private String horizontalaccuracy; + + /** + * 地址;暂时不用 + */ + private String address; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java new file mode 100644 index 0000000000..7c37dd2813 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/user/StaffPatrolRecordEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_patrol_record") +public class StaffPatrolRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String grid; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 巡查开始时间 + */ + private Date patrolStartTime; + + /** + * 巡查结束时间,前端传入 + */ + private Date patrolEndTime; + + /** + * 实际结束时间=操作结束巡查的时间 + */ + private Date actrualEndTime; + + /** + * 本次巡查总耗时,单位秒;结束巡查时写入 + */ + private Integer totalTime; + + /** + * 正在巡查中:patrolling;结束:end + */ + private String status; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java new file mode 100644 index 0000000000..35a952b658 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -0,0 +1,14 @@ +package com.epmet.datareport.service.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolDetailService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java new file mode 100644 index 0000000000..e1d15008e5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolRecordService.java @@ -0,0 +1,14 @@ +package com.epmet.datareport.service.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StaffPatrolRecordService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java new file mode 100644 index 0000000000..90fd30694d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -0,0 +1,20 @@ +package com.epmet.datareport.service.user.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.datareport.dao.user.StaffPatrolDetailDao; +import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.datareport.service.user.StaffPatrolDetailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查记录明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +@Slf4j +public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java new file mode 100644 index 0000000000..35351b5746 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolRecordServiceImpl.java @@ -0,0 +1,21 @@ +package com.epmet.datareport.service.user.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.datareport.dao.user.StaffPatrolRecordDao; +import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import com.epmet.datareport.service.user.StaffPatrolRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Service +@Slf4j +public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml new file mode 100644 index 0000000000..7b9093502a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml new file mode 100644 index 0000000000..511d20a355 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 2cc1f533e54af2b0e02bfdd2495b70218c4a4f3b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 7 Jun 2021 15:11:14 +0800 Subject: [PATCH 21/52] =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=B0=83=E5=8A=A8?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8F=AF=E8=83=BD=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E7=99=BB=E9=99=86token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/StaffServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index d72d3cdd8a..a77dd1c449 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -3,6 +3,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; @@ -47,6 +49,8 @@ public class StaffServiceImpl implements StaffService { private StaffTransferRecordService staffTransferRecordService; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private RedisUtils redisUtils; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -255,6 +259,11 @@ public class StaffServiceImpl implements StaffService { staffTransferRecordDTO.setAgencyId(fromDTO.getAgencyId()); staffTransferRecordDTO.setRemarks(fromDTO.getRemarks()); staffTransferRecordService.save(staffTransferRecordDTO); + //2021.6.7 添加逻辑-人员调动删除token sun start + //8.清除可能存在的工作人员登陆token + String key = RedisKeys.getCpUserKey("gov", "wxmp", fromDTO.getStaffId()); + redisUtils.delete(key); + //2021.6.7 添加逻辑-人员调动删除token sun end } /** From 89ef245266e54c707b5eb3bc4d0ba0a241ef09e6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 7 Jun 2021 16:36:07 +0800 Subject: [PATCH 22/52] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/epmetuser/form/StaffListFormDTO.java | 48 +++++++++++++++++++ .../epmetuser/result/StaffListResultDTO.java | 32 +++++++++++++ .../controller/EpmetUserController.java | 30 ++++++++++++ .../service/epmetuser/EpmetUserService.java | 8 ++++ .../epmetuser/impl/EpmetUserServiceImpl.java | 13 +++++ 5 files changed, 131 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java new file mode 100644 index 0000000000..95aeed99d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dataaggre.dto.epmetuser.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 巡查-各人员巡查记录列表查询-接口入参 + * @Auth sun + */ +@Data +public class StaffListFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 近1一个月传1; 近3个月传3【自然月分】 + */ + @NotBlank(message = "最近时间不能为空", groups = StaffListFormDTO.Staff.class) + private Integer time; + /** + * 排序字段【巡查总次数:patrolTotal;最近开始巡查时间:latestPatrolledTime】 + */ + @NotBlank(message = "排序条件不能为空", groups = StaffListFormDTO.Staff.class) + private String sortCode; + /** + * 网格id集合,为空则查询当前组织下所有网格数据 + */ + private Integer gridIds; + /** + * 工作人员姓名;可空 + */ + private String staffName; + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + /** + * 每页多少条 + * */ + private Integer pageSize = 20; + public interface Staff extends CustomerClientShowGroup { + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java new file mode 100644 index 0000000000..15f2647e88 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/StaffListResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 巡查-各人员巡查记录列表查询-接口入参 + * @Auth sun + */ +@Data +public class StaffListResultDTO implements Serializable { + private static final long serialVersionUID = 7129564173128153335L; + + //工作人员所属网格id + private String gridId = ""; + //工作人员所在网格名称,最多显示到网格的上两级 + private String gridName = ""; + //工作人员用户id + private String staffId = ""; + //真名 + private String staffName = ""; + //最近巡查时间[最近一次进行中或已结束巡查的开始时间] + private String patrolStartTime = ""; + //巡查总次数 + private Integer patrolTotal = 0; + //性别0.未知,1男,2.女前端默认头像用 + private String gender = "0"; + //正在巡查中:patrolling;否则返回空字符串 + private String status = ""; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 583b66f4f1..349fe37827 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -1,8 +1,21 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Author zxc * @DateTime 2020/12/25 上午9:45 @@ -10,4 +23,21 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("epmetuser") public class EpmetUserController { + + @Autowired + private EpmetUserService epmetUserService; + + + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + @PostMapping("stafflist") + public Result> staffList(@RequestBody StaffListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); + return new Result>().ok(epmetUserService.staffList(formDTO)); + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index d6e03f7f40..b43df6d3a4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -1,5 +1,7 @@ package com.epmet.dataaggre.service.epmetuser; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; import java.util.List; @@ -26,4 +28,10 @@ public interface EpmetUserService { */ List selectUserIdByCustomerId(List userIds); + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + List staffList(StaffListFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 2dac9b0ccd..2fe1c69be4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -3,6 +3,8 @@ package com.epmet.dataaggre.service.epmetuser.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.UserBaseInfoDao; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import lombok.extern.slf4j.Slf4j; @@ -44,4 +46,15 @@ public class EpmetUserServiceImpl implements EpmetUserService { public List selectUserIdByCustomerId(List userIds) { return userBaseInfoDao.selectUserIdByCustomerId(userIds); } + + /** + * @Param formDTO + * @Description 001、各人员巡查记录列表查询 + * @author sun + */ + @Override + public List staffList(StaffListFormDTO formDTO) { + return null; + } + } From bf8e539e3b683dd5b3e2bad784a85b0311d5e154 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 09:56:41 +0800 Subject: [PATCH 23/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8F=8Ajob=E7=9A=84=E7=AD=89=E5=BE=85=E6=97=B6=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/StatsGroupServiceImpl.java | 11 +++++------ .../com/epmet/task/StatsGroupAgencyDailyTask.java | 3 ++- .../epmet-job-server/src/main/resources/bootstrap.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 50382aa75e..e75870980f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -83,13 +83,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { Integer pageSize = NumConstant.ONE_HUNDRED; List customerIds = new ArrayList<>(); - if (StringUtils.isNotBlank(formDTO.getCustomerId())) { - customerIds.add(formDTO.getCustomerId()); - } else { - customerIds = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); - } do { - + if (StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerIds.add(formDTO.getCustomerId()); + } else { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + } DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); if (customerIds.size() != NumConstant.ZERO) { customerIds.forEach(customerId -> { diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java index f5ff55f74e..a8f8c7802d 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -1,5 +1,6 @@ package com.epmet.task; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsGroupService; import org.slf4j.Logger; @@ -28,7 +29,7 @@ public class StatsGroupAgencyDailyTask implements ITask { if (result.success()){ logger.info("StatsGroupAgencyDailyTask定时任务执行成功"); }else { - logger.error("StatsGroupAgencyDailyTask定时任务执行失败:" + result.getMsg()); + logger.error("StatsGroupAgencyDailyTask定时任务执行失败:" , JSON.toJSONString(result)); } } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 20fc7cb138..aa0d5545ed 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ hystrix: execution: isolation: thread: - timeoutInMilliseconds: 60000 #缺省为1000 + timeoutInMilliseconds: 90000 #缺省为1000 ribbon: ReadTimeout: 300000 From e980051aae809e1377d254e084c63c6526a8568d Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 10:28:04 +0800 Subject: [PATCH 24/52] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=90=8D=E7=A7=B0=20?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E4=BF=AE=E6=94=B9=20=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=82=B9=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/form/CenterPointForm.java | 18 +++++++++++ .../dto/screen/form/GridCenterPointForm.java | 30 +++++++++++++++++++ .../com/epmet/controller/EIDimController.java | 14 +++++++++ .../java/com/epmet/service/EIDimService.java | 13 ++++++++ .../screen/ScreenCustomerGridService.java | 4 ++- .../impl/ScreenCustomerGridServiceImpl.java | 22 +++++++++++++- .../epmet/service/impl/EIDimServiceImpl.java | 21 ++++++++++--- 7 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java new file mode 100644 index 0000000000..59cf43ebf1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CenterPointForm.java @@ -0,0 +1,18 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * desc:修改组织中心点 + * @author liujianjun + */ +@Data +public class CenterPointForm implements Serializable { + private static final long serialVersionUID = 6425114459278919896L; + private String title; + private List center = new ArrayList<>(); +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java new file mode 100644 index 0000000000..6859b4a1ee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/GridCenterPointForm.java @@ -0,0 +1,30 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * desc:修改组织中心点 + * @author liujianjun + */ +@Data +public class GridCenterPointForm implements Serializable { + + private static final long serialVersionUID = -6988009829971668860L; + + private String customerId; + + private List centerDataList = new ArrayList<>(); + + + /* @Data + public class CenterData implements Serializable{ + + private static final long serialVersionUID = 6425114459278919896L; + private String title; + private List center = new ArrayList<>(); + }*/ +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java index 761c62bb0b..e15b66e188 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/EIDimController.java @@ -2,14 +2,18 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.service.EIDimService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Map; + /** * epmet_evaluation_index库的维度controller */ @@ -45,4 +49,14 @@ public class EIDimController { return new Result(); } + /** + * desc 更新网格的中心点位 + * @return + */ + @PostMapping("update/gridcenterpoint") + public Result upsertOrgCenterPoint(@RequestBody GridCenterPointForm param) { + Map effectRow = eiDimService.updateCenterPointByName(param); + return new Result().ok(effectRow); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java index 64ba669caf..f74e041940 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/EIDimService.java @@ -1,7 +1,10 @@ package com.epmet.service; +import com.epmet.dto.screen.form.GridCenterPointForm; import org.springframework.stereotype.Service; +import java.util.Map; + /** * epmet_evaluation_index 维度的service */ @@ -10,4 +13,14 @@ public interface EIDimService { void initAgencies(); void initDepartments(); void initGrids(); + + /** + * desc: 更新中心点位 + * + * @param param + * @return java.lang.Integer + * @author LiuJanJun + * @date 2021/6/7 3:52 下午 + */ + Map updateCenterPointByName(GridCenterPointForm param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index ef39e1b781..eeb24aad81 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -102,4 +102,6 @@ public interface ScreenCustomerGridService extends BaseService selectBelongGridInfo(String customerId,String level); -} \ No newline at end of file + + Integer updateCenterPointByName(String customerId, String title, List center); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 67dae90b1c..7253d1bc1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -18,6 +18,8 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.utils.DateUtils; @@ -37,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -94,6 +97,12 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); + w.eq(ScreenCustomerGridEntity::getGridId, grid.getId()); + screenCustomerGridDao.delete(w); + } } } } @@ -179,4 +188,15 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectBelongGridInfo(String customerId, String level) { return baseDao.selectBelongGridInfo(customerId, level); } -} \ No newline at end of file + + @Override + public Integer updateCenterPointByName(String customerId, String title, List center) { + LambdaUpdateWrapper tWrapper = new LambdaUpdateWrapper<>(); + String val = center.toString(); + List array = new ArrayList<>(Collections.singleton(val)); + tWrapper.eq(ScreenCustomerGridEntity::getCustomerId,customerId) + .likeRight(ScreenCustomerGridEntity::getGridName,title) + .set(ScreenCustomerGridEntity::getCenterMark, array.toString()); + return baseDao.update(null,tWrapper); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index d35aa6bec6..b80c287843 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -1,5 +1,7 @@ package com.epmet.service.impl; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; @@ -16,10 +18,7 @@ import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; @Service public class EIDimServiceImpl implements EIDimService { @@ -130,6 +129,20 @@ public class EIDimServiceImpl implements EIDimService { screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update); } + @Override + public Map updateCenterPointByName(GridCenterPointForm param) { + //todo 怎么反向判断 左匹配 + List gridInfoList = screenCustomerGridService.selectAllGridInfo(param.getCustomerId()); + Map result = new HashMap<>(); + param.getCenterDataList().forEach(o ->{ + Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + if (integer == 0 || integer > 1){ + result.put(o.getTitle(),integer); + } + }); + return result; + } + private List listGrids2Update() { ScreenCustomerGridEntity lastUpdateGrid = screenCustomerGridService.getLastUpdateGrid(); if (lastUpdateGrid != null) { From 9d583b720f404537c8f98ce9dbfeee81974bdc1e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 10:29:02 +0800 Subject: [PATCH 25/52] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/StatsGroupServiceImpl.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index e75870980f..a6cc1d5c1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; @@ -11,7 +10,6 @@ import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; -import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; @@ -24,14 +22,12 @@ import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; @@ -213,7 +209,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupCount = approvedResult.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + Integer groupCount = approvedResult.stream().mapToInt(AgencyGroupTotalCountResultDTO::getGridGroupCount).sum(); agencyResult.setGroupTotalCount(groupCount); // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" List peopleTotal = new ArrayList<>(); @@ -225,7 +221,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { } }); }); - Integer groupPeopleCount = peopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + Integer groupPeopleCount = peopleTotal.stream().mapToInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal).sum(); agencyResult.setGroupMemberTotalCount(groupPeopleCount); // 4. 机关下小组平均人数 agencyResult.setGroupMemberAvgCount( From 0c3d1ad0f13ad4ed7d4a013588698cec23fdfa19 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Jun 2021 10:32:59 +0800 Subject: [PATCH 26/52] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=B7=A1=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/form/GridManagerListFormDTO.java | 25 ++++++++ .../epmet/user/form/PatrolTrackFormDTO.java | 23 +++++++ .../epmet/user/form/RecordListFormDTO.java | 26 ++++++++ .../user/result/GridManagerListResultDTO.java | 52 +++++++++++++++ .../user/result/PatrolTrackResultDTO.java | 26 ++++++++ .../user/result/RecordListResultDTO.java | 36 +++++++++++ .../user/StaffPatrolDetailController.java | 50 ++++++++++++++- .../dao/user/StaffPatrolDetailDao.java | 14 ++++- .../dao/user/StaffPatrolRecordDao.java | 12 ++++ .../user/StaffPatrolDetailService.java | 34 +++++++++- .../impl/StaffPatrolDetailServiceImpl.java | 63 ++++++++++++++++++- .../mapper/user/StaffPatrolDetailDao.xml | 12 ++++ .../mapper/user/StaffPatrolRecordDao.xml | 13 ++++ 13 files changed, 379 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java new file mode 100644 index 0000000000..58a1912d1f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListFormDTO implements Serializable { + + private static final long serialVersionUID = -7624307754570242679L; + + public interface GridManagerListForm{} + + @NotBlank(message = "组织ID不能为空",groups = GridManagerListForm.class) + private String agencyId; + + @NotBlank(message = "行政区域编码不能为空",groups = GridManagerListForm.class) + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java new file mode 100644 index 0000000000..831a4ee8fd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:27 下午 + * @DESC + */ +@Data +public class PatrolTrackFormDTO implements Serializable { + + private static final long serialVersionUID = 5074643104620363029L; + + public interface PatrolTrackForm{} + + @NotBlank(message = "巡查记录ID不能为空",groups = PatrolTrackForm.class) + private String staffPatrolRecId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java new file mode 100644 index 0000000000..c540ddc579 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:09 下午 + * @DESC + */ +@Data +public class RecordListFormDTO implements Serializable { + + private static final long serialVersionUID = 1034587652692011650L; + + public interface RecordListForm{} + + @NotBlank(message = "staffId不能为空",groups = RecordListForm.class) + private String staffId; + + @NotBlank(message = "网格ID不能为空",groups = RecordListForm.class) + private String gridId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java new file mode 100644 index 0000000000..7ea6da09f1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListResultDTO implements Serializable { + + private static final long serialVersionUID = 3606724812822179356L; + + /** + * 工作人员id + */ + private String staffId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 网格ID + */ + private String gridId; + + /** + * 正在巡查:patrolling;否则返回空字符串 + */ + private String status; + + /** + * 网格名称,最多显示上两级 + */ + private String gridName; + + /** + * 姓名 + */ + private String staffName; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java new file mode 100644 index 0000000000..070b5a7d9a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:29 下午 + * @DESC + */ +@Data +public class PatrolTrackResultDTO implements Serializable { + + private static final long serialVersionUID = 5147586435344204616L; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java new file mode 100644 index 0000000000..aab9d52ef0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:14 下午 + * @DESC + */ +@Data +public class RecordListResultDTO implements Serializable { + + private static final long serialVersionUID = -1021736989973649009L; + + /** + * 巡查记录id + */ + private String staffPatrolRecId; + + /** + * 开始时间;yyyy-MM-dd HH:mm + */ + private String patrolStartTime; + + /** + * 结束时间;yyyy-MM-dd HH:mm + */ + private String patrolEndTime; + + /** + * 正在巡查:patrolling;已结束:end + */ + private String status; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index c527606726..e853fa3a48 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -1,9 +1,19 @@ package com.epmet.datareport.controller.user; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 工作人员巡查记录明细 * @@ -11,10 +21,46 @@ import org.springframework.web.bind.annotation.*; * @since v1.0.0 2021-06-07 */ @RestController -@RequestMapping("staffpatroldetail") +@RequestMapping("staffpatrol") public class StaffPatrolDetailController { @Autowired - private StaffPatrolDetailService staffPatrolDetailService; + private StaffPatrolDetailService staffPatrolService; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @PostMapping("gridmanagerlist") + public Result> gridManagerList(@RequestBody GridManagerListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GridManagerListFormDTO.GridManagerListForm.class); + return new Result>().ok(staffPatrolService.gridManagerList(formDTO)); + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @PostMapping("recordlist") + public Result> recordList(@RequestBody RecordListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); + return new Result>().ok(staffPatrolService.recordList(formDTO)); + } + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @PostMapping("patroltrack") + public Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); + return new Result>().ok(staffPatrolService.patrolTrack(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java index 80feec8810..56e3249113 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java @@ -19,7 +19,11 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.result.PatrolTrackResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员巡查记录明细 @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolDetailDao extends BaseDao { - + + /** + * @Description 查询巡查轨迹 + * @Param staffPatrolRecId + * @author zxc + * @date 2021/6/7 5:13 下午 + */ + List selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java index c282d4e98d..a8637bd720 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java @@ -19,8 +19,12 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.RecordListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 工作人员巡查主记录 * @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolRecordDao extends BaseDao { + + /** + * @Description 巡查记录查询 + * @Param formDTO + * @author zxc + * @date 2021/6/7 5:29 下午 + */ + List recordList(RecordListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java index 35a952b658..8afa465ea3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -2,6 +2,14 @@ package com.epmet.datareport.service.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; + +import java.util.List; /** * 工作人员巡查记录明细 @@ -9,6 +17,30 @@ import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; * @author generator generator@elink-cn.com * @since v1.0.0 2021-06-07 */ -public interface StaffPatrolDetailService extends BaseService { +public interface StaffPatrolDetailService{ + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + List gridManagerList(GridManagerListFormDTO formDTO); + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + List recordList(RecordListFormDTO formDTO); + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + List patrolTrack(PatrolTrackFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java index 90fd30694d..5c9537862f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -1,11 +1,21 @@ package com.epmet.datareport.service.user.impl; -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.datareport.dao.user.StaffPatrolDetailDao; -import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.datareport.dao.user.StaffPatrolRecordDao; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; /** * 工作人员巡查记录明细 @@ -15,6 +25,53 @@ import org.springframework.stereotype.Service; */ @Service @Slf4j -public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { +public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { + + @Autowired + private StaffPatrolDetailDao staffPatrolDetailDao; + + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @Override + public List gridManagerList(GridManagerListFormDTO formDTO) { + + return null; + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @Override + public List recordList(RecordListFormDTO formDTO) { + List result = staffPatrolRecordDao.recordList(formDTO); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @Override + public List patrolTrack(PatrolTrackFormDTO formDTO) { + List results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId()); + if (!CollectionUtils.isEmpty(results)){ + return results; + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml index 7b9093502a..cdc99d435b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml @@ -3,4 +3,16 @@ + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml index 511d20a355..5fef17c84a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml @@ -3,4 +3,17 @@ + + \ No newline at end of file From 56eacc146358c2ba8e0bccc7c78867555f97266c Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 10:40:02 +0800 Subject: [PATCH 27/52] =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/RequirePermissionEnum.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 72d2e072b4..ca3e901d44 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -166,6 +166,16 @@ public enum RequirePermissionEnum { MORE_BADGE_MANAGE_EDIT("more_badge_manage_edit","更多:徽章:徽章管理:编辑","编辑徽章"), MORE_BADGE_MANAGE_DELETE("more_badge_manage_delete","更多:徽章:徽章管理:删除","删除徽章"), + /** + * 更多-日志记录 + */ + MORE_PATROL_RECORD_LIST("more_patrol_record_list","更多:日志记录:巡查记录:列表","巡查记录列表"), + /** + * 更多-系统 + */ + MORE_SYSTEM_LOG_LIST("MORE_SYSTEM_LOG_LIST","更多:系统:系统日志:列表","系统日志列表"), + + /** * 项目立项 */ From e45b0edce83af2eded23eda828d94dd6cbb19ee0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 13:31:33 +0800 Subject: [PATCH 28/52] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/ScreenProjectGridDailyDTO.java | 7 ++++- .../screen/ScreenCustomerGridService.java | 3 +++ .../impl/ScreenCustomerGridServiceImpl.java | 6 +++++ .../epmet/service/impl/EIDimServiceImpl.java | 26 +++++++++++++++---- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java index c1f5f2ed12..60fdc4a14a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java @@ -55,6 +55,11 @@ public class ScreenProjectGridDailyDTO implements Serializable { */ private String gridId; + /** + * 网格id + */ + private String gridName; + /** * 网格所属的组织id */ @@ -149,4 +154,4 @@ public class ScreenProjectGridDailyDTO implements Serializable { this.delFlag = NumConstant.ZERO_STR; this.revision = NumConstant.ZERO; } -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index eeb24aad81..d19a8bfca8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; @@ -104,4 +105,6 @@ public interface ScreenCustomerGridService extends BaseService selectBelongGridInfo(String customerId,String level); Integer updateCenterPointByName(String customerId, String title, List center); + + List selectGridInfoByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 7253d1bc1b..b7f23a6ba1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; @@ -199,4 +200,9 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectGridInfoByCustomerId(String customerId) { + return baseDao.selectGridInfoByCustomerId(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index b80c287843..0633983ea4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -1,6 +1,6 @@ package com.epmet.service.impl; -import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.dto.screen.form.GridCenterPointForm; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; @@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; @Service public class EIDimServiceImpl implements EIDimService { @@ -132,14 +133,29 @@ public class EIDimServiceImpl implements EIDimService { @Override public Map updateCenterPointByName(GridCenterPointForm param) { //todo 怎么反向判断 左匹配 - List gridInfoList = screenCustomerGridService.selectAllGridInfo(param.getCustomerId()); + List gridInfos = screenCustomerGridService.selectGridInfoByCustomerId(param.getCustomerId()); Map result = new HashMap<>(); - param.getCenterDataList().forEach(o ->{ - Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + + + gridInfos.forEach(grid->{ + //客户id 和组织id 都相等 且 名字 包含关系时才修改 + if (grid.getCustomerId().equals(param.getCustomerId())){ + AtomicInteger integer = new AtomicInteger(0); + param.getCenterDataList().forEach(o ->{ + if (grid.getGridName().contains(o.getTitle())) { + Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + integer.addAndGet(effectRow); + } + result.put(grid.getGridId(),integer.intValue()); + }); + } + }); + /*param.getCenterDataList().forEach(o ->{ + Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(),param.getAgencyId(), o.getTitle(), o.getCenter()); if (integer == 0 || integer > 1){ result.put(o.getTitle(),integer); } - }); + });*/ return result; } From d2ce490fd94ae0c65196a90dc91a650537904dab Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 14:32:56 +0800 Subject: [PATCH 29/52] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BAbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95=E4=B8=8B=20=E7=9C=8B?= =?UTF-8?q?=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GrassrootsPartyDevServiceImpl.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 54b0b797be..1fc834ae1f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -164,7 +164,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService BranchBuildTrendResultDTO result = new BranchBuildTrendResultDTO(); //生成近十二个月的横坐标数组 Map monthMap = dateUtils.getXpro(); - result.setXAxis(monthMap.values().stream().collect(Collectors.toList())); + result.setXAxis(new ArrayList<>(monthMap.values())); List dataArray = new LinkedList<>(); List yearlyDataList = @@ -185,15 +185,26 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService BranchTrendSeriesDataResultDTO data = new BranchTrendSeriesDataResultDTO(); data.setName(issue); if(null != issueYearlyDataList && !issueYearlyDataList.isEmpty()){ - monthMap.keySet().forEach( monthId ->{ - Optional optional + int i = 0; + monthMap.keySet().forEach(monthId->{ + Map collect = val.stream().collect(Collectors.toMap(BranchIssueDataResultDTO::getMonthId, BranchIssueDataResultDTO::getData, (o1, o2) -> o1)); + numArray.add(collect.getOrDefault(monthId,NumConstant.ZERO)); + }); + + //for (int i=0;i< monthMap.keySet().size();i++) { + String monthId = monthMap.keySet().iterator().next(); + + + // 202007 + // 2007->list + /* Optional optional = issueYearlyDataList.stream().filter(yearly -> StringUtils.equals(monthId,yearly.getMonthId())).findAny(); if(optional.isPresent()){ numArray.add(optional.get().getData()); }else{ numArray.add(NumConstant.ZERO); - } - }); + }*/ + //} }else{ for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ numArray.add(NumConstant.ZERO); @@ -225,6 +236,14 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService return result; } + public static void main(String[] args) { + DateUtils dateUtils = new DateUtils(); + Map monthMap = dateUtils.getXpro(); + + System.out.println(monthMap); + System.out.println(monthMap.keySet().iterator().next()); + } + /** * @Description 4、支部建设情况|联建共建情况-排行 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 From f8ab3ffd814c6f12e698bcf903471f7d3b399559 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 8 Jun 2021 14:33:18 +0800 Subject: [PATCH 30/52] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=9B=91=E5=90=AC=E5=99=A8&=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/LogOperationListFormDTO.java | 15 ++ .../dto/region/LogOperationResultDTO.java | 49 +++++ .../com/epmet/enums/LogOperationTypeEnum.java | 39 ++++ epmet-admin/epmet-admin-server/pom.xml | 37 +++- .../main/java/com/epmet/AdminApplication.java | 4 + .../controller/LogOperationController.java | 45 +++++ .../java/com/epmet/dao/LogOperationDao.java | 33 ++++ .../com/epmet/entity/LogOperationEntity.java | 70 +++++++ .../mq/listener/RocketMQConsumerRegister.java | 66 +++++++ .../listener/OperationLogListener.java | 76 +++++++ .../epmet/service/LogOperationService.java | 28 +++ .../service/impl/LogOperationServiceImpl.java | 186 ++++++++++++++++++ .../src/main/resources/bootstrap.yml | 3 + .../migration/V0.0.3__add_log_ope_table.sql | 15 ++ .../main/resources/mapper/LogOperationDao.xml | 23 +++ .../constants/ConsomerGroupConstants.java | 5 + .../rocketmq/constants/TopicConstants.java | 5 + .../rocketmq/messages/OperationLogMQMsg.java | 16 ++ .../tools/feign/ResultDataResolver.java | 50 +++++ .../epmet/dto/form/CustomerStaffFormDTO.java | 19 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 26 ++- .../EpmetUserOpenFeignClientFallback.java | 10 + .../controller/CustomerStaffController.java | 23 ++- .../java/com/epmet/dao/CustomerStaffDao.java | 8 + .../epmet/service/CustomerStaffService.java | 8 + .../impl/CustomerStaffServiceImpl.java | 6 + .../resources/mapper/CustomerStaffDao.xml | 42 ++++ 27 files changed, 898 insertions(+), 9 deletions(-) create mode 100644 epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java create mode 100644 epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java create mode 100644 epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java new file mode 100644 index 0000000000..05e4de0032 --- /dev/null +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class LogOperationListFormDTO { + + private String operatorName; + + private String operatorMobile; + + private Integer pageNo = 1; + + private Integer pageSize = 10; +} diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java new file mode 100644 index 0000000000..a052b9dd2d --- /dev/null +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.region; + +import lombok.Data; + +import java.util.Date; + +/** + * + */ +@Data +public class LogOperationResultDTO { + + /** + * 大类别。登录login,项目流转project + */ + private String category; + /** + * 类型枚举,小类别。登录login,logout退出,shift_project议题转项目等 + */ + private String type; + + /** + * 类型枚举名称 + */ + private String typeDisplay; + + /** + * 内容 + */ + private String content; + + /** + * 操作目标ID + */ + private String targetId; + + /** + * 操作人ID + */ + private String operatorId; + private String operatorName; + private String operatorMobile; + + /** + * 操作时间,该时间不是插入数据的时间,而是操作发生的真实时间 + */ + private Date operatingTime; + +} diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java new file mode 100644 index 0000000000..60baf21cc7 --- /dev/null +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java @@ -0,0 +1,39 @@ +package com.epmet.enums; + +/** + * 操作日志类型枚举 + */ +public enum LogOperationTypeEnum { + LOGIN("login", "登录"), + LOGOUT("logout", "退出登录"), + ISSUE_SHIFT_PROJECT("issue_shift_project", "议题转项目"), + CLOSE_PROJECT("close_project", "项目结案"), + PROJECT_TRANSFER("project_transfer", "项目流转"), + PROJECT_RESPONSE("project_response", "响应处理"), + PROJECT_APPROVAL("project_approval", "项目立项"); + + private String type; + private String typeDisplay; + + LogOperationTypeEnum(String type, String typeDisplay) { + this.type = type; + this.typeDisplay = typeDisplay; + } + + public static LogOperationTypeEnum get(String type) { + for (LogOperationTypeEnum t : LogOperationTypeEnum.values()) { + if (t.type.equals(type)) { + return t; + } + } + return null; + } + + public static String getDisplay(String type) { + LogOperationTypeEnum object = get(type); + if (object == null) { + return null; + } + return object.typeDisplay; + } +} diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index df371df8a9..15e142e3dd 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -54,6 +54,21 @@ feign-httpclient 10.3.0 + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + + + + + com.epmet + epmet-user-client + 2.0.0 + compile + @@ -109,6 +124,10 @@ false + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -122,14 +141,14 @@ - + epmet_admin_user EpmEt-db-UsEr 0 - 192.168.1.130 - 6379 + 118.190.150.119 + 47379 123456 false @@ -141,6 +160,10 @@ false + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -170,6 +193,10 @@ true + + + 192.168.10.161:9876 + epmet_message @@ -199,6 +226,10 @@ true + + + 192.168.11.187:9876;192.168.11.184:9876 + epmet_message diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java index 89ac2c70d8..ea0ca31624 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/AdminApplication.java @@ -10,6 +10,8 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; /** * 管理后台 @@ -18,6 +20,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @since 1.0.0 */ @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class AdminApplication { public static void main(String[] args) { diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java new file mode 100644 index 0000000000..cc19f5dc36 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java @@ -0,0 +1,45 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.LogOperationListFormDTO; +import com.epmet.dto.region.LogOperationResultDTO; +import com.epmet.service.LogOperationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.List; + +@RequestMapping("log/operation") +@RestController +public class LogOperationController { + + @Autowired + private LogOperationService logOperationService; + + @Autowired + private LoginUserUtil loginUserUtil; + + @PostMapping("/list") + public Result> listLogOperations(@RequestBody LogOperationListFormDTO input) { + ValidatorUtils.validateEntity(input); + String operatorMobile = input.getOperatorMobile(); + String operatorName = input.getOperatorName(); + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + + String customerId = loginUserUtil.getLoginUserCustomerId(); + List resultList = logOperationService.listOperationLogs(operatorName, operatorMobile, customerId, pageNo, pageSize); + if (CollectionUtils.isEmpty(resultList)) { + resultList = new ArrayList<>(); + } + return new Result>().ok(resultList); + } + +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java new file mode 100644 index 0000000000..a63a5aa8e4 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LogOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 操作日指标 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Mapper +public interface LogOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java new file mode 100644 index 0000000000..54a141651a --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 操作日指标 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("log_operation") +public class LogOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 大类别。登录login,项目流转project + */ + private String category; + /** + * 类型枚举,小类别。登录login,logout退出,shift_project议题转项目等 + */ + private String type; + + /** + * 内容 + */ + private String content; + + /** + * 操作目标ID + */ + private String targetId; + + /** + * 操作人ID + */ + private String operatorId; + + /** + * 操作时间,该时间不是插入数据的时间,而是操作发生的真实时间 + */ + private Date operatingTime; + +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..f722f40a72 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java @@ -0,0 +1,66 @@ +package com.epmet.mq.listener; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.mq.listener.listener.OperationLogListener; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +@Component +public class RocketMQConsumerRegister { + @Value("${spring.profiles.active}") + private String env; + @Value("${rocketmq.name-server}") + private String nameServer; + + /** + * @return + * @Description 注册监听器 + * @author wxz + * @date 2021.03.03 16:09 + */ + @PostConstruct + public void registerAllListeners() { + try { + //if (!EnvEnum.LOCAL.getCode().equals(env)) { + register(nameServer, ConsomerGroupConstants.OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.OPERATION_LOG, "*", new OperationLogListener()); + //} + } catch (MQClientException e) { + e.printStackTrace(); + } + } + + public void register(String nameServer, String group, MessageModel messageModel, String topic, String subException, MessageListenerConcurrently listener) throws MQClientException { + // 实例化消费者 + DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(group); + + // 设置NameServer的地址 + consumer.setNamesrvAddr(nameServer); + consumer.setMessageModel(messageModel); + consumer.setInstanceName(buildInstanceName()); + // 订阅一个或者多个Topic,以及Tag来过滤需要消费的消息 + consumer.subscribe(topic, subException); + // 注册回调实现类来处理从broker拉取回来的消息 + consumer.registerMessageListener(listener); + // 启动消费者实例 + consumer.start(); + } + + private String buildInstanceName() { + String instanceName = ""; + for (int i = 0; i < 4; i++) { + int t = (int) (Math.random() * 10); + instanceName = instanceName.concat(t + ""); + } + + return instanceName; + } + +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java new file mode 100644 index 0000000000..55bf16fd99 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java @@ -0,0 +1,76 @@ +package com.epmet.mq.listener.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.LogOperationService; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 操作日志监听器 + + * @return + * @date 2021.06.07 16:12 + * + * + * { + * "type": "login", + * "content": "我登录了", + * "targetId": "11", + * "operatorId": "2", + * "operatingTime": "1623056525000" + * } + */ +public class OperationLogListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + String tags = messageExt.getTags(); + String msg = new String(messageExt.getBody()); + logger.info("操作日志监听器-收到消息内容:{}", msg); + OperationLogMQMsg msgObj = JSON.parseObject(msg, OperationLogMQMsg.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:operation_log:%s:%s", msgObj.getType(), msgObj.getTargetId()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(LogOperationService.class).log(msgObj, tags); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + } +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java new file mode 100644 index 0000000000..dec11275c8 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java @@ -0,0 +1,28 @@ +package com.epmet.service; + +import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; +import com.epmet.dto.region.LogOperationResultDTO; + +import java.util.List; + +/** + * 操作日志 + */ +public interface LogOperationService { + + /** + * @Description 记录日志 + * @return + * @author wxz + * @date 2021.06.07 21:56 + */ + void log(OperationLogMQMsg msg, String category); + + /** + * @Description 查询操作日志 列表 + * @return + * @author wxz + * @date 2021.06.07 21:56 + */ + List listOperationLogs(String operatorName, String operatorMobile, String customerId, Integer pageNo, Integer pageSize); +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java new file mode 100644 index 0000000000..5d247e93a3 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -0,0 +1,186 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.LogOperationDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.ThirdCustomerStaffFormDTO; +import com.epmet.dto.region.LogOperationResultDTO; +import com.epmet.entity.LogOperationEntity; +import com.epmet.enums.LogOperationTypeEnum; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.LogOperationService; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service +public class LogOperationServiceImpl implements LogOperationService, ResultDataResolver { + + @Autowired + private LogOperationDao logOperationDao; + + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + + @Override + public void log(OperationLogMQMsg msg, String category) { + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.eq(LogOperationEntity::getType, msg.getType()); + w.eq(LogOperationEntity::getTargetId, msg.getTargetId()); + w.eq(LogOperationEntity::getOperatorId, msg.getOperatorId()); + w.eq(LogOperationEntity::getOperatingTime, msg.getOperatingTime()); + + Integer existsCount = logOperationDao.selectCount(w); + if (existsCount > 0) { + // 该日志已存在,不做任何操作 + return; + } + + LogOperationEntity insert = new LogOperationEntity(); + insert.setContent(msg.getContent()); + insert.setOperatingTime(msg.getOperatingTime()); + insert.setOperatorId(msg.getOperatorId()); + insert.setTargetId(msg.getTargetId()); + insert.setType(msg.getType()); + insert.setCategory(category); + logOperationDao.insert(insert); + } + + @Override + public List listOperationLogs(String operatorName, String operatorMobile, String customerId, Integer pageNo, Integer pageSize) { + // 1.条件查询 + if (StringUtils.isNotBlank(operatorMobile)) { + return listByOperatorMobile(operatorMobile, customerId, pageNo, pageSize); + } else if (StringUtils.isNotBlank(operatorName)) { + return listByOperatorName(operatorName, pageNo, pageSize); + } + + // 2.直接分页查询 + // 条件查询,排序 + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.orderByDesc(LogOperationEntity::getOperatingTime); + IPage iPage = logOperationDao.selectPage(new Page<>(pageNo, pageSize), w); + List logs = iPage.getRecords(); + List userIds = logs.stream().map(l -> l.getOperatorId()).collect(Collectors.toList()); + + return convertLogOperationEntity2DTO(logs, getStaffMapByUserIds(userIds)); + } + + private Map getStaffMapByUserIds(List userIds) { + CustomerStaffFormDTO form = new CustomerStaffFormDTO(); + form.setUserIds(userIds); + Result> result = userOpenFeignClient.list(form); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + + HashMap staffMap = new HashMap<>(); + staffs.forEach(s -> { + staffMap.put(s.getUserId(), s); + }); + + return staffMap; + } + + /** + * 通过操作人手机号查询操作日志列表 + * + * @param operatorMobile + * @param customerId + */ + private List listByOperatorMobile(String operatorMobile, String customerId, Integer pageNo, Integer pageSize) { + CustomerStaffFormDTO form = new CustomerStaffFormDTO(); + form.setCustomerId(customerId); + form.setMobile(operatorMobile); + Result> result = userOpenFeignClient.list(form); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务发生异常"); + + if (staffs.size() == 0) { + return null; + } + CustomerStaffDTO staff = staffs.get(0); + + QueryWrapper w = new QueryWrapper<>(); + w.lambda() + .eq(LogOperationEntity::getOperatorId, staff.getUserId()) + .eq(LogOperationEntity::getDelFlag, 0) + .orderByDesc(LogOperationEntity::getOperatingTime); + + IPage iPage = logOperationDao.selectPage(new Page<>(pageNo, pageSize), w); + + HashMap staffMap = new HashMap<>(); + staffMap.put(staff.getUserId(), staff); + + return convertLogOperationEntity2DTO(iPage.getRecords(), staffMap); + } + + /** + * @Description 通过操作人姓名查询操作日志列表 + * @return + * @author wxz + * @date 2021.06.08 11:12 + */ + private List listByOperatorName(String operatorName, Integer pageNo, Integer pageSize) { + CustomerStaffFormDTO form = new CustomerStaffFormDTO(); + form.setRealName(operatorName); + Result> result = userOpenFeignClient.list(form); + List staffs = getResultDataOrThrowsException(result, ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用user服务查询工作人员信息发生异常"); + + List userIds = new ArrayList<>(); + HashMap staffMap = new HashMap(); + staffs.forEach(s -> { + staffMap.put(s.getUserId(), s); + userIds.add(s.getUserId()); + }); + + if (CollectionUtils.isEmpty(userIds)) { + return new ArrayList<>(); + } + LambdaQueryWrapper w = new LambdaQueryWrapper<>(); + w.in(LogOperationEntity::getOperatorId, userIds); + w.eq(LogOperationEntity::getDelFlag, 0); + w.orderByDesc(LogOperationEntity::getOperatingTime); + + IPage iPage = logOperationDao.selectPage(new Page<>(pageNo, pageSize), w); + + return convertLogOperationEntity2DTO(iPage.getRecords(), staffMap); + } + + /** + * @Description 将操作日志entity转化为dto列表 + * @return + * @author wxz + * @date 2021.06.08 11:12 + */ + private List convertLogOperationEntity2DTO(List logOperationEntities, Map staffMap) { + return logOperationEntities.stream().map(l -> { + LogOperationResultDTO ldto = new LogOperationResultDTO(); + ldto.setCategory(l.getCategory()); + ldto.setContent(l.getContent()); + ldto.setOperatingTime(l.getOperatingTime()); + ldto.setOperatorId(l.getOperatorId()); + ldto.setTargetId(l.getTargetId()); + ldto.setType(l.getType()); + ldto.setTypeDisplay(LogOperationTypeEnum.getDisplay(l.getType())); + ldto.setOperatorMobile(staffMap.get(l.getOperatorId()).getMobile()); + ldto.setOperatorName(staffMap.get(l.getOperatorId()).getRealName()); + return ldto; + }).collect(Collectors.toList()); + } +} diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 89f42ed404..0d9082cec3 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -134,3 +134,6 @@ shutdown: graceful: enable: true #是否开启优雅停机 waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + +rocketmq: + name-server: @rocketmq.nameserver@ \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql new file mode 100644 index 0000000000..0613c1dd2c --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql @@ -0,0 +1,15 @@ +CREATE TABLE `log_operation` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `TYPE` varchar(64) NOT NULL COMMENT '类型枚举', + `CONTENT` varchar(512) NOT NULL COMMENT '内容', + `CATEGORY` varchar(64) NOT NULL COMMENT '类别', + `TARGET_ID` varchar(64) NOT NULL COMMENT '操作目标ID', + `OPERATOR_ID` varchar(64) NOT NULL COMMENT '操作人ID', + `OPERATING_TIME` datetime NOT NULL COMMENT '操作时间,该时间不是插入数据的时间,而是操作发生的真实时间', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='操作日指标' \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml new file mode 100644 index 0000000000..f63500d118 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 5acfebb90e..e6d4732409 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -31,4 +31,9 @@ public interface ConsomerGroupConstants { */ String GROUP_ACHIEVEMENT_COMPONENTS_GROUP = "group_achievement_components_group"; + /** + * 操作日志组 + */ + String OPERATION_LOG_GROUP = "operation_log_group"; + } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index bd9fed05eb..99a9b839c9 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -13,4 +13,9 @@ public interface TopicConstants { * 小组成就 */ String GROUP_ACHIEVEMENT = "group_achievement"; + + /** + * 操作日志 + */ + String OPERATION_LOG = "operation_log"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java new file mode 100644 index 0000000000..95e3956114 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java @@ -0,0 +1,16 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +import java.util.Date; + +@Data +public class OperationLogMQMsg { + + private String type; + private String content; + private String targetId; + private String operatorId; + private Date operatingTime; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java new file mode 100644 index 0000000000..1e44b924c2 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java @@ -0,0 +1,50 @@ +package com.epmet.commons.tools.feign; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.lang3.StringUtils; + +/** + * Feign请求结果解析器 + */ +public interface ResultDataResolver { + + /** + * @Description 获取Result种的data,如果失败(返回result为null或者result.success为false),那么返回null + * @return + * @author wxz + * @date 2021.06.07 22:45 + */ + //default R tryGetResultData(Result result, String targetServiceName) { + // Logger logger = LoggerFactory.getLogger(ResultDataResolver.class); + // if (result == null) { + // logger.error("调用{}服务发生错误,返回Result为null", targetServiceName); + // return null; + // } + // if (!result.success()) { + // logger.error("调用{}服务发生错误,错误信息:{}", targetServiceName, result.getInternalMsg()); + // return null; + // } + // return result.getData(); + //} + + /** + * @Description 获取Result种的data,如果失败(返回result为null或者result.success为false),那么抛出异常 + * @return + * @author wxz + * @date 2021.06.07 22:45 + */ + default R getResultDataOrThrowsException(Result result, String targetServiceName, Integer errorCode, String errorInternalMsg) { + if (result == null) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "调用{}服务发生错误,返回Result为null", targetServiceName); + } + if (!result.success()) { + Integer finalErrorCode = errorCode == null ? result.getCode() : errorCode; + String finalErrorInternalMsg = StringUtils.isBlank(errorInternalMsg) ? result.getInternalMsg() : errorInternalMsg; + throw new RenException(finalErrorCode, finalErrorInternalMsg); + } + return result.getData(); + } + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java index 43acb11d1c..f5317723e6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffFormDTO.java @@ -4,6 +4,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @Description 根据手机号+客户id获取工作人员基本信息 @@ -13,9 +14,23 @@ import java.io.Serializable; @Data public class CustomerStaffFormDTO implements Serializable { private static final long serialVersionUID = 7619815083427853431L; - @NotBlank(message = "手机号不能为空") + + // 根据手机号+客户id获取工作人员基本信息 + public interface GetCustomerStaffInfo {} + + @NotBlank(message = "手机号不能为空", groups = { GetCustomerStaffInfo.class }) private String mobile; - @NotBlank(message = "客户id不能为空") + @NotBlank(message = "客户id不能为空", groups = { GetCustomerStaffInfo.class }) private String customerId; + + /** + * 姓名 + */ + private String realName; + + /** + * 用户id集合 + */ + private List userIds; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f85ba6d782..ea092ea63a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.Map; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087") -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "http://127.0.0.1:8087") +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) public interface EpmetUserOpenFeignClient { /** @@ -224,7 +224,7 @@ public interface EpmetUserOpenFeignClient { * @Author sun * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 **/ - @GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndPhone") + @GetMapping(value = "/epmetuser/customerstaff/getCustsomerStaffByIdAndPhone") Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO); /** @@ -530,4 +530,24 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/badge/userbadges") Result> userBadges(@RequestBody UserBadgesFormDTO formDTO); + + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") + Result getCustomerStaffInfoByUserId(@RequestBody CustomerStaffDTO formDTO); + + /** + * @Description 通用批量查询 + * @return + * @author wxz + * @date 2021.06.08 10:54 + */ + @PostMapping(value = "/epmetuser/customerstaff/list") + Result> list(CustomerStaffFormDTO input); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 518cca9cef..3e0ee743e1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -373,4 +373,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> userBadges(UserBadgesFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "userBadges", formDTO); } + + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } + + @Override + public Result> list(CustomerStaffFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", input); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index e1eefc0a94..d488ecff59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -20,6 +20,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -32,10 +33,12 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerStaffExcel; import com.epmet.service.CustomerStaffService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; @@ -53,6 +56,9 @@ public class CustomerStaffController { @Autowired private CustomerStaffService customerStaffService; + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("page") public Result> page(@RequestParam Map params) { PageData page = customerStaffService.page(params); @@ -116,7 +122,7 @@ public class CustomerStaffController { **/ @PostMapping(value = "getcustomerstaffinfo") public Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, CustomerStaffFormDTO.GetCustomerStaffInfo.class); return customerStaffService.getCustomerStaffInfo(formDTO); } @@ -410,4 +416,19 @@ public class CustomerStaffController { return new Result().ok(customerStaffService.getStaffBasicInfo(fromDTO)); } + /** + * @Description 通用列表查询。可以指定customerId,如果指定了,则使用指定的,如果未指定,则使用当前登录用户的customerId + * @return + * @author wxz + * @date 2021.06.08 10:54 + */ + @PostMapping("list") + public Result> list(@RequestBody CustomerStaffFormDTO input) { + String customerId = StringUtils.isBlank(input.getCustomerId()) ? loginUserUtil.getLoginUserCustomerId() : input.getCustomerId(); + + List staffs = customerStaffService.list(customerId, input.getRealName(), input.getMobile(), input.getUserIds()); + return new Result>().ok(staffs); + } + + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index acffa2840e..fc8b35d778 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -197,4 +197,12 @@ public interface CustomerStaffDao extends BaseDao { * @return */ BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO); + + /** + * 通用列表查询 + * @param customerId + * @param realName + * @return + */ + List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 833791fc54..7f5b43161e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -321,4 +321,12 @@ public interface CustomerStaffService extends BaseService { * @return */ BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO); + + /** + * @Description 根据姓名查询工作人员 + * @return + * @author wxz + * @date 2021.06.08 10:52 + */ + List list(String customerId, String realName, String mobile, List ids); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index e52b9441ae..983ee63637 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; @@ -56,6 +57,7 @@ import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; import com.epmet.service.UserService; import com.epmet.util.ModuleConstant; +import kotlin.jvm.internal.Lambda; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -699,4 +701,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl list(String customerId, String realName, String mobile, List userIds) { + return baseDao.listDTOS(customerId, realName, mobile, userIds); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index eab3a42191..725df08c21 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -357,4 +357,46 @@ AND user_id = #{staffId} LIMIT 1 + + From b7c4ba41b42b4eab42b0b3ade2e8dbbcc733ecb2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 8 Jun 2021 14:33:51 +0800 Subject: [PATCH 31/52] =?UTF-8?q?=E5=B7=A1=E6=9F=A5-001=E3=80=81=E5=90=84?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=B7=A1=E6=9F=A5=E8=AE=B0=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 11 +++++ .../dto/epmetuser/form/StaffListFormDTO.java | 14 ++++-- .../controller/EpmetUserController.java | 12 ++++- .../dao/epmetuser/StaffPatrolRecordDao.java | 10 +++++ .../dataaggre/dao/govorg/CustomerGridDao.java | 8 ++++ .../epmetuser/impl/EpmetUserServiceImpl.java | 41 ++++++++++++++++- .../service/govorg/GovOrgService.java | 8 ++++ .../govorg/impl/GovOrgServiceImpl.java | 11 +++++ .../mapper/epmetuser/StaffPatrolRecordDao.xml | 45 +++++++++++++++++++ .../mapper/govorg/CustomerGridDao.xml | 22 +++++++++ 10 files changed, 175 insertions(+), 7 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index a2f88e4133..67ab18f0ec 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -818,4 +818,15 @@ public class DateUtils { return date; } + /** + * @Author sun + * @Description 获取当前日期几个自然月之前的日期(yyyy-MM-dd HH:mm:ss) + **/ + public static String getBeforeMonthDate(int beforMonth){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, - beforMonth); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_TIME_PATTERN); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java index 95aeed99d9..4945b5de46 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/StaffListFormDTO.java @@ -5,7 +5,10 @@ import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * @Description 巡查-各人员巡查记录列表查询-接口入参 @@ -18,7 +21,7 @@ public class StaffListFormDTO implements Serializable { /** * 近1一个月传1; 近3个月传3【自然月分】 */ - @NotBlank(message = "最近时间不能为空", groups = StaffListFormDTO.Staff.class) + @NotNull(message = "最近时间不能为空", groups = StaffListFormDTO.Staff.class) private Integer time; /** * 排序字段【巡查总次数:patrolTotal;最近开始巡查时间:latestPatrolledTime】 @@ -28,7 +31,7 @@ public class StaffListFormDTO implements Serializable { /** * 网格id集合,为空则查询当前组织下所有网格数据 */ - private Integer gridIds; + private List gridIds; /** * 工作人员姓名;可空 */ @@ -42,7 +45,10 @@ public class StaffListFormDTO implements Serializable { * 每页多少条 * */ private Integer pageSize = 20; - public interface Staff extends CustomerClientShowGroup { - } + //token中用户Id + private String userId; + //起止巡查开始时间 + private String patrolStartTime; + public interface Staff extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 349fe37827..4f7145b3fd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -1,5 +1,8 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; @@ -34,8 +37,15 @@ public class EpmetUserController { * @author sun */ @PostMapping("stafflist") - public Result> staffList(@RequestBody StaffListFormDTO formDTO) { + public Result> staffList(@LoginUser TokenDto tokenDto, @RequestBody StaffListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, StaffListFormDTO.Staff.class); + if (!"patrolTotal".equals(formDTO.getSortCode()) && !"latestPatrolledTime".equals(formDTO.getSortCode())) { + throw new RenException("参数错误,排序条件值错误"); + } + if (formDTO.getTime() != 1 && formDTO.getTime() != 3) { + throw new RenException("参数错误,最近时间值不正确"); + } + formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(epmetUserService.staffList(formDTO)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java index 9b26421034..5c6cb03bdb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java @@ -19,9 +19,13 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 工作人员巡查主记录 * @@ -31,4 +35,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface StaffPatrolRecordDao extends BaseDao { + /** + * @Description 按条件查询巡查业务数据 + * @author sun + */ + List selectPatrolList(StaffListFormDTO formDTO); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java index 1da9910104..cc73cc2c1f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; @@ -54,4 +55,11 @@ public interface CustomerGridDao extends BaseDao { * @Description 根据组织Id查询当前组织下所有网格列表 **/ List selectGridListByAgencyId(@Param("agencyId") String agencyId); + + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + List gridListByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 2fe1c69be4..301b3ff441 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -1,17 +1,25 @@ package com.epmet.dataaggre.service.epmetuser.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; import com.epmet.dataaggre.dao.epmetuser.UserBaseInfoDao; import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @Author zxc @@ -24,6 +32,10 @@ public class EpmetUserServiceImpl implements EpmetUserService { @Autowired private UserBaseInfoDao userBaseInfoDao; + @Autowired + private GovOrgService govOrgService; + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; /** * @Description 根据UserIds查询 @@ -54,7 +66,32 @@ public class EpmetUserServiceImpl implements EpmetUserService { */ @Override public List staffList(StaffListFormDTO formDTO) { - return null; + List resultList = new ArrayList<>(); + //1.设置分页参数 + int num = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(num); + + //2.查询当前人员所属组织下网格列表数据,供后续使用 + List list = govOrgService.gridListByStaffId(formDTO.getUserId()); + if (list.size() < NumConstant.ONE) { + return resultList; + } + //网格集合为空则查询当前人员所属组织下网格列表 + if (CollectionUtils.isEmpty(formDTO.getGridIds())) { + formDTO.setGridIds(list.stream().map(CustomerGridDTO::getId).collect(Collectors.toList())); + } + + //3.按条件查询巡查业务数据 + formDTO.setPatrolStartTime(DateUtils.getBeforeMonthDate(formDTO.getTime())); + resultList = staffPatrolRecordDao.selectPatrolList(formDTO); + if (resultList.size() < NumConstant.ONE) { + return new ArrayList<>(); + } + + //4.封装数据并返回 + resultList.forEach(re -> list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()))); + return resultList; } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 916044b1f3..c79837ec60 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.govorg; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; @@ -48,4 +49,11 @@ public interface GovOrgService { List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO); List queryNextOrgInfoDTO(String customerId, String orgId); + + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + List gridListByStaffId(String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index ec45f0419f..dfaff1bd06 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; import com.epmet.dataaggre.dao.govorg.CustomerGridDao; import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao; +import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; @@ -225,5 +226,15 @@ public class GovOrgServiceImpl implements GovOrgService { System.out.println(JSON.toJSONString(allList, true)); } + /** + * @param staffId + * @Author sun + * @Description 查询工作人员所属组织下网格列表 + **/ + @Override + public List gridListByStaffId(String staffId) { + List resultList = customerGridDao.gridListByStaffId(staffId); + return resultList; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml index f8fa69fada..a0f8a495e0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml @@ -3,5 +3,50 @@ + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index 331246a2f5..000f2c2b49 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -52,4 +52,26 @@ AND pid = #{agencyId} + + From 55a3cf5b1e25d3776054f4295b696a1a988bd9bf Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 14:47:12 +0800 Subject: [PATCH 32/52] =?UTF-8?q?Revert=20"=E8=81=94=E5=BB=BA=E5=85=B1?= =?UTF-8?q?=E5=BB=BAbug=E4=BF=AE=E6=94=B9=20=E6=B5=8B=E8=AF=95=E4=B8=8B=20?= =?UTF-8?q?=E7=9C=8B=E7=9C=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d2ce490f --- .../impl/GrassrootsPartyDevServiceImpl.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 1fc834ae1f..3173e1269e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -185,26 +185,15 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService BranchTrendSeriesDataResultDTO data = new BranchTrendSeriesDataResultDTO(); data.setName(issue); if(null != issueYearlyDataList && !issueYearlyDataList.isEmpty()){ - int i = 0; - monthMap.keySet().forEach(monthId->{ - Map collect = val.stream().collect(Collectors.toMap(BranchIssueDataResultDTO::getMonthId, BranchIssueDataResultDTO::getData, (o1, o2) -> o1)); - numArray.add(collect.getOrDefault(monthId,NumConstant.ZERO)); - }); - - //for (int i=0;i< monthMap.keySet().size();i++) { - String monthId = monthMap.keySet().iterator().next(); - - - // 202007 - // 2007->list - /* Optional optional + monthMap.keySet().forEach( monthId ->{ + Optional optional = issueYearlyDataList.stream().filter(yearly -> StringUtils.equals(monthId,yearly.getMonthId())).findAny(); if(optional.isPresent()){ numArray.add(optional.get().getData()); }else{ numArray.add(NumConstant.ZERO); - }*/ - //} + } + }); }else{ for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ numArray.add(NumConstant.ZERO); @@ -236,14 +225,6 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService return result; } - public static void main(String[] args) { - DateUtils dateUtils = new DateUtils(); - Map monthMap = dateUtils.getXpro(); - - System.out.println(monthMap); - System.out.println(monthMap.keySet().iterator().next()); - } - /** * @Description 4、支部建设情况|联建共建情况-排行 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 From 026851fc2b1eef53a48604f8e8fcec6c012b1f13 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 15:20:33 +0800 Subject: [PATCH 33/52] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/EIDimServiceImpl.java | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index 0633983ea4..8b5b67fe7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -52,6 +52,7 @@ public class EIDimServiceImpl implements EIDimService { /** * 查询可更新的单位 + * * @return */ private List listAgencies2Update() { @@ -69,6 +70,7 @@ public class EIDimServiceImpl implements EIDimService { /** * 查询可增加的单位 + * * @return */ private List listAgencies2Add() { @@ -92,6 +94,7 @@ public class EIDimServiceImpl implements EIDimService { /** * 查询需要更新的部门列表 + * * @return */ private List listDepts2Update() { @@ -109,6 +112,7 @@ public class EIDimServiceImpl implements EIDimService { /** * 查询需要新增的部门列表 + * * @return */ private List listDepts2Add() { @@ -126,36 +130,28 @@ public class EIDimServiceImpl implements EIDimService { @Override public void initGrids() { List grids2Add = listGrids2Add(); - List grids2Update =listGrids2Update(); + List grids2Update = listGrids2Update(); screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update); } @Override - public Map updateCenterPointByName(GridCenterPointForm param) { - //todo 怎么反向判断 左匹配 + public Map updateCenterPointByName(GridCenterPointForm param) { List gridInfos = screenCustomerGridService.selectGridInfoByCustomerId(param.getCustomerId()); - Map result = new HashMap<>(); + Map result = new HashMap<>(); - - gridInfos.forEach(grid->{ + gridInfos.forEach(grid -> { //客户id 和组织id 都相等 且 名字 包含关系时才修改 - if (grid.getCustomerId().equals(param.getCustomerId())){ + if (grid.getCustomerId().equals(param.getCustomerId())) { AtomicInteger integer = new AtomicInteger(0); - param.getCenterDataList().forEach(o ->{ - if (grid.getGridName().contains(o.getTitle())) { - Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); - integer.addAndGet(effectRow); - } - result.put(grid.getGridId(),integer.intValue()); - }); + param.getCenterDataList().forEach(o -> { + if (grid.getGridName().contains(o.getTitle())) { + Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + integer.addAndGet(effectRow); + } + result.put(grid.getGridId(), integer.intValue()); + }); } }); - /*param.getCenterDataList().forEach(o ->{ - Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(),param.getAgencyId(), o.getTitle(), o.getCenter()); - if (integer == 0 || integer > 1){ - result.put(o.getTitle(),integer); - } - });*/ return result; } From 1eb61b3725ec353dcc5a84ad984d4e955f21c2c3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 16:18:17 +0800 Subject: [PATCH 34/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F=20=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginProjectMainDailyService.java | 4 +-- ...FactOriginProjectMainDailyServiceImpl.java | 10 +------ .../impl/ScreenProjectSettleServiceImpl.java | 27 +++---------------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index d9a4c12c93..0f55775b23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -361,13 +361,11 @@ public interface FactOriginProjectMainDailyService extends BaseService * @author wangc * @date 2021.03.04 22:56 */ - List initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit); + List initNewScreenProjectData(String customerId,Integer rows ,String dateId); void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 7347feb480..3e8b210781 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -20,7 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; @@ -470,19 +469,12 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl * @author wangc * @date 2021.03.04 22:56 */ @Override - public List initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) { - boolean ifBeforeYesterday = true; - int beforeDate = Integer.parseInt(DateUtils.getBeforeNDay(NumConstant.ONE)); - if(beforeDate > Integer.parseInt(dateId)){ - ifBeforeYesterday = false; - } + public List initNewScreenProjectData(String customerId,Integer rows , String dateId) { List projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId); projects.forEach(project -> { if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 730c2e8f17..a92f1169c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -1,7 +1,5 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; @@ -71,27 +69,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic public void extractScreenData(ScreenCentralZoneDataFormDTO param) { //screen_project_data表是否存在此客户数据 int rows = targetDbService.checkIfExisted(param.getCustomerId()); - //查找客户项目超期参数 - List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); - Integer exceedLimit = NumConstant.FIVE; - Integer about2ExceedLimit = NumConstant.FIVE; - - - if(!CollectionUtils.isEmpty(exceedParams)){ - for(ProjectExceedParamsResultDTO ex :exceedParams){ - if(null != ex.getDefaultExceedLimit()){ - exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit(); - } - if(null != ex.getDefaultAbout2ExceedLimit()){ - about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit(); - } - } - } - //因为即将超期提醒时间(天)就是即将超期期限,在表中存储的是超期前多少天 - //所以这里要换算成滞留日 - about2ExceedLimit = exceedLimit >= about2ExceedLimit ? exceedLimit - about2ExceedLimit : exceedLimit; + List metaData = - originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); + originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId()); if(!CollectionUtils.isEmpty(metaData)) { // 查询项目信息 @@ -137,7 +117,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic //重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily // originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit); - originMainService.setProjectLevel(orientData, param.getCustomerId()); + //todo 与上面重复处理 暂时注释掉 + //originMainService.setProjectLevel(orientData, param.getCustomerId()); processService.updateProjectCloseTime(metaData); //更新结案时间和结案状态 processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); From c7822de9c7938cdb41bb62aabb69861731b48063 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 8 Jun 2021 16:59:37 +0800 Subject: [PATCH 35/52] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=8F=91=E9=80=81=E4=BA=8B=E4=BB=B6=EF=BC=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/LogOperationListFormDTO.java | 4 +- .../com/epmet/enums/LogOperationTypeEnum.java | 10 +++++ epmet-admin/epmet-admin-server/pom.xml | 5 +++ .../controller/LogOperationController.java | 5 +-- .../mq/listener/RocketMQConsumerRegister.java | 5 +-- ...er.java => LoginOperationLogListener.java} | 31 +++++++------- .../epmet/service/LogOperationService.java | 6 +-- .../service/impl/LogOperationServiceImpl.java | 35 ++++++---------- .../controller/ThirdLoginController.java | 3 ++ .../service/impl/ThirdLoginServiceImpl.java | 40 ++++++++++++++++++- .../constants/ConsomerGroupConstants.java | 4 +- .../rocketmq/constants/TopicConstants.java | 4 +- .../commons/rocketmq/messages/LoginMQMsg.java | 20 ++++++++++ .../rocketmq/messages/OperationLogMQMsg.java | 16 -------- .../tools/security/user/LoginUserUtil.java | 1 + epmet-gateway/pom.xml | 7 ++-- .../com/epmet/constant/SystemMessageType.java | 7 +++- .../feign/EpmetMessageOpenFeignClient.java | 4 +- .../impl/SystemMessageServiceImpl.java | 4 +- .../resources/mapper/CustomerStaffDao.xml | 2 +- 20 files changed, 134 insertions(+), 79 deletions(-) rename epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/{OperationLogListener.java => LoginOperationLogListener.java} (76%) create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java delete mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java index 05e4de0032..3fe203b482 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java @@ -5,9 +5,7 @@ import lombok.Data; @Data public class LogOperationListFormDTO { - private String operatorName; - - private String operatorMobile; + private String condition; private Integer pageNo = 1; diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java index 60baf21cc7..e17078245b 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java @@ -1,5 +1,7 @@ package com.epmet.enums; +import lombok.Data; + /** * 操作日志类型枚举 */ @@ -15,6 +17,14 @@ public enum LogOperationTypeEnum { private String type; private String typeDisplay; + public String getType() { + return type; + } + + public String getTypeDisplay() { + return typeDisplay; + } + LogOperationTypeEnum(String type, String typeDisplay) { this.type = type; this.typeDisplay = typeDisplay; diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 15e142e3dd..2e2afe5bc7 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -69,6 +69,11 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java index cc19f5dc36..ddd86e8fac 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java @@ -29,13 +29,12 @@ public class LogOperationController { @PostMapping("/list") public Result> listLogOperations(@RequestBody LogOperationListFormDTO input) { ValidatorUtils.validateEntity(input); - String operatorMobile = input.getOperatorMobile(); - String operatorName = input.getOperatorName(); + String condition = input.getCondition(); Integer pageNo = input.getPageNo(); Integer pageSize = input.getPageSize(); String customerId = loginUserUtil.getLoginUserCustomerId(); - List resultList = logOperationService.listOperationLogs(operatorName, operatorMobile, customerId, pageNo, pageSize); + List resultList = logOperationService.listOperationLogs(condition, customerId, pageNo, pageSize); if (CollectionUtils.isEmpty(resultList)) { resultList = new ArrayList<>(); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java index f722f40a72..b68c768f97 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java @@ -2,8 +2,7 @@ package com.epmet.mq.listener; import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; import com.epmet.commons.rocketmq.constants.TopicConstants; -import com.epmet.commons.tools.enums.EnvEnum; -import com.epmet.mq.listener.listener.OperationLogListener; +import com.epmet.mq.listener.listener.LoginOperationLogListener; import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; import org.apache.rocketmq.client.exception.MQClientException; @@ -30,7 +29,7 @@ public class RocketMQConsumerRegister { public void registerAllListeners() { try { //if (!EnvEnum.LOCAL.getCode().equals(env)) { - register(nameServer, ConsomerGroupConstants.OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.OPERATION_LOG, "*", new OperationLogListener()); + register(nameServer, ConsomerGroupConstants.LOGIN_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.LOGIN, "*", new LoginOperationLogListener()); //} } catch (MQClientException e) { e.printStackTrace(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java similarity index 76% rename from epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java rename to epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java index 55bf16fd99..53246a8364 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/OperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java @@ -1,11 +1,13 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; -import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.entity.LogOperationEntity; +import com.epmet.enums.LogOperationTypeEnum; import com.epmet.service.LogOperationService; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -20,21 +22,12 @@ import java.util.concurrent.TimeUnit; /** * @author wxz - * @Description 操作日志监听器 + * @Description 登录操作日志监听器 * @return * @date 2021.06.07 16:12 - * - * - * { - * "type": "login", - * "content": "我登录了", - * "targetId": "11", - * "operatorId": "2", - * "operatingTime": "1623056525000" - * } */ -public class OperationLogListener implements MessageListenerConcurrently { +public class LoginOperationLogListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); @@ -53,15 +46,23 @@ public class OperationLogListener implements MessageListenerConcurrently { String tags = messageExt.getTags(); String msg = new String(messageExt.getBody()); logger.info("操作日志监听器-收到消息内容:{}", msg); - OperationLogMQMsg msgObj = JSON.parseObject(msg, OperationLogMQMsg.class); + LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class); + + LogOperationEntity logEntity = new LogOperationEntity(); + logEntity.setCategory(messageExt.getTopic()); + logEntity.setType(tags); + logEntity.setTargetId(""); + logEntity.setOperatorId(msgObj.getUserId()); + logEntity.setOperatingTime(msgObj.getLoginTime()); + logEntity.setContent("成功登录系统"); DistributedLock distributedLock = null; RLock lock = null; try { distributedLock = SpringContextUtils.getBean(DistributedLock.class); - lock = distributedLock.getLock(String.format("lock:operation_log:%s:%s", msgObj.getType(), msgObj.getTargetId()), + lock = distributedLock.getLock(String.format("lock:operation_log:%s:%s", logEntity.getType(), logEntity.getTargetId()), 30L, 30L, TimeUnit.SECONDS); - SpringContextUtils.getBean(LogOperationService.class).log(msgObj, tags); + SpringContextUtils.getBean(LogOperationService.class).log(logEntity); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java index dec11275c8..67b3736395 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java @@ -1,7 +1,7 @@ package com.epmet.service; -import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; import com.epmet.dto.region.LogOperationResultDTO; +import com.epmet.entity.LogOperationEntity; import java.util.List; @@ -16,7 +16,7 @@ public interface LogOperationService { * @author wxz * @date 2021.06.07 21:56 */ - void log(OperationLogMQMsg msg, String category); + void log(LogOperationEntity msg); /** * @Description 查询操作日志 列表 @@ -24,5 +24,5 @@ public interface LogOperationService { * @author wxz * @date 2021.06.07 21:56 */ - List listOperationLogs(String operatorName, String operatorMobile, String customerId, Integer pageNo, Integer pageSize); + List listOperationLogs(String condition, String customerId, Integer pageNo, Integer pageSize); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 5d247e93a3..323ffae80e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -4,22 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.epmet.commons.rocketmq.messages.OperationLogMQMsg; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.LogOperationDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffFormDTO; -import com.epmet.dto.form.ThirdCustomerStaffFormDTO; import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; import com.epmet.enums.LogOperationTypeEnum; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.LogOperationService; -import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,7 +37,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR private EpmetUserOpenFeignClient userOpenFeignClient; @Override - public void log(OperationLogMQMsg msg, String category) { + public void log(LogOperationEntity msg) { LambdaQueryWrapper w = new LambdaQueryWrapper<>(); w.eq(LogOperationEntity::getType, msg.getType()); w.eq(LogOperationEntity::getTargetId, msg.getTargetId()); @@ -53,24 +49,19 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR // 该日志已存在,不做任何操作 return; } - - LogOperationEntity insert = new LogOperationEntity(); - insert.setContent(msg.getContent()); - insert.setOperatingTime(msg.getOperatingTime()); - insert.setOperatorId(msg.getOperatorId()); - insert.setTargetId(msg.getTargetId()); - insert.setType(msg.getType()); - insert.setCategory(category); - logOperationDao.insert(insert); + logOperationDao.insert(msg); } @Override - public List listOperationLogs(String operatorName, String operatorMobile, String customerId, Integer pageNo, Integer pageSize) { + public List listOperationLogs(String condition, String customerId, Integer pageNo, Integer pageSize) { // 1.条件查询 - if (StringUtils.isNotBlank(operatorMobile)) { - return listByOperatorMobile(operatorMobile, customerId, pageNo, pageSize); - } else if (StringUtils.isNotBlank(operatorName)) { - return listByOperatorName(operatorName, pageNo, pageSize); + List logDtos = listByOperatorMobile(condition, customerId, pageNo, pageSize); + if (CollectionUtils.isEmpty(logDtos)) { + logDtos = listByOperatorName(condition, pageNo, pageSize); + } + + if (CollectionUtils.isEmpty(logDtos)) { + return new ArrayList<>(); } // 2.直接分页查询 @@ -78,10 +69,10 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR LambdaQueryWrapper w = new LambdaQueryWrapper<>(); w.orderByDesc(LogOperationEntity::getOperatingTime); IPage iPage = logOperationDao.selectPage(new Page<>(pageNo, pageSize), w); - List logs = iPage.getRecords(); - List userIds = logs.stream().map(l -> l.getOperatorId()).collect(Collectors.toList()); + List logEntities = iPage.getRecords(); + List userIds = logEntities.stream().map(l -> l.getOperatorId()).collect(Collectors.toList()); - return convertLogOperationEntity2DTO(logs, getStaffMapByUserIds(userIds)); + return convertLogOperationEntity2DTO(logEntities, getStaffMapByUserIds(userIds)); } private Map getStaffMapByUserIds(List userIds) { diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 144e18d024..65e718aacf 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -1,7 +1,10 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.UserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 8dd958fe36..92295f9c7e 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -6,17 +6,21 @@ import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.SystemMessageType; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -29,6 +33,7 @@ import com.epmet.redis.CaptchaRedis; import com.epmet.service.ThirdLoginService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -44,7 +49,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service -public class ThirdLoginServiceImpl implements ThirdLoginService { +public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResolver { private static final Logger logger = LoggerFactory.getLogger(ThirdLoginServiceImpl.class); @Autowired @@ -61,6 +66,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { private GovOrgOpenFeignClient govOrgOpenFeignClient; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; /** * @param formDTO @@ -170,8 +179,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { this.saveLatestGovTokenDto(staffLatestAgencyResultDTO, userWechatDTO, token); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); - return userTokenResultDTO; + //7.发送登录事件 + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId()); + + return userTokenResultDTO; } /** @@ -635,4 +647,28 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); } + + /** + * @Description 发送登录事件 + * @return + * @author wxz + * @date 2021.06.08 15:27 + */ + private void sendLoginEvent(String userId, String appId) { + LoginMQMsg loginMQMsg = new LoginMQMsg(); + loginMQMsg.setUserId(userId); + loginMQMsg.setLoginTime(new Date()); + loginMQMsg.setAppId(appId); + + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.LOGIN); + form.setContent(loginMQMsg); + Result result = messageOpenFeignClient.sendSystemMsgByMQ(form); + try { + getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } + } + } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index e6d4732409..89e7f5a884 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -32,8 +32,8 @@ public interface ConsomerGroupConstants { String GROUP_ACHIEVEMENT_COMPONENTS_GROUP = "group_achievement_components_group"; /** - * 操作日志组 + * 登录操作日志消费组 */ - String OPERATION_LOG_GROUP = "operation_log_group"; + String LOGIN_OPERATION_LOG_GROUP = "login_operation_log_group"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 99a9b839c9..c50ff93dc3 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -15,7 +15,7 @@ public interface TopicConstants { String GROUP_ACHIEVEMENT = "group_achievement"; /** - * 操作日志 + * 登录 */ - String OPERATION_LOG = "operation_log"; + String LOGIN = "login"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java new file mode 100644 index 0000000000..643cd99f03 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java @@ -0,0 +1,20 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +import java.util.Date; + +@Data +public class LoginMQMsg { + + /** + * 谁登录 + */ + private String userId; + private String appId; + /** + * 什么时间登录的 + */ + private Date loginTime; + +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java deleted file mode 100644 index 95e3956114..0000000000 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OperationLogMQMsg.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.commons.rocketmq.messages; - -import lombok.Data; - -import java.util.Date; - -@Data -public class OperationLogMQMsg { - - private String type; - private String content; - private String targetId; - private String operatorId; - private Date operatingTime; - -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index 410549aecb..bb5e6f7b5d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -6,6 +6,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; import java.util.List; /** diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index af02a2054c..2a41a386b0 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -255,10 +255,11 @@ - - lb://epmet-auth-server + http://localhost:8081 + - lb://epmet-admin-server + http://localhost:8082 + lb://epmet-oss-server diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 282dc7b711..b29f2efaba 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -1,7 +1,7 @@ package com.epmet.constant; /** - * 系统消息类型 + * 系统消息类型(可以理解为动作,约等于rocket mq中的tag) */ public interface SystemMessageType { @@ -20,4 +20,9 @@ public interface SystemMessageType { */ String GROUP_ACHIEVEMENT = "group_achievement"; + /** + * 登录 + */ + String LOGIN = "login"; + } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index ff085c7bc0..2a6f2428d2 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -26,8 +26,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ -//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") -@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") +//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) public interface EpmetMessageOpenFeignClient { /** * 发送短信 diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index db9be4c1ba..82466bf528 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -43,7 +43,7 @@ public class SystemMessageServiceImpl implements SystemMessageService { //发送mq消息 try { - Message meMessage = new Message(getTopicByMsgType(messageType), contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); + Message meMessage = new Message(getTopicByMsgType(messageType), messageType, contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); rocketMQTemplate.getProducer().send(meMessage); } catch (Exception e) { String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); @@ -70,6 +70,8 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.GROUP_ACHIEVEMENT: topic = TopicConstants.GROUP_ACHIEVEMENT; break; + case SystemMessageType.LOGIN: + topic = TopicConstants.LOGIN; } return topic; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 725df08c21..ccb3dc0e41 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -389,7 +389,7 @@ and MOBILE = #{mobile} - + and userId in #{userId} From 3de74d7681f3b3b504dfdc7012675ce8be9d97c8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Jun 2021 18:02:45 +0800 Subject: [PATCH 36/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9B=B4=E6=8E=A5=E7=AB=8B=E9=A1=B9=E7=9A=84=20?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA=E5=8F=8A=E7=94=B5=E8=AF=9D=20?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=BE=85=E8=B0=83=E6=95=B4=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E8=8E=B7=E5=8F=96=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E7=9A=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/ScreenProjectDataDTO.java | 9 ++- .../main/java/com/epmet/dao/user/UserDao.java | 56 +++++++++++-------- .../epmet/entity/project/ProjectEntity.java | 2 +- .../impl/ScreenProjectSettleServiceImpl.java | 9 +++ .../com/epmet/service/user/UserService.java | 2 +- .../service/user/impl/UserServiceImpl.java | 35 ++++++++++-- .../main/resources/mapper/user/UserDao.xml | 19 ++++++- 7 files changed, 96 insertions(+), 36 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index aeb148d8e9..6c292909d2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto.screen; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 中央区-项目数据 @@ -54,6 +54,11 @@ public class ScreenProjectDataDTO implements Serializable { */ private String orgId; + /** + * 来源:议题issue,组织agency + */ + private String origin; + /** * 上级组织Id */ 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 e48dc81ab3..dabacfd7da 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 @@ -22,97 +22,97 @@ import java.util.Set; public interface UserDao { /** - * @Description 查询注册用户的总量与增量 * @param * @return + * @Description 查询注册用户的总量与增量 * @author wangc * @date 2020.06.18 18:50 - **/ - CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate")Date targetDate); + **/ + CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询党员的总量与增量 * @param * @return + * @Description 查询党员的总量与增量 * @author wangc * @date 2020.06.18 18:50 **/ CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("targetDate") Date targetDate); /** - * @Description 查询热心居民的总量与增量 * @param * @return + * @Description 查询热心居民的总量与增量 * @author wangc * @date 2020.06.18 18:50 **/ CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询指定网格范围下单位时间内新增的注册用户Id * @param * @return + * @Description 查询指定网格范围下单位时间内新增的注册用户Id * @author wangc * @date 2020.06.18 18:50 **/ List selectIncrUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询指定网格范围下截至指定位时间累计的注册用户Id * @param * @return + * @Description 查询指定网格范围下截至指定位时间累计的注册用户Id * @author wangc * @date 2020.06.18 18:50 **/ List selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); /** - * @Description 查询指定时间范围内网格新增的注册/参与用户Id * @param * @return + * @Description 查询指定时间范围内网格新增的注册/参与用户Id * @author wangc * @date 2020.06.18 18:50 **/ - List selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + List selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); /** - * @Description 查询指定时间范围内注册/参与用户增量 * @param * @return + * @Description 查询指定时间范围内注册/参与用户增量 * @author wangc * @date 2020.06.18 18:50 **/ - Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); /** - * @Description 查询指定时间范围内党员的增量 * @param * @return + * @Description 查询指定时间范围内党员的增量 * @author wangc * @date 2020.06.18 18:50 **/ - Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds") List incrUserIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); /** - * @Description 查询指定时间范围内热心居民的增量 * @param * @return + * @Description 查询指定时间范围内热心居民的增量 * @author wangc * @date 2020.06.18 18:50 **/ - Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("gridIds") Set gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); /** - * @Description 查询用户是不是党员 * @param userIds + * @Description 查询用户是不是党员 * @author zxc * @date 2020/9/15 4:23 下午 */ List selectUserIsParty(@Param("userIds") List userIds); - List selectPartymembersByCustomerId(@Param("customerId")String customerId); + List selectPartymembersByCustomerId(@Param("customerId") String customerId); - List selectWarmHeartedByCustomerId(@Param("customerId")String customerId); + List selectWarmHeartedByCustomerId(@Param("customerId") String customerId); /** * @param customerId @@ -125,22 +125,22 @@ public interface UserDao { List selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId); /** - * @Description 获取客户下的网格注册居民 * @param customerId * @return + * @Description 获取客户下的网格注册居民 * @author wangc * @date 2020.09.25 13:54 **/ List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); /** - * @Description 获取大屏项目相关信息 联系人 - * @param list + * @param userIdList * @return java.util.List + * @Description 获取大屏项目相关信息 联系人 * @author wangc * @date 2021.03.08 17:16 */ - List selectScreenProjectData(@Param("list") List list); + List selectScreenProjectData(@Param("list") List userIdList); /** * 根据工作员用户id, 返回这些人当中多少个网格员 @@ -148,6 +148,16 @@ public interface UserDao { * @param staffIds * @return int */ - int selectGridManagerTotal(@Param("customerId")String customerId,@Param("staffIds")List staffIds); + int selectGridManagerTotal(@Param("customerId") String customerId, @Param("staffIds") List staffIds); + + /** + * desc: 根据Id获取工作人员 昵称及手机号 + * + * @param staffUserIdList + * @return java.util.List + * @author LiuJanJun + * @date 2021/6/8 5:21 下午 + */ + List selectStaffInfo(@Param("list") List staffUserIdList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java index 15c533efc3..7a59cbb9ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java @@ -46,7 +46,7 @@ public class ProjectEntity extends BaseEpmetEntity { private String agencyId; /** - * 来源:议题issue + * 来源:议题issue,组织agency */ private String origin; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index a92f1169c6..afd8256f26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +import com.epmet.constant.ProjectConstant; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; @@ -81,11 +82,19 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic nature.getId())).map(projectInfo -> { meta.setProjectCreateTime(projectInfo.getCreatedTime()); meta.setProjectTitle(projectInfo.getTitle()); + meta.setOrigin(projectInfo.getOrigin()); + //直接立项的话 项目内容是项目背景 + if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){ + meta.setProjectContent(projectInfo.getBackGround()); + meta.setLinkName(projectInfo.getCreatedBy()); + } return meta; })).collect(Collectors.toList()); } + //设置项目经纬度和项目内容 topicService.fillScreenProjectData(metaData); //metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData); + //设置联系人及电话 userService.fillScreenProjectData(metaData); //metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData); } 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 b7cab26df1..ebc01ebdb3 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 @@ -84,7 +84,7 @@ public interface UserService { * @author wangc * @date 2021.03.08 17:16 */ - List fillScreenProjectData(List list); + void fillScreenProjectData(List list); /** * 返回每个组织或者每个网格下的网格员数量 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 fc40a2e5fd..a7f1d594c4 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 @@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.ExtractConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; @@ -744,16 +745,38 @@ public class UserServiceImpl implements UserService { * @date 2021.03.08 17:16 */ @Override - public List fillScreenProjectData(List list) { - List collection = userDao.selectScreenProjectData(list); - if(!CollectionUtils.isEmpty(collection)){ - list = list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) + public void fillScreenProjectData(List list) { + List topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin())) + .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); + if (CollectionUtils.isEmpty(topicUserIdList)){ + return; + } + List collection = userDao.selectScreenProjectData(topicUserIdList); + Map topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); + /* if(!CollectionUtils.isEmpty(collection)){ + list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) .map(merge -> { target.setLinkName(merge.getLinkName()); target.setLinkMobile(merge.getLinkMobile()); - return target;})).collect(Collectors.toList()); + return target;})); + }*/ + List staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin())) + .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); + if (CollectionUtils.isEmpty(topicUserIdList)){ + return; } - return collection; + List staffList = userDao.selectStaffInfo(staffUserIdList); + Map collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); + list.forEach(project->{ + ScreenProjectDataDTO userDTO = collect.get(project.getLinkName()); + if (userDTO == null){ + userDTO = topicUserMap.get(project.getLinkName()); + } + if (userDTO != null){ + project.setLinkName(userDTO.getLinkName()); + project.setLinkMobile(userDTO.getLinkMobile()); + } + }); } /** 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 51db8980fc..acb6c9feb3 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 @@ -528,8 +528,8 @@ user_base_info WHERE del_flag = '0' - - user_id = #{project.linkName} + + user_id = #{userId} @@ -550,11 +550,24 @@ WHERE m.DEL_FLAG = '0' AND m.CUSTOMER_ID = #{customerId} - AND m.ROLE_KEY = 'grid_manager' + AND m.ROLE_KEY = 'grid_member' ) AND sr.STAFF_ID in #{staffId} + From bd83b4ab6bbcf5da3f81370c8043930f1cf5be0c Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 8 Jun 2021 21:08:31 +0800 Subject: [PATCH 37/52] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ThirdLoginServiceImpl.java | 25 +++++++++++++------ .../epmet/service/impl/IssueServiceImpl.java | 3 +++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 92295f9c7e..db26d3d75c 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -181,7 +181,13 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol userTokenResultDTO.setToken(token); //7.发送登录事件 - sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId()); + try { + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId()); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } catch (Exception e) { + log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。错误信息"); + } return userTokenResultDTO; } @@ -404,6 +410,15 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); + + //6.发送登录事件 + try { + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId()); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } catch (Exception e) { + log.error("【工作端enterOrg登录】发送登录事件失败,程序继续执行。错误信息"); + } return userTokenResultDTO; } @@ -663,12 +678,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(SystemMessageType.LOGIN); form.setContent(loginMQMsg); - Result result = messageOpenFeignClient.sendSystemMsgByMQ(form); - try { - getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); - } catch (RenException e) { - log.error(e.getInternalMsg()); - } + messageOpenFeignClient.sendSystemMsgByMQ(form); + //getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 2c0cf4bb23..587b92c4a2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1041,6 +1041,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp if(!resiGroupOpenFeignClient.sendEvent(eventParam).success()){ logger.warn("com.epmet.service.impl.IssueServiceImpl.shiftProjectV2,话题被转为项目积分事件发送失败,参数:{}", JSON.toJSONString(formDTO)); } + + //8.记录日志 + //SendMqMsgUtil.build().openFeignClient(messageOpenFeignClient); } /** From d584fc283518162120ca5cc32fb04afd2870cb62 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 9 Jun 2021 09:23:24 +0800 Subject: [PATCH 38/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9sql=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r_project_location.sql => V0.0.14__alter_project_location.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/{V0.0.13__alter_project_location.sql => V0.0.14__alter_project_location.sql} (100%) diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.14__alter_project_location.sql similarity index 100% rename from epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__alter_project_location.sql rename to epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.14__alter_project_location.sql From 3f392332142b963337993116c4177fcd301e34be Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 9 Jun 2021 11:05:52 +0800 Subject: [PATCH 39/52] =?UTF-8?q?=E5=8F=96=E5=80=BC=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ProjectServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 2d3c544ad5..85f3fa3823 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1011,9 +1011,9 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Wed, 9 Jun 2021 13:30:24 +0800 Subject: [PATCH 40/52] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=82=B9=E6=97=B6=E5=8E=BB=E6=8E=89=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=87=8C=E7=9A=84=E5=A7=94=E4=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/EIDimServiceImpl.java | 5 +++-- .../stats/impl/ScreenCentralZoneDataExtractServiceImpl.java | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java index 8b5b67fe7d..c846f14f30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java @@ -144,8 +144,9 @@ public class EIDimServiceImpl implements EIDimService { if (grid.getCustomerId().equals(param.getCustomerId())) { AtomicInteger integer = new AtomicInteger(0); param.getCenterDataList().forEach(o -> { - if (grid.getGridName().contains(o.getTitle())) { - Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter()); + String title = o.getTitle().replace("委会",""); + if (grid.getGridName().contains(title)) { + Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), title, o.getCenter()); integer.addAndGet(effectRow); } result.put(grid.getGridId(), integer.intValue()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index ff368ab5da..36511421f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -182,11 +182,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon o.setDataEndTime(dimId); //For:06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数 - if(gridManagerMap.containsKey(orgId)){ - o.setGridMemberTotal(gridManagerMap.get(orgId)); - }else{ - o.setGridMemberTotal(NumConstant.ZERO); - } + o.setGridMemberTotal(gridManagerMap.getOrDefault(orgId, NumConstant.ZERO)); }); return result; } From 2176562b56443400aa15cca7d1b19a4111cdb536 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 13:48:48 +0800 Subject: [PATCH 41/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/enums/LogOperationTypeEnum.java | 93 ++++++++-------- epmet-admin/epmet-admin-server/pom.xml | 5 + .../com/epmet/entity/LogOperationEntity.java | 2 + .../mq/listener/RocketMQConsumerRegister.java | 11 +- ...ner.java => AuthOperationLogListener.java} | 9 +- .../listener/ProjectOperationLogListener.java | 100 ++++++++++++++++++ .../service/impl/LogOperationServiceImpl.java | 5 +- .../main/resources/mapper/LogOperationDao.xml | 1 + epmet-auth/epmet-auth-client/pom.xml | 14 +++ .../constants/AuthOperationConstants.java | 9 ++ .../auth/constants/AuthOperationEnum.java | 43 ++++++++ epmet-auth/pom.xml | 8 ++ .../service/impl/ThirdLoginServiceImpl.java | 3 +- .../constants/ConsomerGroupConstants.java | 9 +- .../rocketmq/constants/TopicConstants.java | 7 +- .../messages/ProjectChangedMQMsg.java | 11 ++ .../com/epmet/constant/SystemMessageType.java | 5 - .../java/com/epmet/send/SendMqMsgUtil.java | 2 +- .../epmet-message-server/pom.xml | 6 ++ .../impl/SystemMessageServiceImpl.java | 10 +- .../epmet/service/impl/IssueServiceImpl.java | 4 +- .../impl/ProjectProcessServiceImpl.java | 33 +++++- .../service/impl/ProjectServiceImpl.java | 68 ++++++++++-- .../service/impl/ProjectTraceServiceImpl.java | 7 +- 24 files changed, 379 insertions(+), 86 deletions(-) rename epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/{LoginOperationLogListener.java => AuthOperationLogListener.java} (87%) create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java create mode 100644 epmet-auth/epmet-auth-client/pom.xml create mode 100644 epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java create mode 100644 epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java index e17078245b..892d41ed34 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/enums/LogOperationTypeEnum.java @@ -1,49 +1,44 @@ -package com.epmet.enums; - -import lombok.Data; - -/** - * 操作日志类型枚举 - */ -public enum LogOperationTypeEnum { - LOGIN("login", "登录"), - LOGOUT("logout", "退出登录"), - ISSUE_SHIFT_PROJECT("issue_shift_project", "议题转项目"), - CLOSE_PROJECT("close_project", "项目结案"), - PROJECT_TRANSFER("project_transfer", "项目流转"), - PROJECT_RESPONSE("project_response", "响应处理"), - PROJECT_APPROVAL("project_approval", "项目立项"); - - private String type; - private String typeDisplay; - - public String getType() { - return type; - } - - public String getTypeDisplay() { - return typeDisplay; - } - - LogOperationTypeEnum(String type, String typeDisplay) { - this.type = type; - this.typeDisplay = typeDisplay; - } - - public static LogOperationTypeEnum get(String type) { - for (LogOperationTypeEnum t : LogOperationTypeEnum.values()) { - if (t.type.equals(type)) { - return t; - } - } - return null; - } - - public static String getDisplay(String type) { - LogOperationTypeEnum object = get(type); - if (object == null) { - return null; - } - return object.typeDisplay; - } -} +//package com.epmet.enums; +// +//import lombok.Data; +// +///** +// * 操作日志类型枚举 +// */ +//public enum LogOperationTypeEnum { +// LOGIN("login", "登录"), +// LOGOUT("logout", "退出登录"); +// +// private String type; +// private String typeDisplay; +// +// public String getType() { +// return type; +// } +// +// public String getTypeDisplay() { +// return typeDisplay; +// } +// +// LogOperationTypeEnum(String type, String typeDisplay) { +// this.type = type; +// this.typeDisplay = typeDisplay; +// } +// +// public static LogOperationTypeEnum get(String type) { +// for (LogOperationTypeEnum t : LogOperationTypeEnum.values()) { +// if (t.type.equals(type)) { +// return t; +// } +// } +// return null; +// } +// +// public static String getDisplay(String type) { +// LogOperationTypeEnum object = get(type); +// if (object == null) { +// return null; +// } +// return object.typeDisplay; +// } +//} diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 2e2afe5bc7..5093acffb8 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -74,6 +74,11 @@ epmet-message-client 2.0.0 + + com.epmet + epmet-auth-client + 2.0.0 + diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java index 54a141651a..b6b0d4364e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java @@ -47,6 +47,8 @@ public class LogOperationEntity extends BaseEpmetEntity { */ private String type; + private String typeDisplay; + /** * 内容 */ diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java index b68c768f97..ef71399b7d 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java @@ -2,7 +2,9 @@ package com.epmet.mq.listener; import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; import com.epmet.commons.rocketmq.constants.TopicConstants; -import com.epmet.mq.listener.listener.LoginOperationLogListener; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.mq.listener.listener.AuthOperationLogListener; +import com.epmet.mq.listener.listener.ProjectOperationLogListener; import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; import org.apache.rocketmq.client.exception.MQClientException; @@ -28,9 +30,10 @@ public class RocketMQConsumerRegister { @PostConstruct public void registerAllListeners() { try { - //if (!EnvEnum.LOCAL.getCode().equals(env)) { - register(nameServer, ConsomerGroupConstants.LOGIN_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.LOGIN, "*", new LoginOperationLogListener()); - //} + if (!EnvEnum.LOCAL.getCode().equals(env)) { + register(nameServer, ConsomerGroupConstants.AUTH_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.AUTH, "*", new AuthOperationLogListener()); + register(nameServer, ConsomerGroupConstants.PROJECT_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.PROJECT_CHANGED, "*", new ProjectOperationLogListener()); + } } catch (MQClientException e) { e.printStackTrace(); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java similarity index 87% rename from epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java rename to epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java index 53246a8364..fe6cf5a03d 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/LoginOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java @@ -1,13 +1,13 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; +import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.entity.LogOperationEntity; -import com.epmet.enums.LogOperationTypeEnum; import com.epmet.service.LogOperationService; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; * @return * @date 2021.06.07 16:12 */ -public class LoginOperationLogListener implements MessageListenerConcurrently { +public class AuthOperationLogListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); @@ -45,12 +45,13 @@ public class LoginOperationLogListener implements MessageListenerConcurrently { private void consumeMessage(MessageExt messageExt) { String tags = messageExt.getTags(); String msg = new String(messageExt.getBody()); - logger.info("操作日志监听器-收到消息内容:{}", msg); + logger.info("认证操作日志监听器-收到消息内容:{}", msg); LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class); LogOperationEntity logEntity = new LogOperationEntity(); logEntity.setCategory(messageExt.getTopic()); logEntity.setType(tags); + logEntity.setTypeDisplay(AuthOperationEnum.getDisplay(tags)); logEntity.setTargetId(""); logEntity.setOperatorId(msgObj.getUserId()); logEntity.setOperatingTime(msgObj.getLoginTime()); @@ -60,7 +61,7 @@ public class LoginOperationLogListener implements MessageListenerConcurrently { RLock lock = null; try { distributedLock = SpringContextUtils.getBean(DistributedLock.class); - lock = distributedLock.getLock(String.format("lock:operation_log:%s:%s", logEntity.getType(), logEntity.getTargetId()), + lock = distributedLock.getLock(String.format("lock:auth_operation_log:%s:%s", logEntity.getType(), logEntity.getOperatorId()), 30L, 30L, TimeUnit.SECONDS); SpringContextUtils.getBean(LogOperationService.class).log(logEntity); } catch (RenException e) { diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java new file mode 100644 index 0000000000..181e7cd3fc --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java @@ -0,0 +1,100 @@ +package com.epmet.mq.listener.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.entity.LogOperationEntity; +import com.epmet.service.LogOperationService; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author wxz + * @Description 项目操作日志监听器 + + * @return + * @date 2021.06.08 22.21 + */ +public class ProjectOperationLogListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + //String tags = messageExt.getTags(); + String msg = new String(messageExt.getBody()); + logger.info("项目变动操作日志监听器-收到消息内容:{}", msg); + ProjectChangedMQMsg msgObj = JSON.parseObject(msg, ProjectChangedMQMsg.class); + + String content = StringUtils.isBlank(msgObj.getOperationBrief()) ? "" : msgObj.getOperationBrief(); + + LogOperationEntity logEntity = new LogOperationEntity(); + logEntity.setCategory(messageExt.getTopic()); + logEntity.setType(msgObj.getOperation()); + logEntity.setTypeDisplay(getOperationTypeDisplay(msgObj.getOperation())); + logEntity.setTargetId(msgObj.getProjectId()); + logEntity.setOperatorId(msgObj.getOperatorId()); + logEntity.setOperatingTime(msgObj.getOperatingTime()); + logEntity.setContent(content); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:project_operation_log:%s:%s", logEntity.getType(), logEntity.getTargetId()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(LogOperationService.class).log(logEntity); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + } + + private String getOperationTypeDisplay(String type) { + switch (type) { + case "response": + return "项目响应处理"; + case "issue_shift_project": + return "议题转项目"; + case "close": + return "项目结案"; + case "return": + return "项目退回"; + case "transfer": + return "项目吹哨"; + case "created": + return "项目立项"; + default: + return null; + } + } +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 323ffae80e..15c1d4e44b 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.feign.ResultDataResolver; @@ -13,10 +14,8 @@ import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; -import com.epmet.enums.LogOperationTypeEnum; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.LogOperationService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -168,7 +167,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR ldto.setOperatorId(l.getOperatorId()); ldto.setTargetId(l.getTargetId()); ldto.setType(l.getType()); - ldto.setTypeDisplay(LogOperationTypeEnum.getDisplay(l.getType())); + ldto.setTypeDisplay(l.getTypeDisplay()); ldto.setOperatorMobile(staffMap.get(l.getOperatorId()).getMobile()); ldto.setOperatorName(staffMap.get(l.getOperatorId()).getRealName()); return ldto; diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index f63500d118..1496892029 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -6,6 +6,7 @@ + diff --git a/epmet-auth/epmet-auth-client/pom.xml b/epmet-auth/epmet-auth-client/pom.xml new file mode 100644 index 0000000000..685407f474 --- /dev/null +++ b/epmet-auth/epmet-auth-client/pom.xml @@ -0,0 +1,14 @@ + + + + epmet-auth + com.epmet + 2.0.0 + + 4.0.0 + + epmet-auth-client + + \ No newline at end of file diff --git a/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java b/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java new file mode 100644 index 0000000000..2cffd341ee --- /dev/null +++ b/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java @@ -0,0 +1,9 @@ +package com.epmet.auth.constants; + +/** + * 认证操作常量 + */ +public interface AuthOperationConstants { + String LOGIN = "login"; + String LOGOUT = "logout"; +} diff --git a/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java b/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java new file mode 100644 index 0000000000..fb112e7c36 --- /dev/null +++ b/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java @@ -0,0 +1,43 @@ +package com.epmet.auth.constants; + +/** + * 认证操作枚举 + */ +public enum AuthOperationEnum { + + LOGIN(AuthOperationConstants.LOGIN, "登录"), + LOGOUT(AuthOperationConstants.LOGOUT, "退出"); + + private String operationType; + private String operationDisplay; + + AuthOperationEnum(String operationType, String operationDisplay) { + this.operationType = operationType; + this.operationDisplay = operationDisplay; + } + + public String getOperationType() { + return operationType; + } + + public String getOperationDisplay() { + return operationDisplay; + } + + public static AuthOperationEnum get(String operationType) { + for (AuthOperationEnum e : AuthOperationEnum.values()) { + if (e.getOperationType().equals(operationType)) { + return e; + } + } + return null; + } + + public static String getDisplay(String operationType) { + AuthOperationEnum obj = get(operationType); + if (obj == null) { + return null; + } + return obj.getOperationDisplay(); + } +} diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 87fe58c7a8..6970ec1dd8 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -3,6 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 0.3.70 + + epmet-auth-client + com.epmet epmet-cloud @@ -133,6 +136,11 @@ 2.0.0 compile + + com.epmet + epmet-auth-client + 2.0.0 + diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index db26d3d75c..3926452c8d 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.ServiceConstant; @@ -676,7 +677,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol loginMQMsg.setAppId(appId); SystemMsgFormDTO form = new SystemMsgFormDTO(); - form.setMessageType(SystemMessageType.LOGIN); + form.setMessageType(AuthOperationConstants.LOGIN); form.setContent(loginMQMsg); messageOpenFeignClient.sendSystemMsgByMQ(form); //getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 89e7f5a884..ef5970dbb3 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -32,8 +32,13 @@ public interface ConsomerGroupConstants { String GROUP_ACHIEVEMENT_COMPONENTS_GROUP = "group_achievement_components_group"; /** - * 登录操作日志消费组 + * 认证操作日志消费组 */ - String LOGIN_OPERATION_LOG_GROUP = "login_operation_log_group"; + String AUTH_OPERATION_LOG_GROUP = "auth_operation_log_group"; + + /** + * 项目操作日志小肥猪 + */ + String PROJECT_OPERATION_LOG_GROUP = "project_operation_log_group"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index c50ff93dc3..70d4e006f8 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -1,5 +1,8 @@ package com.epmet.commons.rocketmq.constants; +/** + * 话题列表常量,其他服务要想发送消息到mq,则应当引入epmet-commons-rocketmq模块,并且使用此常量 + */ public interface TopicConstants { /** * 初始化客户 @@ -15,7 +18,7 @@ public interface TopicConstants { String GROUP_ACHIEVEMENT = "group_achievement"; /** - * 登录 + * 认证 */ - String LOGIN = "login"; + String AUTH = "auth"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java index d93871bd55..9530f7a326 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * desc:项目变动通知消息实体类 @@ -18,4 +19,14 @@ public class ProjectChangedMQMsg implements Serializable { * 操作类型 议题转项目issue_shift_project, 处理:response, 结案close,退回return,部门流转transfer,立项created */ private String operation; + +// ============> new + private String projectId; + private String operatorId; + private Date operatingTime; + /** + * 操作简介 + */ + private String operationBrief; + } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index b29f2efaba..bc71d2817a 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -20,9 +20,4 @@ public interface SystemMessageType { */ String GROUP_ACHIEVEMENT = "group_achievement"; - /** - * 登录 - */ - String LOGIN = "login"; - } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java index 4e8e7c954a..a6204e07ac 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java @@ -37,7 +37,7 @@ public class SendMqMsgUtil { } /** - * desc: 发送小组成就消息,计算小组成就 + * desc: 发送项目变动事件消息 * * @param msgContent * @return boolean diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 6af8aed5e8..f8de809d99 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -125,6 +125,12 @@ epmet-commons-rocketmq 2.0.0 + + + com.epmet + epmet-auth-client + 2.0.0 + diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index 82466bf528..6813dcd362 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.epmet.auth.constants.AuthOperationConstants; +import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -70,8 +72,12 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.GROUP_ACHIEVEMENT: topic = TopicConstants.GROUP_ACHIEVEMENT; break; - case SystemMessageType.LOGIN: - topic = TopicConstants.LOGIN; + case AuthOperationConstants.LOGIN: + topic = TopicConstants.AUTH; + break; + case AuthOperationConstants.LOGOUT: + topic = TopicConstants.AUTH; + break; } return topic; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 587b92c4a2..b1f1701e75 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -125,6 +125,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp private IssueProjectTagDictService issueProjectTagDictService; @Autowired private IssueVoteDetailDao issueVoteDetailDao; + @Autowired + private EpmetMessageOpenFeignClient messageOpenFeignClient; @Value("${openapi.scan.server.url}") @@ -1043,7 +1045,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp } //8.记录日志 - //SendMqMsgUtil.build().openFeignClient(messageOpenFeignClient); + //SendMqMsgUtil.build().openFeignClient(messageOpenFeignClient).sendProjectChangedMqMsg(); } /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index ff85abe02b..79e1903e7d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -386,8 +386,15 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl processStaff = epmetUserFeignClient.getCustomerStaffInfoByUserId(form); + + ProjectEntity projectEntity = projectService.selectById(projectId); + return String.format("将项目\"%s\"吹哨给%s%s处理", projectEntity.getTitle(), departmentName, processStaff.getData().getRealName()); + } + /** * @Description 项目流转给流转工作人员推送消息 * @author sun @@ -741,7 +763,12 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl getProjectByIssue(ShiftProjectsFromDTO fromDTO) { List resultList = new ArrayList<>(); @@ -1165,8 +1205,15 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectTraceS } //项目实时统计消息 - ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED); + String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); + ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, + projectEntity.getId(), + formDTO.getUserId(), + new Date(), + mqMsgBrief); boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); if (!msgResult) { log.error("项目实时统计消息发送失败"); From 3cb8dbc460b842625a5e0be0bd67990f94ed7ffd Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 14:03:56 +0800 Subject: [PATCH 42/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=EF=BC=8C=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/region/LogOperationResultDTO.java | 5 ++++- .../java/com/epmet/service/impl/LogOperationServiceImpl.java | 2 +- .../java/com/epmet/feign/EpmetMessageOpenFeignClient.java | 4 ++-- .../main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 4 ++-- .../src/main/resources/mapper/CustomerStaffDao.xml | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java index a052b9dd2d..6033b176e6 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java @@ -1,5 +1,8 @@ package com.epmet.dto.region; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.util.Date; @@ -44,6 +47,6 @@ public class LogOperationResultDTO { /** * 操作时间,该时间不是插入数据的时间,而是操作发生的真实时间 */ - private Date operatingTime; + private Long operatingTime; } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 15c1d4e44b..2e332fc171 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -163,7 +163,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR LogOperationResultDTO ldto = new LogOperationResultDTO(); ldto.setCategory(l.getCategory()); ldto.setContent(l.getContent()); - ldto.setOperatingTime(l.getOperatingTime()); + ldto.setOperatingTime(l.getOperatingTime().getTime()); ldto.setOperatorId(l.getOperatorId()); ldto.setTargetId(l.getTargetId()); ldto.setType(l.getType()); diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 2a6f2428d2..ff085c7bc0 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -26,8 +26,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ -@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") -//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) public interface EpmetMessageOpenFeignClient { /** * 发送短信 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index ea092ea63a..a9d3550fdf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.Map; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "http://127.0.0.1:8087") -//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "http://127.0.0.1:8087") +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) public interface EpmetUserOpenFeignClient { /** diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index ccb3dc0e41..a05cf9f51f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -390,7 +390,7 @@ and MOBILE = #{mobile} - and userId in + and user_id in #{userId} From 39d1645fe3c748ffc69ff575fda5f1f69a3c9f21 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 14:05:24 +0800 Subject: [PATCH 43/52] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8F=98=E5=8A=A8ddl?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.3__add_log_ope_table.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql index 0613c1dd2c..b55c87ecf8 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql @@ -1,8 +1,9 @@ CREATE TABLE `log_operation` ( `ID` varchar(64) NOT NULL COMMENT '主键ID', - `TYPE` varchar(64) NOT NULL COMMENT '类型枚举', + `TYPE` varchar(64) NOT NULL COMMENT '动作类型枚举', + `TYPE_DISPLAY` varchar(64) NOT NULL COMMENT '操作类型中文展示', `CONTENT` varchar(512) NOT NULL COMMENT '内容', - `CATEGORY` varchar(64) NOT NULL COMMENT '类别', + `CATEGORY` varchar(64) NOT NULL COMMENT '操作类型大类。例如login和logout都属于login大类。项目立项,项目流转,项目结案都属于项目大类', `TARGET_ID` varchar(64) NOT NULL COMMENT '操作目标ID', `OPERATOR_ID` varchar(64) NOT NULL COMMENT '操作人ID', `OPERATING_TIME` datetime NOT NULL COMMENT '操作时间,该时间不是插入数据的时间,而是操作发生的真实时间', From 8d0ce728b8b07b8e1f4df7a0a8eddd4808bc0b6c Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 14:08:49 +0800 Subject: [PATCH 44/52] - --- epmet-gateway/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 2a41a386b0..dc2dd76fda 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -255,11 +255,11 @@ - http://localhost:8081 - + + lb://epmet-auth-server - http://localhost:8082 - + + lb://epmet-admin-server lb://epmet-oss-server From f9a344633ef195d11ce63c544a673c6ba3db7522 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 14:18:32 +0800 Subject: [PATCH 45/52] =?UTF-8?q?=E8=B0=83=E6=95=B4auth-client=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-auth-client => epmet-auth-client}/pom.xml | 2 +- .../com/epmet/auth/constants/AuthOperationConstants.java | 0 .../java/com/epmet/auth/constants/AuthOperationEnum.java | 0 epmet-auth/pom.xml | 3 --- epmet-gateway/pom.xml | 8 ++++---- pom.xml | 1 + 6 files changed, 6 insertions(+), 8 deletions(-) rename {epmet-auth/epmet-auth-client => epmet-auth-client}/pom.xml (89%) rename {epmet-auth/epmet-auth-client => epmet-auth-client}/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java (100%) rename {epmet-auth/epmet-auth-client => epmet-auth-client}/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java (100%) diff --git a/epmet-auth/epmet-auth-client/pom.xml b/epmet-auth-client/pom.xml similarity index 89% rename from epmet-auth/epmet-auth-client/pom.xml rename to epmet-auth-client/pom.xml index 685407f474..1aee53c24e 100644 --- a/epmet-auth/epmet-auth-client/pom.xml +++ b/epmet-auth-client/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - epmet-auth + epmet-cloud com.epmet 2.0.0 diff --git a/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java b/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java similarity index 100% rename from epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java rename to epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationConstants.java diff --git a/epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java b/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java similarity index 100% rename from epmet-auth/epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java rename to epmet-auth-client/src/main/java/com/epmet/auth/constants/AuthOperationEnum.java diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 6970ec1dd8..87300fc380 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -3,9 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 0.3.70 - - epmet-auth-client - com.epmet epmet-cloud diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 2a41a386b0..dc2dd76fda 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -255,11 +255,11 @@ - http://localhost:8081 - + + lb://epmet-auth-server - http://localhost:8082 - + + lb://epmet-admin-server lb://epmet-oss-server diff --git a/pom.xml b/pom.xml index 9b61cacf07..32fdd9b549 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ epmet-commons epmet-gateway epmet-auth + epmet-auth-client epmet-admin epmet-module epmet-user From 0f6a9e12a78b434ec3bcaac5b6b9c29809a870b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Jun 2021 15:15:11 +0800 Subject: [PATCH 46/52] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=B7=A1=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/form/GridManagerListFormDTO.java | 4 +- .../user/result/GridManagerListResultDTO.java | 24 ++++ .../datareport/constant/PatrolConstant.java | 20 +++ .../user/StaffPatrolDetailController.java | 8 +- .../screen/ScreenCustomerAgencyDao.java | 9 ++ .../dao/user/StaffPatrolDetailDao.java | 2 +- .../dao/user/StaffPatrolRecordDao.java | 14 +- .../screen/ScreenOrgService.java | 23 +++ .../screen/impl/ScreenOrgServiceImpl.java | 44 ++++++ .../user/StaffPatrolDetailService.java | 10 +- .../impl/StaffPatrolDetailServiceImpl.java | 131 +++++++++++++++++- .../mapper/screen/ScreenCustomerAgencyDao.xml | 20 +++ .../mapper/user/StaffPatrolDetailDao.xml | 2 +- .../mapper/user/StaffPatrolRecordDao.xml | 24 +++- .../epmet/dto/result/GridStaffResultDTO.java | 21 +++ .../epmet/feign/GovOrgOpenFeignClient.java | 9 ++ .../GovOrgOpenFeignClientFallback.java | 5 + .../CustomerStaffGridController.java | 12 ++ .../com/epmet/dao/CustomerStaffGridDao.java | 9 ++ .../service/CustomerStaffGridService.java | 9 ++ .../impl/CustomerStaffGridServiceImpl.java | 35 +++++ .../resources/mapper/CustomerStaffGridDao.xml | 14 ++ .../epmet/dto}/form/PatrolTrackFormDTO.java | 2 +- .../epmet/dto}/form/RecordListFormDTO.java | 2 +- .../result/GridManagerUserListResultDTO.java | 65 +++++++++ .../dto/result/GridStaffUserResultDTO.java | 20 +++ .../dto}/result/PatrolTrackResultDTO.java | 2 +- .../dto}/result/RecordListResultDTO.java | 2 +- .../dto/result/UserNameAndLLResultDTO.java | 33 +++++ .../epmet/dto/result/UserNameResultDTO.java | 19 +++ .../epmet/feign/EpmetUserOpenFeignClient.java | 36 +++++ .../EpmetUserOpenFeignClientFallback.java | 21 +++ .../controller/StaffPatrolController.java | 68 +++++++++ .../epmet/controller/StaffRoleController.java | 16 ++- .../java/com/epmet/dao/CustomerStaffDao.java | 8 ++ .../com/epmet/dao/StaffPatrolDetailDao.java | 14 +- .../com/epmet/dao/StaffPatrolRecordDao.java | 24 +++- .../main/java/com/epmet/dao/StaffRoleDao.java | 13 +- .../service/StaffPatrolRecordService.java | 30 ++++ .../com/epmet/service/StaffRoleService.java | 13 +- .../impl/StaffPatrolRecordServiceImpl.java | 90 +++++++++--- .../service/impl/StaffRoleServiceImpl.java | 24 +++- .../resources/mapper/CustomerStaffDao.xml | 17 +++ .../resources/mapper/StaffPatrolDetailDao.xml | 34 ++--- .../resources/mapper/StaffPatrolRecordDao.xml | 53 ++++--- .../main/resources/mapper/StaffRoleDao.xml | 14 ++ 46 files changed, 966 insertions(+), 103 deletions(-) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java rename {epmet-module/data-report/data-report-client/src/main/java/com/epmet/user => epmet-user/epmet-user-client/src/main/java/com/epmet/dto}/form/PatrolTrackFormDTO.java (94%) rename {epmet-module/data-report/data-report-client/src/main/java/com/epmet/user => epmet-user/epmet-user-client/src/main/java/com/epmet/dto}/form/RecordListFormDTO.java (95%) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java rename {epmet-module/data-report/data-report-client/src/main/java/com/epmet/user => epmet-user/epmet-user-client/src/main/java/com/epmet/dto}/result/PatrolTrackResultDTO.java (92%) rename {epmet-module/data-report/data-report-client/src/main/java/com/epmet/user => epmet-user/epmet-user-client/src/main/java/com/epmet/dto}/result/RecordListResultDTO.java (95%) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java index 58a1912d1f..7f2e582ef3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java @@ -20,6 +20,8 @@ public class GridManagerListFormDTO implements Serializable { @NotBlank(message = "组织ID不能为空",groups = GridManagerListForm.class) private String agencyId; - @NotBlank(message = "行政区域编码不能为空",groups = GridManagerListForm.class) + /** + * 行政区域编码 【平阴传】 + */ private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java index 7ea6da09f1..986350e424 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.user.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -49,4 +50,27 @@ public class GridManagerListResultDTO implements Serializable { */ private String staffName; + /** + * 中心点位 + */ + @JsonIgnore + private String centerMark; + + /** + * 经纬度赋值状态 + */ + @JsonIgnore + private Boolean llStatus; + + public GridManagerListResultDTO() { + this.staffId = ""; + this.longitude = ""; + this.latitude = ""; + this.gridId = ""; + this.status = ""; + this.gridName = ""; + this.staffName = ""; + this.centerMark = ""; + this.llStatus = false; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java new file mode 100644 index 0000000000..eff0bdd451 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java @@ -0,0 +1,20 @@ +package com.epmet.datareport.constant; + +/** + * @Author zxc + * @DateTime 2021/6/9 1:49 下午 + * @DESC + */ +public interface PatrolConstant { + + /** + * 经度 + */ + String LONGITUDE = "longitude"; + + /** + * 纬度 + */ + String LATITUDE = "latitude"; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index e853fa3a48..72329ea1a1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -4,11 +4,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.user.StaffPatrolDetailService; import com.epmet.user.form.GridManagerListFormDTO; -import com.epmet.user.form.PatrolTrackFormDTO; -import com.epmet.user.form.RecordListFormDTO; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; import com.epmet.user.result.GridManagerListResultDTO; -import com.epmet.user.result.PatrolTrackResultDTO; -import com.epmet.user.result.RecordListResultDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; +import com.epmet.dto.result.RecordListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index a0992f8d97..986a880aac 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.dto.result.plugins.DeptNodeDTO; import com.epmet.dto.result.plugins.GridNodeDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.user.result.GridManagerListResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -161,4 +162,12 @@ public interface ScreenCustomerAgencyDao { List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); List selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + + /** + * @Description 根据agencyId查询网格 + * @Param agencyId + * @author zxc + * @date 2021/6/8 1:27 下午 + */ + List selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java index 56e3249113..fafcc77d6e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java @@ -19,7 +19,7 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; -import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java index a8637bd720..19849b856b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java @@ -19,9 +19,11 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; -import com.epmet.user.form.RecordListFormDTO; -import com.epmet.user.result.RecordListResultDTO; +import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.dto.result.RecordListResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -41,5 +43,13 @@ public interface StaffPatrolRecordDao extends BaseDao { * @date 2021/6/7 5:29 下午 */ List recordList(RecordListFormDTO formDTO); + + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:24 上午 + */ + List selectLL(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java new file mode 100644 index 0000000000..3de2656f69 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java @@ -0,0 +1,23 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.user.result.GridManagerListResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/6/8 10:45 上午 + * @DESC + */ +public interface ScreenOrgService { + + /** + * @Description 查询组织下的所有网格 + * @Param agencyId + * @Param areaCode + * @author zxc + * @date 2021/6/8 10:46 上午 + */ + List selectAllGrid(String agencyId,String areaCode); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java new file mode 100644 index 0000000000..c387350d34 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java @@ -0,0 +1,44 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; +import com.epmet.user.result.GridManagerListResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/6/8 10:45 上午 + * @DESC + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenOrgServiceImpl implements ScreenOrgService { + + @Autowired + private ScreenCustomerAgencyDao agencyDao; + + /** + * @Description 查询组织下的所有网格 + * @Param agencyId + * @Param areaCode + * @author zxc + * @date 2021/6/8 10:46 上午 + */ + @Override + public List selectAllGrid(String agencyId,String areaCode) { + List result = agencyDao.selectGrid(agencyId, areaCode); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java index 8afa465ea3..98260990a3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -1,13 +1,11 @@ package com.epmet.datareport.service.user; -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; import com.epmet.user.form.GridManagerListFormDTO; -import com.epmet.user.form.PatrolTrackFormDTO; -import com.epmet.user.form.RecordListFormDTO; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; import com.epmet.user.result.GridManagerListResultDTO; -import com.epmet.user.result.PatrolTrackResultDTO; -import com.epmet.user.result.RecordListResultDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; +import com.epmet.dto.result.RecordListResultDTO; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java index 5c9537862f..fb205ff276 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -1,21 +1,33 @@ package com.epmet.datareport.service.user.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.constant.PatrolConstant; import com.epmet.datareport.dao.user.StaffPatrolDetailDao; import com.epmet.datareport.dao.user.StaffPatrolRecordDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.dto.result.GridStaffResultDTO; +import com.epmet.dto.result.UserNameAndLLResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.user.form.GridManagerListFormDTO; -import com.epmet.user.form.PatrolTrackFormDTO; -import com.epmet.user.form.RecordListFormDTO; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; import com.epmet.user.result.GridManagerListResultDTO; -import com.epmet.user.result.PatrolTrackResultDTO; -import com.epmet.user.result.RecordListResultDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; +import com.epmet.dto.result.RecordListResultDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 工作人员巡查记录明细 @@ -33,16 +45,111 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { @Autowired private StaffPatrolRecordDao staffPatrolRecordDao; + @Autowired + private ScreenOrgService screenOrgService; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + /** * @Description 001、网格员分布 + * 1.根据agencyId或者areaCode查询出网格 + * 2.根据查出来的网格ID去查网格下边的人【人只要网格员】 + * 3.根据userId查询巡查记录表 + * 4.数据补全 * @Param formDTO * @author zxc * @date 2021/6/7 3:06 下午 */ @Override public List gridManagerList(GridManagerListFormDTO formDTO) { + List grids = new ArrayList<>(); + if (StringUtils.isEmpty(formDTO.getAreaCode())){ + // 根据agencyId查询网格 + grids = screenOrgService.selectAllGrid(formDTO.getAgencyId(), null); + }else { + // 根据areaCode查询网格 + grids = screenOrgService.selectAllGrid(null, formDTO.getAreaCode()); + } + if (CollectionUtils.isEmpty(grids)){ + return new ArrayList<>(); + } + List gridIds = grids.stream().map(m -> m.getGridId()).collect(Collectors.toList()); + // 查询网格下的网格员 + Result> resultData = govOrgOpenFeignClient.selectGridStaffByGridIds(gridIds); + if(!resultData.success()){ + throw new RenException("查询网格下的网格员失败【"+resultData.getMsg()+"】"); + } + List data = resultData.getData(); + if (CollectionUtils.isEmpty(data)){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(data, GridManagerListResultDTO.class); + // 查询经纬度 + Result selectll = epmetUserOpenFeignClient.selectll(result.stream().map(m -> m.getStaffId()).collect(Collectors.toList())); + if (!selectll.success()){ + throw new RenException("查询经纬度和姓名失败【"+selectll.getMsg()+"】"); + } + UserNameAndLLResultDTO llAndNameData = selectll.getData(); + List finalGrids = grids; + result.forEach(r -> { + // 经纬度赋值 巡查状态赋值 + if (!CollectionUtils.isEmpty(llAndNameData.getLl())) { + llAndNameData.getLl().forEach(l -> { + if (r.getStaffId().equals(l.getStaffId()) && r.getGridId().equals(l.getGridId())) { + r.setLatitude(l.getLatitude()); + r.setLongitude(l.getLongitude()); + r.setStatus(l.getStatus()); + r.setLlStatus(true); + } + }); + } + // 姓名赋值 + if (!CollectionUtils.isEmpty(llAndNameData.getUserNames())){ + llAndNameData.getUserNames().forEach(n -> { + if (r.getStaffId().equals(n.getUserId())){ + r.setStaffName(n.getUserName()); + } + }); + } + finalGrids.forEach(g -> { + if (r.getGridId().equals(g.getGridId())){ + r.setGridName(g.getGridName()); + } + }); + }); + result.forEach(r -> { + if (!r.getLlStatus()){ + finalGrids.forEach(g -> { + if (StringUtils.isNotBlank(g.getCenterMark())){ + r.setLongitude(getLL(g.getCenterMark(),PatrolConstant.LONGITUDE)); + r.setLatitude(getLL(g.getCenterMark(),PatrolConstant.LATITUDE)); + } + }); + } + }); + return result; + } - return null; + /** + * @Description 根据中心点位截取经纬度 + * @Param centMark + * @Param ll + * @author zxc + * @date 2021/6/9 2:08 下午 + */ + public String getLL(String centMark,String ll){ + if (ll.equals(PatrolConstant.LONGITUDE)){ + String longitude = centMark.substring(NumConstant.TWO, centMark.indexOf(",")); + return longitude; + }else { + String s = centMark.substring(NumConstant.ZERO, centMark.indexOf(",")); + String latitude = centMark.substring(s.length() + NumConstant.ONE, centMark.length() - NumConstant.TWO); + return latitude; + } } /** @@ -53,7 +160,11 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { */ @Override public List recordList(RecordListFormDTO formDTO) { - List result = staffPatrolRecordDao.recordList(formDTO); + Result> listResult = epmetUserOpenFeignClient.recordList(formDTO); + if (!listResult.success()){ + throw new RenException("查询巡查记录失败【"+listResult.getMsg()+"】"); + } + List result = listResult.getData(); if (!CollectionUtils.isEmpty(result)){ return result; } @@ -68,10 +179,16 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { */ @Override public List patrolTrack(PatrolTrackFormDTO formDTO) { - List results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId()); + Result> result = epmetUserOpenFeignClient.patrolTrack(formDTO); + if (!result.success()){ + throw new RenException("查询 巡查轨迹失败【"+result.getMsg()+"】"); + } + List results = result.getData(); if (!CollectionUtils.isEmpty(results)){ return results; } return new ArrayList<>(); } + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 328bb2f753..4397b99fd6 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -320,4 +320,24 @@ + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml index cdc99d435b..2bf91e89f2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml @@ -4,7 +4,7 @@ - SELECT LATITUDE, LONGITUDE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml index 5fef17c84a..02e4069ff7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml @@ -4,7 +4,7 @@ - SELECT ID AS staffPatrolRecId, DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d %H:%i:%s') AS patrolStartTime, @@ -16,4 +16,26 @@ AND STAFF_ID = #{staffId} ORDER BY CREATED_TIME DESC + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java new file mode 100644 index 0000000000..d74af6d7f6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/8 3:23 下午 + * @DESC + */ +@Data +public class GridStaffResultDTO implements Serializable { + + private static final long serialVersionUID = -5910427385795368242L; + + private String gridId; + + private String staffId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 6cefd55a53..4e28d10dc1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -333,4 +333,13 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getprocessorlist/{agencyId}") Result getProcessorList(@PathVariable("agencyId") String agencyId); + + /** + * @Description 查询网格下的网格员 + * @Param gridIds + * @author zxc + * @date 2021/6/8 3:36 下午 + */ + @PostMapping("/gov/org/customerstaffgrid/gridstaff") + Result> selectGridStaffByGridIds(@RequestBody List gridIds); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index f34b6f53ae..4976297323 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -192,4 +192,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result getProcessorList(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getProcessorList", agencyId); } + + @Override + public Result> selectGridStaffByGridIds(List gridIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridStaffByGridIds", gridIds); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index 72b6dabe25..53e6330d06 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -29,6 +29,7 @@ import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.excel.CustomerStaffGridExcel; import com.epmet.service.CustomerStaffGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -119,4 +120,15 @@ public class CustomerStaffGridController { ValidatorUtils.validateEntity(gridIdFormDTO); return customerStaffGridService.getAllGridStaffs(gridIdFormDTO); } + + /** + * @Description 查询网格下的人 + * @Param gridIds + * @author zxc + * @date 2021/6/8 3:36 下午 + */ + @PostMapping("gridstaff") + public Result> selectGridStaffByGridIds(@RequestBody List gridIds){ + return new Result>().ok(customerStaffGridService.selectGridStaffByGridIds(gridIds)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index 54cad95662..d9ce1b0e61 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffDepartmentDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -97,4 +98,12 @@ public interface CustomerStaffGridDao extends BaseDao { * @Description 查询人员在客户下参与的网格列表 */ List selectStaffGridList(CustomerStaffGridDTO staffGridDTO); + + /** + * @Description 查询网格下的人 + * @Param gridIds + * @author zxc + * @date 2021/6/8 3:36 下午 + */ + List selectGridStaffByGridIds(@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 7813dd3b06..0cf4041cce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import java.util.List; @@ -117,4 +118,12 @@ public interface CustomerStaffGridService extends BaseService> getAllGridStaffs(CommonGridIdFormDTO gridIdFormDTO); + + /** + * @Description 查询网格下的人 + * @Param gridIds + * @author zxc + * @date 2021/6/8 3:36 下午 + */ + List selectGridStaffByGridIds(List gridIds); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 2eb0873cc8..ac8abc82fc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -30,13 +31,16 @@ import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.CustomerStaffGridRedis; import com.epmet.service.CustomerStaffGridService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Arrays; @@ -56,6 +60,9 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -146,4 +153,32 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl selectGridStaffByGridIds(List gridIds) { + if (CollectionUtils.isEmpty(gridIds)){ + return new ArrayList<>(); + } + // 查询网格下所有的人 + List gridStaff = baseDao.selectGridStaffByGridIds(gridIds); + if (CollectionUtils.isEmpty(gridStaff)){ + return new ArrayList<>(); + } + // 拿着网格下所有人去筛选网格员 + Result> result = epmetUserOpenFeignClient.staffGridRole(gridStaff); + if (!result.success()){ + throw new RenException("查询网格下的网格员失败【"+result.getMsg()+"】"); + } + List data = result.getData(); + if (CollectionUtils.isEmpty(data)){ + return new ArrayList<>(); + } + return data; + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 7f1a8d3220..5e08a59b97 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -88,6 +88,20 @@ AND customer_id = #{customerId} + + + insert into customer_staff_grid diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolTrackFormDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolTrackFormDTO.java index 831a4ee8fd..6c0dfb8478 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolTrackFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RecordListFormDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RecordListFormDTO.java index c540ddc579..cfaf7a62c4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RecordListFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form; import lombok.Data; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java new file mode 100644 index 0000000000..8a8e51887b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerUserListResultDTO implements Serializable { + + private static final long serialVersionUID = 3606766812822179356L; + + /** + * 工作人员id + */ + private String staffId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 网格ID + */ + private String gridId; + + /** + * 正在巡查:patrolling;否则返回空字符串 + */ + private String status; + + /** + * 网格名称,最多显示上两级 + */ + private String gridName; + + /** + * 姓名 + */ + private String staffName; + + /** + * 中心点位 + */ + @JsonIgnore + private String centerMark; + + /** + * 经纬度赋值状态 + */ + @JsonIgnore + private Boolean llStatus; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java new file mode 100644 index 0000000000..da70a707fe --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/8 4:30 下午 + * @DESC + */ +@Data +public class GridStaffUserResultDTO implements Serializable { + + private static final long serialVersionUID = 7715622585539953368L; + + private String gridId; + + private String staffId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolTrackResultDTO.java similarity index 92% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolTrackResultDTO.java index 070b5a7d9a..d20d951367 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolTrackResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RecordListResultDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java rename to epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RecordListResultDTO.java index aab9d52ef0..078586c69d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RecordListResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result; import lombok.Data; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java new file mode 100644 index 0000000000..ac255b7c56 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/6/9 11:12 上午 + * @DESC + */ +@Data +public class UserNameAndLLResultDTO implements Serializable { + + private static final long serialVersionUID = 8997436689118596889L; + + /** + * 用户名字 + */ + private List userNames; + + /** + * 经纬度 + */ + private List ll; + + public UserNameAndLLResultDTO() { + this.userNames = new ArrayList<>(); + this.ll = new ArrayList<>(); + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java new file mode 100644 index 0000000000..286fc17ea7 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/9 11:12 上午 + * @DESC + */ +@Data +public class UserNameResultDTO implements Serializable { + + private static final long serialVersionUID = 5383959788021394553L; + + private String userId; + private String userName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f85ba6d782..95c98adfa6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -530,4 +530,40 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/badge/userbadges") Result> userBadges(@RequestBody UserBadgesFormDTO formDTO); + + /** + * @Description 查询网格员角色 + * @Param forms + * @author zxc + * @date 2021/6/8 4:42 下午 + */ + @PostMapping("/epmetuser/staffrole/staffgridrole") + Result> staffGridRole(@RequestBody List forms); + + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:40 上午 + */ + @PostMapping("/epmetuser/staffpatrol/getll") + Result selectll(@RequestBody List userIds); + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @PostMapping("/epmetuser/staffpatrol/recordlist") + Result> recordList(@RequestBody RecordListFormDTO formDTO); + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @PostMapping("/epmetuser/staffpatrol/patroltrack") + Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 518cca9cef..2263284f8e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -373,4 +373,25 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> userBadges(UserBadgesFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "userBadges", formDTO); } + + @Override + public Result> staffGridRole(List forms) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "staffGridRole", forms); + } + + @Override + public Result selectll(List userIds) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectll", userIds); + } + + @Override + public Result> recordList(RecordListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "recordList", formDTO); + } + + @Override + public Result> patrolTrack(PatrolTrackFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolTrack", formDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java new file mode 100644 index 0000000000..f0a0558c34 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java @@ -0,0 +1,68 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.dto.result.GridManagerUserListResultDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; +import com.epmet.dto.result.RecordListResultDTO; +import com.epmet.dto.result.UserNameAndLLResultDTO; +import com.epmet.service.StaffPatrolRecordService; +import com.epmet.user.result.GridManagerListResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/6/9 10:32 上午 + * @DESC + */ +@RestController +@RequestMapping("staffpatrol") +public class StaffPatrolController { + + @Autowired + private StaffPatrolRecordService staffPatrolRecordService; + + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:40 上午 + */ + @PostMapping("getll") + public Result selectll(@RequestBody List userIds){ + return new Result().ok(staffPatrolRecordService.selectLL(userIds)); + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @PostMapping("recordlist") + public Result> recordList(@RequestBody RecordListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); + return new Result>().ok(staffPatrolRecordService.recordList(formDTO)); + } + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @PostMapping("patroltrack") + public Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); + return new Result>().ok(staffPatrolRecordService.patrolTrack(formDTO)); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 60b4d5400e..00d3cd154e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -10,11 +10,8 @@ import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerRoleFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.form.*; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -181,4 +178,15 @@ public class StaffRoleController { staffRoleService.changeRoleOrg(formDTO); return new Result(); } + + /** + * @Description 查询网格员角色 + * @Param forms + * @author zxc + * @date 2021/6/8 4:42 下午 + */ + @PostMapping("staffgridrole") + public Result> staffGridRole(@RequestBody List forms){ + return new Result>().ok(staffRoleService.staffGridRole(forms)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index acffa2840e..6a580a6372 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -197,4 +197,12 @@ public interface CustomerStaffDao extends BaseDao { * @return */ BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO); + + /** + * @Description 查询用户名字 + * @Param userIds + * @author zxc + * @date 2021/6/9 1:36 下午 + */ + List selectUserName(@Param("userIds")List userIds); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java index 844e0d0036..2d7ed83136 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PatrolTrackResultDTO; import com.epmet.entity.StaffPatrolDetailEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员巡查记录明细 @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolDetailDao extends BaseDao { - + + /** + * @Description 查询巡查轨迹 + * @Param staffPatrolRecId + * @author zxc + * @date 2021/6/7 5:13 下午 + */ + List selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java index 61f5769af4..a476cfd3a5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java @@ -18,8 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.dto.result.GridManagerUserListResultDTO; +import com.epmet.dto.result.RecordListResultDTO; import com.epmet.entity.StaffPatrolRecordEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员巡查主记录 @@ -29,5 +35,21 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolRecordDao extends BaseDao { - + + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:24 上午 + */ + List selectLL(@Param("userIds")List userIds); + + /** + * @Description 巡查记录查询 + * @Param formDTO + * @author zxc + * @date 2021/6/7 5:29 下午 + */ + List recordList(RecordListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 3124fc68c7..6d10c5fe23 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -24,10 +24,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.GetRoleKeyListFormDTO; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -131,4 +128,12 @@ public interface StaffRoleDao extends BaseDao { * @Description 工作端-查询用户角色key列表 **/ List selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO); + + /** + * @Description 查询是网格员的人 + * @Param forms + * @author zxc + * @date 2021/6/8 4:53 下午 + */ + List staffGridRole(@Param("forms") List forms); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java index ae347f87e7..9883d87bc9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java @@ -18,8 +18,15 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.dto.result.PatrolTrackResultDTO; +import com.epmet.dto.result.RecordListResultDTO; +import com.epmet.dto.result.UserNameAndLLResultDTO; import com.epmet.entity.StaffPatrolRecordEntity; +import java.util.List; + /** * 工作人员巡查主记录 @@ -29,5 +36,28 @@ import com.epmet.entity.StaffPatrolRecordEntity; */ public interface StaffPatrolRecordService extends BaseService { + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:40 上午 + */ + UserNameAndLLResultDTO selectLL(List userIds); + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + List recordList(RecordListFormDTO formDTO); + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + List patrolTrack(PatrolTrackFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 5e260dd3c3..31a9883a4f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -25,10 +25,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import java.util.List; @@ -159,4 +156,12 @@ public interface StaffRoleService extends BaseService { * @return void */ void changeRoleOrg(StaffRoleDTO formDTO); + + /** + * @Description 查询网格员角色 + * @Param forms + * @author zxc + * @date 2021/6/8 4:42 下午 + */ + List staffGridRole(List forms); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index aa6f7c5571..f0d9103e51 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -1,27 +1,21 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.CustomerStaffDao; +import com.epmet.dao.StaffPatrolDetailDao; import com.epmet.dao.StaffPatrolRecordDao; +import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dto.form.PatrolTrackFormDTO; +import com.epmet.dto.form.RecordListFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffPatrolRecordEntity; import com.epmet.service.StaffPatrolRecordService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; /** * 工作人员巡查主记录 @@ -32,5 +26,67 @@ import org.springframework.stereotype.Service; @Service public class StaffPatrolRecordServiceImpl extends BaseServiceImpl implements StaffPatrolRecordService { + @Autowired + private CustomerStaffDao customerStaffDao; + + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; + + @Autowired + private StaffPatrolDetailDao staffPatrolDetailDao; + + /** + * @Description 查询经纬度 + * @Param userIds + * @author zxc + * @date 2021/6/9 10:40 上午 + */ + @Override + public UserNameAndLLResultDTO selectLL(List userIds) { + UserNameAndLLResultDTO result = new UserNameAndLLResultDTO(); + if (CollectionUtils.isEmpty(userIds)){ + return result; + } + // 经纬度查询 + List llResult = baseDao.selectLL(userIds); + if (!CollectionUtils.isEmpty(llResult)){ + result.setLl(llResult); + } + // 姓名查询 + List nameResult = customerStaffDao.selectUserName(userIds); + if (!CollectionUtils.isEmpty(nameResult)){ + result.setUserNames(nameResult); + } + return result; + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @Override + public List recordList(RecordListFormDTO formDTO) { + List result = staffPatrolRecordDao.recordList(formDTO); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @Override + public List patrolTrack(PatrolTrackFormDTO formDTO) { + List results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId()); + if (!CollectionUtils.isEmpty(results)){ + return results; + } + return new ArrayList<>(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index bb85550f3c..0e65e701b2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -32,10 +32,7 @@ import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import com.epmet.redis.StaffRoleRedis; import com.epmet.service.StaffRoleService; @@ -43,6 +40,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Arrays; @@ -188,4 +186,22 @@ public class StaffRoleServiceImpl extends BaseServiceImpl staffGridRole(List forms) { + if (CollectionUtils.isEmpty(forms)){ + return new ArrayList<>(); + } + List result = baseDao.staffGridRole(forms); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index eab3a42191..e6db9c61a6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -357,4 +357,21 @@ AND user_id = #{staffId} LIMIT 1 + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml index 235ad55597..0168ef7042 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml @@ -3,27 +3,17 @@ - - - - - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml index c57b356e99..2e760a499e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml @@ -3,25 +3,40 @@ - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 0b39b350b7..fe378570ec 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -193,4 +193,18 @@ AND gsr.del_flag = '0' AND sr.staff_id = #{userId} + + + From 28795cfd31ba9d56d3660d79e75abc5813b98f86 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Jun 2021 15:30:14 +0800 Subject: [PATCH 47/52] =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/IssueProjectCategoryDictDao.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 4a7b073b73..05e72af022 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -235,12 +235,13 @@ SELECT #{l.projectId} AS projectId, - CATEGORY_NAME - FROM issue_project_category_dict - WHERE DEL_FLAG = '0' - AND IS_DISABLE = 'enable' - AND CUSTOMER_ID = #{customerId} - AND CATEGORY_CODE = #{l.categoryCode} + CONCAT(if(cd2.CATEGORY_CODE = '0','',CONCAT(cd2.CATEGORY_NAME,'-')),cd.CATEGORY_NAME) AS categoryName + FROM issue_project_category_dict cd + LEFT JOIN issue_project_category_dict cd2 ON cd2.CATEGORY_CODE = cd.PARENT_CATEGORY_CODE AND cd2.DEL_FLAG = '0' + WHERE cd.DEL_FLAG = '0' + AND cd.IS_DISABLE = 'enable' + AND cd.CUSTOMER_ID = #{customerId} + AND cd.CATEGORY_CODE = #{l.categoryCode} From 422f15f71e67ad9c9b7e95779b88df81e6c51c3c Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 9 Jun 2021 15:34:19 +0800 Subject: [PATCH 48/52] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E5=8D=95=E4=BD=8D=E4=B8=BA=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/LogOperationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 2e332fc171..ad8a3c1d6a 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -163,7 +163,7 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR LogOperationResultDTO ldto = new LogOperationResultDTO(); ldto.setCategory(l.getCategory()); ldto.setContent(l.getContent()); - ldto.setOperatingTime(l.getOperatingTime().getTime()); + ldto.setOperatingTime(l.getOperatingTime().getTime()/1000); ldto.setOperatorId(l.getOperatorId()); ldto.setTargetId(l.getTargetId()); ldto.setType(l.getType()); From cc7b97f37c2005ee3981c2bbf23a174defe95c86 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 9 Jun 2021 16:04:25 +0800 Subject: [PATCH 49/52] =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=90=8D=E6=8B=BC=E6=8E=A5=E5=88=B0=E4=B8=8A=E4=B8=A4=E7=BA=A7?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0=EF=BC=8C=E6=81=B6=E5=BF=83?= =?UTF-8?q?=E4=BA=BA=E7=9A=84=E7=8E=A9=E6=84=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../govorg/impl/GovOrgServiceImpl.java | 1 + .../mapper/govorg/CustomerGridDao.xml | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index dfaff1bd06..e3c9752a00 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -233,6 +233,7 @@ public class GovOrgServiceImpl implements GovOrgService { **/ @Override public List gridListByStaffId(String staffId) { + //网格名是拼接上两级组织名称 List resultList = customerGridDao.gridListByStaffId(staffId); return resultList; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index 000f2c2b49..3d00ea3cd4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -56,10 +56,22 @@ SELECT cg.id AS 'id', IF ( - ca.organization_name = '', - cg.grid_name, - CONCAT(ca.organization_name,'-',cg.grid_name) - ) AS 'gridName' + ca.pid = '0', + IF ( + ca.organization_name = '', + cg.grid_name, + CONCAT(ca.organization_name,'-',cg.grid_name) + ), + CONCAT( + (select organization_name from customer_agency where id = ca.pid), + '-', + IF ( + ca.organization_name = '', + cg.grid_name, + CONCAT(ca.organization_name,'-',cg.grid_name) + ) + ) + )AS 'gridName' FROM customer_grid cg INNER JOIN customer_agency ca ON cg.pid = ca.id From 9a7fcd3b8241c294e96bc1527bef21d20113a028 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Jun 2021 16:43:19 +0800 Subject: [PATCH 50/52] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueProjectCategoryDictDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 05e72af022..dca01a63f5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -237,7 +237,7 @@ #{l.projectId} AS projectId, CONCAT(if(cd2.CATEGORY_CODE = '0','',CONCAT(cd2.CATEGORY_NAME,'-')),cd.CATEGORY_NAME) AS categoryName FROM issue_project_category_dict cd - LEFT JOIN issue_project_category_dict cd2 ON cd2.CATEGORY_CODE = cd.PARENT_CATEGORY_CODE AND cd2.DEL_FLAG = '0' + LEFT JOIN issue_project_category_dict cd2 ON cd2.CATEGORY_CODE = cd.PARENT_CATEGORY_CODE AND cd2.DEL_FLAG = '0' AND cd2.CUSTOMER_ID = #{customerId} WHERE cd.DEL_FLAG = '0' AND cd.IS_DISABLE = 'enable' AND cd.CUSTOMER_ID = #{customerId} From 9e873d2595c4234810691c0f83fa25c66833e0b8 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 10 Jun 2021 09:16:26 +0800 Subject: [PATCH 51/52] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0ip,app,client,operatorName,operatorM?= =?UTF-8?q?obile=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LogOperationController.java | 4 +- .../com/epmet/entity/LogOperationEntity.java | 15 +++++ .../listener/bean/log/LogOperationHelper.java | 63 +++++++++++++++++ .../mq/listener/bean/log/OperatorInfo.java | 11 +++ .../listener/AuthOperationLogListener.java | 16 +++++ .../listener/ProjectOperationLogListener.java | 9 +++ .../migration/V0.0.3__add_log_ope_table.sql | 5 ++ .../main/resources/mapper/LogOperationDao.xml | 5 ++ .../service/impl/ThirdLoginServiceImpl.java | 18 +++-- .../commons/rocketmq/messages/LoginMQMsg.java | 6 ++ .../messages/ProjectChangedMQMsg.java | 8 +++ .../impl/ProjectProcessServiceImpl.java | 20 +++++- .../service/impl/ProjectServiceImpl.java | 67 ++++++++++++++++--- .../service/impl/ProjectTraceServiceImpl.java | 13 +++- 14 files changed, 240 insertions(+), 20 deletions(-) create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/OperatorInfo.java diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java index ddd86e8fac..13ed1b9bd1 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.LogOperationListFormDTO; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; @@ -27,7 +29,7 @@ public class LogOperationController { private LoginUserUtil loginUserUtil; @PostMapping("/list") - public Result> listLogOperations(@RequestBody LogOperationListFormDTO input) { + public Result> listLogOperations(@RequestBody LogOperationListFormDTO input, HttpServletRequest request) { ValidatorUtils.validateEntity(input); String condition = input.getCondition(); Integer pageNo = input.getPageNo(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java index b6b0d4364e..3bbbb75841 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java @@ -49,6 +49,12 @@ public class LogOperationEntity extends BaseEpmetEntity { private String typeDisplay; + private String ip; + + private String fromApp; + + private String fromClient; + /** * 内容 */ @@ -63,6 +69,15 @@ public class LogOperationEntity extends BaseEpmetEntity { * 操作人ID */ private String operatorId; + /** + * 操作人姓名 + */ + private String operatorName; + + /** + * 操作人手机号 + */ + private String operatorMobile; /** * 操作时间,该时间不是插入数据的时间,而是操作发生的真实时间 diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java new file mode 100644 index 0000000000..0d390709bd --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/LogOperationHelper.java @@ -0,0 +1,63 @@ +package com.epmet.mq.listener.bean.log; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; + +/** + * 操作日志帮助类 单例 + */ +public class LogOperationHelper implements ResultDataResolver { + + private EpmetUserOpenFeignClient userOpenFeignClient; + + private LogOperationHelper() { + } + + /** + * @Description 利用类只能加载一次的特性,保证类静态变量只能生成一份,实现单例 + * @return + * @author wxz + * @date 2021.06.09 16:55 + */ + private static class SingletonInnerClass { + public static LogOperationHelper instance = new LogOperationHelper(); + } + + /** + * @Description 获取实例 + * @return + * @author wxz + * @date 2021.06.09 16:54 + */ + public static LogOperationHelper getInstance() { + return SingletonInnerClass.instance; + } + + /** + * @Description 获取操作人信息 + * @return + * @author wxz + * @date 2021.06.09 16:57 + */ + public OperatorInfo getOperatorInfo(String userId) { + if (userOpenFeignClient == null) { + synchronized (this) { + if (userOpenFeignClient == null) { + userOpenFeignClient = SpringContextUtils.getBean(EpmetUserOpenFeignClient.class); + } + } + } + + CustomerStaffDTO form = new CustomerStaffDTO(); + form.setUserId(userId); + Result result = userOpenFeignClient.getCustomerStaffInfoByUserId(form); + CustomerStaffDTO staffInfo = getResultDataOrThrowsException(result, ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), + "调用epmet-user服务获取staff信息发生异常"); + return new OperatorInfo(staffInfo.getMobile(), staffInfo.getRealName()); + } +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/OperatorInfo.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/OperatorInfo.java new file mode 100644 index 0000000000..fe1ce2fc09 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/bean/log/OperatorInfo.java @@ -0,0 +1,11 @@ +package com.epmet.mq.listener.bean.log; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class OperatorInfo { + private String mobile; + private String name; +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java index fe6cf5a03d..85573d40f0 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java @@ -3,11 +3,20 @@ package com.epmet.mq.listener.listener; import com.alibaba.fastjson.JSON; import com.epmet.auth.constants.AuthOperationEnum; import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.entity.LogOperationEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.mq.listener.bean.log.LogOperationHelper; +import com.epmet.mq.listener.bean.log.OperatorInfo; import com.epmet.service.LogOperationService; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -48,12 +57,19 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { logger.info("认证操作日志监听器-收到消息内容:{}", msg); LoginMQMsg msgObj = JSON.parseObject(msg, LoginMQMsg.class); + //获取操作人信息 + OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getUserId()); LogOperationEntity logEntity = new LogOperationEntity(); logEntity.setCategory(messageExt.getTopic()); logEntity.setType(tags); logEntity.setTypeDisplay(AuthOperationEnum.getDisplay(tags)); + logEntity.setIp(msgObj.getIp()); + logEntity.setFromApp(msgObj.getFromApp()); + logEntity.setFromClient(msgObj.getFromClient()); logEntity.setTargetId(""); logEntity.setOperatorId(msgObj.getUserId()); + logEntity.setOperatorName(operatorInfo.getName()); + logEntity.setOperatorMobile(operatorInfo.getMobile()); logEntity.setOperatingTime(msgObj.getLoginTime()); logEntity.setContent("成功登录系统"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java index 181e7cd3fc..5240444701 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/ProjectOperationLogListener.java @@ -8,6 +8,8 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.entity.LogOperationEntity; +import com.epmet.mq.listener.bean.log.LogOperationHelper; +import com.epmet.mq.listener.bean.log.OperatorInfo; import com.epmet.service.LogOperationService; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; @@ -51,12 +53,19 @@ public class ProjectOperationLogListener implements MessageListenerConcurrently String content = StringUtils.isBlank(msgObj.getOperationBrief()) ? "" : msgObj.getOperationBrief(); + OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getOperatorId()); + LogOperationEntity logEntity = new LogOperationEntity(); logEntity.setCategory(messageExt.getTopic()); logEntity.setType(msgObj.getOperation()); logEntity.setTypeDisplay(getOperationTypeDisplay(msgObj.getOperation())); logEntity.setTargetId(msgObj.getProjectId()); + logEntity.setIp(msgObj.getIp()); + logEntity.setFromApp(msgObj.getFromApp()); + logEntity.setFromClient(msgObj.getFromClient()); logEntity.setOperatorId(msgObj.getOperatorId()); + logEntity.setOperatorMobile(operatorInfo.getMobile()); + logEntity.setOperatorName(operatorInfo.getName()); logEntity.setOperatingTime(msgObj.getOperatingTime()); logEntity.setContent(content); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql index b55c87ecf8..c6ccb2e1e9 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.3__add_log_ope_table.sql @@ -4,8 +4,13 @@ CREATE TABLE `log_operation` ( `TYPE_DISPLAY` varchar(64) NOT NULL COMMENT '操作类型中文展示', `CONTENT` varchar(512) NOT NULL COMMENT '内容', `CATEGORY` varchar(64) NOT NULL COMMENT '操作类型大类。例如login和logout都属于login大类。项目立项,项目流转,项目结案都属于项目大类', + `IP` varchar(15) NOT NULL COMMENT 'IP地址', + `FROM_APP` varchar(10) NOT NULL COMMENT '所用的APP', + `FROM_CLIENT` varchar(10) NOT NULL COMMENT '所用的client', `TARGET_ID` varchar(64) NOT NULL COMMENT '操作目标ID', `OPERATOR_ID` varchar(64) NOT NULL COMMENT '操作人ID', + `OPERATOR_NAME` varchar(15) NOT NULL COMMENT '操作者姓名', + `OPERATOR_MOBILE` varchar(11) NOT NULL COMMENT '操作者电话', `OPERATING_TIME` datetime NOT NULL COMMENT '操作时间,该时间不是插入数据的时间,而是操作发生的真实时间', `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', `REVISION` int(11) NOT NULL COMMENT '乐观锁', diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index 1496892029..0e00d21c34 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -9,8 +9,13 @@ + + + + + diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 3926452c8d..b6881aefdd 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -32,6 +33,7 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; import com.epmet.service.ThirdLoginService; +import com.sun.deploy.association.utility.AppConstants; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.spring.core.RocketMQTemplate; @@ -40,7 +42,10 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.util.*; import java.util.stream.Collectors; @@ -183,11 +188,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //7.发送登录事件 try { - sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId()); + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { - log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。错误信息"); + log.error("【工作端workLogin登录】发送登录事件失败,程序继续执行。"); } return userTokenResultDTO; @@ -414,7 +419,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId()); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -670,11 +675,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol * @author wxz * @date 2021.06.08 15:27 */ - private void sendLoginEvent(String userId, String appId) { + private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + LoginMQMsg loginMQMsg = new LoginMQMsg(); loginMQMsg.setUserId(userId); loginMQMsg.setLoginTime(new Date()); loginMQMsg.setAppId(appId); + loginMQMsg.setIp(IpUtils.getIpAddr(request)); + loginMQMsg.setFromApp(fromApp); + loginMQMsg.setFromClient(fromClient); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(AuthOperationConstants.LOGIN); diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java index 643cd99f03..646db43501 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java @@ -17,4 +17,10 @@ public class LoginMQMsg { */ private Date loginTime; + private String ip; + + private String fromApp; + + private String fromClient; + } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java index 9530f7a326..5f33faae98 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java @@ -29,4 +29,12 @@ public class ProjectChangedMQMsg implements Serializable { */ private String operationBrief; + /** + * 操作者ip + */ + private String ip; + private String fromApp; + private String fromClient; + + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 79e1903e7d..ad3fec6959 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -31,7 +31,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; @@ -71,7 +73,10 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.util.*; import java.util.stream.Collectors; @@ -116,6 +121,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -387,14 +394,17 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectTraceS private EpmetUserFeignClient epmetUserFeignClient; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; @Override public List getPendProjectList(TokenDto tokenDto, ProjectListFromDTO fromDTO) { @@ -506,12 +513,16 @@ public class ProjectTraceServiceImpl implements ProjectTraceS } //项目实时统计消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, projectEntity.getId(), formDTO.getUserId(), new Date(), - mqMsgBrief); + mqMsgBrief, + IpUtils.getIpAddr(request), + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient()); boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); if (!msgResult) { log.error("项目实时统计消息发送失败"); From 4a5b12206156eaf5dd5ae4446f10b0841537c3cb Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 10 Jun 2021 09:29:23 +0800 Subject: [PATCH 52/52] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99impor?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index b6881aefdd..4d848f2dcf 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -22,7 +22,6 @@ import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; import com.epmet.constant.SmsTemplateConstant; -import com.epmet.constant.SystemMessageType; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -33,10 +32,8 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; import com.epmet.service.ThirdLoginService; -import com.sun.deploy.association.utility.AppConstants; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired;