Browse Source

Merge branch 'dev_grid_platform' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

master
jianjun 4 years ago
parent
commit
1ee7e59c46
  1. 12
      epmet-module/data-statistical/data-statistical-client/pom.xml
  2. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/AgencyBaseInfoFormDTO.java
  3. 103
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/GridBaseInfoDTO.java
  4. 152
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java
  5. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  6. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  7. 6
      epmet-module/data-statistical/data-statistical-server/pom.xml
  8. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java
  9. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java
  10. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java
  11. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  12. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java
  13. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  14. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java
  15. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java
  16. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java
  17. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java
  18. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  20. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  21. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml
  22. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  23. 136
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridInfoDTO.java
  24. 191
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseGridUserDTO.java
  25. 13
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java
  26. 6
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/StaffBaseInfoFormDTO.java
  27. 67
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridInfoController.java
  28. 59
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridUserController.java
  29. 41
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridInfoDao.java
  30. 41
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridUserDao.java
  31. 106
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridInfoEntity.java
  32. 161
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridUserEntity.java
  33. 19
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  34. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  35. 20
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java
  36. 44
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridInfoService.java
  37. 38
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridUserService.java
  38. 120
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java
  39. 73
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridUserServiceImpl.java
  40. 1
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java
  41. 50
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml
  42. 58
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml

12
epmet-module/data-statistical/data-statistical-client/pom.xml

@ -17,6 +17,18 @@
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>open-data-worker-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>open-data-worker-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

29
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/AgencyBaseInfoFormDTO.java

@ -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<String> agencyIdList;
public interface Agency extends CustomerClientShowGroup {}
}

103
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否成立网格党支部或网格党小组[YN]
*/
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;
}

152
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
}

10
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<List<CustomerAgencyDTO>> getAgencyBaseInfo(@RequestBody AgencyBaseInfoFormDTO formDTO);
Result<List<CustomerAgencyDTO>> getAgencyBaseInfo(@RequestBody GridBaseInfoFormDTO formDTO);
/**
* @dscription 批量查询客户网格基础信息
@ -308,7 +308,7 @@ public interface DataStatisticalOpenFeignClient {
* @author sun
*/
@PostMapping("/data/stats/datareporting/staffbaseinfo")
Result<List<CustomerStaffDTO>> getStaffBaseInfo(@RequestBody StaffBaseInfoFormDTO formDTO);
Result<List<GridUserInfoDTO>> getStaffBaseInfo(@RequestBody StaffBaseInfoFormDTO formDTO);
/**
* 根据巡查记录id 获取巡查主记录信息

10
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<List<CustomerAgencyDTO>> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) {
public Result<List<CustomerAgencyDTO>> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getAgencyBaseInfo", formDTO);
}
@ -290,7 +290,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
}
@Override
public Result<List<CustomerStaffDTO>> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
public Result<List<GridUserInfoDTO>> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getStaffBaseInfo", formDTO);
}

6
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -116,6 +116,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>open-data-worker-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

15
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<List<CustomerAgencyDTO>> getAgencyBaseInfo(@RequestBody(required = false) AgencyBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AgencyBaseInfoFormDTO.Agency.class);
public Result<List<CustomerAgencyDTO>> getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class);
return new Result<List<CustomerAgencyDTO>>().ok(dataReportingService.getAgencyBaseInfo(formDTO));
}
@ -55,11 +55,12 @@ public class DataReportingController {
* @Description 批量查询客户网格员基础信息
**/
@PostMapping("staffbaseinfo")
public Result<List<CustomerStaffDTO>> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) {
public Result<List<GridUserInfoDTO>> getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class);
return new Result<List<CustomerStaffDTO>>().ok(dataReportingService.getStaffBaseInfo(formDTO));
return new Result<List<GridUserInfoDTO>>().ok(dataReportingService.getStaffBaseInfo(formDTO));
}
/**
* desc: 条件获取巡查主表信息
*

10
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<CustomerGridEntity> {
* @Description 批量查询客户网格基础信息
**/
List<CustomerGridDTO> getGridBaseInfo(GridBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 查询工作人员所属网格信息
**/
List<GridUserInfoDTO> getStaffGrid(StaffBaseInfoFormDTO formDTO);
}

4
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<CustomerAgencyEntity> {
* @Author sun
* @Description 批量查询客户组织基础信息
**/
List<CustomerAgencyDTO> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO);
List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO);
}

2
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;

