|
|
@ -105,6 +105,7 @@ public class PlaceController { |
|
|
} |
|
|
} |
|
|
insert.put("state",1); |
|
|
insert.put("state",1); |
|
|
insert.put("quantity",0); |
|
|
insert.put("quantity",0); |
|
|
|
|
|
insert.put("flagType",1); |
|
|
success += placeService.InsertPlace(insert); |
|
|
success += placeService.InsertPlace(insert); |
|
|
} |
|
|
} |
|
|
else if("list".equals(type)){ |
|
|
else if("list".equals(type)){ |
|
|
@ -119,7 +120,7 @@ public class PlaceController { |
|
|
Integer place_end_z = ObjectFormatUtil.toInteger(map.get("place_end_z")); |
|
|
Integer place_end_z = ObjectFormatUtil.toInteger(map.get("place_end_z")); |
|
|
// 计算所需库位数目
|
|
|
// 计算所需库位数目
|
|
|
// total = (place_end_x - place_start_x) * (place_end_y - place_start_y) * (place_end_z - place_start_z);
|
|
|
// total = (place_end_x - place_start_x) * (place_end_y - place_start_y) * (place_end_z - place_start_z);
|
|
|
total = (place_end_x - place_start_x) * (place_end_z - place_start_z); |
|
|
total = (place_end_x - place_start_x + 1) * (place_end_z - place_start_z + 1); |
|
|
String min = (String) map.get("min"); |
|
|
String min = (String) map.get("min"); |
|
|
String max = (String) map.get("max"); |
|
|
String max = (String) map.get("max"); |
|
|
for (int i = place_start_x; i <= place_end_x; i++) { |
|
|
for (int i = place_start_x; i <= place_end_x; i++) { |
|
|
@ -136,6 +137,7 @@ public class PlaceController { |
|
|
insert.put("did", map.get("depositoryId")); |
|
|
insert.put("did", map.get("depositoryId")); |
|
|
insert.put("state",1); |
|
|
insert.put("state",1); |
|
|
insert.put("quantity",0); |
|
|
insert.put("quantity",0); |
|
|
|
|
|
insert.put("flagType",1); |
|
|
success += placeService.InsertPlace(insert); |
|
|
success += placeService.InsertPlace(insert); |
|
|
} |
|
|
} |
|
|
// }
|
|
|
// }
|
|
|
@ -154,6 +156,57 @@ public class PlaceController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/addTray") |
|
|
|
|
|
public RestResponse addTray(@RequestBody Map<String,Object> map){ |
|
|
|
|
|
String type = (String) map.get("type"); |
|
|
|
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
|
|
|
Integer success = 0; |
|
|
|
|
|
Integer total = 0; |
|
|
|
|
|
String min = (String) map.get("min"); |
|
|
|
|
|
String max = (String) map.get("max"); |
|
|
|
|
|
if (!"".equals(min)) { |
|
|
|
|
|
insert.put("min", map.get("min")); |
|
|
|
|
|
} else { |
|
|
|
|
|
insert.put("min", 0); |
|
|
|
|
|
} |
|
|
|
|
|
if (!"".equals(max)) { |
|
|
|
|
|
insert.put("max", map.get("max")); |
|
|
|
|
|
} else { |
|
|
|
|
|
insert.put("max", 0); |
|
|
|
|
|
} |
|
|
|
|
|
Object depositoryId = map.get("depositoryId"); |
|
|
|
|
|
insert.put("did", depositoryId); |
|
|
|
|
|
// 获取当前仓库的托盘数量
|
|
|
|
|
|
Integer countForTray = placeService.findPlaceCoutnByTypeForFlag(2, ObjectFormatUtil.toInteger(depositoryId)); |
|
|
|
|
|
if ("one".equals(type)) { |
|
|
|
|
|
String code = "F"+String.format("%02d",countForTray+1); |
|
|
|
|
|
insert.put("code", code); |
|
|
|
|
|
insert.put("state",1); |
|
|
|
|
|
insert.put("quantity",0); |
|
|
|
|
|
insert.put("flagType",2); |
|
|
|
|
|
success += placeService.InsertPlace(insert); |
|
|
|
|
|
}else if("list".equals(type)){ |
|
|
|
|
|
Integer num = ObjectFormatUtil.toInteger(map.get("num")); |
|
|
|
|
|
insert.put("state",1); |
|
|
|
|
|
insert.put("quantity",0); |
|
|
|
|
|
insert.put("flagType",2); |
|
|
|
|
|
total = num; |
|
|
|
|
|
for (int i = 1; i <= num; i++) { |
|
|
|
|
|
String code = "F"+String.format("%02d",countForTray+i); |
|
|
|
|
|
insert.put("code", code); |
|
|
|
|
|
success += placeService.InsertPlace(insert); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if ("one".equals(type)) { |
|
|
|
|
|
return CrudUtil.postHandle(success, 1); |
|
|
|
|
|
} else if("list".equals(type)){ |
|
|
|
|
|
return CrudUtil.postHandle(success,total); |
|
|
|
|
|
}else{ |
|
|
|
|
|
throw new MyException("请求参数错误!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
/** |
|
|
/** |
|
|
* 将库位状态改为删除 |
|
|
* 将库位状态改为删除 |
|
|
* @param map |
|
|
* @param map |
|
|
|