巡检点备注字段无数据

liweidong
张乾翔 2 days ago
parent 000504dea6
commit 492ddd35d2
  1. 8
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/mapper/EpciuPatrolInspectionMapper.xml
  2. 42
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsEpciuPatrolInspectionServiceImpl.java

@ -8,9 +8,9 @@
<result column="EPC_ID" property="epcId"/>
<result column="INS_NUM" property="insNum"/>
<result column="INS_SITE" property="insSite"/>
<result column="INS_MAN" property="insMan"/>
<result column="uName" property="insMan"/>
<!-- <result column="WAIT_CYCLE" property="waitCycle"/>-->
<result column="INS_MEMO" property="insMemo"/>
<result column="pMemo" property="insMemo"/>
<result column="PAR_MEMO" property="parMemo"/>
<result column="LAUNCH_TIME" property="launchTime"/>
<result column="TEST_TIME" property="testTime"/>
@ -27,7 +27,9 @@
<select id="selectBsEpciuPatrolInspectionPage" resultMap="bsEpciuPatrolInspectionResultMap">
select * from BS_EPCIU_PATROL_INSPECTION n
select n.*,po.MEMO AS pMemo,u.name as uName from BS_EPCIU_PATROL_INSPECTION n
INNER JOIN BS_EPCIU_INSPECTION_POINT po on po.ID = n.EPC_ID
left join blade_user u on u.id = n.INS_MAN
<where>
n.is_deleted = 0
<if test="bsEpciuPatrolInspection.taskStatus!=null">

@ -81,27 +81,27 @@ public class BsEpciuPatrolInspectionServiceImpl extends BaseServiceImpl<BsEpciuP
IPage<BsEpciuPatrolInspectionVO> bsEpciuPatrolInspectionVOIPage =
page.setRecords(baseMapper.selectBsEpciuPatrolInspectionPage(page, bsEpciuPatrolInspection));
Set<String> manIds =
bsEpciuPatrolInspectionVOIPage.getRecords().stream().map(BsEpciuPatrolInspectionVO::getInsMan).collect(Collectors.toSet());
if (CollUtil.isNotEmpty(manIds)) {
String userId = Func.toStr(manIds);
List<User> users = new ArrayList<>();
try {
users = userClient.userUNListByIds(userId);
} catch (Exception e) {
e.printStackTrace();
return bsEpciuPatrolInspectionVOIPage;
}
if (CollUtil.isEmpty( users)){
return bsEpciuPatrolInspectionVOIPage;
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(s -> s.getId().toString(), User::getName));
bsEpciuPatrolInspectionVOIPage.getRecords().forEach(bsEpciuPatrolInspectionVO -> {
bsEpciuPatrolInspectionVO.setInsMan(userMap.getOrDefault(bsEpciuPatrolInspectionVO.getInsMan(),bsEpciuPatrolInspectionVO.getInsMan()));
});
}
//Set<String> manIds =
// bsEpciuPatrolInspectionVOIPage.getRecords().stream().map(BsEpciuPatrolInspectionVO::getInsMan).collect(Collectors.toSet());
//if (CollUtil.isNotEmpty(manIds)) {
// String userId = Func.toStr(manIds);
// List<User> users = new ArrayList<>();
// try {
// users = userClient.userUNListByIds(userId);
// } catch (Exception e) {
// e.printStackTrace();
// return bsEpciuPatrolInspectionVOIPage;
// }
//
// if (CollUtil.isEmpty( users)){
// return bsEpciuPatrolInspectionVOIPage;
// }
//
// Map<String, String> userMap = users.stream().collect(Collectors.toMap(s -> s.getId().toString(), User::getName));
// bsEpciuPatrolInspectionVOIPage.getRecords().forEach(bsEpciuPatrolInspectionVO -> {
// bsEpciuPatrolInspectionVO.setInsMan(userMap.getOrDefault(bsEpciuPatrolInspectionVO.getInsMan(),bsEpciuPatrolInspectionVO.getInsMan()));
// });
//}
return bsEpciuPatrolInspectionVOIPage;
}

Loading…
Cancel
Save