Browse Source

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

master
wxz 2 years ago
parent
commit
a8dcb18844
  1. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java
  2. 18
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java
  3. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenPublicServicePlaceListByCateRstDTO.java
  4. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenStatsByCategoryRstDTO.java
  5. 27
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PlaceOrgByTypeResultDTO.java
  6. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java
  7. 22
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
  8. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java
  9. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java
  10. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java
  11. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java
  12. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java
  13. 35
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java
  14. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java
  15. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
  16. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java
  17. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java
  18. 49
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
  19. 68
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java
  20. 55
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml
  21. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
  22. 7
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml
  23. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPublicServiceAddEditFormDTO.java

@ -76,4 +76,19 @@ public class IcPublicServiceAddEditFormDTO implements Serializable {
private String customerId;
private String userId;
/**
* 片区sir名字[灵山]
*/
private String policeName;
/**
* 片区sir电话[灵山]
*/
private String policePhone;
/**
* 网格员id[灵山]
*/
private String griderId;
}

18
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcPublicServiceListResultDTO.java

@ -75,4 +75,22 @@ public class IcPublicServiceListResultDTO implements Serializable {
*/
private String mobile;
/**
* 片区sir名字[灵山]
*/
private String policeName;
/**
* 片区sir电话[灵山]
*/
private String policePhone;
/**
* 网格员id[灵山]
*/
private String griderId;
private String griderName;
private String griderPhone;
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/ListByCategory.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenPublicServicePlaceListByCateRstDTO.java

@ -1,9 +1,13 @@
package com.epmet.dto.result.lingshan;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
public class ListByCategory {
@NoArgsConstructor
@AllArgsConstructor
public class LingShanScreenPublicServicePlaceListByCateRstDTO {
/**
* 资源名称

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/StatsByCategoryRstDTO.java → epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/LingShanScreenStatsByCategoryRstDTO.java

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StatsByCategoryRstDTO {
public class LingShanScreenStatsByCategoryRstDTO {
/**
* 分类

27
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PlaceOrgByTypeResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result.lingshan;
import lombok.Data;
import java.io.Serializable;
/**
* @author yan Lu
* @description 灵山大屏企业分类统计
* @create 2023/5/30 10:21
*/
@Data
public class PlaceOrgByTypeResultDTO implements Serializable {
/**
* 类型名称
*/
private String dictLabel;
/**
* 类型值
*/
private String dictValue;
/**
* 企业数量
*/
private Integer total;
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java

@ -26,12 +26,12 @@ import com.epmet.dto.form.EditPlaceOrgFormDTO;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.result.GetListPlaceOrgResultDTO;
import com.epmet.dto.result.PlaceOrgDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.service.IcPlaceOrgService;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
/**
@ -105,5 +105,17 @@ public class IcPlaceOrgController {
return new Result<GetListPlaceOrgResultDTO>().ok(placeOrgService.getList(formDTO));
}
/**
* 根据生产企业类型分类统计企业数量
*
* @return
*/
@GetMapping("getPlaceOrgByType")
public Result<List<PlaceOrgByTypeResultDTO>> getPlaceOrgByType(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType,
@RequestParam("dictType") String dictType) {
return new Result().ok(placeOrgService.getPlaceOrgByType(orgId, orgType, dictType));
}
}

22
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java

@ -26,12 +26,12 @@ import com.epmet.dto.form.EditPlacePatrolRecordFormDTO;
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.service.IcPlacePatrolRecordService;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
/**
@ -106,4 +106,18 @@ public class IcPlacePatrolRecordController {
}
/**
* 根据隐患类型分类统计数量
*
* @return
*/
@GetMapping("getPlacePatrolRecordByType")
public Result<List<PlaceOrgByTypeResultDTO>> getPlacePatrolRecordByType(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType,
@RequestParam("dictType") String dictType) {
return new Result().ok(placePatrolRecordService.getPlacePatrolRecordByType(orgId, orgType, dictType));
}
}

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPublicServiceController.java

@ -11,11 +11,13 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
@ -30,13 +32,15 @@ import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.form.IcSuperiorResourceAddEditFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenPublicServicePlaceListByCateRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO;
import com.epmet.excel.IcPublicServiceExcel;
import com.epmet.service.IcPublicServiceService;
import com.epmet.utils.ImportTaskUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
@ -228,7 +232,7 @@ public class IcPublicServiceController implements ResultDataResolver {
}
/**
* @Description: 分类统计
* @Description: 灵山大屏分类统计
* @param orgType:
* @param orgId:
* @Return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.lingshan.StatsByCategoryRstDTO>>
@ -236,14 +240,29 @@ public class IcPublicServiceController implements ResultDataResolver {
* @Date: 2023/5/30 9:20 AM
*/
@GetMapping("lingshan/screen/statsByCategory")
public Result<List<StatsByCategoryRstDTO>> lingshanScreenStatsByCategory(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId) {
public Result<List<LingShanScreenStatsByCategoryRstDTO>> lingshanScreenStatsByCategory(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId) {
List<StatsByCategoryRstDTO> l = icPublicServiceService.lingshanScreenStatsByCategory(orgType, orgId);
return new Result<List<StatsByCategoryRstDTO>>().ok(l);
List<LingShanScreenStatsByCategoryRstDTO> l = icPublicServiceService.lingshanScreenStatsByCategory(orgType, orgId);
return new Result<List<LingShanScreenStatsByCategoryRstDTO>>().ok(l);
}
// @GetMapping("lingshan/screen/listByCategory")
// public Result<>
/**
* @Description: 灵山大屏查询组织下某个类别的场所列表带坐标打点
* @param orgType:
* @param orgId:
* @param category:
* @Return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.lingshan.LingShanScreenPublicServicePlaceListByCateRstDTO>>
* @Author: wangxianzhang
* @Date: 2023/5/30 1:50 PM
*/
@GetMapping("lingshan/screen/listByCategory")
public Result<List<LingShanScreenPublicServicePlaceListByCateRstDTO>> lingshanScreenListByCategory(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId,
@RequestParam(value = "category", required = false) String category) {
List<LingShanScreenPublicServicePlaceListByCateRstDTO> rl = icPublicServiceService.lingshanScreenListByCategory(orgId, orgType, category);
return new Result<List<LingShanScreenPublicServicePlaceListByCateRstDTO>>().ok(rl);
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java

@ -20,8 +20,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.result.PlaceOrgDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlaceOrgEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -40,4 +42,5 @@ public interface IcPlaceOrgDao extends BaseDao<IcPlaceOrgEntity> {
**/
List<PlaceOrgDetailResultDTO> getList(GetListPlaceOrgFormDTO formDTO);
List<PlaceOrgByTypeResultDTO> getPlaceOrgByType(@Param("orgPath") String orgPath);
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java

@ -20,8 +20,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlacePatrolRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -35,4 +37,6 @@ import java.util.List;
public interface IcPlacePatrolRecordDao extends BaseDao<IcPlacePatrolRecordEntity> {
List<PlacePatrolRecordDetailResultDTO> getList(GetListPlacePatrolRecordFormDTO dto);
List<PlaceOrgByTypeResultDTO> getPlacePatrolRecordByType(@Param("orgPath") String orgPath);
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java

@ -3,7 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -35,5 +35,5 @@ public interface IcPublicServiceDao extends BaseDao<IcPublicServiceEntity> {
* @Author: wangxianzhang
* @Date: 2023/5/30 9:44 AM
*/
List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(@Param("orgIdPath") String orgIdPath, @Param("customerId") String customerId);
List<LingShanScreenStatsByCategoryRstDTO> lingshanScreenStatsByCategory(@Param("orgIdPath") String orgIdPath, @Param("customerId") String customerId);
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPublicServiceEntity.java

@ -83,6 +83,21 @@ public class IcPublicServiceEntity extends BaseEpmetEntity {
*/
private String mobile;
/**
* 片区sir名字[灵山]
*/
private String policeName;
/**
* 片区sir电话[灵山]
*/
private String policePhone;
/**
* 网格员id[灵山]
*/
private String griderId;
/**
* 用于聚合统计
*

35
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcPublicServiceExcel.java

@ -1,5 +1,6 @@
package com.epmet.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@ -46,6 +47,40 @@ public class IcPublicServiceExcel {
@ColumnWidth(20)
private String mobile;
/**
* 片区sir名字[灵山]
*/
@ExcelProperty(value = "片区民警")
@ColumnWidth(20)
private String policeName;
/**
* 片区sir电话[灵山]
*/
@ExcelProperty(value = "片区民警电话")
@ColumnWidth(20)
private String policePhone;
/**
* 网格员电话[灵山]excel中不体现
*/
@ExcelIgnore
private String griderId;
/**
* 网格员[灵山]
*/
@ExcelProperty(value = "网格员")
@ColumnWidth(20)
private String griderName;
/**
* 网格员电话[灵山]
*/
@ExcelProperty(value = "网格员电话")
@ColumnWidth(20)
private String griderPhone;
@Data
public static class RowRemarkMessage {

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java

@ -23,8 +23,11 @@ import com.epmet.dto.form.EditPlaceOrgFormDTO;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.result.GetListPlaceOrgResultDTO;
import com.epmet.dto.result.PlaceOrgDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlaceOrgEntity;
import java.util.List;
/**
* 九小场所下组织管理
*
@ -62,4 +65,6 @@ public interface IcPlaceOrgService extends BaseService<IcPlaceOrgEntity> {
* @Description 九小场所下组织列表查询
**/
GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO);
List<PlaceOrgByTypeResultDTO> getPlaceOrgByType(String orgId, String orgType, String dictType);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java

@ -22,8 +22,11 @@ import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlacePatrolRecordEntity;
import java.util.List;
/**
* 场所巡查记录
*
@ -58,4 +61,6 @@ public interface IcPlacePatrolRecordService extends BaseService<IcPlacePatrolRec
* @Description 场所巡查记录列表查询
**/
GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO);
List<PlaceOrgByTypeResultDTO> getPlacePatrolRecordByType(String orgId, String orgType, String dictType);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPublicServiceService.java

@ -6,7 +6,8 @@ import com.epmet.dto.IcPublicServiceDTO;
import com.epmet.dto.form.IcPublicServiceAddEditFormDTO;
import com.epmet.dto.form.IcPublicServiceListFormDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenPublicServicePlaceListByCateRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import java.nio.file.Path;
@ -73,5 +74,7 @@ public interface IcPublicServiceService extends BaseService<IcPublicServiceEntit
void importExcel(Path fileSavePath, String taskId);
List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId);
List<LingShanScreenStatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId);
List<LingShanScreenPublicServicePlaceListByCateRstDTO> lingshanScreenListByCategory(String orgId, String orgType, String category);
}

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java

@ -29,14 +29,19 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.IcPlaceOrgDao;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.AddPlaceOrgFormDTO;
import com.epmet.dto.form.EditPlaceOrgFormDTO;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.result.GetListPlaceOrgResultDTO;
import com.epmet.dto.result.PlaceOrgDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlaceOrgEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPlaceOrgService;
@ -49,6 +54,7 @@ import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 九小场所下组织管理
@ -58,6 +64,7 @@ import java.util.Map;
*/
@Service
public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlaceOrgEntity> implements IcPlaceOrgService {
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@ -176,4 +183,47 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
resultDTO.setList(result.getList());
return resultDTO;
}
@Override
public List<PlaceOrgByTypeResultDTO> getPlaceOrgByType(String orgId, String orgType, String dictType) {
String orgPath = getOrgPath(orgId, orgType);
//获取字典
List<SysDictDataDTO> dtos = epmetAdminOpenFeignClient.dictDataList(dictType).getData();
//转换查询参数
Map<String, String> dtoMaps = dtos.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel));
List<PlaceOrgByTypeResultDTO> resDto = baseDao.getPlaceOrgByType(orgPath);
for (PlaceOrgByTypeResultDTO dto : resDto) {
dto.setDictLabel(dtoMaps.get(dto.getDictValue()));
}
for (String key : dtoMaps.keySet()) {
for (PlaceOrgByTypeResultDTO dto : resDto) {
if (dto.getDictValue().equals(key)) {
dto.setDictLabel(dtoMaps.get(key));
break;
} else {
PlaceOrgByTypeResultDTO pd = new PlaceOrgByTypeResultDTO();
pd.setDictValue(key);
pd.setDictLabel(dtoMaps.get(key));
pd.setTotal(0);
resDto.add(pd);
break;
}
}
}
return resDto;
}
/**
* @deprecationg 获取orgPath
*/
private String getOrgPath(String orgId, String orgType) {
if (OrgInfoConstant.AGENCY.equals(orgType)) { // 行政组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {// 网格
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
return PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
}
}

49
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java

@ -23,20 +23,27 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.IcPlacePatrolRecordDao;
import com.epmet.dao.IcPlacePatrolTeamStaffDao;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO;
import com.epmet.entity.IcPlaceAttachmentEntity;
import com.epmet.entity.IcPlacePatrolRecordEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -54,6 +61,7 @@ import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
@ -264,4 +272,45 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
resultDTO.setList(result.getList());
return resultDTO;
}
@Override
public List<PlaceOrgByTypeResultDTO> getPlacePatrolRecordByType(String orgId, String orgType, String dictType) {
//获取字典
List<SysDictDataDTO> dtos = epmetAdminOpenFeignClient.dictDataList(dictType).getData();
//转换查询参数
Map<String, String> dtoMaps = dtos.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel));
List<PlaceOrgByTypeResultDTO> resDto = baseDao.getPlacePatrolRecordByType(getOrgPath(orgId, orgType));
for (PlaceOrgByTypeResultDTO dto : resDto) {
dto.setDictLabel(dtoMaps.get(dto.getDictValue()));
}
for (String key : dtoMaps.keySet()) {
for (PlaceOrgByTypeResultDTO dto : resDto) {
if (dto.getDictValue().equals(key)) {
dto.setDictLabel(dtoMaps.get(key));
break;
} else {
PlaceOrgByTypeResultDTO pd = new PlaceOrgByTypeResultDTO();
pd.setDictValue(key);
pd.setDictLabel(dtoMaps.get(key));
pd.setTotal(0);
resDto.add(pd);
break;
}
}
}
return resDto;
}
/**
* @deprecationg 获取orgPath
*/
private String getOrgPath(String orgId, String orgType) {
if (OrgInfoConstant.AGENCY.equals(orgType)) { // 行政组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {// 网格
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
return PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
}
}

