Browse Source

党员风采数据导入

master
zhaoqifeng 4 years ago
parent
commit
628c32864d
  1. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  3. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  4. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  5. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  6. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java
  7. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -528,4 +528,7 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/icneighborhood/getlistbyids")
Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids);
@GetMapping("/gov/org/customergrid/getGridIListByAgency/{agencyId}")
Result<List<CustomerGridDTO>> getGridIListByAgency(@PathVariable("agencyId") String agencyId)
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -329,6 +329,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getListByIds", ids);
}
@Override
public Result<List<CustomerGridDTO>> getGridIListByAgency(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridIListByAgency", agencyId);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -302,4 +302,10 @@ public class CustomerGridController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<OptionResultDTO>>().ok(customerGridService.getGridOption(formDTO.getAgencyId(),formDTO.getPurpose()));
}
@GetMapping("getGridIListByAgency/{agencyId}")
public Result<List<CustomerGridDTO>> getGridIListByAgency(@PathVariable("agencyId") String agencyId) {
List<CustomerGridDTO> resultDTOS = customerGridService.getGridIListByAgency(agencyId);
return new Result<List<CustomerGridDTO>>().ok(resultDTOS);
}
}

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

@ -338,4 +338,14 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Date 2021/10/26 14:01
*/
List<OptionResultDTO> getGridOption(String agencyId,String purpose);
/**
* @Description 获取组织下网格
* @Param agencyId
* @Return {@link List< CustomerGridDTO>}
* @Author zhaoqifeng
* @Date 2021/11/29 17:00
*/
List<CustomerGridDTO> getGridIListByAgency(String agencyId);
}

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

@ -873,4 +873,23 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}).collect(Collectors.toList());
}
/**
* @param agencyId
* @Description 获取组织下网格
* @Param agencyId
* @Return {@link List< CustomerGridDTO>}
* @Author zhaoqifeng
* @Date 2021/11/29 17:00
*/
@Override
public List<CustomerGridDTO> getGridIListByAgency(String agencyId) {
LambdaQueryWrapper<CustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerGridEntity::getPid, agencyId);
List<CustomerGridEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class);
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java

@ -113,7 +113,7 @@ public class IcPartymemberStyleController {
@PostMapping("import")
public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException {
icPartymemberStyleService.importData(tokenDto, response, file);
return new Result();
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -26,7 +26,6 @@ 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.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -36,6 +35,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.GridOptionFormDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.partymember.dao.IcPartymemberStyleDao;
@ -223,11 +223,11 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
//获取组织下网格信息
GridOptionFormDTO formDTO = new GridOptionFormDTO();
formDTO.setAgencyId(staffInfoCache.getAgencyId());
Result<List<OptionResultDTO>> gridOptionResult = govOrgOpenFeignClient.getGridOption(formDTO);
Result<List<CustomerGridDTO>> gridOptionResult = govOrgOpenFeignClient.getGridIListByAgency(staffInfoCache.getAgencyId());
if (!gridOptionResult.success()) {
throw new EpmetException(gridOptionResult.getCode(), gridOptionResult.getMsg());
}
Map<String, String> gridMap = gridOptionResult.getData().stream().collect(Collectors.toMap(OptionResultDTO::getLabel, OptionResultDTO::getValue));
Map<String, String> gridMap = gridOptionResult.getData().stream().collect(Collectors.toMap(CustomerGridDTO::getGridName, CustomerGridDTO::getId));
//1.数据校验 只允许导入当前组织下的网格的数据
//网格名称不一样的数据舍弃
Iterator<IcPartymemberStyleImportExcel> iterator = result.iterator();

Loading…
Cancel
Save