Browse Source

Merge branch 'dev_grid_patrol' into dev_temp

# Conflicts:
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
#	epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
master
zxc 4 years ago
parent
commit
0445ece155
  1. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java
  2. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java
  3. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java
  4. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java
  5. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  6. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java
  7. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java
  8. 23
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java
  9. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  10. 44
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java
  11. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java
  12. 131
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java
  13. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  14. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml
  15. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml
  16. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  17. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  18. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java
  19. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  20. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  21. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  22. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java
  23. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java
  24. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  25. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  26. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  27. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java
  28. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  29. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  30. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
  31. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
  32. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  33. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  34. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
  35. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolTrackFormDTO.java
  36. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RecordListFormDTO.java
  37. 65
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java
  38. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java
  39. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolTrackResultDTO.java
  40. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RecordListResultDTO.java
  41. 33
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java
  42. 19
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java
  43. 36
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  44. 21
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  45. 68
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java
  46. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  47. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  48. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java
  49. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java
  50. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  51. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java
  52. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  53. 90
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java
  54. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  55. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
  56. 34
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml
  57. 53
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml
  58. 14
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java

@ -20,6 +20,8 @@ public class GridManagerListFormDTO implements Serializable {
@NotBlank(message = "组织ID不能为空",groups = GridManagerListForm.class)
private String agencyId;
@NotBlank(message = "行政区域编码不能为空",groups = GridManagerListForm.class)
/**
* 行政区域编码 平阴传
*/
private String areaCode;
}

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.user.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -49,4 +50,27 @@ public class GridManagerListResultDTO implements Serializable {
*/
private String staffName;
/**
* 中心点位
*/
@JsonIgnore
private String centerMark;
/**
* 经纬度赋值状态
*/
@JsonIgnore
private Boolean llStatus;
public GridManagerListResultDTO() {
this.staffId = "";
this.longitude = "";
this.latitude = "";
this.gridId = "";
this.status = "";
this.gridName = "";
this.staffName = "";
this.centerMark = "";
this.llStatus = false;
}
}

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/PatrolConstant.java

@ -0,0 +1,20 @@
package com.epmet.datareport.constant;
/**
* @Author zxc
* @DateTime 2021/6/9 1:49 下午
* @DESC
*/
public interface PatrolConstant {
/**
* 经度
*/
String LONGITUDE = "longitude";
/**
* 纬度
*/
String LATITUDE = "latitude";
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java

@ -4,11 +4,11 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.user.StaffPatrolDetailService;
import com.epmet.user.form.GridManagerListFormDTO;
import com.epmet.user.form.PatrolTrackFormDTO;
import com.epmet.user.form.RecordListFormDTO;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.user.result.PatrolTrackResultDTO;
import com.epmet.user.result.RecordListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.dto.result.plugins.DeptNodeDTO;
import com.epmet.dto.result.plugins.GridNodeDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.user.result.GridManagerListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -161,4 +162,12 @@ public interface ScreenCustomerAgencyDao {
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<String> selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
/**
* @Description 根据agencyId查询网格
* @Param agencyId
* @author zxc
* @date 2021/6/8 1:27 下午
*/
List<GridManagerListResultDTO> selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode);
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java

@ -19,7 +19,7 @@ package com.epmet.datareport.dao.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.user.StaffPatrolDetailEntity;
import com.epmet.user.result.PatrolTrackResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java

@ -19,9 +19,11 @@ package com.epmet.datareport.dao.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.user.StaffPatrolRecordEntity;
import com.epmet.user.form.RecordListFormDTO;
import com.epmet.user.result.RecordListResultDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -41,5 +43,13 @@ public interface StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> {
* @date 2021/6/7 5:29 下午
*/
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO);
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:24 上午
*/
List<GridManagerListResultDTO> selectLL(@Param("userIds")List<String> userIds);
}

23
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenOrgService.java

