Browse Source

灵山项目:大屏生产企业类型统计和安全隐患类型统计;

master
luyan 3 years ago
parent
commit
10f29d7a6e
  1. 27
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/PlaceOrgByTypeResultDTO.java
  2. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java
  3. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
  4. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlaceOrgDao.java
  5. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java
  6. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlaceOrgService.java
  7. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
  8. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java
  9. 49
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
  10. 55
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml
  11. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml

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

24
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;
/**
@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("placeorg")
public class IcPlaceOrgController {
@Autowired
private IcPlaceOrgService placeOrgService;
@ -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));
}
}
}

24
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));
}
}

5
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);
}

6
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);
}

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

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());
}
}
}

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>

Loading…
Cancel
Save