e59cc5b1 张雷

设备台账接口修改

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