Browse Source

生产企业类型统计-点击饼图列表(详情)通用

master
yinzuomei 2 years ago
parent
commit
51113bdb38
  1. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/lingshan/DangerousChemicalsDistributionFormDTO.java
  2. 56
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java
  3. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java
  4. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java
  5. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java
  6. 44
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java
  7. 28
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml

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

@ -0,0 +1,15 @@
package com.epmet.dto.form.lingshan;
import com.epmet.commons.tools.dto.form.OrgCommonFormDTO;
import lombok.Data;
/**
* @Description 灵山大屏-安全生产-生产企业类型统计点击饼图中间地图显示列表
* @Author yzm
* @Date 2023/5/15 14:59
*/
@Data
public class DangerousChemicalsDistributionFormDTO extends OrgCommonFormDTO {
private String typeCode;
}

56
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.result.lingshan;
/**
* @Description 灵山大屏-安全生产-生产企业类型统计 点击饼图列表及详情返参DTO
* @Author yzm
* @Date 2023/5/15 15:00
*/
import lombok.Data;
@Data
public class DangerousChemicalsTypeStatDetailDTO {
/**
* 企业id
*/
private String id;
/**
* 企业名称
*/
private String name;
/**
* 企业介绍
*/
private String content;
private String longitude;
private String latitude;
private String addr;
/**
* 联系人
*/
private String annt;
/**
* 联系电话
*/
private String phone;
// @JsonIgnore
private String category;
/**
* 类别名称
*/
private String type;
/**
* 是否重点企业
*/
private Boolean zd;
/**
* 包企领导
*/
private String leader;
/**
* 包企干部
*/
private String cadre;
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java

@ -24,8 +24,10 @@ import com.epmet.dto.IcDangerousChemicalsDTO;
import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO;
import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.lingshan.DangerousChemicalsDistributionFormDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO;
import com.epmet.excel.IcDangerousChemicalsExcel; import com.epmet.excel.IcDangerousChemicalsExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -297,7 +299,25 @@ public class IcDangerousChemicalsController {
* @return * @return
*/ */
@PostMapping("type-stat") @PostMapping("type-stat")
public Result<List<DangerousChemicalsTypeStatResultDTO>> typeStat(@RequestBody OrgCommonFormDTO formDto) { public Result<List<DangerousChemicalsTypeStatResultDTO>> typeStat(@LoginUser TokenDto tokenDto, @RequestBody OrgCommonFormDTO formDto) {
return new Result<List<DangerousChemicalsTypeStatResultDTO>>().ok(icDangerousChemicalsService.typeStat(formDto.getOrgId(), formDto.getOrgType())); return new Result<List<DangerousChemicalsTypeStatResultDTO>>().ok(icDangerousChemicalsService.typeStat(tokenDto.getCustomerId(),
tokenDto.getUserId(),
formDto.getOrgId(),
formDto.getOrgType()));
}
/**
* 灵山大屏-安全生产-生产企业类型统计,点击饼图查询列表及详情
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("distribution")
public Result<List<DangerousChemicalsTypeStatDetailDTO>> distribution(@LoginUser TokenDto tokenDto, @RequestBody DangerousChemicalsDistributionFormDTO formDTO) {
return new Result<List<DangerousChemicalsTypeStatDetailDTO>>().ok(icDangerousChemicalsService.distribution(tokenDto.getCustomerId(),
tokenDto.getUserId(),
formDTO.getOrgId(),
formDTO.getOrgType(),
formDTO.getTypeCode()));
} }
} }

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO;
import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.entity.IcDangerousChemicalsEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -24,4 +25,14 @@ public interface IcDangerousChemicalsDao extends BaseDao<IcDangerousChemicalsEnt
void importInsert(@Param("entityList") List<IcDangerousChemicalsEntity> entityList); void importInsert(@Param("entityList") List<IcDangerousChemicalsEntity> entityList);
/**
* 灵山大屏-安全生产-生产企业类型统计,点击饼图查询列表及详情
* @param customerId
* @param orgIdPath
* @param typeCode
* @return
*/
List<DangerousChemicalsTypeStatDetailDTO> selectDistributionList(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("typeCode") String typeCode);
} }

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java

@ -7,6 +7,7 @@ import com.epmet.dto.IcDangerousChemicalsDTO;
import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO;
import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO;
import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.entity.IcDangerousChemicalsEntity;
@ -90,5 +91,16 @@ public interface IcDangerousChemicalsService extends BaseService<IcDangerousChem
* @param orgType * @param orgType
* @return * @return
*/ */
List<DangerousChemicalsTypeStatResultDTO> typeStat(String orgId, String orgType); List<DangerousChemicalsTypeStatResultDTO> typeStat(String customerId,String staffId,String orgId, String orgType);
/**
* 灵山大屏-安全生产-生产企业类型统计,点击饼图查询列表及详情
* @param customerId
* @param userId
* @param orgId
* @param orgType
* @param typeCode
* @return
*/
List<DangerousChemicalsTypeStatDetailDTO> distribution(String customerId, String staffId, String orgId, String orgType, String typeCode);
} }

44
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java

