设备台账接口修改
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
... | @@ -120,7 +120,7 @@ public class EquipmentInController { | ... | @@ -120,7 +120,7 @@ public class EquipmentInController { |
120 | private ThreadPoolTaskExecutor taskExecutor; | 120 | private ThreadPoolTaskExecutor taskExecutor; |
121 | @Autowired | 121 | @Autowired |
122 | private ISuppliesWarehouseService suppliesWarehouseService; | 122 | private ISuppliesWarehouseService suppliesWarehouseService; |
123 | 123 | ||
124 | 124 | ||
125 | @CustomExceptionAnno(description = "入库-详情") | 125 | @CustomExceptionAnno(description = "入库-详情") |
126 | @AutoLog(value = "入库-详情") | 126 | @AutoLog(value = "入库-详情") |
... | @@ -147,7 +147,7 @@ public class EquipmentInController { | ... | @@ -147,7 +147,7 @@ public class EquipmentInController { |
147 | "\tINNER JOIN equipment_in_child AS eic ON ei.id = eic.in_id\n" + | 147 | "\tINNER JOIN equipment_in_child AS eic ON ei.id = eic.in_id\n" + |
148 | "\tLEFT JOIN equipment_sparepart_supplies AS es ON eic.sparepart_id = es.id\n" + | 148 | "\tLEFT JOIN equipment_sparepart_supplies AS es ON eic.sparepart_id = es.id\n" + |
149 | "\tLEFT JOIN equipment_sparepart_type tp ON es.sparepart_type = tp.id\n" + | 149 | "\tLEFT JOIN equipment_sparepart_type tp ON es.sparepart_type = tp.id\n" + |
150 | 150 | ||
151 | " WHERE ei.id in( '" + inId + "')"; | 151 | " WHERE ei.id in( '" + inId + "')"; |
152 | List<Map<String, Object>> mapList = iCommonSqlService.queryForList(sql); | 152 | List<Map<String, Object>> mapList = iCommonSqlService.queryForList(sql); |
153 | JSONObject jsonObject = sysCommonDictService.translateTDictValue(equipmentIn); | 153 | JSONObject jsonObject = sysCommonDictService.translateTDictValue(equipmentIn); |
... | @@ -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; | ... | ... |
-
请 注册 或 登录 后发表评论