|
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("dwxx")
|
|
|
|
@RequestMapping("dwxx")
|
|
|
@ -24,13 +25,15 @@ public class DmDwxxpController {
|
|
|
|
@PostMapping("addOrEdit")
|
|
|
|
@PostMapping("addOrEdit")
|
|
|
|
public ResultBean<?> add(@RequestBody Map<String,List<DmDwxxp>> map){
|
|
|
|
public ResultBean<?> add(@RequestBody Map<String,List<DmDwxxp>> map){
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
dwxxpService.saveOrEdit(map.get("add"));
|
|
|
|
Optional.ofNullable(map.get("add")).ifPresent(item->{
|
|
|
|
|
|
|
|
item.forEach(dwxxpService::save);
|
|
|
|
|
|
|
|
});
|
|
|
|
dwxxpService.saveOrEdit(map.get("edit"));
|
|
|
|
dwxxpService.saveOrEdit(map.get("edit"));
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|
throw new RuntimeException("同一个区域存在相同垛位号,禁止保存");
|
|
|
|
throw new RuntimeException("同一个区域存在相同垛位号,禁止保存");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (map.get("remove")!=null&& !map.get("remove").isEmpty()){
|
|
|
|
if (map.get("remove")!=null&& !map.get("remove").isEmpty()){
|
|
|
|
map.get("remove").forEach(dwxxpService::deleteByMultiId);
|
|
|
|
map.get("remove").forEach(dwxxpService::removeById);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
return new ResultBean<>();
|
|
|
|