diff --git a/epmet-module/data-statistical/data-statistical-client/pom.xml b/epmet-module/data-statistical/data-statistical-client/pom.xml index 1e128a8adf..34fae622ba 100644 --- a/epmet-module/data-statistical/data-statistical-client/pom.xml +++ b/epmet-module/data-statistical/data-statistical-client/pom.xml @@ -17,6 +17,18 @@ epmet-commons-tools 2.0.0 + + com.epmet + open-data-worker-client + 2.0.0 + compile + + + com.epmet + open-data-worker-client + 2.0.0 + compile + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/AgencyBaseInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/AgencyBaseInfoFormDTO.java deleted file mode 100644 index c3e98287ad..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/AgencyBaseInfoFormDTO.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.epmet.dto.org; - -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import java.io.Serializable; -import java.util.List; - -/** - * @dscription 插叙客户网格基础信息--接口入参 - * @author sun - */ -@Data -public class AgencyBaseInfoFormDTO implements Serializable { - - private static final long serialVersionUID = -3634745091993094743L; - /** - * 客户Id - */ - @NotBlank(message = "事件标识不能为空", groups = {Agency.class}) - private String customerId = ""; - /** - * 组织Id - */ - private List agencyIdList; - public interface Agency extends CustomerClientShowGroup {} - -} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java new file mode 100644 index 0000000000..5da47611a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java @@ -0,0 +1,103 @@ +/** + * 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.org.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 网格员基础信息表 + */ +@Data +public class GridBaseInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId; + /** + * 工作人员Id + */ + private String staffId; + /** + * 客户Id + */ + private String customerId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String GRID_LEVEL; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String GRID_TYPE; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String POPULATION_SIZE; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String IS_PARTY_BRANCH; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String PARTY_BRANCH_TYPE; + + /** + * 中心点(质心)经度 + */ + private String LNG; + + /** + * 中心点(质心)纬度 + */ + private String LAT; + + /** + * 网格颜色 + */ + private Date GRID_COLOR; + + /** + * 空间范围 + */ + private String SHAPE; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java new file mode 100644 index 0000000000..6978b50bf9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java @@ -0,0 +1,152 @@ +/** + * 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.user.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 网格员基础信息表 + */ +@Data +public class GridUserInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId; + /** + * 工作人员Id + */ + private String staffId; + /** + * 客户Id + */ + private String customerId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String cardNum; + + /** + * 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] + */ + private String userType; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 性别[1:男性; 2:女性; 9:未说明的性别] + */ + private String sex; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 2cf227e5a0..e91c56ad39 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -9,18 +9,18 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -294,7 +294,7 @@ public interface DataStatisticalOpenFeignClient { * @author sun */ @PostMapping("/data/stats/datareporting/agencybaseinfo") - Result> getAgencyBaseInfo(@RequestBody AgencyBaseInfoFormDTO formDTO); + Result> getAgencyBaseInfo(@RequestBody GridBaseInfoFormDTO formDTO); /** * @dscription 批量查询客户网格基础信息 @@ -308,7 +308,7 @@ public interface DataStatisticalOpenFeignClient { * @author sun */ @PostMapping("/data/stats/datareporting/staffbaseinfo") - Result> getStaffBaseInfo(@RequestBody StaffBaseInfoFormDTO formDTO); + Result> getStaffBaseInfo(@RequestBody StaffBaseInfoFormDTO formDTO); /** * 根据巡查记录id 获取巡查主记录信息 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 069de2e0ad..fd66b4a73f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -10,18 +10,18 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import java.util.List; @@ -280,7 +280,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp } @Override - public Result> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) { + public Result> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getAgencyBaseInfo", formDTO); } @@ -290,7 +290,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp } @Override - public Result> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + public Result> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getStaffBaseInfo", formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 714dfa2c01..4e19d8988d 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -116,6 +116,12 @@ 2.0.0 compile + + com.epmet + open-data-worker-client + 2.0.0 + compile + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java index 8314f6e390..23ad509167 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java @@ -2,15 +2,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.DataReportingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -35,8 +35,8 @@ public class DataReportingController { * @Description 批量查询客户组织基础信息 **/ @PostMapping("agencybaseinfo") - public Result> getAgencyBaseInfo(@RequestBody(required = false) AgencyBaseInfoFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, AgencyBaseInfoFormDTO.Agency.class); + public Result> getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); return new Result>().ok(dataReportingService.getAgencyBaseInfo(formDTO)); } @@ -55,11 +55,12 @@ public class DataReportingController { * @Description 批量查询客户网格员基础信息 **/ @PostMapping("staffbaseinfo") - public Result> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { + public Result> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); - return new Result>().ok(dataReportingService.getStaffBaseInfo(formDTO)); + return new Result>().ok(dataReportingService.getStaffBaseInfo(formDTO)); } + /** * desc: 条件获取巡查主表信息 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 57f5119ad5..84743c5a76 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -22,10 +22,12 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,4 +105,10 @@ public interface CustomerGridDao extends BaseDao { * @Description 批量查询客户网格基础信息 **/ List getGridBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询工作人员所属网格信息 + **/ + List getStaffGrid(StaffBaseInfoFormDTO formDTO); } \ No newline at end of file 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 f03cfc9cf4..d091e81711 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 @@ -2,11 +2,11 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubTreeDto; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -78,5 +78,5 @@ public interface StatsCustomerAgencyDao extends BaseDao { * @Author sun * @Description 批量查询客户组织基础信息 **/ - List getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO); + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); } 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 5f2d700755..fabf82d123 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 @@ -5,10 +5,10 @@ import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java index 3164c5fc35..d1f051f8c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java @@ -1,14 +1,14 @@ package com.epmet.service; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import java.util.List; @@ -22,7 +22,7 @@ public interface DataReportingService { * @Description 批量查询客户组织基础信息 * * @return*/ - List getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO); + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); /** * @Author sun @@ -36,7 +36,7 @@ public interface DataReportingService { * @Description 批量查询客户网格员基础信息 * * @return*/ - List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); /** * desc: 获取巡查记录列表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index f3d1215173..6e2396199d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -1,14 +1,14 @@ package com.epmet.service.impl; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.DataReportingService; import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; @@ -17,8 +17,9 @@ import com.epmet.service.user.UserService; 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.List; +import java.util.*; /** * @dscription 省网格化平台数据上报--数据查询 @@ -41,7 +42,7 @@ public class DataReportingServiceImpl implements DataReportingService { * @Description 批量查询客户组织基础信息 **/ @Override - public List getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) { + public List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { //批量查询客户组织信息 List resultList = customerAgencyService.getAgencyBaseInfo(formDTO); return resultList; @@ -63,9 +64,44 @@ public class DataReportingServiceImpl implements DataReportingService { * @Description 批量查询客户网格员基础信息 **/ @Override - public List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { - //批量查询客户网格员信息 - List resultList = userService.getStaffBaseInfo(formDTO); + public List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + //1.查询工作人员所属网格信息 + List resultList = customerGridService.getStaffGrid(formDTO); + + //2.查询工作人员基础信息 + List staffDTOList = userService.getStaffBaseInfo(formDTO); + if (CollectionUtils.isEmpty(staffDTOList)) { + return new ArrayList<>(); + } + Map staffMap = new HashMap<>(); + staffDTOList.forEach(staff -> staffMap.put(staff.getUserId(), staff)); + + //3.封装数据 + resultList.forEach(st -> { + if (staffMap.containsKey(st.getStaffId())) { + CustomerStaffDTO dto = staffMap.get(st.getStaffId()); + st.setNickName(dto.getRealName()); + st.setCardNum("01"); + st.setUserType(dto.getWorkType().equals("fulltime") ? "01" : "02"); + st.setPhonenumber(dto.getMobile()); + st.setSex(0 == dto.getGender() ? "9" : dto.getGender().toString()); + st.setNation("01"); + st.setPaerty("13"); + st.setBirthday(new Date()); + st.setEducation("20"); + st.setEntryDate(new Date()); + st.setIsLeave("N"); + //st.setLeaveDate(); + st.setIncome("05"); + st.setIsCommittee("Y"); + st.setIsCommunityWorkers("Y"); + st.setIsSocialWorker("Y"); + st.setIsVillageLeader("Y"); + st.setIsPoliceAssistant("N"); + st.setIsMediator("Y"); + } + }); + return resultList; } 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 31f60edb4f..00e573797a 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,10 +1,10 @@ package com.epmet.service.org; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import java.util.Date; import java.util.List; @@ -65,5 +65,5 @@ public interface CustomerAgencyService { * @Author sun * @Description 批量查询客户组织基础信息 **/ - List getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO); + List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 7078cc19da..a0d6fb449d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -5,10 +5,12 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import java.util.Date; import java.util.List; @@ -84,4 +86,10 @@ public interface CustomerGridService extends BaseService { * @Description 批量查询客户网格基础信息 **/ List getGridBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 查询工作人员所属网格信息 + **/ + List getStaffGrid(StaffBaseInfoFormDTO formDTO); } 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 575254ce1d..1e2ac5cdb7 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 @@ -5,7 +5,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; -import com.epmet.dto.org.AgencyBaseInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.dto.org.result.OrgStaffDTO; @@ -13,6 +12,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.org.CustomerAgencyService; @@ -279,7 +279,7 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { * @Description 批量查询客户组织基础信息 **/ @Override - public List getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) { + public List getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { return customerAgencyDao.getAgencyBaseInfo(formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 1c9d26f03f..5c3b0cedc0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -9,10 +9,12 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.dto.org.CustomerStaffGridDTO; -import com.epmet.dto.org.GridBaseInfoFormDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.Issue.IssueService; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -126,4 +128,13 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getStaffGrid(StaffBaseInfoFormDTO formDTO) { + return customerGridDao.getStaffGrid(formDTO); + } + } 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 729623f10e..cf98bb6c18 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 @@ -7,10 +7,10 @@ import com.epmet.dto.org.result.OrgStaffDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.util.DimIdGenerator; import java.util.Date; 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 cabe064d84..f6dc980302 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 @@ -17,10 +17,10 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; -import com.epmet.dto.user.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 52264cd938..5d637d31de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -128,17 +128,39 @@ + + \ No newline at end of file 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 68cab60dd6..e1e4d79131 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 @@ -209,11 +209,13 @@ * FROM customer_agency - WHERE - del_flag = '0' + WHERE 1=1 + + AND del_flag = '0' + AND customer_id = #{customerId} - - + + #{agencyId} 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 b2cb63b899..6778c0305c 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 @@ -996,17 +996,10 @@ cs.* FROM customer_staff cs - INNER JOIN staff_role sr ON cs.user_id = sr.staff_id - INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id - WHERE - cs.del_flag = '0' - AND cs.enable_flag = 'enable' - AND sr.del_flag = '0' - AND gsr.del_flag = '0' - AND gsr.role_name = '网格员' + WHERE 1=1 AND cs.customer_id = #{customerId} - + #{staffId} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java new file mode 100644 index 0000000000..2b105cfe85 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java @@ -0,0 +1,136 @@ +/** + * 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.opendata.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +public class BaseGridInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织/网格Id + */ + private String orgId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格层级[07:网格] + */ + private String gridLevel; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String gridType; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String populationSize; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String isPartyBranch; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String partyBranchType; + + /** + * 中心点(质心)经度 + */ + private String lng; + + /** + * 中心点(质心)纬度 + */ + private String lat; + + /** + * 网格颜色 + */ + private String gridColor; + + /** + * 空间范围 + */ + private String shape; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Long 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/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java new file mode 100644 index 0000000000..fb5218cdf8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java @@ -0,0 +1,191 @@ +/** + * 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.opendata.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Data +public class BaseGridUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 人员Id + */ + private String staffId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String cardNum; + + /** + * 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] + */ + private String userType; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 性别[1:男性; 2:女性; 9:未说明的性别] + */ + private String sex; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Long 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-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridBaseInfoFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java similarity index 71% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridBaseInfoFormDTO.java rename to epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java index 7aaaa77078..c14d4ee570 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridBaseInfoFormDTO.java +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.org; +package com.epmet.opendata.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; @@ -23,7 +23,16 @@ public class GridBaseInfoFormDTO implements Serializable { /** * 网格Id */ - private List gridIdList; + private List orgIdList; + /** + * 数据类型【组织:agency 网格:grid】 + */ + private String orgType; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; + public interface Grid extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/StaffBaseInfoFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java similarity index 84% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/StaffBaseInfoFormDTO.java rename to epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java index fca748f654..d486c7f67a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/StaffBaseInfoFormDTO.java +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.user; +package com.epmet.opendata.dto.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; @@ -24,6 +24,10 @@ public class StaffBaseInfoFormDTO implements Serializable { * 人员Id */ private List staffIdList; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; public interface Staff extends CustomerClientShowGroup {} } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java new file mode 100644 index 0000000000..531ecc8cde --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java @@ -0,0 +1,67 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridInfoService; +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; + + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@RestController +@RequestMapping("basegridinfo") +public class BaseGridInfoController { + + @Autowired + private BaseGridInfoService baseGridInfoService; + + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + @PostMapping("agencybaseinfo") + public Result getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + baseGridInfoService.getAgencyBaseInfo(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + @PostMapping("gridbaseinfo") + public Result getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); + baseGridInfoService.getGridBaseInfo(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java new file mode 100644 index 0000000000..dcf3146724 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java @@ -0,0 +1,59 @@ +/** + * 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.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridUserService; +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 generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@RestController +@RequestMapping("basegriduser") +public class BaseGridUserController { + + @Autowired + private BaseGridUserService baseGridUserService; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @PostMapping("staffbaseinfo") + public Result getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); + baseGridUserService.getStaffBaseInfo(formDTO); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java new file mode 100644 index 0000000000..40c5649d1b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.BaseGridInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Mapper +public interface BaseGridInfoDao extends BaseDao { + + /** + * @Author sun + * @Description 网格基础信息批量更新部分字段 + **/ + void updateBatch(@Param("list") List entityList); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java new file mode 100644 index 0000000000..c53eb48e1f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.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.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.BaseGridUserEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Mapper +public interface BaseGridUserDao extends BaseDao { + + /** + * @Author sun + * @Description 网格员基础信息批量更新部分字段 + **/ + void updateBatch(@Param("list") List entityList); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java new file mode 100644 index 0000000000..f74e8b2205 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java @@ -0,0 +1,106 @@ +/** + * 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.opendata.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-10-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_grid_info") +public class BaseGridInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织/网格Id + */ + private String orgId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格层级[07:网格] + */ + private String gridLevel; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String gridType; + + /** + * 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] + */ + private String populationSize; + + /** + * 是否成立网格党支部或网格党小组[Y:是、N:否] + */ + private String isPartyBranch; + + /** + * 网格党组织类型[01:网格党支部; 02:网格党小组] + */ + private String partyBranchType; + + /** + * 中心点(质心)经度 + */ + private String lng; + + /** + * 中心点(质心)纬度 + */ + private String lat; + + /** + * 网格颜色 + */ + private String gridColor; + + /** + * 空间范围 + */ + private String shape; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java new file mode 100644 index 0000000000..5d0b2f1de6 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java @@ -0,0 +1,161 @@ +/** + * 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.opendata.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-10-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("base_grid_user") +public class BaseGridUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 人员Id + */ + private String staffId; + + /** + * 网格编码 + */ + private String code; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; + */ + private String cardNum; + + /** + * 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] + */ + private String userType; + + /** + * 手机号码 + */ + private String phonenumber; + + /** + * 性别[1:男性; 2:女性; 9:未说明的性别] + */ + private String sex; + + /** + * 民族[字典表主键] + */ + private String nation; + + /** + * 政治面貌[字典表主键] + */ + private String paerty; + + /** + * 出生日期[YYYY-MM-DD] + */ + private Date birthday; + + /** + * 学历[字典表主键] + */ + private String education; + + /** + * 入职时间 + */ + private Date entryDate; + + /** + * 是否离职 + */ + private String isLeave; + + /** + * 离职时间 + */ + private Date leaveDate; + + /** + * 网格员年收入 + */ + private String income; + + /** + * 是否社区(村)两委委员[Y:是、N:否] + */ + private String isCommittee; + + /** + * 是否社区工作者[Y:是、N:否] + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者[Y:是、N:否] + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长[Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理[Y:是、N:否] + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员[Y:是、N:否] + */ + private String isMediator; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java index 0f9192f281..5a13adb637 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java @@ -1,5 +1,6 @@ package com.epmet.opendata.mq.listener; +import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -7,6 +8,8 @@ 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.utils.SpringContextUtils; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridInfoService; import org.apache.commons.lang.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -17,6 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; +import java.util.concurrent.TimeUnit; /** * @Description 系统对接中间库,组织信息变更监听器 @@ -54,13 +58,20 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.PENDING_MSG_LABEL); logger.info("【开放数据事件监听器】-组织信息变更-收到消息内容:{},操作:{}", msg, tags); + GridBaseInfoFormDTO obj = JSON.parseObject(msg, GridBaseInfoFormDTO.class); DistributedLock distributedLock = null; RLock lock = null; try { - //distributedLock = SpringContextUtils.getBean(DistributedLock.class); - //lock = distributedLock.getLock(String.format("lock:open_data_org:%s", orgId), - // 30L, 30L, TimeUnit.SECONDS); + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgIdList()), + 30L, 30L, TimeUnit.SECONDS); + + if ("agency".equals(obj.getOrgType())) { + SpringContextUtils.getBean(BaseGridInfoService.class).getAgencyBaseInfo(obj); + } else { + SpringContextUtils.getBean(BaseGridInfoService.class).getGridBaseInfo(obj); + } } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e))); @@ -69,7 +80,7 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e))); throw e; } finally { - //distributedLock.unLock(lock); + distributedLock.unLock(lock); } if (StringUtils.isNotBlank(pendingMsgLabel)) { diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java index 99d35daac1..a9797b34d8 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java @@ -80,10 +80,10 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr Boolean aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).upsertPatrolRecord(patrolRecordForm); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 - logger.error("【开放数据事件监听器】-巡查记录信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e))); } catch (Exception e) { // 不是我们自己抛出的异常,可以让MQ重试 - logger.error("【开放数据事件监听器】-巡查记录信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e))); throw e; } finally { distributedLock.unLock(lock); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java index a6e853ba0f..270c7ff3e3 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java @@ -1,6 +1,7 @@ package com.epmet.opendata.mq.listener; import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -8,6 +9,8 @@ import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.service.BaseGridUserService; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -18,12 +21,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; +import java.util.concurrent.TimeUnit; /** - * @Description 系统对接中间库,工作人员信息变更监听器 * @author wxz + * @Description 系统对接中间库,工作人员信息变更监听器 * @date 2021.10.13 15:21:48 -*/ + */ public class OpenDataStaffChangeEventListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); @@ -59,14 +63,15 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre //messageExt.propert logger.info("【开放数据事件监听器】-工作人员信息变更-收到消息内容:{}, 操作:{}, pendingMsgLabel:{}", msg, tags, pendingMsgLabel); + StaffBaseInfoFormDTO obj = JSON.parseObject(msg, StaffBaseInfoFormDTO.class); DistributedLock distributedLock = null; RLock lock = null; try { - //distributedLock = SpringContextUtils.getBean(DistributedLock.class); - //lock = distributedLock.getLock(String.format("lock:open_data_staff:%s", staffId), - // 30L, 30L, TimeUnit.SECONDS); - + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:open_data_staff:%s", obj.getStaffIdList()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(BaseGridUserService.class).getStaffBaseInfo(obj); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); @@ -75,7 +80,7 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); throw e; } finally { - //distributedLock.unLock(lock); + distributedLock.unLock(lock); } if (StringUtils.isNotBlank(pendingMsgLabel)) { @@ -92,6 +97,7 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre * * @param pendingMsgLabel * @return + * @description 应答mq消息 * @author wxz * @date 2021.10.14 16:32:32 */ diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java new file mode 100644 index 0000000000..f0fe03c28a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java @@ -0,0 +1,44 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +public interface BaseGridInfoService extends BaseService { + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + void getGridBaseInfo(GridBaseInfoFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java new file mode 100644 index 0000000000..2cdda5d9c5 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java @@ -0,0 +1,38 @@ +/** + * 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.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridUserEntity; + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +public interface BaseGridUserService extends BaseService { + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java new file mode 100644 index 0000000000..a1b93cf4ed --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java @@ -0,0 +1,120 @@ +/** + * 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.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.BaseGridInfoDao; +import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; +import com.epmet.opendata.service.BaseGridInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 网格基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Service +public class BaseGridInfoServiceImpl extends BaseServiceImpl implements BaseGridInfoService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + /** + * @Author sun + * @Description 组织基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { + //1.查询网格基础信息 + Result> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + //2.中间库新增/修改数据 + List entityList = new ArrayList<>(); + result.getData().forEach(ag->{ + BaseGridInfoEntity entity = new BaseGridInfoEntity(); + entity.setCustomerId(ag.getCustomerId()); + entity.setOrgId(ag.getId()); + entity.setCode(""); + entity.setGridName(ag.getOrganizationName()); + String level = "06"; + if("province".equals(ag.getLevel())){ level = "01"; } + else if("city".equals(ag.getLevel())){ level = "02"; } + else if("district".equals(ag.getLevel())){ level = "03"; } + else if("street".equals(ag.getLevel())){ level = "04"; } + entity.setGridLevel(level); + entity.setGridType("01"); + entityList.add(entity); + }); + if("add".equals(formDTO.getType())){ + insertBatch(entityList); + }else { + baseDao.updateBatch(entityList); + } + + } + + /** + * @Author sun + * @Description 网格基础信息中介库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getGridBaseInfo(GridBaseInfoFormDTO formDTO) { + //1.查询网格基础信息 + Result> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + //2.中间库新增/修改数据 + List entityList = new ArrayList<>(); + result.getData().forEach(ag->{ + BaseGridInfoEntity entity = new BaseGridInfoEntity(); + entity.setCustomerId(ag.getCustomerId()); + entity.setOrgId(ag.getId()); + entity.setCode(""); + entity.setGridName(ag.getGridName()); + entity.setGridLevel("07"); + entity.setGridType("01"); + entity.setDelFlag(ag.getDelFlag().toString()); + entity.setUpdatedBy(ag.getUpdatedBy()); + entity.setUpdatedTime(ag.getUpdatedTime()); + entityList.add(entity); + }); + if("add".equals(formDTO.getType())){ + insertBatch(entityList); + }else { + baseDao.updateBatch(entityList); + } + + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java new file mode 100644 index 0000000000..c323a8e2c4 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java @@ -0,0 +1,73 @@ +/** + * 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.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.BaseGridUserDao; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.BaseGridInfoEntity; +import com.epmet.opendata.entity.BaseGridUserEntity; +import com.epmet.opendata.service.BaseGridUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 网格员基础信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-15 + */ +@Service +public class BaseGridUserServiceImpl extends BaseServiceImpl implements BaseGridUserService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + //1.查询网格基础信息 + Result> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + //2.中间库新增/修改数据 + List entityList = ConvertUtils.sourceToTarget(result.getData(), BaseGridUserEntity.class); + if("add".equals(formDTO.getType())){ + insertBatch(entityList); + }else { + baseDao.updateBatch(entityList); + } + + } + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java index ad2d5f04f7..35d626e2eb 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java @@ -60,6 +60,7 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl + + + + + + UPDATE base_grid_info + + + + + + when org_id = #{item.orgId} then #{item.gridName} + + + + + + + + when org_id = #{item.orgId} then #{item.delFlag} + + + + + + + + when org_id = #{item.orgId} then #{item.updatedBy} + + + + + + + + when org_id = #{item.orgId} then #{item.updatedTime} + + + + + + WHERE + 1=1 + + org_id = #{item.orgId} + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml new file mode 100644 index 0000000000..f5a47aea3a --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml @@ -0,0 +1,58 @@ + + + + + + + UPDATE base_grid_user + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.gridName} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.nickName} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.delFlag} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedBy} + + + + + + + + when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedTime} + + + + + + WHERE + 1=1 + + (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) + + + + \ No newline at end of file