@ -0,0 +1,23 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.user.result.GridManagerListResultDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/6/8 10:45 上午
* @DESC
*/
public interface ScreenOrgService {
/**
* @Description 查询组织下的所有网格
* @Param agencyId
* @Param areaCode
* @author zxc
* @date 2021/6/8 10:46 上午
*/
List<GridManagerListResultDTO> selectAllGrid(String agencyId,String areaCode);
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java

@ -164,7 +164,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
BranchBuildTrendResultDTO result = new BranchBuildTrendResultDTO();
//生成近十二个月的横坐标数组
Map<String,String> monthMap = dateUtils.getXpro();
result.setXAxis(monthMap.values().stream().collect(Collectors.toList()));
result.setXAxis(new ArrayList<>(monthMap.values()));
List<BranchTrendSeriesDataResultDTO> dataArray = new LinkedList<>();
List<BranchIssueDataResultDTO> yearlyDataList =

44
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenOrgServiceImpl.java

@ -0,0 +1,44 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService;
import com.epmet.user.result.GridManagerListResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/6/8 10:45 上午
* @DESC
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenOrgServiceImpl implements ScreenOrgService {
@Autowired
private ScreenCustomerAgencyDao agencyDao;
/**
* @Description 查询组织下的所有网格
* @Param agencyId
* @Param areaCode
* @author zxc
* @date 2021/6/8 10:46 上午
*/
@Override
public List<GridManagerListResultDTO> selectAllGrid(String agencyId,String areaCode) {
List<GridManagerListResultDTO> result = agencyDao.selectGrid(agencyId, areaCode);
if (!CollectionUtils.isEmpty(result)){
return result;
}
return new ArrayList<>();
}
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java

@ -1,13 +1,11 @@
package com.epmet.datareport.service.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.datareport.entity.user.StaffPatrolDetailEntity;
import com.epmet.user.form.GridManagerListFormDTO;
import com.epmet.user.form.PatrolTrackFormDTO;
import com.epmet.user.form.RecordListFormDTO;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.user.result.PatrolTrackResultDTO;
import com.epmet.user.result.RecordListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import java.util.List;

131
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java

@ -1,21 +1,33 @@
package com.epmet.datareport.service.user.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.constant.PatrolConstant;
import com.epmet.datareport.dao.user.StaffPatrolDetailDao;
import com.epmet.datareport.dao.user.StaffPatrolRecordDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenOrgService;
import com.epmet.datareport.service.user.StaffPatrolDetailService;
import com.epmet.dto.result.GridStaffResultDTO;
import com.epmet.dto.result.UserNameAndLLResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.user.form.GridManagerListFormDTO;
import com.epmet.user.form.PatrolTrackFormDTO;
import com.epmet.user.form.RecordListFormDTO;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.user.result.GridManagerListResultDTO;
import com.epmet.user.result.PatrolTrackResultDTO;
import com.epmet.user.result.RecordListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 工作人员巡查记录明细
@ -33,16 +45,111 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
@Autowired
private StaffPatrolRecordDao staffPatrolRecordDao;
@Autowired
private ScreenOrgService screenOrgService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* @Description 001网格员分布
* 1.根据agencyId或者areaCode查询出网格
* 2.根据查出来的网格ID去查网格下边的人人只要网格员
* 3.根据userId查询巡查记录表
* 4.数据补全
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:06 下午
*/
@Override
public List<GridManagerListResultDTO> gridManagerList(GridManagerListFormDTO formDTO) {
List<GridManagerListResultDTO> grids = new ArrayList<>();
if (StringUtils.isEmpty(formDTO.getAreaCode())){
// 根据agencyId查询网格
grids = screenOrgService.selectAllGrid(formDTO.getAgencyId(), null);
}else {
// 根据areaCode查询网格
grids = screenOrgService.selectAllGrid(null, formDTO.getAreaCode());
}
if (CollectionUtils.isEmpty(grids)){
return new ArrayList<>();
}
List<String> gridIds = grids.stream().map(m -> m.getGridId()).collect(Collectors.toList());
// 查询网格下的网格员
Result<List<GridStaffResultDTO>> resultData = govOrgOpenFeignClient.selectGridStaffByGridIds(gridIds);
if(!resultData.success()){
throw new RenException("查询网格下的网格员失败【"+resultData.getMsg()+"】");
}
List<GridStaffResultDTO> data = resultData.getData();
if (CollectionUtils.isEmpty(data)){
return new ArrayList<>();
}
List<GridManagerListResultDTO> result = ConvertUtils.sourceToTarget(data, GridManagerListResultDTO.class);
// 查询经纬度
Result<UserNameAndLLResultDTO> selectll = epmetUserOpenFeignClient.selectll(result.stream().map(m -> m.getStaffId()).collect(Collectors.toList()));
if (!selectll.success()){
throw new RenException("查询经纬度和姓名失败【"+selectll.getMsg()+"】");
}
UserNameAndLLResultDTO llAndNameData = selectll.getData();
List<GridManagerListResultDTO> finalGrids = grids;
result.forEach(r -> {
// 经纬度赋值 巡查状态赋值
if (!CollectionUtils.isEmpty(llAndNameData.getLl())) {
llAndNameData.getLl().forEach(l -> {
if (r.getStaffId().equals(l.getStaffId()) && r.getGridId().equals(l.getGridId())) {
r.setLatitude(l.getLatitude());
r.setLongitude(l.getLongitude());
r.setStatus(l.getStatus());
r.setLlStatus(true);
}
});
}
// 姓名赋值
if (!CollectionUtils.isEmpty(llAndNameData.getUserNames())){
llAndNameData.getUserNames().forEach(n -> {
if (r.getStaffId().equals(n.getUserId())){
r.setStaffName(n.getUserName());
}
});
}
finalGrids.forEach(g -> {
if (r.getGridId().equals(g.getGridId())){
r.setGridName(g.getGridName());
}
});
});
result.forEach(r -> {
if (!r.getLlStatus()){
finalGrids.forEach(g -> {
if (StringUtils.isNotBlank(g.getCenterMark())){
r.setLongitude(getLL(g.getCenterMark(),PatrolConstant.LONGITUDE));
r.setLatitude(getLL(g.getCenterMark(),PatrolConstant.LATITUDE));
}
});
}
});
return result;
}
return null;
/**
* @Description 根据中心点位截取经纬度
* @Param centMark
* @Param ll
* @author zxc
* @date 2021/6/9 2:08 下午
*/
public String getLL(String centMark,String ll){
if (ll.equals(PatrolConstant.LONGITUDE)){
String longitude = centMark.substring(NumConstant.TWO, centMark.indexOf(","));
return longitude;
}else {
String s = centMark.substring(NumConstant.ZERO, centMark.indexOf(","));
String latitude = centMark.substring(s.length() + NumConstant.ONE, centMark.length() - NumConstant.TWO);
return latitude;
}
}
/**
@ -53,7 +160,11 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
*/
@Override
public List<RecordListResultDTO> recordList(RecordListFormDTO formDTO) {
List<RecordListResultDTO> result = staffPatrolRecordDao.recordList(formDTO);
Result<List<RecordListResultDTO>> listResult = epmetUserOpenFeignClient.recordList(formDTO);
if (!listResult.success()){
throw new RenException("查询巡查记录失败【"+listResult.getMsg()+"】");
}
List<RecordListResultDTO> result = listResult.getData();
if (!CollectionUtils.isEmpty(result)){
return result;
}
@ -68,10 +179,16 @@ public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService {
*/
@Override
public List<PatrolTrackResultDTO> patrolTrack(PatrolTrackFormDTO formDTO) {
List<PatrolTrackResultDTO> results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId());
Result<List<PatrolTrackResultDTO>> result = epmetUserOpenFeignClient.patrolTrack(formDTO);
if (!result.success()){
throw new RenException("查询 巡查轨迹失败【"+result.getMsg()+"】");
}
List<PatrolTrackResultDTO> results = result.getData();
if (!CollectionUtils.isEmpty(results)){
return results;
}
return new ArrayList<>();
}
}

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -320,4 +320,24 @@
</otherwise>
</choose>
</select>
<!-- 根据agencyId查询网格 -->
<select id="selectGrid" resultType="com.epmet.user.result.GridManagerListResultDTO">
SELECT
CONCAT(IF(ISNULL(ca2.AGENCY_NAME),'',CONCAT(ca2.AGENCY_NAME,'-')),
IF(ISNULL(ca.AGENCY_NAME),'',CONCAT(ca.AGENCY_NAME,'-')),
IF(ISNULL(cg.GRID_NAME),'',cg.GRID_NAME)) AS gridName,
cg.GRID_ID,
IFNULL(cg.CENTER_MARK,'') AS centerMark
FROM epmet_evaluation_index.screen_customer_grid cg
LEFT JOIN epmet_evaluation_index.screen_customer_agency ca ON ca.AGENCY_ID = cg.PARENT_AGENCY_ID AND ca.DEL_FLAG = 0
LEFT JOIN epmet_evaluation_index.screen_customer_agency ca2 ON ca2.AGENCY_ID = ca.PID AND ca2.DEL_FLAG = 0
WHERE cg.DEL_FLAG = 0
<if test="agencyId == null">
AND cg.AREA_CODE LIKE CONCAT(#{areaCode},'%')
</if>
<if test="areaCode == null">
AND cg.PARENT_AGENCY_ID = #{agencyId}
</if>
</select>
</mapper>

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.datareport.dao.user.StaffPatrolDetailDao">
<!-- 查询巡查轨迹 -->
<select id="selectPatrolTrack" resultType="com.epmet.user.result.PatrolTrackResultDTO">
<select id="selectPatrolTrack" resultType="com.epmet.dto.result.PatrolTrackResultDTO">
SELECT
LATITUDE,
LONGITUDE

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml

@ -4,7 +4,7 @@
<mapper namespace="com.epmet.datareport.dao.user.StaffPatrolRecordDao">
<!-- 巡查记录查询 -->
<select id="recordList" resultType="com.epmet.user.result.RecordListResultDTO">
<select id="recordList" resultType="com.epmet.dto.result.RecordListResultDTO">
SELECT
ID AS staffPatrolRecId,
DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d %H:%i:%s') AS patrolStartTime,
@ -16,4 +16,26 @@
AND STAFF_ID = #{staffId}
ORDER BY CREATED_TIME DESC
</select>
<!-- 查询经纬度 -->
<select id="selectLL" resultType="com.epmet.user.result.GridManagerListResultDTO">
SELECT t.* FROM
(SELECT
distinct(pr.ID) AS ID,
pr.GRID AS gridId,
pr.STAFF_ID,
pr.`STATUS`,
pd.LATITUDE,
pd.LONGITUDE,
pd.SERIAL_NUM
FROM staff_patrol_record pr
LEFT JOIN staff_patrol_detail pd ON pd.STAFF_PATROL_REC_ID = pr.ID AND pd.DEL_FLAG = 0
WHERE pr.DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
pr.STAFF_ID = #{userId}
</foreach>
)
ORDER BY pd.SERIAL_NUM DESC)t GROUP BY ID
</select>
</mapper>

9
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -17,11 +17,11 @@
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 中央区-项目数据
@ -54,6 +54,11 @@ public class ScreenProjectDataDTO implements Serializable {
*/
private String orgId;
/**
* 来源议题issue组织agency
*/
private String origin;
/**
* 上级组织Id
*/

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -22,97 +22,97 @@ import java.util.Set;
public interface UserDao {
/**
* @Description 查询注册用户的总量与增量
* @param
* @return
* @Description 查询注册用户的总量与增量
* @author wangc
* @date 2020.06.18 18:50
**/
CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("targetDate")Date targetDate);
**/
CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("targetDate") Date targetDate);
/**
* @Description 查询党员的总量与增量
* @param
* @return
* @Description 查询党员的总量与增量
* @author wangc
* @date 2020.06.18 18:50
**/
CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List<String> userIds, @Param("incrUserIds") List<String> incrUserIds, @Param("targetDate") Date targetDate);
/**
* @Description 查询热心居民的总量与增量
* @param
* @return
* @Description 查询热心居民的总量与增量
* @author wangc
* @date 2020.06.18 18:50
**/
CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List<String> userIds, @Param("incrUserIds") List<String> incrUserIds, @Param("gridIds") Set<String> gridIds, @Param("targetDate") Date targetDate);
/**
* @Description 查询指定网格范围下单位时间内新增的注册用户Id
* @param
* @return
* @Description 查询指定网格范围下单位时间内新增的注册用户Id
* @author wangc
* @date 2020.06.18 18:50
**/
List<String> selectIncrUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("targetDate") Date targetDate);
/**
* @Description 查询指定网格范围下截至指定位时间累计的注册用户Id
* @param
* @return
* @Description 查询指定网格范围下截至指定位时间累计的注册用户Id
* @author wangc
* @date 2020.06.18 18:50
**/
List<String> selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("targetDate") Date targetDate);
/**
* @Description 查询指定时间范围内网格新增的注册/参与用户Id
* @param
* @return
* @Description 查询指定时间范围内网格新增的注册/参与用户Id
* @author wangc
* @date 2020.06.18 18:50
**/
List<String> selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate);
List<String> selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* @Description 查询指定时间范围内注册/参与用户增量
* @param
* @return
* @Description 查询指定时间范围内注册/参与用户增量
* @author wangc
* @date 2020.06.18 18:50
**/
Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate);
Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set<String> gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* @Description 查询指定时间范围内党员的增量
* @param
* @return
* @Description 查询指定时间范围内党员的增量
* @author wangc
* @date 2020.06.18 18:50
**/
Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds")List<String> incrUserIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds") List<String> incrUserIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* @Description 查询指定时间范围内热心居民的增量
* @param
* @return
* @Description 查询指定时间范围内热心居民的增量
* @author wangc
* @date 2020.06.18 18:50
**/
Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List<String> incrUserIds,@Param("gridIds") Set<String> gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds") List<String> incrUserIds, @Param("gridIds") Set<String> gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
/**
* @Description 查询用户是不是党员
* @param userIds
* @Description 查询用户是不是党员
* @author zxc
* @date 2020/9/15 4:23 下午
*/
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);
List<String> selectPartymembersByCustomerId(@Param("customerId")String customerId);
List<String> selectPartymembersByCustomerId(@Param("customerId") String customerId);
List<GridHeartedFormDTO> selectWarmHeartedByCustomerId(@Param("customerId")String customerId);
List<GridHeartedFormDTO> selectWarmHeartedByCustomerId(@Param("customerId") String customerId);
/**
* @param customerId
@ -125,22 +125,22 @@ public interface UserDao {
List<String> selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* @Description 获取客户下的网格注册居民
* @param customerId
* @return
* @Description 获取客户下的网格注册居民
* @author wangc
* @date 2020.09.25 13:54
**/
List<ScreenPartyUserRankDataEntity> selectRegisteredUserByCustomerId(@Param("customerId") String customerId);
/**
* @Description 获取大屏项目相关信息 联系人
* @param list
* @param userIdList
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @Description 获取大屏项目相关信息 联系人
* @author wangc
* @date 2021.03.08 17:16
*/
List<ScreenProjectDataDTO> selectScreenProjectData(@Param("list") List<ScreenProjectDataDTO> list);
List<ScreenProjectDataDTO> selectScreenProjectData(@Param("list") List<String> userIdList);
/**
* 根据工作员用户id, 返回这些人当中多少个网格员
@ -148,6 +148,16 @@ public interface UserDao {
* @param staffIds
* @return int
*/
int selectGridManagerTotal(@Param("customerId")String customerId,@Param("staffIds")List<String> staffIds);
int selectGridManagerTotal(@Param("customerId") String customerId, @Param("staffIds") List<String> staffIds);
/**
* desc: 根据Id获取工作人员 昵称及手机号
*
* @param staffUserIdList
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author LiuJanJun
* @date 2021/6/8 5:21 下午
*/
List<ScreenProjectDataDTO> selectStaffInfo(@Param("list") List<String> staffUserIdList);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java

