Browse Source

Merge remote-tracking branch 'origin/lingshan_master' into lingshan_master

master
wxz 2 years ago
parent
commit
9bbb469749
  1. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  2. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java
  3. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsModel.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  5. 31
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  6. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -351,7 +351,7 @@ public class CustomerAgencyController {
@PostMapping("agencylist") @PostMapping("agencylist")
public Result<AgencyTreeResultDTO> getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) { public Result<AgencyTreeResultDTO> getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) {
if(AppClientConstant.APP_OPER.equals(tokenDTO.getApp())){ if(AppClientConstant.APP_OPER.equals(tokenDTO.getApp())){
ValidatorUtils.validateEntity(formDTO.getCustomerId(),GetAgencyListFormDTO.OperAddUserShowGroup.class); ValidatorUtils.validateEntity(formDTO,GetAgencyListFormDTO.OperAddUserShowGroup.class);
}else{ }else{
if (StringUtils.isBlank(formDTO.getCustomerId())){ if (StringUtils.isBlank(formDTO.getCustomerId())){
formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setCustomerId(tokenDTO.getCustomerId());
@ -405,6 +405,17 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId(),tokenDTO.getCustomerId())); return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId(),tokenDTO.getCustomerId()));
} }
/**
* 根组织开始含网格
* @param formDTO
* @return
*/
@PostMapping("agencygridtreeV2")
public Result<AgencyTreeResultDTO> getOrgList(@RequestBody GetAgencyListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,GetAgencyListFormDTO.OperAddUserShowGroup.class);
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(formDTO.getUserId(),formDTO.getCustomerId()));
}
/** /**
* @Description 事件社区服务热线 * @Description 事件社区服务热线
* @author sun * @author sun

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java

@ -49,7 +49,7 @@ public class IcDangerousChemicalsExcel {
@ColumnWidth(25) @ColumnWidth(25)
private String securityPrincipalName; private String securityPrincipalName;
@ExcelProperty(value = "安全负责电话") @ExcelProperty(value = "安全负责电话")
@ColumnWidth(25) @ColumnWidth(25)
private String securityPrincipalMobile; private String securityPrincipalMobile;

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsModel.java

@ -28,8 +28,8 @@ public class DangerousChemicalsModel {
@ExcelProperty(value = "企业名称") @ExcelProperty(value = "企业名称")
private String name; private String name;
@NotBlank(message = "企业类不能为空") @NotBlank(message = "企业类不能为空")
@ExcelProperty(value = "企业类") @ExcelProperty(value = "企业类")
private String categoryName; private String categoryName;
/** /**
@ -168,7 +168,7 @@ public class DangerousChemicalsModel {
/** /**
* 灵山企业介绍 * 灵山企业介绍
*/ */
@ColumnWidth(5) @ColumnWidth(50)
@ExcelProperty(value = "企业介绍") @ExcelProperty(value = "企业介绍")
private String companyProfile; private String companyProfile;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -267,7 +267,7 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
/** /**
* desc:获取用户所属组织的组织及网格树 * desc:获取用户所属组织的组织及网格树
* @param staffId * @param staffId 为空时从根组织返回
* @return * @return
*/ */
AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId); AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId);

31
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1178,14 +1178,35 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
} }
/**
* 从登录用户所属组织开始包含网格的一颗组织树
* @param staffId 如果staffId为空时从根组织返回
* @param customerId
* @return
*/
@Override @Override
public AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId) { public AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId) {
AgencyTreeResultDTO result = new AgencyTreeResultDTO(); AgencyTreeResultDTO result = new AgencyTreeResultDTO();
//1.查询工作人员所属组织信息 AgencyResultDTO rootAgency=new AgencyResultDTO();
AgencyResultDTO rootAgency = baseDao.selectAgencyByStaffId(staffId); if(StringUtils.isNotBlank(staffId)){
if (null == rootAgency) { //1.查询工作人员所属组织信息
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId)); rootAgency = baseDao.selectAgencyByStaffId(staffId);
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); if (null == rootAgency) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
}
}else{
LambdaQueryWrapper<CustomerAgencyEntity> rootQuery=new LambdaQueryWrapper<>();
rootQuery.eq(CustomerAgencyEntity::getCustomerId,customerId)
.eq(CustomerAgencyEntity::getPid,NumConstant.ZERO_STR);
CustomerAgencyEntity rootEntity=baseDao.selectOne(rootQuery);
rootAgency.setAgencyId(rootEntity.getId());
rootAgency.setAgencyName(rootEntity.getOrganizationName());
rootAgency.setPids(rootEntity.getPids());
rootAgency.setPid(rootEntity.getPid());
rootAgency.setLevel(rootEntity.getLevel());
rootAgency.setLongitude(rootEntity.getLongitude());
rootAgency.setLatitude(rootEntity.getLatitude());
} }
result.setPid(rootAgency.getPid()); result.setPid(rootAgency.getPid());
result.setAgencyName(rootAgency.getAgencyName()); result.setAgencyName(rootAgency.getAgencyName());

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

@ -258,7 +258,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
String staffAgencyPath=PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(),staffAgencyInfo.getPids()); String staffAgencyPath=PidUtils.convertPid2OrgIdPath(staffInfo.getAgencyId(),staffAgencyInfo.getPids());
//危化品种类字典 //危化品种类字典
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode());
if (!statusRes.success() || MapUtils.isNotEmpty(statusRes.getData())) { if (!statusRes.success() || MapUtils.isEmpty(statusRes.getData())) {
throw new EpmetException("获取IC_DANGER_TYPE字典表失败"); throw new EpmetException("获取IC_DANGER_TYPE字典表失败");
} }
Map<String, String> dangerTypeMap = statusRes.getData(); Map<String, String> dangerTypeMap = statusRes.getData();
@ -326,7 +326,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
importFinishTaskForm.setTaskId(importTaskId); importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setOperatorId(tokenDto.getUserId()); importFinishTaskForm.setOperatorId(tokenDto.getUserId());
importFinishTaskForm.setResultDesc("导入失败"); importFinishTaskForm.setResultDesc("导入失败"+errorMsg);
Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm);
if (!result.success()) { if (!result.success()) {

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

@ -104,7 +104,7 @@
</if> </if>
<if test='orgType == "agency"'> <if test='orgType == "agency"'>
<if test="orgIdPath != null and orgIdPath != '' "> <if test="orgIdPath != null and orgIdPath != '' ">
AND dc.org_id_path like concat(#{orgIdPath},'%') AND dc.AGENCY_ID_PATH like concat(#{orgIdPath},'%')
</if> </if>
</if> </if>
<if test='orgType == "grid"'> <if test='orgType == "grid"'>

Loading…
Cancel
Save