add:添加组盘页面
This commit is contained in:
@@ -3,6 +3,7 @@ package org.nl.wms.sch.group.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -12,6 +13,8 @@ import org.nl.common.exception.BadRequestException;
|
|||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.basedata.master.vehicle.service.IStoragevehicleinfoService;
|
||||||
|
import org.nl.wms.basedata.master.vehicle.service.dao.Storagevehicleinfo;
|
||||||
import org.nl.wms.sch.group.service.IMdPbGroupplateService;
|
import org.nl.wms.sch.group.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.sch.group.service.dao.GroupPlate;
|
import org.nl.wms.sch.group.service.dao.GroupPlate;
|
||||||
import org.nl.wms.sch.group.service.enums.GroupStatus;
|
import org.nl.wms.sch.group.service.enums.GroupStatus;
|
||||||
@@ -42,6 +45,8 @@ public class GroupController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||||
|
@Autowired
|
||||||
|
private final IStoragevehicleinfoService iStoragevehicleinfoService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@@ -54,17 +59,12 @@ public class GroupController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
@Log("新增组盘组盘")
|
@Log("新增组盘组盘")
|
||||||
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
public ResponseEntity<Object> create(@RequestBody JSONObject group) {
|
||||||
Assert.noNullElements(new Object[]{group,group.get("material_id"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
Assert.noNullElements(new Object[]{group,group.get("material_code"),group.get("storagevehicle_code"),group.get("qty")},"请求参数不能为空");
|
||||||
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
GroupPlate groupPlate = group.toJavaObject(GroupPlate.class);
|
||||||
String storagevehicleCode = groupPlate.getStoragevehicle_code();
|
Storagevehicleinfo one = iStoragevehicleinfoService.getOne(new LambdaQueryWrapper<Storagevehicleinfo>()
|
||||||
{
|
.eq(Storagevehicleinfo::getStoragevehicle_code, groupPlate.getStoragevehicle_code()));
|
||||||
// iMdPbStoragevehicleinfoService.getByCode(storagevehicleCode);
|
if (one != null){
|
||||||
// int has = iMdPbGroupplateService.count(new LambdaUpdateWrapper<GroupPlate>()
|
throw new BadRequestException("当前载具组盘信息已存在");
|
||||||
// .eq(GroupPlate::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
|
||||||
// .lt(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
|
||||||
// if (has>0){
|
|
||||||
// throw new BadRequestException("当前载具组盘信息已存在");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
|||||||
Reference in New Issue
Block a user