|
|
@ -12,6 +12,7 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.enums.DictTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
@ -43,6 +44,7 @@ import com.epmet.entity.IcCommunitySelfOrganizationEntity; |
|
|
|
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; |
|
|
|
import com.epmet.excel.CommunitySelfOrgImportExcel; |
|
|
|
import com.epmet.excel.ImportCommunitySelfOrganization; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.feign.OssFeignClient; |
|
|
|
import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; |
|
|
@ -51,6 +53,7 @@ import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.fileupload.FileItem; |
|
|
|
import org.apache.commons.fileupload.FileItemFactory; |
|
|
|
import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
|
|
@ -93,6 +96,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
private OssFeignClient ossFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcCommunitySelfOrganizationDTO> page(Map<String, Object> params) { |
|
|
@ -328,11 +333,16 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
} |
|
|
|
List<CommunitySelfOrganizationListDTO> resultDTOs = baseDao.selectCommunitySelfOrganizationList(formDTO); |
|
|
|
if (CollectionUtils.isNotEmpty(resultDTOs)){ |
|
|
|
//获取分类名称字典
|
|
|
|
Result<Map<String, String>> dictMapRes=adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); |
|
|
|
Map<String, String> dictMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); |
|
|
|
result.setTotal(resultDTOs.size()); |
|
|
|
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE); |
|
|
|
for (CommunitySelfOrganizationListDTO r : resultDTOs) { |
|
|
|
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); |
|
|
|
r.setScore(null == pointMap.get(r.getOrgId()) ? NumConstant.ZERO : pointMap.get(r.getOrgId())); |
|
|
|
//赋值分类名称
|
|
|
|
r.setCategoryName(dictMap.get(r.getCategoryCode())); |
|
|
|
} |
|
|
|
result.setList(resultDTOs); |
|
|
|
} |
|
|
@ -538,7 +548,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
iterator.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Result<Map<String, String>> dictMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.SELF_ORG_CATEGORY.getCode()); |
|
|
|
Map<String, String> categoryMap = dictMapRes.success() && MapUtils.isNotEmpty(dictMapRes.getData()) ? dictMapRes.getData() : new HashMap<>(); |
|
|
|
list.forEach(l -> { |
|
|
|
IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class); |
|
|
|
e.setCustomerId(tokenDto.getCustomerId()); |
|
|
@ -547,7 +558,13 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
e.setPid(agencyInfo.getPid()); |
|
|
|
e.setPids(agencyInfo.getPids()); |
|
|
|
e.setOrganizationCreatedTime(DateUtils.parse(l.getOrganizationCreatedTime(), DATE_PATTERN)); |
|
|
|
|
|
|
|
//赋值分类编码,excel输入的是分类名称,需要找到admin字典库中的key
|
|
|
|
for (String key : categoryMap.keySet()) { |
|
|
|
if (StringUtils.isNotBlank(categoryMap.get(key)) && categoryMap.get(key).equals(e.getCategoryCode())) { |
|
|
|
e.setCategoryCode(categoryMap.get(key)); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
List<IcCommunitySelfOrganizationPersonnelEntity> persons = new ArrayList<>(); |
|
|
|
AtomicReference<Boolean> bl = new AtomicReference<>(false); |
|
|
|
StringBuffer msg = new StringBuffer(""); |
|
|
|