1. 添加单机出库接口
2. 实现出库口查询功能
This commit is contained in:
parent
8ca9d65970
commit
b90f03e1a6
|
|
@ -1,11 +1,9 @@
|
||||||
package com.wms_main.controller.ycwms;
|
package com.wms_main.controller.ycwms;
|
||||||
|
|
||||||
|
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderInReq;
|
import com.wms_main.model.dto.request.ycwms.*;
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderOutReq;
|
|
||||||
import com.wms_main.model.dto.request.ycwms.StockReq;
|
|
||||||
import com.wms_main.model.dto.request.ycwms.StockResp;
|
|
||||||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.IYcwmsControllerService;
|
import com.wms_main.service.controller.IYcwmsControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -49,4 +47,19 @@ public class YcwmsController {
|
||||||
public YcwmsResponse<Object> getAvailPercent(@RequestParam(value = "equipmentId") String equipmentId) {
|
public YcwmsResponse<Object> getAvailPercent(@RequestParam(value = "equipmentId") String equipmentId) {
|
||||||
return ycwmsControllerService.getAvailPercent(equipmentId);
|
return ycwmsControllerService.getAvailPercent(equipmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/localOut")
|
||||||
|
public YcwmsResponse<Object> localOut(@RequestBody LocalOrderReq request) {
|
||||||
|
return ycwmsControllerService.localOrderOut(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getOutLocation")
|
||||||
|
public YcwmsResponse<Object> getOutLocation(@RequestBody OrderOutReq request) {
|
||||||
|
String outLoc = ycwmsControllerService.getLocByGoodsId(request.getGoodsId());
|
||||||
|
if (StringUtils.isEmpty(outLoc)) {
|
||||||
|
return YcwmsResponse.error("查询为空", null);
|
||||||
|
} else {
|
||||||
|
return YcwmsResponse.success(outLoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.wms_main.model.dto.request.ycwms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class LocalOrderReq {
|
||||||
|
@JsonProperty("specification")
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
@JsonProperty("xsfbillno")
|
||||||
|
private String xsfbillno;
|
||||||
|
|
||||||
|
@JsonProperty("xsfseq")
|
||||||
|
private Integer xsfseq;
|
||||||
|
|
||||||
|
@JsonProperty("neibubianhao")
|
||||||
|
private String neibubianhao;
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.wms_main.service.controller;
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderInReq;
|
import com.wms_main.model.dto.request.ycwms.*;
|
||||||
import com.wms_main.model.dto.request.ycwms.OrderOutReq;
|
|
||||||
import com.wms_main.model.dto.request.ycwms.StockReq;
|
|
||||||
import com.wms_main.model.dto.request.ycwms.StockResp;
|
|
||||||
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
import com.wms_main.model.dto.response.ycwms.YcwmsResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -14,4 +11,6 @@ public interface IYcwmsControllerService {
|
||||||
YcwmsResponse<Object> orderOut(OrderOutReq request);
|
YcwmsResponse<Object> orderOut(OrderOutReq request);
|
||||||
YcwmsResponse<List<StockResp>> stock(StockReq request);
|
YcwmsResponse<List<StockResp>> stock(StockReq request);
|
||||||
YcwmsResponse<Object> getAvailPercent(String equipmentId);
|
YcwmsResponse<Object> getAvailPercent(String equipmentId);
|
||||||
|
YcwmsResponse<Object> localOrderOut(LocalOrderReq request);
|
||||||
|
String getLocByGoodsId(String goodsId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,12 +75,13 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
||||||
orderIn.setGoodsName("空托盘");
|
orderIn.setGoodsName("空托盘");
|
||||||
orderIn.setBatch("0");
|
orderIn.setBatch("0");
|
||||||
orderIn.setGoodsType("0");
|
orderIn.setGoodsType("0");
|
||||||
orderIn.setSpecification("empty");
|
|
||||||
orderIn.setQuantity(4.0);
|
orderIn.setQuantity(4.0);
|
||||||
orderIn.setGoodsDesc("");
|
orderIn.setGoodsDesc("");
|
||||||
orderIn.setXsfbillno("");
|
|
||||||
|
orderIn.setSpecification("empty");
|
||||||
|
orderIn.setXsfbillno(goodsId567);
|
||||||
orderIn.setXsfseq(0);
|
orderIn.setXsfseq(0);
|
||||||
orderIn.setNeibubianhao("");
|
orderIn.setNeibubianhao("0");
|
||||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||||
orderIn.setCreateTime(LocalDateTime.now());
|
orderIn.setCreateTime(LocalDateTime.now());
|
||||||
orderIn.setUpdateTime(LocalDateTime.now());
|
orderIn.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
@ -144,12 +145,13 @@ public class WcsControllerServiceImpl implements IWcsControllerService {
|
||||||
orderIn.setGoodsName("空托盘");
|
orderIn.setGoodsName("空托盘");
|
||||||
orderIn.setBatch("0");
|
orderIn.setBatch("0");
|
||||||
orderIn.setGoodsType("0");
|
orderIn.setGoodsType("0");
|
||||||
orderIn.setSpecification("empty");
|
|
||||||
orderIn.setQuantity(1.0);
|
orderIn.setQuantity(1.0);
|
||||||
orderIn.setGoodsDesc("");
|
orderIn.setGoodsDesc("");
|
||||||
orderIn.setXsfbillno("");
|
|
||||||
|
orderIn.setSpecification("empty");
|
||||||
|
orderIn.setXsfbillno(goodsId34);
|
||||||
orderIn.setXsfseq(0);
|
orderIn.setXsfseq(0);
|
||||||
orderIn.setNeibubianhao("");
|
orderIn.setNeibubianhao("0");
|
||||||
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
orderIn.setOrderStatus(OrderStatusEnum.RUNNING.getCode());
|
||||||
orderIn.setCreateTime(LocalDateTime.now());
|
orderIn.setCreateTime(LocalDateTime.now());
|
||||||
orderIn.setUpdateTime(LocalDateTime.now());
|
orderIn.setUpdateTime(LocalDateTime.now());
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,52 @@ public class YcwmsControllerServiceImpl implements IYcwmsControllerService {
|
||||||
return YcwmsResponse.error("equipmentId无效", null);
|
return YcwmsResponse.error("equipmentId无效", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLocByGoodsId(String goodsId) {
|
public YcwmsResponse<Object> localOrderOut(LocalOrderReq request) {
|
||||||
|
log.info("亚驰单机出库单请求参数{}", JSON.toJSON(request));
|
||||||
|
if(request == null) return YcwmsResponse.error("参数错误", null);
|
||||||
|
if (StringUtils.isEmpty(request.getNeibubianhao())
|
||||||
|
|| StringUtils.isEmpty(request.getXsfbillno())
|
||||||
|
|| StringUtils.isEmpty(String.valueOf(request.getXsfseq()))
|
||||||
|
|| StringUtils.isEmpty(request.getSpecification())) {
|
||||||
|
return YcwmsResponse.error("参数错误", null);
|
||||||
|
}
|
||||||
|
List<TAppStock> stocks = appStockService.list(
|
||||||
|
new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getNeibubianhao, request.getNeibubianhao())
|
||||||
|
.eq(TAppStock::getXsfbillno, request.getXsfbillno())
|
||||||
|
.eq(TAppStock::getXsfseq, request.getXsfseq())
|
||||||
|
.eq(TAppStock::getSled, request.getSpecification())
|
||||||
|
);
|
||||||
|
if (stocks == null || stocks.isEmpty()) {
|
||||||
|
return YcwmsResponse.error("库存不足, 出库失败", null);
|
||||||
|
}
|
||||||
|
TAppOrderOut orderOut = new TAppOrderOut();
|
||||||
|
orderOut.setRecordId(UUIDUtils.getNewUUID());
|
||||||
|
orderOut.setOrderId(UUIDUtils.getNewUUID("baokai"));
|
||||||
|
orderOut.setBatch(stocks.getFirst().getBatch());
|
||||||
|
orderOut.setSpecification(request.getSpecification());
|
||||||
|
orderOut.setOrderStatus(OrderStatusEnum.CREATE.getCode());
|
||||||
|
orderOut.setCreateTime(LocalDateTime.now());
|
||||||
|
orderOut.setUpdateTime(LocalDateTime.now());
|
||||||
|
orderOut.setRemark("Local");
|
||||||
|
|
||||||
|
String tmpGoodsId = stocks.getFirst().getGoodsId();
|
||||||
|
if (tmpGoodsId.length() < 3) {
|
||||||
|
orderOut.setGoodsId(tmpGoodsId);
|
||||||
|
int tmpGoodsNum = Integer.parseInt(tmpGoodsId);
|
||||||
|
orderOut.setQuantity((tmpGoodsNum <= 1) ? 1.0 : 4.0);
|
||||||
|
} else {
|
||||||
|
orderOut.setGoodsId(stocks.getFirst().getVehicleId());
|
||||||
|
orderOut.setQuantity(0.0);
|
||||||
|
tmpGoodsId = stocks.getFirst().getVehicleId();
|
||||||
|
}
|
||||||
|
if(!appOrderOutService.save(orderOut)) {
|
||||||
|
return YcwmsResponse.error("出库单保存失败,请稍后再试", null);
|
||||||
|
}
|
||||||
|
return YcwmsResponse.success(getLocByGoodsId(tmpGoodsId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocByGoodsId(String goodsId) {
|
||||||
if (goodsId.length() < 3) {
|
if (goodsId.length() < 3) {
|
||||||
return switch (goodsId) {
|
return switch (goodsId) {
|
||||||
case "0" -> "LK-3";
|
case "0" -> "LK-3";
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@ import axios from "axios";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const _request = axios.create({
|
const _request = axios.create({
|
||||||
// baseURL: 'http://localhost:12315',
|
baseURL: 'http://localhost:12315',
|
||||||
baseURL: 'http://10.18.58.21:12315',
|
// baseURL: 'http://10.18.58.21:12315',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
|
|
||||||
const submitOrderOutForm = (params) => {
|
const submitOrderOutForm = (params) => {
|
||||||
return _request({
|
return _request({
|
||||||
url: '/ycwms/orderOut',
|
url: '/ycwms/localOut',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,23 @@
|
||||||
<el-form ref="orderOutFormRef" :model="orderOutForm" :rules="rules" label-width="70px" :label-position="labelPosition" status-icon>
|
<el-form ref="orderOutFormRef" :model="orderOutForm" :rules="rules" label-width="70px" :label-position="labelPosition" status-icon>
|
||||||
<el-row :gutter="5" class="form-row">
|
<el-row :gutter="5" class="form-row">
|
||||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="物料编号" prop="goodsId">
|
<el-form-item label="内部编号" prop="neibubianhao">
|
||||||
<el-input v-model="orderOutForm.goodsId" clearable @keyup.enter="handleEnter('batch')" ref="goodsIdRef" class="custom-input" />
|
<el-input v-model="orderOutForm.neibubianhao" clearable @keyup.enter="handleEnter('xsfbillno')" ref="neibubianhaoRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="批次" prop="batch">
|
<el-form-item label="销售单号" prop="xsfbillno">
|
||||||
<el-input v-model="orderOutForm.batch" clearable @keyup.enter="handleEnter('specification')" ref="batchRef" class="custom-input" />
|
<el-input v-model="orderOutForm.xsfbillno" clearable @keyup.enter="handleEnter('xsfseq')" ref="xsfbillnoRef" class="custom-input" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
|
<el-form-item label="行号" prop="xsfseq">
|
||||||
|
<el-input-number v-model="orderOutForm.xsfseq" :min="0" controls-position="right" clearable @keyup.enter="handleEnter('specification')" ref="xsfseqRef" class="custom-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
||||||
<el-form-item label="规格" prop="specification">
|
<el-form-item label="规格" prop="specification">
|
||||||
<el-input v-model="orderOutForm.specification" placeholder="请输入规格" clearable @keyup.enter="handleEnter('quantity')" ref="specificationRef" class="custom-input" />
|
<el-input v-model="orderOutForm.specification" placeholder="请输入规格" clearable ref="specificationRef" class="custom-input" />
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :xs="24" :sm="4" :md="4" :lg="4">
|
|
||||||
<el-form-item label="数量" prop="quantity">
|
|
||||||
<el-input-number v-model="orderOutForm.quantity" :min="1" controls-position="right" clearable ref="quantityRef" class="custom-input" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="4" :md="4" :lg="4" class="btn-col">
|
<el-col :xs="24" :sm="4" :md="4" :lg="4" class="btn-col">
|
||||||
|
|
@ -73,26 +73,26 @@ const generateOrderId = () => {
|
||||||
const orderOutFormRef = ref()
|
const orderOutFormRef = ref()
|
||||||
const orderOutForm = reactive({
|
const orderOutForm = reactive({
|
||||||
orderId: generateOrderId(),
|
orderId: generateOrderId(),
|
||||||
goodsId: '',
|
neibubianhao: '',
|
||||||
batch: '',
|
xsfbillno: '',
|
||||||
|
xsfseq: null,
|
||||||
specification: '',
|
specification: '',
|
||||||
quantity: null,
|
|
||||||
clientId: "WMS"
|
clientId: "WMS"
|
||||||
})
|
})
|
||||||
|
|
||||||
// 表单规则
|
// 表单规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
goodsId: [{ required: true, message: '请输入物料编号', trigger: 'blur' }],
|
neibubianhao: [{ required: true, message: '请输入内部编号', trigger: 'blur' }],
|
||||||
batch: [{ required: true, message: '请输入批次', trigger: 'blur' }],
|
xsfbillno: [{ required: true, message: '请输入销售单号', trigger: 'blur' }],
|
||||||
specification: [{ required: true, message: '请输入规格', trigger: 'blur' }],
|
xsfseq: [{ required: true, message: '请输入行号', trigger: 'blur' }],
|
||||||
quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }]
|
specification: [{ required: true, message: '请输入规格', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 引用DOM元素
|
// 引用DOM元素
|
||||||
const goodsIdRef = ref()
|
const neibubianhaoRef = ref()
|
||||||
const batchRef = ref()
|
const xsfbillnoRef = ref()
|
||||||
|
const xsfseqRef = ref()
|
||||||
const specificationRef = ref()
|
const specificationRef = ref()
|
||||||
const quantityRef = ref()
|
|
||||||
|
|
||||||
// 响应结果对话框
|
// 响应结果对话框
|
||||||
const responseDialogVisible = ref(false)
|
const responseDialogVisible = ref(false)
|
||||||
|
|
@ -101,7 +101,7 @@ const responseResult = ref({})
|
||||||
// 初始化时聚焦第一个输入框
|
// 初始化时聚焦第一个输入框
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
goodsIdRef.value.focus()
|
neibubianhaoRef.value.focus()
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -118,10 +118,10 @@ const resizeHeight = () => {
|
||||||
// 处理回车事件
|
// 处理回车事件
|
||||||
const handleEnter = (nextField) => {
|
const handleEnter = (nextField) => {
|
||||||
const refMap = {
|
const refMap = {
|
||||||
'goodsId': goodsIdRef,
|
'neibubianhao': neibubianhaoRef,
|
||||||
'batch': batchRef,
|
'xsfbillno': xsfbillnoRef,
|
||||||
'specification': specificationRef,
|
'xsfseq': xsfseqRef,
|
||||||
'quantity': quantityRef
|
'specification': specificationRef
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refMap[nextField]) {
|
if (refMap[nextField]) {
|
||||||
|
|
@ -135,7 +135,7 @@ const resetForm = () => {
|
||||||
// 重新生成订单号
|
// 重新生成订单号
|
||||||
orderOutForm.orderId = generateOrderId()
|
orderOutForm.orderId = generateOrderId()
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
goodsIdRef.value.focus()
|
neibubianhaoRef.value.focus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user