@ -46,7 +46,7 @@ public class ProjectEntity extends BaseEpmetEntity {
private String agencyId;
/**
* 来源议题issue
* 来源议题issue组织agency
*/
private String origin;

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -361,13 +361,11 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @param customerId
* @param rows
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit);
List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows ,String dateId);
void computerIfExceed(List<ScreenProjectDataDTO> list,Integer exceedLimit,Integer about2exceedLimit);

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -20,7 +20,6 @@ package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
@ -470,19 +469,12 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
* @param customerId
* @param rows
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
@Override
public List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) {
boolean ifBeforeYesterday = true;
int beforeDate = Integer.parseInt(DateUtils.getBeforeNDay(NumConstant.ONE));
if(beforeDate > Integer.parseInt(dateId)){
ifBeforeYesterday = false;
}
public List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows , String dateId) {
List<ScreenProjectDataDTO> projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId);
projects.forEach(project -> {
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) {

36
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
@ -71,27 +70,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
public void extractScreenData(ScreenCentralZoneDataFormDTO param) {
//screen_project_data表是否存在此客户数据
int rows = targetDbService.checkIfExisted(param.getCustomerId());
//查找客户项目超期参数
List<ProjectExceedParamsResultDTO> exceedParams = projectService.getProjectExceedParams(param.getCustomerId());
Integer exceedLimit = NumConstant.FIVE;
Integer about2ExceedLimit = NumConstant.FIVE;
if(!CollectionUtils.isEmpty(exceedParams)){
for(ProjectExceedParamsResultDTO ex :exceedParams){
if(null != ex.getDefaultExceedLimit()){
exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit();
}
if(null != ex.getDefaultAbout2ExceedLimit()){
about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit();
}
}
}
//因为即将超期提醒时间(天)就是即将超期期限,在表中存储的是超期前多少天
//所以这里要换算成滞留日
about2ExceedLimit = exceedLimit >= about2ExceedLimit ? exceedLimit - about2ExceedLimit : exceedLimit;
List<ScreenProjectDataDTO> metaData =
originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit);
originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId());
if(!CollectionUtils.isEmpty(metaData)) {
// 查询项目信息
@ -101,11 +82,19 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
nature.getId())).map(projectInfo -> {
meta.setProjectCreateTime(projectInfo.getCreatedTime());
meta.setProjectTitle(projectInfo.getTitle());
meta.setOrigin(projectInfo.getOrigin());
//直接立项的话 项目内容是项目背景
if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){
meta.setProjectContent(projectInfo.getBackGround());
meta.setLinkName(projectInfo.getCreatedBy());
}
return meta;
})).collect(Collectors.toList());
}
//设置项目经纬度和项目内容
topicService.fillScreenProjectData(metaData);
//metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData);
//设置联系人及电话
userService.fillScreenProjectData(metaData);
//metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData);
}
@ -137,7 +126,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
//重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily
// originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit);
originMainService.setProjectLevel(orientData, param.getCustomerId());
//todo 与上面重复处理 暂时注释掉
//originMainService.setProjectLevel(orientData, param.getCustomerId());
processService.updateProjectCloseTime(metaData);
//更新结案时间和结案状态
processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId());

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/EIDimServiceImpl.java