68
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java

@ -18,6 +18,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcCoverageCategoryDictDao;
import com.epmet.dao.IcPublicServiceDao;
import com.epmet.dto.IcPublicServiceDTO;
import com.epmet.dto.form.IcPublicServiceAddEditFormDTO;
@ -26,9 +27,9 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.lingshan.StatsByCategoryRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenPublicServicePlaceListByCateRstDTO;
import com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO;
import com.epmet.entity.IcPublicServiceEntity;
import com.epmet.entity.IcSuperiorResourceEntity;
import com.epmet.excel.IcPublicServiceExcel;
import com.epmet.excel.handler.IcPublicServiceExcelImportListener;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -61,6 +62,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -87,6 +89,9 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private IcCoverageCategoryDictDao coverageCategoryDictDao;
@Override
@ -100,6 +105,18 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
//列表/导出查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<IcPublicServiceListResultDTO> list = baseDao.selectPublicServiceList(formDTO);
// 网格员信息填充
list.stream().forEach(e -> {
if (org.apache.commons.lang.StringUtils.isNotBlank(e.getGriderId())) {
CustomerStaffInfoCacheResult griderInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), e.getGriderId());
if (griderInfo != null) {
e.setGriderName(griderInfo.getRealName());
e.setGriderPhone(griderInfo.getMobile());
}
}
});
PageInfo<IcPublicServiceListResultDTO> pageInfo = new PageInfo<>(list);
//封装类别数据
@ -312,7 +329,7 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
}
@Override
public List<StatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId) {
public List<LingShanScreenStatsByCategoryRstDTO> lingshanScreenStatsByCategory(String orgType, String orgId) {
// 先拿pids
String orgIdPath;
if (StringUtils.isAnyBlank(orgType, orgId)) {
@ -329,4 +346,49 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl<IcPublicServiceD
// 查询
return baseDao.lingshanScreenStatsByCategory(orgIdPath, EpmetRequestHolder.getLoginUserCustomerId());
}
@Override
public List<LingShanScreenPublicServicePlaceListByCateRstDTO> lingshanScreenListByCategory(String orgId, String orgType, String category) {
String orgIdPath;
if (StringUtils.isAnyBlank(orgType, orgId)) {
orgIdPath = userRemoteService.getLoginUserDetails().getOrgIdPath();
} else {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {
return new ArrayList<>();
}
}
// 查询类别,并且转化为字典,备用
Map<String, IcCoverageCategoryDictListResultDTO> categoryAndObj =
coverageCategoryDictDao.dictMap(EpmetRequestHolder.getLoginUserCustomerId(), "public_service")
.stream()
.collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, Function.identity()));
// 查询数据,并且填充内容,返回前端
LambdaQueryWrapper<IcPublicServiceEntity> q = new LambdaQueryWrapper<>();
q.eq(IcPublicServiceEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
q.eq(StringUtils.isNotBlank(category), IcPublicServiceEntity::getCategory, category);
q.likeRight(IcPublicServiceEntity::getAgencyIdPath, orgIdPath);
return baseDao.selectList(q).stream().map(e -> {
String griderName = null;
String griderPhone = null;
if (org.apache.commons.lang.StringUtils.isNotBlank(e.getGriderId())) {
CustomerStaffInfoCacheResult griderInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), e.getGriderId());
if (griderInfo != null) {
griderName = griderInfo.getRealName();
griderPhone = griderInfo.getMobile();
}
}
return new LingShanScreenPublicServicePlaceListByCateRstDTO(
e.getName(), categoryAndObj.get(e.getCategory()).getLabel(), e.getLongitude(), e.getLatitude(), e.getAddress(),
e.getPrincipal(), e.getMobile(), e.getPoliceName(), e.getPolicePhone(), griderName, griderPhone);
}).collect(Collectors.toList());
}
}

