yinzuomei 2 years ago
parent
commit
e75c12e0df
  1. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java
  2. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java
  3. 120
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsImportListener.java
  4. 140
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsModel.java
  5. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  6. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java
  8. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  9. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  10. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsAddEditFormDTO.java

@ -126,6 +126,7 @@ public class IcDangerousChemicalsAddEditFormDTO implements Serializable {
/** /**
* 灵山企业介绍 * 灵山企业介绍
*/ */
@Length(max = 1000,groups = {LingShanAddGroup.class, LingShanEditGroup.class},message = "企业介绍最多输入1000字")
private String companyProfile; private String companyProfile;

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcDangerousChemicalsListFormDTO.java

@ -25,7 +25,7 @@ public class IcDangerousChemicalsListFormDTO extends PageFormDTO implements Seri
/** /**
* 灵山GRID_ID的全路径包含grid_id * 灵山GRID_ID的全路径包含grid_id
* 接口内部赋值用于sql * 接口内部赋值用于sql只有orgType=agency时使用此列查询
*/ */
private String orgIdPath; private String orgIdPath;

120
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/DangerousChemicalsImportListener.java

@ -3,22 +3,29 @@ package com.epmet.model;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.entity.IcDangerousChemicalsEntity;
import com.epmet.service.CoverageService; import com.epmet.service.CoverageService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerGridService;
import com.epmet.service.IcDangerousChemicalsService; import com.epmet.service.IcDangerousChemicalsService;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Author zxc * @Author zxc
@ -31,6 +38,7 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
private IcDangerousChemicalsService icDangerousChemicalsService; private IcDangerousChemicalsService icDangerousChemicalsService;
private CoverageService coverageService; private CoverageService coverageService;
private CustomerAgencyService customerAgencyService;
private CustomerGridService customerGridService; private CustomerGridService customerGridService;
private String currentUserId; private String currentUserId;
private String customerId; private String customerId;
@ -39,11 +47,11 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
private List<DangerousChemicalsModel.RowRemarkMessage> errorRows = new ArrayList<>(); private List<DangerousChemicalsModel.RowRemarkMessage> errorRows = new ArrayList<>();
private List<DangerousChemicalsModel.RowRemarkMessage> otherRows = new ArrayList<>(); private List<DangerousChemicalsModel.RowRemarkMessage> otherRows = new ArrayList<>();
private List<IcDangerousChemicalsEntity> insertList = new ArrayList<>(); private List<IcDangerousChemicalsEntity> insertList = new ArrayList<>();
private Map<String,String> existMap = null; private List<IcDangerousChemicalsEntity> updateList = new ArrayList<>();
/** // /**
* 危化品种类 // * 危化品种类
*/ // */
private Map<String, String> dangerTypeMap; // private Map<String, String> dangerTypeMap;
/** /**
* 企业类别 * 企业类别
*/ */
@ -60,6 +68,7 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
String staffAgencyPath, String staffAgencyPath,
IcDangerousChemicalsService icDangerousChemicalsService, IcDangerousChemicalsService icDangerousChemicalsService,
CoverageService coverageService, CoverageService coverageService,
CustomerAgencyService customerAgencyService,
CustomerGridService customerGridService, CustomerGridService customerGridService,
Map<String, String> dangerTypeMap, Map<String, String> dangerTypeMap,
Map<String, String> categoryDictMap){ Map<String, String> categoryDictMap){
@ -69,8 +78,9 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
this.staffAgencyPath=staffAgencyPath; this.staffAgencyPath=staffAgencyPath;
this.icDangerousChemicalsService = icDangerousChemicalsService; this.icDangerousChemicalsService = icDangerousChemicalsService;
this.coverageService = coverageService; this.coverageService = coverageService;
this.customerAgencyService=customerAgencyService;
this.customerGridService=customerGridService; this.customerGridService=customerGridService;
this.dangerTypeMap=dangerTypeMap; // this.dangerTypeMap=dangerTypeMap;
this.categoryDictMap=categoryDictMap; this.categoryDictMap=categoryDictMap;
} }
@ -80,24 +90,72 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
data.setRowNum(rowNum); data.setRowNum(rowNum);
try { try {
ValidatorUtils.validateEntity(data); ValidatorUtils.validateEntity(data);
//todo
// 所属组织,orgIdPath等等。。。。
IcDangerousChemicalsEntity e = ConvertUtils.sourceToTarget(data, IcDangerousChemicalsEntity.class); IcDangerousChemicalsEntity e = ConvertUtils.sourceToTarget(data, IcDangerousChemicalsEntity.class);
//验证所属组织填写的是否正确
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.getByAgencyName(customerId,data.getAgencyName());
if(null==customerAgencyDTO){
throw new ValidateException(String.format("当前客户下,不存在【%s】",data.getAgencyName()));
}
//验证所属网格
if(StringUtils.isNotBlank(data.getGridName())){
CustomerGridDTO gridFormDto=new CustomerGridDTO();
gridFormDto.setCustomerId(customerId);
gridFormDto.setPid(customerAgencyDTO.getId());
gridFormDto.setGridName(data.getGridName());
CustomerGridDTO gridDTO= customerGridService.get(gridFormDto);
if(null==gridDTO){
throw new ValidateException(String.format("%s下,不存在【%s】",data.getAgencyName(),data.getGridName()));
}
// 企业属于网格
e.setOrgId(gridDTO.getId());
e.setOrgType(OrgTypeEnum.GRID.getCode());
e.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridDTO.getId(),gridDTO.getPids()));
}else{
// 企业属于组织
e.setOrgId(customerAgencyDTO.getId());
e.setOrgType(OrgTypeEnum.AGENCY.getCode());
e.setOrgIdPath(PidUtils.convertPid2OrgIdPath(customerAgencyDTO.getId(),customerAgencyDTO.getPids()));
}
// 验证企业类别
String categoryKey = StrConstant.EPMETY_STR;
for (Map.Entry<String, String> entry : categoryDictMap.entrySet()) {
if (data.getCategoryName().equals(entry.getValue())) {
categoryKey = entry.getKey();
break;
}
}
if (StringUtils.isBlank(categoryKey)) {
throw new ValidateException("【" + data.getCategoryName() + "】此企业类别不存在");
}
e.setCategory(categoryKey);
e.setSourceType("import"); e.setSourceType("import");
e.setAgencyId(staffAgencyId);
e.setCustomerId(customerId); e.setCustomerId(customerId);
e.setAgencyId(staffAgencyId);
e.setAgencyIdPath(staffAgencyPath); e.setAgencyIdPath(staffAgencyPath);
e.setCreatedBy(currentUserId); e.setCreatedBy(currentUserId);
e.setUpdatedBy(currentUserId); e.setUpdatedBy(currentUserId);
e.setSecurityFlag("是".equals(data.getSecurityFlagName()) ? true : false);
// 判断是否存在
IcDangerousChemicalsEntity origin=icDangerousChemicalsService.get(e.getOrgId(),e.getName());
if (null != origin) {
e.setId(origin.getId());
updateList.add(origin);
} else {
insertList.add(e); insertList.add(e);
if (insertList.size() == NumConstant.ONE_HUNDRED){ }
if (insertList.size() == NumConstant.ONE_HUNDRED) {
execPersist();
}
if (updateList.size() == NumConstant.ONE_HUNDRED) {
execPersist(); execPersist();
} }
}catch (Exception e){ }catch (Exception e){
String errorMsg = null; String errorMsg = null;
if (e instanceof ValidateException) { if (e instanceof ValidateException) {
errorMsg = ((ValidateException) e).getMsg(); errorMsg = ((ValidateException) e).getMsg();
} else { }else if(e instanceof EpmetException){
errorMsg=((EpmetException) e).getMsg();
}else {
errorMsg = "未知错误"; errorMsg = "未知错误";
log.error("【重点危化品企业导入】出错:{}", ExceptionUtils.getErrorStackTrace(e)); log.error("【重点危化品企业导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
} }
@ -118,43 +176,15 @@ public class DangerousChemicalsImportListener extends AnalysisEventListener<Dang
private void execPersist() { private void execPersist() {
try { try {
if (CollectionUtils.isNotEmpty(insertList)) { if (CollectionUtils.isNotEmpty(insertList)) {
insertList.forEach(i -> { icDangerousChemicalsService.insertBatch(insertList);
dangerTypeMap.forEach((k,v) -> {
if (i.getDangerTypeName().equals(v)){
i.setDangerType(k);
}
});
categoryDictMap.forEach((k,v) -> {
if (i.getCategoryName().equals(v)){
i.setCategory(k);
}
});
});
Map<String, Long> groupByName = insertList.stream().collect(Collectors.groupingBy(IcDangerousChemicalsEntity::getName, Collectors.counting()));
groupByName.forEach((k,v) -> {
if (v.compareTo(NumConstant.ONE_L) != NumConstant.ZERO){
insertList.forEach(i -> {
if (i.getName().equals(k)){
i.setExistStatus(true);
}
});
}
});
Map<Boolean, List<IcDangerousChemicalsEntity>> groupByStatus = insertList.stream().collect(Collectors.groupingBy(IcDangerousChemicalsEntity::getExistStatus));
if (CollectionUtils.isNotEmpty(groupByStatus.get(true))){
groupByStatus.get(true).forEach(t -> {
DangerousChemicalsModel.RowRemarkMessage errorRow = ConvertUtils.sourceToTarget(t, DangerousChemicalsModel.RowRemarkMessage.class);
errorRow.setErrorInfo("表格中存在重复数据");
errorRows.add(errorRow);
});
}
if (CollectionUtils.isNotEmpty(groupByStatus.get(false))){
icDangerousChemicalsService.importInsert(groupByStatus.get(false));
} }
if (CollectionUtils.isNotEmpty(updateList)) {
icDangerousChemicalsService.updateBatchById(updateList);
} }
} finally { } finally {
insertList.clear(); insertList.clear();
existMap = null; updateList.clear();
} }
} }

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

@ -3,7 +3,6 @@ package com.epmet.model;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
@ -17,8 +16,15 @@ import javax.validation.constraints.NotBlank;
@Data @Data
public class DangerousChemicalsModel { public class DangerousChemicalsModel {
@NotBlank(message = "所属组织不能为空")
@ExcelProperty(value = "所属组织")
private String agencyName;
@ExcelProperty(value = "所属网格")
private String gridName;
@NotBlank(message = "企业名称不能为空") @NotBlank(message = "企业名称不能为空")
@Length(max = 50,message = "企业名称长度超出50字限制") @Length(max = 35, message = "企业名称最多输入35字")
@ExcelProperty(value = "企业名称") @ExcelProperty(value = "企业名称")
private String name; private String name;
@ -26,37 +32,82 @@ public class DangerousChemicalsModel {
@ExcelProperty(value = "企业类型") @ExcelProperty(value = "企业类型")
private String categoryName; private String categoryName;
@ExcelProperty(value = "周边安全间距(公里)") /**
private String safeDistance = NumConstant.ZERO_STR; * 灵山是否重点安全企业1是0不是必填
*/
@ExcelProperty(value = "危化品种类") @NotBlank(message = "是否重点安全企业不能为空")
private String dangerTypeName; @ExcelProperty(value = "是否重点安全企业")
private String securityFlagName;
// @ExcelProperty(value = "周边安全间距(公里)")
// private String safeDistance = NumConstant.ZERO_STR;
//
// @ExcelProperty(value = "危化品种类")
// private String dangerTypeName;
@NotBlank(message = "企业地址不能为空")
@Length(max = 200, message = "企业地址最多输入200字")
@ExcelProperty(value = "企业地址")
private String address;
@ExcelProperty(value = "负责人") @ExcelProperty(value = "联系人")
private String principalName; private String principalName;
@Length(max = 50,message = "联系电话长度超出50字限制") @Length(max = 50, message = "联系电话长度超出50字限制")
@ExcelProperty(value = "联系电话") @ExcelProperty(value = "联系电话")
private String principalMobile; private String principalMobile;
@NotBlank(message = "经营地址不能为空") // @ExcelProperty(value = "备注")
@Length(max = 50,message = "经营地址长度超出50字限制") // private String remark;
@ExcelProperty(value = "经营地址")
private String address;
@ExcelProperty(value = "备注") /**
private String remark; * 灵山安全负责人姓名
*/
@ExcelProperty(value = "安全负责人姓名")
private String securityPrincipalName;
/**
* 灵山手机号
*/
@ExcelProperty(value = "手机号")
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
@ExcelProperty(value = "包企领导")
private String bqLd;
/**
* 灵山包企干部
*/
@ExcelProperty(value = "包企干部")
private String bqGb;
/**
* 灵山企业介绍
*/
@Length(max = 1000, message = "企业介绍最多输入1000字")
@ExcelProperty(value = "企业介绍")
private String companyProfile;
@ExcelIgnore @ExcelIgnore
private Integer rowNum; private Integer rowNum;
@Data @Data
public static class RowRemarkMessage { public static class RowRemarkMessage {
@ExcelProperty(value = "行号") @ExcelProperty(value = "行号")
private Integer rowNum; private Integer rowNum;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "所属组织")
private String agencyName;
@ColumnWidth(20)
@ExcelProperty(value = "所属网格")
private String gridName;
@ColumnWidth(40)
@ExcelProperty(value = "企业名称") @ExcelProperty(value = "企业名称")
private String name; private String name;
@ -64,29 +115,62 @@ public class DangerousChemicalsModel {
@ExcelProperty(value = "企业类型") @ExcelProperty(value = "企业类型")
private String categoryName; private String categoryName;
/**
* 灵山是否重点安全企业1是0不是必填
*/
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "周边安全间距(公里)") @ExcelProperty(value = "是否重点安全企业")
private String safeDistance = NumConstant.ZERO_STR; private String securityFlag;
@ColumnWidth(20) @ColumnWidth(50)
@ExcelProperty(value = "危化品种类") @ExcelProperty(value = "企业地址")
private String dangerTypeName; private String address;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "负责人") @ExcelProperty(value = "联系人")
private String principalName; private String principalName;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "联系电话") @ExcelProperty(value = "联系电话")
private String principalMobile; private String principalMobile;
@ColumnWidth(40) // @ExcelProperty(value = "备注")
@ExcelProperty(value = "经营地址") // private String remark;
private String address;
@ColumnWidth(60) /**
@ExcelProperty(value = "备注") * 灵山安全负责人姓名
private String remark; */
@ColumnWidth(20)
@ExcelProperty(value = "安全负责人姓名")
private String securityPrincipalName;
/**
* 灵山手机号
*/
@ColumnWidth(20)
@ExcelProperty(value = "手机号")
private String securityPrincipalMobile;
/**
* 灵山包企领导
*/
@ColumnWidth(30)
@ExcelProperty(value = "包企领导")
private String bqLd;
/**
* 灵山包企干部
*/
@ColumnWidth(30)
@ExcelProperty(value = "包企干部")
private String bqGb;
/**
* 灵山企业介绍
*/
@ColumnWidth(5)
@ExcelProperty(value = "企业介绍")
private String companyProfile;
@ColumnWidth(60) @ColumnWidth(60)
@ExcelProperty("错误信息") @ExcelProperty("错误信息")

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

@ -18,7 +18,6 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -355,4 +354,6 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Date 2022/11/30 22:41 * @Date 2022/11/30 22:41
**/ **/
Result<List<CurrentUserCommunityInfoResultDTO>> getCurrentUserCommunityInfo(TokenDto tokenDTO); Result<List<CurrentUserCommunityInfoResultDTO>> getCurrentUserCommunityInfo(TokenDto tokenDTO);
CustomerAgencyDTO getByAgencyName(String customerId,String agencyName);
} }

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

@ -387,4 +387,6 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @param formDTO * @param formDTO
*/ */
void abandonGridForDealBizData(AbandonGridFormDTO formDTO); void abandonGridForDealBizData(AbandonGridFormDTO formDTO);
CustomerGridDTO get(CustomerGridDTO forDto);
} }

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

