|
|
|
@ -109,7 +109,7 @@ public class PlaceController { |
|
|
|
if (maxQuantity >= 999999999) { |
|
|
|
insert.put("max", 999999999); |
|
|
|
} else { |
|
|
|
insert.put("max",maxQuantity); |
|
|
|
insert.put("max", maxQuantity); |
|
|
|
} |
|
|
|
} else { |
|
|
|
insert.put("max", 0); |
|
|
|
@ -317,18 +317,28 @@ public class PlaceController { |
|
|
|
|
|
|
|
@PostMapping("/tray_edit") |
|
|
|
public RestResponse trayEdit(@RequestBody Map<String, Object> map) { |
|
|
|
if (!map.containsKey("id")) { |
|
|
|
throw new MyException("缺少必要参数"); |
|
|
|
} |
|
|
|
Integer id = ObjectFormatUtil.toInteger(map.get("id")); |
|
|
|
if (map.containsKey("state")) { |
|
|
|
map.put("state", 1); |
|
|
|
} else { |
|
|
|
map.put("state", 2); |
|
|
|
} |
|
|
|
String code = (String) map.get("code"); |
|
|
|
Place placeById = placeService.findPlaceById(id); |
|
|
|
Map<String, Object> update = new HashMap<>(); |
|
|
|
if (!code.equals(placeById.getCode())) { |
|
|
|
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("did")); |
|
|
|
Place placeByDidAndCode = placeService.findPlaceByDidAndCode(depositoryId, code); |
|
|
|
if (placeByDidAndCode != null) { |
|
|
|
if (placeByDidAndCode == null) { |
|
|
|
update.put("code", code); |
|
|
|
} else { |
|
|
|
return new RestResponse("", 12345, new StatusInfo("修改失败", "该编码已经存在")); |
|
|
|
} |
|
|
|
Map<String, Object> update = new HashMap<>(); |
|
|
|
} |
|
|
|
|
|
|
|
String min = (String) map.get("min"); |
|
|
|
String max = (String) map.get("max"); |
|
|
|
if (!"".equals(min)) { |
|
|
|
@ -346,8 +356,8 @@ public class PlaceController { |
|
|
|
} else { |
|
|
|
update.put("max", 50000); |
|
|
|
} |
|
|
|
update.put("code", code); |
|
|
|
update.put("id", map.get("id")); |
|
|
|
|
|
|
|
update.put("id", id); |
|
|
|
return CrudUtil.insertHandle(placeService.UpdatePlace(update), 1); |
|
|
|
} |
|
|
|
|
|
|
|
|