@ -52,6 +52,7 @@ public class EIDimServiceImpl implements EIDimService {
/**
* 查询可更新的单位
*
* @return
*/
private List<CustomerAgencyEntity> listAgencies2Update() {
@ -69,6 +70,7 @@ public class EIDimServiceImpl implements EIDimService {
/**
* 查询可增加的单位
*
* @return
*/
private List<CustomerAgencyEntity> listAgencies2Add() {
@ -92,6 +94,7 @@ public class EIDimServiceImpl implements EIDimService {
/**
* 查询需要更新的部门列表
*
* @return
*/
private List<CustomerDepartmentEntity> listDepts2Update() {
@ -109,6 +112,7 @@ public class EIDimServiceImpl implements EIDimService {
/**
* 查询需要新增的部门列表
*
* @return
*/
private List<CustomerDepartmentEntity> listDepts2Add() {
@ -126,36 +130,29 @@ public class EIDimServiceImpl implements EIDimService {
@Override
public void initGrids() {
List<CustomerGridEntity> grids2Add = listGrids2Add();
List<CustomerGridEntity> grids2Update =listGrids2Update();
List<CustomerGridEntity> grids2Update = listGrids2Update();
screenCustomerGridService.addAndUpdateGrids(grids2Add, grids2Update);
}
@Override
public Map<String,Integer> updateCenterPointByName(GridCenterPointForm param) {
//todo 怎么反向判断 左匹配
public Map<String, Integer> updateCenterPointByName(GridCenterPointForm param) {
List<ScreenProjectGridDailyDTO> gridInfos = screenCustomerGridService.selectGridInfoByCustomerId(param.getCustomerId());
Map<String,Integer> result = new HashMap<>();
Map<String, Integer> result = new HashMap<>();
gridInfos.forEach(grid->{
gridInfos.forEach(grid -> {
//客户id 和组织id 都相等 且 名字 包含关系时才修改
if (grid.getCustomerId().equals(param.getCustomerId())){
if (grid.getCustomerId().equals(param.getCustomerId())) {
AtomicInteger integer = new AtomicInteger(0);
param.getCenterDataList().forEach(o ->{
if (grid.getGridName().contains(o.getTitle())) {
Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), o.getTitle(), o.getCenter());
integer.addAndGet(effectRow);
}
result.put(grid.getGridId(),integer.intValue());
});
param.getCenterDataList().forEach(o -> {
String title = o.getTitle().replace("委会","");
if (grid.getGridName().contains(title)) {
Integer effectRow = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(), title, o.getCenter());
integer.addAndGet(effectRow);
}
result.put(grid.getGridId(), integer.intValue());
});
}
});
/*param.getCenterDataList().forEach(o ->{
Integer integer = screenCustomerGridService.updateCenterPointByName(param.getCustomerId(),param.getAgencyId(), o.getTitle(), o.getCenter());
if (integer == 0 || integer > 1){
result.put(o.getTitle(),integer);
}
});*/
return result;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java

@ -182,11 +182,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
o.setDataEndTime(dimId);
//For:06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数
if(gridManagerMap.containsKey(orgId)){
o.setGridMemberTotal(gridManagerMap.get(orgId));
}else{
o.setGridMemberTotal(NumConstant.ZERO);
}
o.setGridMemberTotal(gridManagerMap.getOrDefault(orgId, NumConstant.ZERO));
});
return result;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -84,7 +84,7 @@ public interface UserService {
* @author wangc
* @date 2021.03.08 17:16
*/
List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list);
void fillScreenProjectData(List<ScreenProjectDataDTO> list);
/**
* 返回每个组织或者每个网格下的网格员数量

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
@ -744,16 +745,38 @@ public class UserServiceImpl implements UserService {
* @date 2021.03.08 17:16
*/
@Override
public List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list) {
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(list);
if(!CollectionUtils.isEmpty(collection)){
list = list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId()))
public void fillScreenProjectData(List<ScreenProjectDataDTO> list) {
List<String> topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin()))
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(topicUserIdList)){
return;
}
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(topicUserIdList);
Map<String, ScreenProjectDataDTO> topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1));
/* if(!CollectionUtils.isEmpty(collection)){
list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId()))
.map(merge -> {
target.setLinkName(merge.getLinkName());
target.setLinkMobile(merge.getLinkMobile());
return target;})).collect(Collectors.toList());
return target;}));
}*/
List<String> staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin()))
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(topicUserIdList)){
return;
}
return collection;
List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList);
Map<String, ScreenProjectDataDTO> collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1));
list.forEach(project->{
ScreenProjectDataDTO userDTO = collect.get(project.getLinkName());
if (userDTO == null){
userDTO = topicUserMap.get(project.getLinkName());
}
if (userDTO != null){
project.setLinkName(userDTO.getLinkName());
project.setLinkMobile(userDTO.getLinkMobile());
}
});
}
/**

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -528,8 +528,8 @@
user_base_info
WHERE
del_flag = '0'
<foreach collection="list" item="project" open="AND (" separator=" OR " close=")">
user_id = #{project.linkName}
<foreach collection="list" item="userId" open="AND (" separator=" OR " close=")">
user_id = #{userId}
</foreach>
</select>
@ -550,11 +550,24 @@
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND m.ROLE_KEY = 'grid_manager'
AND m.ROLE_KEY = 'grid_member'
)
AND sr.STAFF_ID in
<foreach collection="staffIds" item="staffId" open="(" close=")" separator=",">
#{staffId}
</foreach>
</select>
<select id="selectStaffInfo" resultType="com.epmet.dto.screen.ScreenProjectDataDTO">
SELECT
USER_ID as ID,
REAL_NAME AS linkName,
MOBILE AS linkMobile
FROM
customer_staff
WHERE
del_flag = '0'
<foreach collection="list" item="userId" open="AND (" separator=" OR " close=")">
user_id = #{userId}
</foreach>
</select>
</mapper>

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStaffResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/8 3:23 下午
* @DESC
*/
@Data
public class GridStaffResultDTO implements Serializable {
private static final long serialVersionUID = -5910427385795368242L;
private String gridId;
private String staffId;
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -333,4 +333,13 @@ public interface GovOrgOpenFeignClient {
**/
@PostMapping(value = "/gov/org/customeragency/getprocessorlist/{agencyId}")
Result<ProcessorListResultDTO> getProcessorList(@PathVariable("agencyId") String agencyId);
/**
* @Description 查询网格下的网格员
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
*/
@PostMapping("/gov/org/customerstaffgrid/gridstaff")
Result<List<GridStaffResultDTO>> selectGridStaffByGridIds(@RequestBody List<String> gridIds);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -192,4 +192,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<ProcessorListResultDTO> getProcessorList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getProcessorList", agencyId);
}
@Override
public Result<List<GridStaffResultDTO>> selectGridStaffByGridIds(List<String> gridIds) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridStaffByGridIds", gridIds);
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java

@ -29,6 +29,7 @@ import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.dto.result.CustomerGridByUserIdResultDTO;
import com.epmet.dto.result.GridStaffResultDTO;
import com.epmet.excel.CustomerStaffGridExcel;
import com.epmet.service.CustomerStaffGridService;
import org.springframework.beans.factory.annotation.Autowired;
@ -119,4 +120,15 @@ public class CustomerStaffGridController {
ValidatorUtils.validateEntity(gridIdFormDTO);
return customerStaffGridService.getAllGridStaffs(gridIdFormDTO);
}
/**
* @Description 查询网格下的人
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
*/
@PostMapping("gridstaff")
public Result<List<GridStaffResultDTO>> selectGridStaffByGridIds(@RequestBody List<String> gridIds){
return new Result<List<GridStaffResultDTO>>().ok(customerStaffGridService.selectGridStaffByGridIds(gridIds));
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.dto.result.GridStaffResultDTO;
import com.epmet.entity.CustomerStaffGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -97,4 +98,12 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @Description 查询人员在客户下参与的网格列表
*/
List<CustomerStaffGridDTO> selectStaffGridList(CustomerStaffGridDTO staffGridDTO);
/**
* @Description 查询网格下的人
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
*/
List<GridStaffResultDTO> selectGridStaffByGridIds(@Param("gridIds") List<String> gridIds);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java

@ -26,6 +26,7 @@ import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.CustomerGridByUserIdResultDTO;
import com.epmet.dto.result.GridStaffResultDTO;
import com.epmet.entity.CustomerStaffGridEntity;
import java.util.List;
@ -117,4 +118,12 @@ public interface CustomerStaffGridService extends BaseService<CustomerStaffGridE
* @date 2020.04.29 22:59
**/
Result<List<String>> getAllGridStaffs(CommonGridIdFormDTO gridIdFormDTO);
/**
* @Description 查询网格下的人
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
*/
List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds);
}

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
@ -30,13 +31,16 @@ import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.LatestGridFormDTO;
import com.epmet.dto.result.CustomerGridByUserIdResultDTO;
import com.epmet.dto.result.GridStaffResultDTO;
import com.epmet.entity.CustomerStaffGridEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerStaffGridRedis;
import com.epmet.service.CustomerStaffGridService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -56,6 +60,9 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
@Autowired
private CustomerStaffGridRedis customerStaffGridRedis;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<CustomerStaffGridDTO> page(Map<String, Object> params) {
@ -146,4 +153,32 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
)
);
}
/**
* @Description 查询网格下的人
* @Param gridIds
* @author zxc
* @date 2021/6/8 3:36 下午
*/
@Override
public List<GridStaffResultDTO> selectGridStaffByGridIds(List<String> gridIds) {
if (CollectionUtils.isEmpty(gridIds)){
return new ArrayList<>();
}
// 查询网格下所有的人
List<GridStaffResultDTO> gridStaff = baseDao.selectGridStaffByGridIds(gridIds);
if (CollectionUtils.isEmpty(gridStaff)){
return new ArrayList<>();
}
// 拿着网格下所有人去筛选网格员
Result<List<GridStaffResultDTO>> result = epmetUserOpenFeignClient.staffGridRole(gridStaff);
if (!result.success()){
throw new RenException("查询网格下的网格员失败【"+result.getMsg()+"】");
}
List<GridStaffResultDTO> data = result.getData();
if (CollectionUtils.isEmpty(data)){
return new ArrayList<>();
}
return data;
}
}

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml

