| | |
| | | package com.gkhy.safePlatform.incidentManage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountAuthService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressCasualtyInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressFileInfoService; |
| | | import com.gkhy.safePlatform.incidentManage.service.baseService.AccidentExpressInfoService; |
| | | import org.apache.dubbo.config.annotation.DubboReference; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("accidentExpressService") |
| | |
| | | |
| | | @Autowired |
| | | private AccidentExpressCasualtyInfoService accidentExpressCasualtyInfoService; |
| | | |
| | | @DubboReference(check = false) |
| | | private AccountDepartmentService accountDepartmentService; |
| | | |
| | | |
| | | @Override |
| | |
| | | List<AccidentExpressInfoPageDO> accidentExpressInfoPageDOList = accidentExpressInfoService.selectAccidentExpressList(page, accidentExpressDBQuery); |
| | | List<AccidentExpressPageRespDTO> respList = BeanCopyUtils.copyBeanList(accidentExpressInfoPageDOList, AccidentExpressPageRespDTO.class); |
| | | |
| | | Map<Long, String> depPool = new HashMap<>(); |
| | | |
| | | respList.forEach(AccidentExpressPageRespDTO ->{ |
| | | // 设置人员名称 |
| | | // 设置部门名称 |
| | | if (!depPool.containsKey(AccidentExpressPageRespDTO.getAccidentDepartmentId())) { |
| | | ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(AccidentExpressPageRespDTO.getAccidentDepartmentId()); |
| | | if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) { |
| | | if (rpcResult.getData() != null) { |
| | | DepInfoRPCRespDTO dep = (DepInfoRPCRespDTO) rpcResult.getData(); |
| | | |
| | | depPool.put(dep.getDepId(), dep.getDepName()); |
| | | } |
| | | }} |
| | | |
| | | String depName = depPool.get(AccidentExpressPageRespDTO.getAccidentDepartmentId()); |
| | | AccidentExpressPageRespDTO.setDeptName(depName); |
| | | }); |
| | | |
| | | return new SearchResultVO<>( |
| | | true, |
| | | pageIndex, |
| | | pageSize, |
| | | pageSize,page.getPages(), |
| | | page.getTotal(), |
| | | respList, |
| | | ResultCodes.OK |