e59cc5b1 张雷

设备台账接口修改

1 个父辈 06f69860
......@@ -175,7 +175,6 @@ public class EquipmentInController {
Result<IPage<EquipmentInVO>> result = new Result<>();
EquipmentIn equipmentIn = BeanExtUtils.bean2Bean(equipmentInDTO, EquipmentIn.class);
QueryWrapper<EquipmentIn> queryWrapper = QueryGenerator.initQueryWrapper(equipmentIn, req.getParameterMap());
if (StringUtils.isNotEmpty(equipmentInDTO.getStartTime())) {
queryWrapper.ge("in_date", equipmentInDTO.getStartTime() + " 00:00:00");
}
......@@ -190,8 +189,8 @@ public class EquipmentInController {
Page<EquipmentInVO> voPage = new Page<>(pageNo, pageSize);
Page<EquipmentIn> page = new Page<EquipmentIn>(pageNo, pageSize);
IPage<EquipmentIn> equipmentInIPage = equipmentInService.page(page, queryWrapper);
List<EquipmentIn> totalList = equipmentInService.list(queryWrapper);
IPage<EquipmentIn> equipmentInIPage = page.setRecords(totalList);
List<EquipmentIn> equipmentInList = equipmentInIPage.getRecords();
equipmentInList.stream().map(data -> "'" + data.getId() + "'").collect(Collectors.joining(","));
......@@ -199,7 +198,8 @@ public class EquipmentInController {
if ("departIdName".equals(targetFieldName) && srcFieldVal != null) {
return sysDepartVal2KeyMap.getOrDefault(srcFieldVal, "");
} else if ("sparepartName".equals(targetFieldName)) {
String sql2 = "select es.sparepart_name as sparepartName ,es.sparepart_type from equipment_sparepart_supplies as es inner join (select sparepart_id from equipment_in_child where in_id = '" + srcFieldVal + "') as tmp on es.id = tmp.sparepart_id";
String sql2 = "select es.sparepart_name as sparepartName ,es.sparepart_type from equipment_sparepart_supplies as es " +
"inner join (select sparepart_id from equipment_in_child where in_id = '" + srcFieldVal + "') as tmp on es.id = tmp.sparepart_id";
List<Map<String, Object>> sparePartList = iCommonSqlService.queryForList(sql2);
Map<String, Integer> name2CountMap = new HashMap<>();
if (sparePartList != null && !sparePartList.isEmpty() && sparePartList.get(0) != null) {
......@@ -225,7 +225,7 @@ public class EquipmentInController {
if (StringUtils.isNotEmpty(equipmentInDTO.getSparepartName())) {
equipmentInVOList = equipmentInVOList.stream().filter(item -> item.getSparepartName().contains(equipmentInDTO.getSparepartName())).collect(Collectors.toList());
}
voPage.setTotal(equipmentInIPage.getTotal());
voPage.setTotal(page.getTotal());
voPage.setRecords(equipmentInVOList);
result.setResult(voPage);
return result;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!