10
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<CustomerAgencyDTO> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO);
List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO);
/**
* @Author sun
@ -36,7 +36,7 @@ public interface DataReportingService {
* @Description 批量查询客户网格员基础信息
*
* @return*/
List<CustomerStaffDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO);
List<GridUserInfoDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO);
/**
* desc: 获取巡查记录列表

52
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<CustomerAgencyDTO> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) {
public List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
//批量查询客户组织信息
List<CustomerAgencyDTO> resultList = customerAgencyService.getAgencyBaseInfo(formDTO);
return resultList;
@ -63,9 +64,44 @@ public class DataReportingServiceImpl implements DataReportingService {
* @Description 批量查询客户网格员基础信息
**/
@Override
public List<CustomerStaffDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//批量查询客户网格员信息
List<CustomerStaffDTO> resultList = userService.getStaffBaseInfo(formDTO);
public List<GridUserInfoDTO> getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//1.查询工作人员所属网格信息
List<GridUserInfoDTO> resultList = customerGridService.getStaffGrid(formDTO);
//2.查询工作人员基础信息
List<CustomerStaffDTO> staffDTOList = userService.getStaffBaseInfo(formDTO);
if (CollectionUtils.isEmpty(staffDTOList)) {
return new ArrayList<>();
}
Map<String, CustomerStaffDTO> 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;
}

4
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<CustomerAgencyDTO> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO);
List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO);
}

10
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<CustomerGridEntity> {
* @Description 批量查询客户网格基础信息
**/
List<CustomerGridDTO> getGridBaseInfo(GridBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 查询工作人员所属网格信息
**/
List<GridUserInfoDTO> getStaffGrid(StaffBaseInfoFormDTO formDTO);
}

4
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<CustomerAgencyDTO> getAgencyBaseInfo(AgencyBaseInfoFormDTO formDTO) {
public List<CustomerAgencyDTO> getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
return customerAgencyDao.getAgencyBaseInfo(formDTO);
}

13
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<CustomerGridDao, Cu
return customerGridDao.getGridBaseInfo(formDTO);
}
/**
* @Author sun
* @Description 查询工作人员所属网格信息
**/
@Override
public List<GridUserInfoDTO> getStaffGrid(StaffBaseInfoFormDTO formDTO) {
return customerGridDao.getStaffGrid(formDTO);
}
}

2
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;

2
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;

32
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -128,17 +128,39 @@
<select id="getGridBaseInfo" resultType="com.epmet.dto.org.result.CustomerGridDTO">
SELECT
*
*
FROM
customer_grid
WHERE
del_flag = '0'
WHERE 1=1
<if test="orgIdList == null">
AND del_flag = '0'
</if>
AND customer_id = #{customerId}
<if test="gridIdList != null and gridIdList.size() > 0">
<foreach collection="gridIdList" item="gridId" open="AND id IN (" separator="," close=")">
<if test="orgIdList != null and orgIdList.size() > 0">
<foreach collection="orgIdList" item="gridId" open="AND id IN (" separator="," close=")">
#{gridId}
</foreach>
</if>
</select>
<select id="getStaffGrid" resultType="com.epmet.dto.user.result.GridUserInfoDTO">
SELECT
csg.customer_id customerId,
csg.grid_id gridId,
csg.user_id staffId,
cg.grid_name gridName,
cg.`code` code
FROM
customer_staff_grid csg
INNER JOIN customer_grid cg ON csg.grid_id = cg.id
WHERE
csg.del_flag = '0'
AND csg.customer_id = #{customerId}
<if test="staffIdList != null and staffIdList.size() > 0">
<foreach collection="staffIdList" item="staffId" open="AND csg.user_id IN (" separator="," close=")">
#{staffId}
</foreach>
</if>
</select>
</mapper>

10
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
<if test="orgIdList == null">
AND del_flag = '0'
</if>
AND customer_id = #{customerId}
<if test="agencyIdList != null and agencyIdList.size() > 0">
<foreach collection="agencyIdList" item="agencyId" open="AND id IN (" separator="," close=")">
<if test="orgIdList != null and orgIdList.size() > 0">
<foreach collection="orgIdList" item="agencyId" open="AND id IN (" separator="," close=")">
#{agencyId}
</foreach>
</if>

11
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}
<if test="staffIdList != null and staffIdList.size() > 0">
<foreach collection="staffIdList" item="staffId" open="AND cs.USER_ID IN (" separator="," close=")">
<foreach collection="staffIdList" item="staffId" open="AND cs.user_id IN (" separator="," close=")">
#{staffId}
</foreach>
</if>

136
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否成立网格党支部或网格党小组[YN]
*/
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;
}

191
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
/**
* 删除标识 0.未删除 1.已删除
*/
private Long delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

