Browse Source

修改资源相关导入

master
qushutong 2 years ago
parent
commit
a0080d936b
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java
  5. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java
  6. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcSuperiorResourceExcelImportListener.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcSuperiorResourceServiceImpl.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyActivityImportListener.java

@ -60,6 +60,8 @@ public class IcPartyActivityImportListener implements ReadListener<IcPartyActivi
e.setAgencyId(staffInfo.getAgencyId());
e.setPids(staffInfo.getAgencyPIds());
e.setContent(StrConstant.EPMETY_STR);
e.setLatitude(staffInfo.getLatitude());
e.setLongitude(staffInfo.getLongitude());
datas.add(e);
if (datas.size() == MAX_THRESHOLD) {

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/handler/IcPartyUnitExcelImportListener.java

@ -88,6 +88,8 @@ public class IcPartyUnitExcelImportListener implements ReadListener<IcPartyUnitI
e.setCustomerId(customerId);
e.setAgencyId(staffInfo.getAgencyId());
e.setPids(staffInfo.getAgencyPIds());
e.setLongitude(staffInfo.getLongitude());
e.setLatitude(staffInfo.getLatitude());
datas.add(e);
if (datas.size() == MAX_THRESHOLD) {

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -603,6 +603,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setLatitude(agencyInfo.getLatitude());
e.setLongitude(agencyInfo.getLongitude());
e.setOrganizationCreatedTime(StringUtils.isNotBlank(l.getOrganizationCreatedTime()) ? DateUtils.stringToDate(l.getOrganizationCreatedTime(), DATE_PATTERN) : new Date());
//赋值分类编码,excel输入的是分类名称,需要找到admin字典库中的key
String categoryName=l.getCategoryCode();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java

@ -278,7 +278,7 @@ public class IcEnterpriseController implements ResultDataResolver {
}
/**
*
* 九小场所导入
* @param tokenDto
* @param file
* @return

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcEnterpriseExcelImportListener.java

@ -95,8 +95,8 @@ public class IcEnterpriseExcelImportListener implements ReadListener<EnterpriseI
enterpriseEntity.setAgencyPids(staffInfo.getAgencyPIds());
//场所类型
enterpriseEntity.setPlaceType(placeTypeMap.get(data.getPlaceTypeName()));
enterpriseEntity.setLongitude(StrConstant.EPMETY_STR);
enterpriseEntity.setLatitude(StrConstant.EPMETY_STR);
enterpriseEntity.setLongitude(staffInfo.getLongitude());
enterpriseEntity.setLatitude(staffInfo.getLatitude());
//规模
// enterpriseEntity.setScale(scaleMap.get(data.getScaleName()));
enterpriseEntity.setScaleTotal(Integer.valueOf(data.getScaleTotal()));

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/handler/IcSuperiorResourceExcelImportListener.java

@ -3,6 +3,7 @@ package com.epmet.excel.handler;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -37,7 +38,7 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup
private String currentCustomerId;
private String currentAgencyId;
private String currentAgencyPids;
private CustomerStaffInfoCacheResult staffInfo;
//数据
private List<IcSuperiorResourceEntity> datas = new ArrayList<>();
//错误项列表
@ -51,8 +52,8 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup
private Map<String, String> existMap = null;
public IcSuperiorResourceExcelImportListener(String currentUserId, String currentCustomerId, String currentAgencyId, String currentAgencyPids,
IcSuperiorResourceServiceImpl icSuperiorResourceServiceImpl, CoverageService coverageService, IcSuperiorResourceDao icSuperiorResourceDao) {
public IcSuperiorResourceExcelImportListener(CustomerStaffInfoCacheResult staffInfo, String currentUserId, String currentCustomerId, String currentAgencyId, String currentAgencyPids,
IcSuperiorResourceServiceImpl icSuperiorResourceServiceImpl, CoverageService coverageService, IcSuperiorResourceDao icSuperiorResourceDao) {
this.currentUserId = currentUserId;
this.currentCustomerId = currentCustomerId;
this.currentAgencyId = currentAgencyId;
@ -60,6 +61,7 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup
this.icSuperiorResourceServiceImpl = icSuperiorResourceServiceImpl;
this.coverageService = coverageService;
this.icSuperiorResourceDao = icSuperiorResourceDao;
this.staffInfo = staffInfo;
}
@Override
@ -96,7 +98,9 @@ public class IcSuperiorResourceExcelImportListener implements ReadListener<IcSup
icSuperiorResourceEntity.setSourceType("import");
icSuperiorResourceEntity.setCategory(data.getCategoryName());
icSuperiorResourceEntity.setAreaCovered(data.getAreaCoveredName());
if(StringUtils.isNotBlank(data.getCapacityName())){
icSuperiorResourceEntity.setLatitude(staffInfo.getLatitude());
icSuperiorResourceEntity.setLongitude(staffInfo.getLongitude());
if (StringUtils.isNotBlank(data.getCapacityName())) {
icSuperiorResourceEntity.setCapacity(Integer.parseInt(data.getCapacityName()));
}
icSuperiorResourceEntity.setCreatedBy(currentUserId);

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

@ -214,7 +214,7 @@ public class IcSuperiorResourceServiceImpl extends BaseServiceImpl<IcSuperiorRes
String agencyId = staffInfo.getAgencyId();
String agencyIdPath = StringUtils.isNotBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId() : staffInfo.getAgencyId();
IcSuperiorResourceExcelImportListener listener = new IcSuperiorResourceExcelImportListener(userId, customerId, agencyId, agencyIdPath, this, coverageService, icSuperiorResourceDao);
IcSuperiorResourceExcelImportListener listener = new IcSuperiorResourceExcelImportListener(staffInfo,userId, customerId, agencyId, agencyIdPath, this, coverageService, icSuperiorResourceDao);
EasyExcel.read(filePath.toFile(), IcSuperiorResourceExcel.class, listener).headRowNumber(1).sheet(0).doRead();

Loading…
Cancel
Save