|
|
@ -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) { |
|
|
@ -313,6 +318,11 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; |
|
|
|
CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO(); |
|
|
|
|
|
|
|
//获取分类名称字典
|
|
|
|
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<>(); |
|
|
|
|
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
PageInfo<CommunitySelfOrganizationListDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); |
|
|
|
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); |
|
|
@ -321,6 +331,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
l.setSort(i[NumConstant.ZERO]); |
|
|
|
i[NumConstant.ZERO]++; |
|
|
|
l.setScore(null == pointMap.get(l.getOrgId()) ? NumConstant.ZERO : pointMap.get(l.getOrgId())); |
|
|
|
//赋值分类名称
|
|
|
|
l.setCategoryName(dictMap.get(l.getCategoryCode())); |
|
|
|
} |
|
|
|
result.setList(objectPageInfo.getList()); |
|
|
|
} |
|
|
@ -333,6 +345,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
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 +552,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 +562,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(""); |
|
|
|