@ -81,5 +81,5 @@ public interface IcDangerousChemicalsService extends BaseService<IcDangerousChem
void dangerousChemicalsImport(Path filePath, String importTaskId, TokenDto tokenDto); void dangerousChemicalsImport(Path filePath, String importTaskId, TokenDto tokenDto);
void importInsert(List<IcDangerousChemicalsEntity> entityList); void importInsert(List<IcDangerousChemicalsEntity> entityList);
IcDangerousChemicalsEntity get(String orgId, String name);
} }

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

@ -17,6 +17,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -1607,4 +1608,13 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return new Result<List<CurrentUserCommunityInfoResultDTO>>().ok(list); return new Result<List<CurrentUserCommunityInfoResultDTO>>().ok(list);
} }
@Override
public CustomerAgencyDTO getByAgencyName(String customerId,String agencyName) {
LambdaQueryWrapper<CustomerAgencyEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(CustomerAgencyEntity::getOrganizationName,agencyName)
.eq(CustomerAgencyEntity::getCustomerId,customerId)
.last("limit 1");
CustomerAgencyEntity customerAgencyEntity=baseDao.selectOne(queryWrapper);
return ConvertUtils.sourceToTarget(customerAgencyEntity,CustomerAgencyDTO.class);
}
} }

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -1095,4 +1095,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
baseDao.update(null,updateGrid); baseDao.update(null,updateGrid);
} }
@Override
public CustomerGridDTO get(CustomerGridDTO formDto) {
LambdaQueryWrapper<CustomerGridEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank(formDto.getCustomerId()),CustomerGridEntity::getCustomerId,formDto.getCustomerId())
.eq(StringUtils.isNotBlank(formDto.getPid()),CustomerGridEntity::getPid,formDto.getPid())
.eq(StringUtils.isNotBlank(formDto.getGridName()),CustomerGridEntity::getGridName,formDto.getGridName())
.last("limit 1");
CustomerGridEntity customerGridEntity=baseDao.selectOne(queryWrapper);
return ConvertUtils.sourceToTarget(customerGridEntity,CustomerGridDTO.class);
}
} }

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