@ -88,6 +88,20 @@
AND customer_id = #{customerId}
</select>
<!-- 查询网格下的人 -->
<select id="selectGridStaffByGridIds" resultType="com.epmet.dto.result.GridStaffResultDTO">
SELECT
USER_ID AS staffId,
GRID_ID
FROM customer_staff_grid
WHERE DEL_FLAG = '0'
AND (
<foreach collection="gridIds" item="gridId" separator=" OR ">
GRID_ID = #{gridId}
</foreach>
)
</select>
<!-- 批量插入网格工作人员 -->
<insert id="insertBatch" parameterType="java.util.List">
insert into customer_staff_grid

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java → epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolTrackFormDTO.java

@ -1,4 +1,4 @@
package com.epmet.user.form;
package com.epmet.dto.form;
import lombok.Data;

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java → epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RecordListFormDTO.java

@ -1,4 +1,4 @@
package com.epmet.user.form;
package com.epmet.dto.form;
import lombok.Data;

65
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java

@ -0,0 +1,65 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/7 2:57 下午
* @DESC
*/
@Data
public class GridManagerUserListResultDTO implements Serializable {
private static final long serialVersionUID = 3606766812822179356L;
/**
* 工作人员id
*/
private String staffId;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 网格ID
*/
private String gridId;
/**
* 正在巡查patrolling否则返回空字符串
*/
private String status;
/**
* 网格名称最多显示上两级
*/
private String gridName;
/**
* 姓名
*/
private String staffName;
/**
* 中心点位
*/
@JsonIgnore
private String centerMark;
/**
* 经纬度赋值状态
*/
@JsonIgnore
private Boolean llStatus;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUserResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/8 4:30 下午
* @DESC
*/
@Data
public class GridStaffUserResultDTO implements Serializable {
private static final long serialVersionUID = 7715622585539953368L;
private String gridId;
private String staffId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java → epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolTrackResultDTO.java

@ -1,4 +1,4 @@
package com.epmet.user.result;
package com.epmet.dto.result;
import lombok.Data;

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java → epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RecordListResultDTO.java

@ -1,4 +1,4 @@
package com.epmet.user.result;
package com.epmet.dto.result;
import lombok.Data;

33
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameAndLLResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/6/9 11:12 上午
* @DESC
*/
@Data
public class UserNameAndLLResultDTO implements Serializable {
private static final long serialVersionUID = 8997436689118596889L;
/**
* 用户名字
*/
private List<UserNameResultDTO> userNames;
/**
* 经纬度
*/
private List<GridManagerUserListResultDTO> ll;
public UserNameAndLLResultDTO() {
this.userNames = new ArrayList<>();
this.ll = new ArrayList<>();
}
}

19
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserNameResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/6/9 11:12 上午
* @DESC
*/
@Data
public class UserNameResultDTO implements Serializable {
private static final long serialVersionUID = 5383959788021394553L;
private String userId;
private String userName;
}

36
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -550,4 +550,40 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping(value = "/epmetuser/customerstaff/list")
Result<List<CustomerStaffDTO>> list(CustomerStaffFormDTO input);
/**
* @Description 查询网格员角色
* @Param forms
* @author zxc
* @date 2021/6/8 4:42 下午
*/
@PostMapping("/epmetuser/staffrole/staffgridrole")
Result<List<GridStaffResultDTO>> staffGridRole(@RequestBody List<GridStaffResultDTO> forms);
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:40 上午
*/
@PostMapping("/epmetuser/staffpatrol/getll")
Result<UserNameAndLLResultDTO> selectll(@RequestBody List<String> userIds);
/**
* @Description 002查看巡查记录
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:25 下午
*/
@PostMapping("/epmetuser/staffpatrol/recordlist")
Result<List<RecordListResultDTO>> recordList(@RequestBody RecordListFormDTO formDTO);
/**
* @Description 003巡查轨迹
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:35 下午
*/
@PostMapping("/epmetuser/staffpatrol/patroltrack")
Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO);
}