13
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridBaseInfoFormDTO.java → 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<String> gridIdList;
private List<String> orgIdList;
/**
* 数据类型组织:agency 网格:grid
*/
private String orgType;
/**
* 操作类型新增:add 修改删除:edit
*/
private String type;
public interface Grid extends CustomerClientShowGroup {}
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/StaffBaseInfoFormDTO.java → 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<String> staffIdList;
/**
* 操作类型新增:add 修改删除:edit
*/
private String type;
public interface Staff extends CustomerClientShowGroup {}
}

67
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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();
}
}

59
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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();
}
}

41
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridInfoEntity> {
/**
* @Author sun
* @Description 网格基础信息批量更新部分字段
**/
void updateBatch(@Param("list") List<BaseGridInfoEntity> entityList);
}

41
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridUserEntity> {
/**
* @Author sun
* @Description 网格员基础信息批量更新部分字段
**/
void updateBatch(@Param("list") List<BaseGridUserEntity> entityList);
}

106
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否成立网格党支部或网格党小组[YN]
*/
private String isPartyBranch;
/**
* 网格党组织类型[01:网格党支部; 02:网格党小组]
*/
private String partyBranchType;
/**
* 中心点质心经度
*/
private String lng;
/**
* 中心点质心纬度
*/
private String lat;
/**
* 网格颜色
*/
private String gridColor;
/**
* 空间范围
*/
private String shape;
}

161
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
/**
* 是否社区两委委员[YN]
*/
private String isCommittee;
/**
* 是否社区工作者[YN]
*/
private String isCommunityWorkers;
/**
* 是否社会工作者[YN]
*/
private String isSocialWorker;
/**
* 是否村民小组长[YN
*/
private String isVillageLeader;
/**
* 是否警务助理[YN]
*/
private String isPoliceAssistant;
/**
* 是否人民调解员[YN]
*/
private String isMediator;
}

19
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)) {

4
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);

20
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
*/

44
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridInfoEntity> {
/**
* @Author sun
* @Description 组织基础信息中介库同步
**/
void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO);
/**
* @Author sun
* @Description 网格基础信息中介库同步
**/
void getGridBaseInfo(GridBaseInfoFormDTO formDTO);
}

38
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridUserEntity> {
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO);
}

120
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridInfoDao, BaseGridInfoEntity> implements BaseGridInfoService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
/**
* @Author sun
* @Description 组织基础信息中介库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
//2.中间库新增/修改数据
List<BaseGridInfoEntity> 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<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
//2.中间库新增/修改数据
List<BaseGridInfoEntity> 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);
}
}
}

73
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<BaseGridUserDao, BaseGridUserEntity> implements BaseGridUserService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
/**
* @Author sun
* @Description 网格员信息中间库同步
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
//2.中间库新增/修改数据
List<BaseGridUserEntity> entityList = ConvertUtils.sourceToTarget(result.getData(), BaseGridUserEntity.class);
if("add".equals(formDTO.getType())){
insertBatch(entityList);
}else {
baseDao.updateBatch(entityList);
}
}
}

1
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<UserPatrolRecor
@Override
public Boolean upsertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm) {
log.info("upsertPatrolRecord param:{}",JSON.toJSONString(patrolRecordForm));
ValidatorUtils.validateEntity(patrolRecordForm);
boolean delFlag = false;
MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);

50
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridInfoDao.xml

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.BaseGridInfoDao">
<update id="updateBatch" >
UPDATE base_grid_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="grid_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.gridName'>
when org_id = #{item.orgId} then #{item.gridName}
</if>
</foreach>
</trim>
<trim prefix="del_flag =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.delFlag'>
when org_id = #{item.orgId} then #{item.delFlag}
</if>
</foreach>
</trim>
<trim prefix="updated_by =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedBy'>
when org_id = #{item.orgId} then #{item.updatedBy}
</if>
</foreach>
</trim>
<trim prefix="updated_time =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedTime'>
when org_id = #{item.orgId} then #{item.updatedTime}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
org_id = #{item.orgId}
</foreach>
</update>
</mapper>

58
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridUserDao.xml

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.opendata.dao.BaseGridUserDao">
<update id="updateBatch">
UPDATE base_grid_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="grid_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.gridName'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.gridName}
</if>
</foreach>
</trim>
<trim prefix="nick_name =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.nickName'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.nickName}
</if>
</foreach>
</trim>
<trim prefix="del_flag =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.delFlag'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.delFlag}
</if>
</foreach>
</trim>
<trim prefix="updated_by =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedBy'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedBy}
</if>
</foreach>
</trim>
<trim prefix="updated_time =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.updatedTime'>
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedTime}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
(grid_id = #{item.gridId} AND staff_id = #{item.staffId} )
</foreach>
</update>
</mapper>
Loading…
Cancel
Save