@ -84,6 +84,8 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
private OssFeignClient ossFeignClient; private OssFeignClient ossFeignClient;
@Autowired @Autowired
private CustomerGridService customerGridService; private CustomerGridService customerGridService;
@Autowired
private CustomerAgencyService customerAgencyService;
@Override @Override
public PageData<IcDangerousChemicalsListResultDTO> list(IcDangerousChemicalsListFormDTO formDTO) { public PageData<IcDangerousChemicalsListResultDTO> list(IcDangerousChemicalsListFormDTO formDTO) {
@ -162,7 +164,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
* @param name * @param name
* @param icDangerousChemicalsId * @param icDangerousChemicalsId
*/ */
private void checkNameUnqiue(String orgId, String name, String icDangerousChemicalsId) { public void checkNameUnqiue(String orgId, String name, String icDangerousChemicalsId) {
LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcDangerousChemicalsEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcDangerousChemicalsEntity::getOrgId, orgId); tWrapper.eq(IcDangerousChemicalsEntity::getOrgId, orgId);
tWrapper.eq(IcDangerousChemicalsEntity::getName, name) tWrapper.eq(IcDangerousChemicalsEntity::getName, name)
@ -259,6 +261,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
staffInfo.getAgencyId(),staffAgencyPath, staffInfo.getAgencyId(),staffAgencyPath,
this, this,
coverageService, coverageService,
customerAgencyService,
customerGridService, customerGridService,
dangerTypeMap, dangerTypeMap,
categoryDictMap); categoryDictMap);
@ -337,4 +340,10 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl<IcDangerous
baseDao.importInsert(entityList); baseDao.importInsert(entityList);
} }
@Override
public IcDangerousChemicalsEntity get(String orgId, String name) {
LambdaQueryWrapper<IcDangerousChemicalsEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcDangerousChemicalsEntity::getOrgId,orgId).eq(IcDangerousChemicalsEntity::getName,name);
return baseDao.selectOne(queryWrapper);
}
} }
Loading…
Cancel
Save