技术监督bug修改
This commit is contained in:
@@ -184,7 +184,7 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
|
||||
Page<SupvPlan> page = this.page(new Page<>(PageFactory.getPageNum(supvPlanParam), PageFactory.getPageSize(supvPlanParam)), lambdaQueryWrapper);
|
||||
List<SupvPlanVO> supvPlanVOList = BeanUtil.copyToList(page.getRecords(), SupvPlanVO.class);
|
||||
List<String> userIds = supvPlanVOList.stream().map(SupvPlanVO::getUpdateBy).distinct().collect(Collectors.toList());
|
||||
List<String> userIds = supvPlanVOList.stream().map(SupvPlanVO::getPlanUserId).distinct().collect(Collectors.toList());
|
||||
supvPlanVOList.forEach(item -> {
|
||||
PvTerminalTreeVO pvTerminalTreeVO = null;
|
||||
if (mapCode.containsKey(item.getSupvOrgId())) {
|
||||
@@ -231,8 +231,8 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
List<User> userList = userFeignClient.getUserByIdList(userIds).getData();
|
||||
Map<String, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
|
||||
if (map.containsKey(item.getUpdateBy())) {
|
||||
item.setCreateBy(map.get(item.getUpdateBy()).getName());
|
||||
if (map.containsKey(item.getPlanUserId())) {
|
||||
item.setPlanUserName(map.get(item.getPlanUserId()).getName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,12 +15,15 @@ import com.njcn.process.pojo.po.SupvFile;
|
||||
import com.njcn.process.pojo.po.SupvPlan;
|
||||
import com.njcn.process.pojo.po.SupvProblem;
|
||||
import com.njcn.process.pojo.po.SupvReportM;
|
||||
import com.njcn.process.pojo.vo.SupvPlanVO;
|
||||
import com.njcn.process.service.SupvPushGwService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -66,6 +69,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
private final UserFeignClient userFeignClient;
|
||||
|
||||
@Override
|
||||
public boolean pushPlan(List<String> planIds) {
|
||||
LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -93,6 +99,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
List<DictData> supvVoltageDicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> mapVoltage = supvVoltageDicList.stream().collect(Collectors.toMap(DictData::getId,Function.identity()));
|
||||
|
||||
List<String> userIds = supvPlanList.stream().map(SupvPlan::getUpdateBy).distinct().collect(Collectors.toList());
|
||||
List<User> userList = userFeignClient.getUserByIdList(userIds).getData();
|
||||
Map<String, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
|
||||
|
||||
for(SupvPlan supvPlan:supvPlanList){
|
||||
@@ -168,6 +177,11 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
supvPlan.setObjVoltageLevelName(dictData.getName());
|
||||
}
|
||||
|
||||
|
||||
if (map.containsKey(supvPlan.getPlanUserId())) {
|
||||
supvPlan.setPlanUserName(map.get(supvPlan.getPlanUserId()).getName());
|
||||
}
|
||||
|
||||
}
|
||||
if(supvPlanList.size()>100){
|
||||
throw new BusinessException("一次最多上送100条数据");
|
||||
|
||||
Reference in New Issue
Block a user