21
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -383,4 +383,25 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<List<CustomerStaffDTO>> list(CustomerStaffFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", input);
}
@Override
public Result<List<GridStaffResultDTO>> staffGridRole(List<GridStaffResultDTO> forms) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "staffGridRole", forms);
}
@Override
public Result<UserNameAndLLResultDTO> selectll(List<String> userIds) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectll", userIds);
}
@Override
public Result<List<RecordListResultDTO>> recordList(RecordListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "recordList", formDTO);
}
@Override
public Result<List<PatrolTrackResultDTO>> patrolTrack(PatrolTrackFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolTrack", formDTO);
}
}

68
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java

@ -0,0 +1,68 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.dto.result.GridManagerUserListResultDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import com.epmet.dto.result.UserNameAndLLResultDTO;
import com.epmet.service.StaffPatrolRecordService;
import com.epmet.user.result.GridManagerListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/6/9 10:32 上午
* @DESC
*/
@RestController
@RequestMapping("staffpatrol")
public class StaffPatrolController {
@Autowired
private StaffPatrolRecordService staffPatrolRecordService;
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:40 上午
*/
@PostMapping("getll")
public Result<UserNameAndLLResultDTO> selectll(@RequestBody List<String> userIds){
return new Result<UserNameAndLLResultDTO>().ok(staffPatrolRecordService.selectLL(userIds));
}
/**
* @Description 002查看巡查记录
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:25 下午
*/
@PostMapping("recordlist")
public Result<List<RecordListResultDTO>> recordList(@RequestBody RecordListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class);
return new Result<List<RecordListResultDTO>>().ok(staffPatrolRecordService.recordList(formDTO));
}
/**
* @Description 003巡查轨迹
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:35 下午
*/
@PostMapping("patroltrack")
public Result<List<PatrolTrackResultDTO>> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class);
return new Result<List<PatrolTrackResultDTO>>().ok(staffPatrolRecordService.patrolTrack(formDTO));
}
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java

