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