@ -28,6 +28,7 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO;
import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO;
import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.entity.IcDangerousChemicalsEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -363,13 +364,13 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
* @return * @return
*/ */
@Override @Override
public List<DangerousChemicalsTypeStatResultDTO> typeStat(String orgId, String orgType) { public List<DangerousChemicalsTypeStatResultDTO> typeStat(String customerId,String staffId,String orgId, String orgType) {
// 企业类别字典数据 // 企业类别字典数据
List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(EpmetRequestHolder.getLoginUserCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(customerId, CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode());
if (CollectionUtils.isEmpty(dictList)) { if (CollectionUtils.isEmpty(dictList)) {
return new ArrayList<>(); return new ArrayList<>();
} }
String orgIdPath = queryOrgIdPath(orgId, orgType); String orgIdPath = queryOrgIdPath(customerId,staffId,orgId, orgType);
if (StringUtils.isBlank(orgIdPath)) { if (StringUtils.isBlank(orgIdPath)) {
return new ArrayList<>(); return new ArrayList<>();
} }
@ -378,7 +379,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
DangerousChemicalsTypeStatResultDTO resultDTO = new DangerousChemicalsTypeStatResultDTO(); DangerousChemicalsTypeStatResultDTO resultDTO = new DangerousChemicalsTypeStatResultDTO();
resultDTO.setName(dto.getLabel()); resultDTO.setName(dto.getLabel());
LambdaQueryWrapper<IcDangerousChemicalsEntity> countWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcDangerousChemicalsEntity> countWrapper = new LambdaQueryWrapper<>();
countWrapper.eq(IcDangerousChemicalsEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()) countWrapper.eq(IcDangerousChemicalsEntity::getCustomerId, customerId)
.likeRight(IcDangerousChemicalsEntity::getOrgIdPath, orgIdPath) .likeRight(IcDangerousChemicalsEntity::getOrgIdPath, orgIdPath)
.eq(IcDangerousChemicalsEntity::getCategory, dto.getValue()); .eq(IcDangerousChemicalsEntity::getCategory, dto.getValue());
resultDTO.setValue(baseDao.selectCount(countWrapper)); resultDTO.setValue(baseDao.selectCount(countWrapper));
@ -388,11 +389,11 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
return resultList; return resultList;
} }
private String queryOrgIdPath(String orgId, String orgType) { private String queryOrgIdPath(String customerId,String staffId,String orgId, String orgType) {
String orgIdPath = ""; String orgIdPath = "";
// 如果没传,默认查询当前工作人员所属组织 // 如果没传,默认查询当前工作人员所属组织
if (StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) { if (StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, staffId);
orgId = staffInfoCacheResult.getAgencyId(); orgId = staffInfoCacheResult.getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode(); orgType = OrgTypeEnum.AGENCY.getCode();
} }
@ -406,5 +407,36 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
return orgIdPath; return orgIdPath;
} }
/**
* 灵山大屏-安全生产-生产企业类型统计,点击饼图查询列表及详情
*
* @param customerId
* @param staffId
* @param orgId
* @param orgType
* @param typeCode
* @return
*/
@Override
public List<DangerousChemicalsTypeStatDetailDTO> distribution(String customerId, String staffId, String orgId, String orgType, String typeCode) {
// 企业类别字典数据
List<IcCoverageCategoryDictListResultDTO> dictList = coverageService.dictMap(customerId, CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode());
if (CollectionUtils.isEmpty(dictList)) {
return new ArrayList<>();
}
Map<String, String> categoryDictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel));
String orgIdPath = queryOrgIdPath(customerId, staffId, orgId, orgType);
if (StringUtils.isBlank(orgIdPath)) {
return new ArrayList<>();
}
List<DangerousChemicalsTypeStatDetailDTO> list = baseDao.selectDistributionList(customerId, orgIdPath, typeCode);
list.forEach(l -> {
// 赋值企业分类名称
if (MapUtils.isNotEmpty(categoryDictMap) && categoryDictMap.containsKey(l.getCategory())) {
l.setType(categoryDictMap.get(l.getCategory()));
}
});
return list;
}
} }

28
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml

@ -143,5 +143,31 @@
AND del_flag = '0' AND del_flag = '0'
</delete> </delete>
<!-- 灵山大屏-安全生产-生产企业类型统计,点击饼图,查询列表及详情 -->
<select id="selectDistributionList" parameterType="map" resultType="com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO">
SELECT
c.id,
c.`NAME`,
c.COMPANY_PROFILE AS content,
c.LONGITUDE,
c.LATITUDE,
c.ADDRESS AS addr,
c.PRINCIPAL_NAME AS annt,
c.PRINCIPAL_MOBILE AS phone,
c.CATEGORY,
'' AS type,
c.SECURITY_FLAG AS zd,
c.BQ_LD AS leader,
c.BQ_GB AS cadre
FROM
ic_dangerous_chemicals c
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
and c.ORG_ID_PATH like concat(#{orgIdPath},'%')
<if test="typeCode != null and typeCode != '' ">
AND c.CATEGORY = #{typeCode}
</if>
order by c.CREATED_TIME desc
</select>
</mapper> </mapper>
Loading…
Cancel
Save