e59cc5b1 张雷

设备台账接口修改

1 个父辈 06f69860
......@@ -120,7 +120,7 @@ public class EquipmentInController {
private ThreadPoolTaskExecutor taskExecutor;
@Autowired
private ISuppliesWarehouseService suppliesWarehouseService;
@CustomExceptionAnno(description = "入库-详情")
@AutoLog(value = "入库-详情")
......@@ -147,7 +147,7 @@ public class EquipmentInController {
"\tINNER JOIN equipment_in_child AS eic ON ei.id = eic.in_id\n" +
"\tLEFT JOIN equipment_sparepart_supplies AS es ON eic.sparepart_id = es.id\n" +
"\tLEFT JOIN equipment_sparepart_type tp ON es.sparepart_type = tp.id\n" +
" WHERE ei.id in( '" + inId + "')";
List<Map<String, Object>> mapList = iCommonSqlService.queryForList(sql);
JSONObject jsonObject = sysCommonDictService.translateTDictValue(equipmentIn);
......@@ -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!