@ -10,11 +10,8 @@ import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerRoleFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.form.StaffRoleFormDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
@ -181,4 +178,15 @@ public class StaffRoleController {
staffRoleService.changeRoleOrg(formDTO);
return new Result();
}
/**
* @Description 查询网格员角色
* @Param forms
* @author zxc
* @date 2021/6/8 4:42 下午
*/
@PostMapping("staffgridrole")
public Result<List<GridStaffResultDTO>> staffGridRole(@RequestBody List<GridStaffResultDTO> forms){
return new Result<List<GridStaffResultDTO>>().ok(staffRoleService.staffGridRole(forms));
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -205,4 +205,12 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @return
*/
List<CustomerStaffDTO> listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List<String> userIds);
/**
* @Description 查询用户名字
* @Param userIds
* @author zxc
* @date 2021/6/9 1:36 下午
*/
List<UserNameResultDTO> selectUserName(@Param("userIds")List<String> userIds);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolDetailDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.entity.StaffPatrolDetailEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作人员巡查记录明细
@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StaffPatrolDetailDao extends BaseDao<StaffPatrolDetailEntity> {
/**
* @Description 查询巡查轨迹
* @Param staffPatrolRecId
* @author zxc
* @date 2021/6/7 5:13 下午
*/
List<PatrolTrackResultDTO> selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId);
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java

@ -18,8 +18,14 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.dto.result.GridManagerUserListResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import com.epmet.entity.StaffPatrolRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作人员巡查主记录
@ -29,5 +35,21 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> {
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:24 上午
*/
List<GridManagerUserListResultDTO> selectLL(@Param("userIds")List<String> userIds);
/**
* @Description 巡查记录查询
* @Param formDTO
* @author zxc
* @date 2021/6/7 5:29 下午
*/
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO);
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -24,10 +24,7 @@ import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -131,4 +128,12 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @Description 工作端-查询用户角色key列表
**/
List<String> selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO);
/**
* @Description 查询是网格员的人
* @Param forms
* @author zxc
* @date 2021/6/8 4:53 下午
*/
List<GridStaffResultDTO> staffGridRole(@Param("forms") List<GridStaffResultDTO> forms);
}

30
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java

@ -18,8 +18,15 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.dto.result.PatrolTrackResultDTO;
import com.epmet.dto.result.RecordListResultDTO;
import com.epmet.dto.result.UserNameAndLLResultDTO;
import com.epmet.entity.StaffPatrolRecordEntity;
import java.util.List;
/**
* 工作人员巡查主记录
@ -29,5 +36,28 @@ import com.epmet.entity.StaffPatrolRecordEntity;
*/
public interface StaffPatrolRecordService extends BaseService<StaffPatrolRecordEntity> {
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:40 上午
*/
UserNameAndLLResultDTO selectLL(List<String> userIds);
/**
* @Description 002查看巡查记录
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:25 下午
*/
List<RecordListResultDTO> recordList(RecordListFormDTO formDTO);
/**
* @Description 003巡查轨迹
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:35 下午
*/
List<PatrolTrackResultDTO> patrolTrack(PatrolTrackFormDTO formDTO);
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java

@ -25,10 +25,7 @@ import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import java.util.List;
@ -159,4 +156,12 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
* @return void
*/
void changeRoleOrg(StaffRoleDTO formDTO);
/**
* @Description 查询网格员角色
* @Param forms
* @author zxc
* @date 2021/6/8 4:42 下午
*/
List<GridStaffResultDTO> staffGridRole(List<GridStaffResultDTO> forms);
}