55
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

@ -5,29 +5,29 @@
<select id="getList" resultType="com.epmet.dto.result.PlaceOrgDetailResultDTO">
SELECT
a.id placeOrgId,
a.grid_id gridId,
b.grid_name gridName,
a.nine_place_val ninePlaceVal,
a.place_org_name placeOrgName,
a.address address,
a.scale scale,
a.person_in_charge personInCharge,
a.mobile mobile,
a.AGENCY_ID as agencyId,
a.SECURITY_FLAG securityFlag,
a.SECURITY_PRINCIPAL_NAME securityPrincipalName,
a.SECURITY_PRINCIPAL_MOBILE securityPrincipalMobile,
a.BQ_LD bqLd,
a.BQ_GB bqGb,
a.LONGITUDE longitude,
a.LATITUDE latitude,
a.COMPANY_PROFILE companyProfile
a.id placeOrgId,
a.grid_id gridId,
b.grid_name gridName,
a.nine_place_val ninePlaceVal,
a.place_org_name placeOrgName,
a.address address,
a.scale scale,
a.person_in_charge personInCharge,
a.mobile mobile,
a.AGENCY_ID as agencyId,
a.SECURITY_FLAG securityFlag,
a.SECURITY_PRINCIPAL_NAME securityPrincipalName,
a.SECURITY_PRINCIPAL_MOBILE securityPrincipalMobile,
a.BQ_LD bqLd,
a.BQ_GB bqGb,
a.LONGITUDE longitude,
a.LATITUDE latitude,
a.COMPANY_PROFILE companyProfile
FROM
ic_place_org a
ic_place_org a
LEFT JOIN customer_grid b ON a.GRID_ID = b.ID
WHERE
a.del_flag = '0'
a.del_flag = '0'
<if test="placeOrgId != null and placeOrgId.trim() != ''">
AND a.id = #{placeOrgId}
</if>
@ -55,4 +55,19 @@
ORDER BY a.created_time DESC
</select>
<select id="getPlaceOrgByType" resultType="com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO">
SELECT
count( p.id) as total,
p.NINE_PLACE_VAL as dictValue
FROM
ic_place_org p
<where>
p.DEL_FLAG = 0
<if test="null != orgPath and orgPath != ''">
AND p.PIDS LIKE concat(#{orgPath},'%')
</if>
</where>
GROUP BY p.NINE_PLACE_VAL
</select>
</mapper>

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml

@ -58,4 +58,19 @@
a.created_time DESC
</select>
<select id="getPlacePatrolRecordByType" resultType="com.epmet.dto.result.lingshan.PlaceOrgByTypeResultDTO">
SELECT
count( r.id) as total,
r.DANGER_TYPE as dictValue
FROM
ic_place_patrol_record r
<where>
r.DEL_FLAG = 0
<if test="null != orgPath and orgPath != ''">
AND r.PIDS LIKE concat(#{orgPath},'%')
</if>
</where>
GROUP BY r.DANGER_TYPE
</select>
</mapper>

7
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml

@ -82,7 +82,10 @@
longitude longitude,
latitude latitude,
PRINCIPAL AS principal,
MOBILE AS mobile
MOBILE AS mobile,
POLICE_NAME,
POLICE_PHONE,
GRIDER_ID
FROM
ic_public_service
WHERE
@ -107,7 +110,7 @@
<!--灵山大屏:各类别服务的数量统计-->
<select id="lingshanScreenStatsByCategory"
resultType="com.epmet.dto.result.lingshan.StatsByCategoryRstDTO">
resultType="com.epmet.dto.result.lingshan.LingShanScreenStatsByCategoryRstDTO">
select d.CATEGORY_KEY category, d.CATEGORY_NAME name, count(*) total
from ic_coverage_category_dict d
left join ic_public_service ps

4
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/converter/LingShanSpecialCrowdJzhzConverter.java

@ -95,8 +95,8 @@ public class LingShanSpecialCrowdJzhzConverter implements Converter<Integer> {
public enum DangerousClass {
ZERO(0, "0级"),
ONE(1, "1级"),
TOW(2, "2级(偏执性精神病)"),
THREE(3, "3级(情感)障碍"),
TOW(2, "2级"),
THREE(3, "3级"),
FOUR(4, "4级"),
FIVE(5, "5级");

Loading…
Cancel
Save