90
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -1,27 +1,21 @@
/**
* 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.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.CustomerStaffDao;
import com.epmet.dao.StaffPatrolDetailDao;
import com.epmet.dao.StaffPatrolRecordDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.form.PatrolTrackFormDTO;
import com.epmet.dto.form.RecordListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffPatrolRecordEntity;
import com.epmet.service.StaffPatrolRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 工作人员巡查主记录
@ -32,5 +26,67 @@ import org.springframework.stereotype.Service;
@Service
public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRecordDao, StaffPatrolRecordEntity> implements StaffPatrolRecordService {
@Autowired
private CustomerStaffDao customerStaffDao;
@Autowired
private StaffPatrolRecordDao staffPatrolRecordDao;
@Autowired
private StaffPatrolDetailDao staffPatrolDetailDao;
/**
* @Description 查询经纬度
* @Param userIds
* @author zxc
* @date 2021/6/9 10:40 上午
*/
@Override
public UserNameAndLLResultDTO selectLL(List<String> userIds) {
UserNameAndLLResultDTO result = new UserNameAndLLResultDTO();
if (CollectionUtils.isEmpty(userIds)){
return result;
}
// 经纬度查询
List<GridManagerUserListResultDTO> llResult = baseDao.selectLL(userIds);
if (!CollectionUtils.isEmpty(llResult)){
result.setLl(llResult);
}
// 姓名查询
List<UserNameResultDTO> nameResult = customerStaffDao.selectUserName(userIds);
if (!CollectionUtils.isEmpty(nameResult)){
result.setUserNames(nameResult);
}
return result;
}
/**
* @Description 002查看巡查记录
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:25 下午
*/
@Override
public List<RecordListResultDTO> recordList(RecordListFormDTO formDTO) {
List<RecordListResultDTO> result = staffPatrolRecordDao.recordList(formDTO);
if (!CollectionUtils.isEmpty(result)){
return result;
}
return new ArrayList<>();
}
/**
* @Description 003巡查轨迹
* @Param formDTO
* @author zxc
* @date 2021/6/7 3:35 下午
*/
@Override
public List<PatrolTrackResultDTO> patrolTrack(PatrolTrackFormDTO formDTO) {
List<PatrolTrackResultDTO> results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId());
if (!CollectionUtils.isEmpty(results)){
return results;
}
return new ArrayList<>();
}
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -32,10 +32,7 @@ import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.StaffRolesResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.StaffRoleEntity;
import com.epmet.redis.StaffRoleRedis;
import com.epmet.service.StaffRoleService;
@ -43,6 +40,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -188,4 +186,22 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
baseDao.updateStaffRoleOrgId(formDTO);
}
/**
* @Description 查询网格员角色
* @Param forms
* @author zxc
* @date 2021/6/8 4:42 下午
*/
@Override
public List<GridStaffResultDTO> staffGridRole(List<GridStaffResultDTO> forms) {
if (CollectionUtils.isEmpty(forms)){
return new ArrayList<>();
}
List<GridStaffResultDTO> result = baseDao.staffGridRole(forms);
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return result;
}
}

17
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -399,4 +399,21 @@
</where>
</select>
<!-- 查询用户名字 -->
<select id="selectUserName" resultType="com.epmet.dto.result.UserNameResultDTO">
SELECT
USER_ID,
IFNULL( REAL_NAME, '' ) AS userName
FROM
customer_staff
WHERE
DEL_FLAG = '0'
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
USER_ID = #{userId}
</foreach>
)
</select>
</mapper>

34
epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolDetailDao.xml

@ -3,27 +3,17 @@
<mapper namespace="com.epmet.dao.StaffPatrolDetailDao">
<resultMap type="com.epmet.entity.StaffPatrolDetailEntity" id="staffPatrolDetailMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="staffPatrolRecId" column="STAFF_PATROL_REC_ID"/>
<result property="serialNum" column="SERIAL_NUM"/>
<result property="uploadTime" column="UPLOAD_TIME"/>
<result property="latitude" column="LATITUDE"/>
<result property="longitude" column="LONGITUDE"/>
<result property="speed" column="SPEED"/>
<result property="accuracy" column="ACCURACY"/>
<result property="altitude" column="ALTITUDE"/>
<result property="verticalaccuracy" column="VERTICALACCURACY"/>
<result property="horizontalaccuracy" column="HORIZONTALACCURACY"/>
<result property="address" column="ADDRESS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 查询巡查轨迹 -->
<select id="selectPatrolTrack" resultType="com.epmet.dto.result.PatrolTrackResultDTO">
SELECT
LATITUDE,
LONGITUDE
FROM
staff_patrol_detail
WHERE
STAFF_PATROL_REC_ID = #{staffPatrolRecId}
AND DEL_FLAG = 0
ORDER BY SERIAL_NUM
</select>
</mapper>

53
epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml

@ -3,25 +3,40 @@
<mapper namespace="com.epmet.dao.StaffPatrolRecordDao">
<resultMap type="com.epmet.entity.StaffPatrolRecordEntity" id="staffPatrolRecordMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="grid" column="GRID"/>
<result property="gridPids" column="GRID_PIDS"/>
<result property="staffId" column="STAFF_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="patrolStartTime" column="PATROL_START_TIME"/>
<result property="patrolEndTime" column="PATROL_END_TIME"/>
<result property="actrualEndTime" column="ACTRUAL_END_TIME"/>
<result property="totalTime" column="TOTAL_TIME"/>
<result property="status" column="STATUS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 查询经纬度 -->
<select id="selectLL" resultType="com.epmet.dto.result.GridManagerUserListResultDTO">
SELECT t.* FROM
(SELECT
distinct(pr.ID) AS ID,
pr.GRID AS gridId,
pr.STAFF_ID,
pr.`STATUS`,
pd.LATITUDE,
pd.LONGITUDE,
pd.SERIAL_NUM
FROM staff_patrol_record pr
LEFT JOIN staff_patrol_detail pd ON pd.STAFF_PATROL_REC_ID = pr.ID AND pd.DEL_FLAG = 0
WHERE pr.DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">
pr.STAFF_ID = #{userId}
</foreach>
)
ORDER BY pd.SERIAL_NUM DESC)t GROUP BY ID
</select>
<!-- 巡查记录查询 -->
<select id="recordList" resultType="com.epmet.dto.result.RecordListResultDTO">
SELECT
ID AS staffPatrolRecId,
DATE_FORMAT(PATROL_START_TIME,'%Y-%m-%d %H:%i:%s') AS patrolStartTime,
DATE_FORMAT(PATROL_END_TIME,'%Y-%m-%d %H:%i:%s') AS patrolEndTime,
`STATUS`
FROM staff_patrol_record
WHERE DEL_FLAG = 0
AND GRID = #{gridId}
AND STAFF_ID = #{staffId}
ORDER BY CREATED_TIME DESC
</select>
</mapper>

14
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -193,4 +193,18 @@
AND gsr.del_flag = '0'
AND sr.staff_id = #{userId}
</select>
<!-- 查询是网格员的人 -->
<select id="staffGridRole" resultType="com.epmet.dto.result.GridStaffResultDTO">
<foreach collection="forms" item="s" separator=" UNION ALL ">
SELECT
#{s.gridId} as gridId,
sr.STAFF_ID
FROM staff_role sr
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0
WHERE sr.DEL_FLAG = 0
AND gsr.ROLE_KEY = 'grid_member'
AND sr.STAFF_ID = #{s.staffId}
</foreach>
</select>
</mapper>

Loading…
Cancel
Save