fix:入库单字段
opt:调拨单回传,ErpUtil,ErpApi,产线送料,缺料叫料 add:工单过滤
This commit is contained in:
@@ -13,12 +13,12 @@ public class RegionConstant {
|
|||||||
/**
|
/**
|
||||||
* 机加工二次配盘区,原料线边库
|
* 机加工二次配盘区,原料线边库
|
||||||
*/
|
*/
|
||||||
public static final String MACHINE_RAW_MATERIAL_SIDE = "6.010";
|
public static final String MACHINE_RAW_MATERIAL_SIDE = "E301";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 焊接二次配盘区,原料线边库
|
* 焊接二次配盘区,原料线边库
|
||||||
*/
|
*/
|
||||||
public static final String WELDING_RAW_MATERIAL_SIDE = "6.009";
|
public static final String WELDING_RAW_MATERIAL_SIDE = "E317";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 喷涂二次配盘区,原料线边库
|
* 喷涂二次配盘区,原料线边库
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package org.nl.wms.ext_manage.api;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.wms.ext_manage.api.request.QueryEasStockRequest;
|
||||||
|
import org.nl.wms.ext_manage.api.request.ReceiveOutRequest;
|
||||||
|
import org.nl.wms.ext_manage.api.response.QueryEasStockResponse;
|
||||||
|
import org.nl.wms.ext_manage.util.ErpUtil;
|
||||||
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||||
|
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class EasApi {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPmStockReturnService iPmStockReturnService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求eas领料出库单接口
|
||||||
|
* @param receiveOutRequest
|
||||||
|
*/
|
||||||
|
public void receiveOut(ReceiveOutRequest receiveOutRequest){
|
||||||
|
log.info("======>请求EAS领料出库单接口:" + JSONObject.toJSONString(receiveOutRequest));
|
||||||
|
JSONObject req = new JSONObject();
|
||||||
|
req.put("type", "MES");
|
||||||
|
req.put("method", "DealLLCKBill");
|
||||||
|
req.put("data", receiveOutRequest);
|
||||||
|
//保存回传单
|
||||||
|
PmStockReturn stockReturn = new PmStockReturn();
|
||||||
|
stockReturn.setRequest_Id(receiveOutRequest.getBillno());
|
||||||
|
stockReturn.setRequest_type(IOSEnum.BILL_TYPE.code("生产领料"));
|
||||||
|
stockReturn.setStatus(StockReturnStatusEnum.TODO.getCode()); // 0-处理中
|
||||||
|
stockReturn.setCreate_time(DateUtil.now());
|
||||||
|
stockReturn.setRequest_data(req.toJSONString());
|
||||||
|
try {
|
||||||
|
ErpUtil.create().login().audit(req.toJSONString());
|
||||||
|
stockReturn.setStatus(StockReturnStatusEnum.SUCESS.getCode());
|
||||||
|
} catch (Exception e) {
|
||||||
|
stockReturn.setError_msg(e.getMessage());
|
||||||
|
stockReturn.setStatus(StockReturnStatusEnum.FAIL.getCode());
|
||||||
|
}
|
||||||
|
iPmStockReturnService.save(stockReturn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询eas库存
|
||||||
|
* @param request
|
||||||
|
*/
|
||||||
|
public List<QueryEasStockResponse> queryStock(QueryEasStockRequest request){
|
||||||
|
log.info("======>请求查询EAS库存接口:" + JSONObject.toJSONString(request));
|
||||||
|
JSONObject req = new JSONObject();
|
||||||
|
req.put("type", "MES");
|
||||||
|
req.put("method", "SelectKCBill");
|
||||||
|
req.put("data", request);
|
||||||
|
JSONObject res = ErpUtil.create().login().audit(req.toJSONString());
|
||||||
|
return JSON.parseArray(res.getJSONObject("data").getString("result"), QueryEasStockResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.ext_manage.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QueryEasStockRequest {
|
||||||
|
private String orgno;
|
||||||
|
private String materialno;
|
||||||
|
private String warehouseno;
|
||||||
|
private String lotnumber;
|
||||||
|
private String tracknumber;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.nl.wms.ext_manage.api.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReceiveOutRequest {
|
||||||
|
private String orgno;
|
||||||
|
private String billno;
|
||||||
|
private String biztype;
|
||||||
|
private String invscheme;
|
||||||
|
private String transtype;
|
||||||
|
private String biztime;
|
||||||
|
private String deptno;
|
||||||
|
private String requserno;
|
||||||
|
private String requsername;
|
||||||
|
private String comment;
|
||||||
|
private String cztype;
|
||||||
|
private List<Entrys> entrys;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Entrys {
|
||||||
|
private Integer seq;
|
||||||
|
private String materialno;
|
||||||
|
private String unitno;
|
||||||
|
private BigDecimal qty;
|
||||||
|
private BigDecimal baseqty;
|
||||||
|
private String warehouseno;
|
||||||
|
private String srcbillno;
|
||||||
|
private String srcbillid;
|
||||||
|
private String srcbillentryid;
|
||||||
|
private String entrycomment;
|
||||||
|
private String auxptyno;
|
||||||
|
private String tracknumber;
|
||||||
|
private String lotnumber;
|
||||||
|
private String stockerno;
|
||||||
|
private String stockername;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.nl.wms.ext_manage.api.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QueryEasStockResponse {
|
||||||
|
private String materialno;
|
||||||
|
private String materialname;
|
||||||
|
private String materialmodel;
|
||||||
|
private String auxptyname;
|
||||||
|
private String warehousename;
|
||||||
|
private String invstatus;
|
||||||
|
private String unitname;
|
||||||
|
private String qty;
|
||||||
|
private String qty_avb;
|
||||||
|
private String lotnumber;
|
||||||
|
private String tracknumber;
|
||||||
|
private String orgno;
|
||||||
|
private String stockername;
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package org.nl.wms.ext_manage.controller;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.base.ResponseData;
|
import org.nl.common.base.ResponseData;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -23,8 +24,7 @@ import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
|||||||
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
||||||
import org.nl.wms.welding_manage.service.work_order.dto.WorkOrderDto;
|
import org.nl.wms.welding_manage.service.work_order.dto.WorkOrderDto;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -74,9 +74,12 @@ public class MesToWmsController {
|
|||||||
@SaIgnore
|
@SaIgnore
|
||||||
@Log("工单同步")
|
@Log("工单同步")
|
||||||
public ResponseEntity subWorkOrder(@RequestBody List<WorkOrderDto.WorkOrderDataDto> dtos){
|
public ResponseEntity subWorkOrder(@RequestBody List<WorkOrderDto.WorkOrderDataDto> dtos){
|
||||||
|
String[] filter = {"E301050","E301100"};//过滤产线
|
||||||
for (WorkOrderDto.WorkOrderDataDto dto : dtos) {
|
for (WorkOrderDto.WorkOrderDataDto dto : dtos) {
|
||||||
|
if (ArrayUtils.contains(filter, dto.getWorkArea())){
|
||||||
iWorkOrderService.insert(dto);
|
iWorkOrderService.insert(dto);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ResponseData.build();
|
return ResponseData.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +94,7 @@ public class MesToWmsController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料单同步
|
* 退料单同步
|
||||||
* @param dtos
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("app/restful/api/v3/wms/mesReturnSync")
|
@PostMapping("app/restful/api/v3/wms/mesReturnSync")
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -85,13 +86,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
allZD = false;
|
allZD = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (easMst.getForwardZD()==1){
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
if (allZD){
|
if (allZD){
|
||||||
//如果全部都是中鼎的则由中鼎回传EAS
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
//转发中鼎
|
//转发中鼎
|
||||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
@@ -148,13 +150,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
allZD = false;
|
allZD = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (easMst.getForwardZD()==1){
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
if (allZD){
|
if (allZD){
|
||||||
//如果全部都是中鼎的则由中鼎回传EAS
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
//转发中鼎
|
//转发中鼎
|
||||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
@@ -211,13 +214,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
allZD = false;
|
allZD = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (easMst.getForwardZD()==1){
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
if (allZD){
|
if (allZD){
|
||||||
//如果全部都是中鼎的则由中鼎回传EAS
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
//转发中鼎
|
//转发中鼎
|
||||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
@@ -274,13 +278,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
allZD = false;
|
allZD = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (easMst.getForwardZD()==1){
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
if (allZD){
|
if (allZD){
|
||||||
//如果全部都是中鼎的则由中鼎回传EAS
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
//转发中鼎
|
//转发中鼎
|
||||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
@@ -337,13 +342,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
|||||||
allZD = false;
|
allZD = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (easMst.getForwardZD()==1){
|
if (Objects.equals(1, easMst.getForwardZD())){
|
||||||
if (allZD){
|
if (allZD){
|
||||||
//如果全部都是中鼎的则由中鼎回传EAS
|
//如果全部都是中鼎的则由中鼎回传EAS
|
||||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||||
}
|
}
|
||||||
//转发中鼎
|
//转发中鼎
|
||||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||||
|
easMst.setForwardZD(2);
|
||||||
}
|
}
|
||||||
purchasedtlMapper.batchSave(easDtlList);
|
purchasedtlMapper.batchSave(easDtlList);
|
||||||
purchasemstMapper.insert(easMst);
|
purchasemstMapper.insert(easMst);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
FROM v_uc_cgrk06
|
FROM v_uc_cgrk06
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTransferByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
|
<select id="selectTransferByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
entryid,
|
entryid,
|
||||||
billid,
|
billid,
|
||||||
@@ -49,8 +49,8 @@
|
|||||||
skuCode,
|
skuCode,
|
||||||
skuName,
|
skuName,
|
||||||
model,
|
model,
|
||||||
houseCode,
|
|
||||||
batchNo,
|
batchNo,
|
||||||
|
houseCode,
|
||||||
qty,
|
qty,
|
||||||
unitCode,
|
unitCode,
|
||||||
unit,
|
unit,
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
FROM V_UC_DBRK02
|
FROM V_UC_DBRK02
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOtherByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
|
<select id="selectOtherByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
entryid,
|
entryid,
|
||||||
billid,
|
billid,
|
||||||
@@ -68,8 +68,8 @@
|
|||||||
skuCode,
|
skuCode,
|
||||||
skuName,
|
skuName,
|
||||||
model,
|
model,
|
||||||
houseCode,
|
|
||||||
batchNo,
|
batchNo,
|
||||||
|
houseCode,
|
||||||
qty,
|
qty,
|
||||||
unitCode,
|
unitCode,
|
||||||
unit,
|
unit,
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
FROM V_UC_QTRK04
|
FROM V_UC_QTRK04
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
|
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
entryid,
|
entryid,
|
||||||
billid,
|
billid,
|
||||||
@@ -87,8 +87,8 @@
|
|||||||
skuCode,
|
skuCode,
|
||||||
skuName,
|
skuName,
|
||||||
model,
|
model,
|
||||||
houseCode,
|
|
||||||
batchNo,
|
batchNo,
|
||||||
|
houseCode,
|
||||||
qty,
|
qty,
|
||||||
unitCode,
|
unitCode,
|
||||||
unit,
|
unit,
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
FROM V_UC_QTCK03
|
FROM V_UC_QTCK03
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl">
|
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasedtl" resultMap="BaseResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
entryid,
|
entryid,
|
||||||
billid,
|
billid,
|
||||||
@@ -106,8 +106,8 @@
|
|||||||
skuCode,
|
skuCode,
|
||||||
skuName,
|
skuName,
|
||||||
model,
|
model,
|
||||||
houseCode,
|
|
||||||
batchNo,
|
batchNo,
|
||||||
|
houseCode,
|
||||||
qty,
|
qty,
|
||||||
unitCode,
|
unitCode,
|
||||||
unit,
|
unit,
|
||||||
|
|||||||
@@ -47,63 +47,51 @@
|
|||||||
FROM v_uc_cgrk06
|
FROM v_uc_cgrk06
|
||||||
WHERE orderNo = #{orderNo}
|
WHERE orderNo = #{orderNo}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTransferByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
|
<select id="selectTransferByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
billid,
|
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
supplierCode,
|
|
||||||
supplierName,
|
|
||||||
creator,
|
creator,
|
||||||
createTime,
|
createTime,
|
||||||
modifyDate,
|
modifyDate,
|
||||||
status,
|
status,
|
||||||
red
|
billid
|
||||||
FROM V_UC_DBRK02
|
FROM V_UC_DBRK02
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOtherByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
|
<select id="selectOtherByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
billid,
|
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
supplierCode,
|
|
||||||
supplierName,
|
|
||||||
creator,
|
creator,
|
||||||
createTime,
|
createTime,
|
||||||
modifyDate,
|
modifyDate,
|
||||||
status,
|
status,
|
||||||
red
|
billid
|
||||||
FROM V_UC_QTRK04
|
FROM V_UC_QTRK04
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
|
<select id="selectOtherOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
billid,
|
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
supplierCode,
|
|
||||||
supplierName,
|
|
||||||
creator,
|
creator,
|
||||||
createTime,
|
createTime,
|
||||||
modifyDate,
|
modifyDate,
|
||||||
status,
|
status,
|
||||||
red
|
billid
|
||||||
FROM V_UC_QTCK03
|
FROM V_UC_QTCK03
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst">
|
<select id="selectTransferOutByBillId" resultType="org.nl.wms.pm_manage.purchase.service.dao.Purchasemst" resultMap="BaseResultMap">
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
billid,
|
|
||||||
orderNo,
|
orderNo,
|
||||||
orderType,
|
orderType,
|
||||||
supplierCode,
|
|
||||||
supplierName,
|
|
||||||
creator,
|
creator,
|
||||||
createTime,
|
createTime,
|
||||||
modifyDate,
|
modifyDate,
|
||||||
status,
|
status,
|
||||||
red
|
billid
|
||||||
FROM V_UC_DBCK01
|
FROM V_UC_DBCK01
|
||||||
WHERE billid = #{bill_id}
|
WHERE billid = #{bill_id}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
|||||||
}
|
}
|
||||||
List<SchBasePoint> matPoints = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
List<SchBasePoint> matPoints = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
.isNotNull(SchBasePoint::getVehicle_code)
|
.isNotNull(SchBasePoint::getVehicle_code)
|
||||||
|
.ne(SchBasePoint::getVehicle_code, "")
|
||||||
.eq(SchBasePoint::getRegion_code, portPoint.getRegion_code())
|
.eq(SchBasePoint::getRegion_code, portPoint.getRegion_code())
|
||||||
.eq(SchBasePoint::getPoint_type, "1"));
|
.eq(SchBasePoint::getPoint_type, "1"));
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ 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.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.sun.javafx.binding.StringFormatter;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -14,32 +13,34 @@ import org.nl.common.utils.SecurityUtils;
|
|||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
|
||||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||||
import org.nl.wms.ext_manage.service.dto.StructLineOfflineDTO;
|
import org.nl.wms.ext_manage.service.dto.StructLineOfflineDTO;
|
||||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
|
||||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch_manage.service.core.AbstractTask;
|
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||||
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
|
|
||||||
import org.nl.wms.sch_manage.service.core.tasks.BWIPInTask;
|
import org.nl.wms.sch_manage.service.core.tasks.BWIPInTask;
|
||||||
import org.nl.wms.sch_manage.service.core.tasks.StInTask;
|
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBaseRegion;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
||||||
|
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderDao;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 焊接区域半成品入库
|
* 焊接区域半成品入库
|
||||||
@@ -54,6 +55,8 @@ public class StructOfflineService{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService iSchBasePointService;
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseRegionService iSchBaseRegionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||||
@@ -63,6 +66,8 @@ public class StructOfflineService{
|
|||||||
private BWIPInTask bwipInTask;
|
private BWIPInTask bwipInTask;
|
||||||
@Resource
|
@Resource
|
||||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||||
|
@Autowired
|
||||||
|
private IWorkOrderService workOrderService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成生产入库任务,任务完成
|
* 生成生产入库任务,任务完成
|
||||||
@@ -70,6 +75,8 @@ public class StructOfflineService{
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void offline(StructLineOfflineDTO offlineDTO){
|
public void offline(StructLineOfflineDTO offlineDTO){
|
||||||
SchBasePoint schBasePoint = iSchBasePointService.selectByCode(offlineDTO.getUnloadPort());
|
SchBasePoint schBasePoint = iSchBasePointService.selectByCode(offlineDTO.getUnloadPort());
|
||||||
|
WorkOrderDao workOrder = workOrderService.getOne(new LambdaQueryWrapper<WorkOrderDao>()
|
||||||
|
.eq(WorkOrderDao::getOrder_code, offlineDTO.getOrderCode()));
|
||||||
if (schBasePoint == null){
|
if (schBasePoint == null){
|
||||||
throw new BadRequestException(String.format("下线失败,下料点%s信息不存在",offlineDTO.getUnloadPort()));
|
throw new BadRequestException(String.format("下线失败,下料点%s信息不存在",offlineDTO.getUnloadPort()));
|
||||||
}
|
}
|
||||||
@@ -78,7 +85,7 @@ public class StructOfflineService{
|
|||||||
throw new BadRequestException("下线失败,下料点没有绑定托盘号");
|
throw new BadRequestException("下线失败,下料点没有绑定托盘号");
|
||||||
}
|
}
|
||||||
|
|
||||||
final MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(offlineDTO.getMaterialCode());
|
final MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(workOrder.getProduct_code());
|
||||||
if (materialbase == null){
|
if (materialbase == null){
|
||||||
throw new BadRequestException("下线失败,物料编码未同步");
|
throw new BadRequestException("下线失败,物料编码未同步");
|
||||||
}
|
}
|
||||||
@@ -95,11 +102,13 @@ public class StructOfflineService{
|
|||||||
plate.setQty_unit_name(materialbase.getQty_unit_id());
|
plate.setQty_unit_name(materialbase.getQty_unit_id());
|
||||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||||
iMdPbGroupplateService.save(plate);
|
iMdPbGroupplateService.save(plate);
|
||||||
//强制:下线点对应的区域就是半成品库区编码
|
//强制:下线点对应的区域的点位类型说明就是半成品库区编码
|
||||||
final String regionCode = schBasePoint.getRegion_code();
|
final String regionCode = schBasePoint.getRegion_code();
|
||||||
|
SchBaseRegion region = iSchBaseRegionService.getOne(new LambdaQueryWrapper<SchBaseRegion>()
|
||||||
|
.eq(SchBaseRegion::getRegion_code, regionCode));
|
||||||
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(StrategyStructParam.builder()
|
List<Structattr> structattrs = iStructattrService.inBoundSectDiv(StrategyStructParam.builder()
|
||||||
.ioType(StatusEnum.STRATEGY_TYPE.code("入库"))
|
.ioType(StatusEnum.STRATEGY_TYPE.code("入库"))
|
||||||
.sect_code(regionCode)
|
.sect_code(region.getPoint_type_explain())
|
||||||
.storagevehicle_code(plate.getStoragevehicle_code())
|
.storagevehicle_code(plate.getStoragevehicle_code())
|
||||||
.strategyMaters(new ArrayList<>())
|
.strategyMaters(new ArrayList<>())
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class ErpUtil {
|
|||||||
/**
|
/**
|
||||||
* 审核接口请求
|
* 审核接口请求
|
||||||
*/
|
*/
|
||||||
public void audit(String json){
|
public JSONObject audit(String json){
|
||||||
try {
|
try {
|
||||||
call.clearOperation();
|
call.clearOperation();
|
||||||
call.setOperationName("dealTask");
|
call.setOperationName("dealTask");
|
||||||
@@ -90,7 +90,8 @@ public class ErpUtil {
|
|||||||
throw new BadRequestException("回传失败:" + resultJson.getString("message"));
|
throw new BadRequestException("回传失败:" + resultJson.getString("message"));
|
||||||
}
|
}
|
||||||
log.error("Eas回传接口请求成功!");
|
log.error("Eas回传接口请求成功!");
|
||||||
log.error("Eas回传接口invoke调用结果:" + result.toString());
|
log.error("Eas回传接口invoke调用结果:" + result);
|
||||||
|
return resultJson;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BadRequestException("erp审核接口请求失败:" + e.getMessage());
|
throw new BadRequestException("erp审核接口请求失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package org.nl.wms.pda_manage.ios_manage.purchase.service.dto;
|
package org.nl.wms.pda_manage.ios_manage.purchase.service.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GroupPlateInboundDto {
|
public class GroupPlateInboundDto {
|
||||||
private String vehicle_code;
|
private String vehicle_code;
|
||||||
private String sect_code;
|
private String sect_code;
|
||||||
private String point_code;
|
private String point_code;
|
||||||
|
private List<GroupPlate> groupPlateList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMappe
|
|||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDtlMapper;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDtlMapper;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.core.enums.InventoryChangeType;
|
||||||
|
import org.nl.wms.warehouse_manage.inventory.core.param.impl.AddInvParam;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -244,34 +246,35 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
log.info("平库入库:找到虚拟库位{}",JSON.toJSONString(struct));
|
log.info("平库入库:找到虚拟库位{}",JSON.toJSONString(struct));
|
||||||
String storagevehicleCode = struct.getStoragevehicle_code();//载具编码
|
String storagevehicleCode = struct.getStoragevehicle_code();//载具编码
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
|
List<GroupPlate> gpList = new ArrayList<>();
|
||||||
for (UsualInboundDto.UsualInboundDtlDto item : usualInboundDto.getDetailList()) {
|
for (UsualInboundDto.UsualInboundDtlDto item : usualInboundDto.getDetailList()) {
|
||||||
//判断当前物料是否在库内
|
//判断当前物料是否在库内
|
||||||
// List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||||
// .eq(GroupPlate::getMaterial_code, item.getSku_code())
|
.eq(GroupPlate::getMaterial_code, item.getSku_code())
|
||||||
// .eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
||||||
// .likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
.likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
||||||
// if (!inStockGps.isEmpty()){
|
if (!inStockGps.isEmpty()){
|
||||||
// GroupPlate groupPlate = inStockGps.get(0);
|
GroupPlate groupPlate = inStockGps.get(0);
|
||||||
// Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||||
// .eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
.eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||||
// .eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
.eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
||||||
// .last("limit 1"));
|
.last("limit 1"));
|
||||||
// if (Objects.equals(structattr.getSect_code(), usualInboundDto.getSect_code())){
|
if (Objects.equals(structattr.getSect_code(), usualInboundDto.getSect_code())){
|
||||||
// //已在库,增加库存
|
//已在库,增加库存
|
||||||
// flag = true;
|
flag = true;
|
||||||
// List<AddInvParam> addInvParams = new ArrayList<>();
|
List<AddInvParam> addInvParams = new ArrayList<>();
|
||||||
// AddInvParam addParam = new AddInvParam();
|
AddInvParam addParam = new AddInvParam();
|
||||||
// addParam.setPcsn(groupPlate.getPcsn());
|
addParam.setPcsn(groupPlate.getPcsn());
|
||||||
// addParam.setMaterialCode(groupPlate.getMaterial_code());
|
addParam.setMaterialCode(groupPlate.getMaterial_code());
|
||||||
// addParam.setStoragevehicleCode(groupPlate.getStoragevehicle_code());
|
addParam.setStoragevehicleCode(groupPlate.getStoragevehicle_code());
|
||||||
// addParam.setUnitName(groupPlate.getQty_unit_name());
|
addParam.setUnitName(groupPlate.getQty_unit_name());
|
||||||
// addParam.setUnitId(groupPlate.getQty_unit_id());
|
addParam.setUnitId(groupPlate.getQty_unit_id());
|
||||||
// addParam.setQty(item.getQty());
|
addParam.setQty(item.getQty());
|
||||||
// addInvParams.add(addParam);
|
addInvParams.add(addParam);
|
||||||
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||||
// continue;
|
continue;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code());
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code());
|
||||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
||||||
//组盘
|
//组盘
|
||||||
@@ -291,12 +294,17 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
.create_name(SecurityUtils.getCurrentNickName())
|
.create_name(SecurityUtils.getCurrentNickName())
|
||||||
.create_time(DateUtil.now())
|
.create_time(DateUtil.now())
|
||||||
.build();
|
.build();
|
||||||
|
if (flag){
|
||||||
|
gpList.add(plateDao);
|
||||||
|
}else{
|
||||||
iMdPbGroupplateService.save(plateDao);
|
iMdPbGroupplateService.save(plateDao);
|
||||||
}
|
}
|
||||||
if (flag) return;//已存在库存则不用走组盘入库
|
}
|
||||||
|
// if (flag) return;//已存在库存则不用走组盘入库
|
||||||
GroupPlateInboundDto groupPlateInboundDto = new GroupPlateInboundDto();
|
GroupPlateInboundDto groupPlateInboundDto = new GroupPlateInboundDto();
|
||||||
groupPlateInboundDto.setSect_code(sectDao.getSect_code());
|
groupPlateInboundDto.setSect_code(sectDao.getSect_code());
|
||||||
groupPlateInboundDto.setVehicle_code(storagevehicleCode);
|
groupPlateInboundDto.setVehicle_code(storagevehicleCode);
|
||||||
|
groupPlateInboundDto.setGroupPlateList(gpList);
|
||||||
this.submitGroupPlateInbound(groupPlateInboundDto, false);
|
this.submitGroupPlateInbound(groupPlateInboundDto, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,11 +312,17 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void submitGroupPlateInbound(GroupPlateInboundDto groupPlateInboundDto, Boolean subTask) {
|
public void submitGroupPlateInbound(GroupPlateInboundDto groupPlateInboundDto, Boolean subTask) {
|
||||||
// 查询组盘明细
|
// 查询组盘明细
|
||||||
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
List<GroupPlate> plateDaoList;
|
||||||
|
if (groupPlateInboundDto.getGroupPlateList().isEmpty()){
|
||||||
|
plateDaoList = iMdPbGroupplateService.list(
|
||||||
new QueryWrapper<GroupPlate>().lambda()
|
new QueryWrapper<GroupPlate>().lambda()
|
||||||
.eq(GroupPlate::getStoragevehicle_code, groupPlateInboundDto.getVehicle_code())
|
.eq(GroupPlate::getStoragevehicle_code, groupPlateInboundDto.getVehicle_code())
|
||||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("组盘"))
|
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("组盘"))
|
||||||
);
|
);
|
||||||
|
}else {
|
||||||
|
plateDaoList = groupPlateInboundDto.getGroupPlateList();
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(plateDaoList)) {
|
if (ObjectUtil.isEmpty(plateDaoList)) {
|
||||||
throw new BadRequestException("当前没有可入库的物料!");
|
throw new BadRequestException("当前没有可入库的物料!");
|
||||||
}
|
}
|
||||||
@@ -454,7 +468,9 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
|||||||
dtl.put("ext_code", plateDao.getExt_code());
|
dtl.put("ext_code", plateDao.getExt_code());
|
||||||
dtl.put("ext_type", plateDao.getExt_type());
|
dtl.put("ext_type", plateDao.getExt_type());
|
||||||
dtl.put("source_billdtl_id", plateDao.getExt_dtl_code());
|
dtl.put("source_billdtl_id", plateDao.getExt_dtl_code());
|
||||||
|
if (!StrUtil.isEmptyIfStr(plateDao.getExt_code())){
|
||||||
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
||||||
|
}
|
||||||
// 调用新增入库单
|
// 调用新增入库单
|
||||||
tableData.add(dtl);
|
tableData.add(dtl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import org.nl.wms.pda_manage.ios_manage.service.dto.OutBoundDis;
|
import org.nl.wms.pda_manage.ios_manage.service.dto.OutBoundDis;
|
||||||
import org.nl.wms.pda_manage.outBound.dto.LineSideDto;
|
import org.nl.wms.pda_manage.outBound.dto.LineSideDto;
|
||||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -12,11 +12,10 @@ import org.nl.wms.basedata_manage.service.ISectattrService;
|
|||||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosOutService;
|
import org.nl.wms.pda_manage.ios_manage.service.PdaIosOutService;
|
||||||
import org.nl.wms.pda_manage.ios_manage.service.dto.OutBoundDis;
|
import org.nl.wms.pda_manage.ios_manage.service.dto.OutBoundDis;
|
||||||
import org.nl.wms.pda_manage.outBound.dto.LineSideDto;
|
import org.nl.wms.pda_manage.outBound.dto.LineSideDto;
|
||||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|||||||
@@ -97,5 +97,5 @@ public class Purchasedtl implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 已入库数量
|
* 已入库数量
|
||||||
*/
|
*/
|
||||||
private BigDecimal instock_qty;
|
private BigDecimal instock_qty = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,24 +21,24 @@
|
|||||||
track_no,
|
track_no,
|
||||||
instock_qty
|
instock_qty
|
||||||
) VALUES
|
) VALUES
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="entitys" item="item" separator=",">
|
||||||
(
|
(
|
||||||
#{item.id},
|
#{item.id},
|
||||||
#{item.entryId},
|
#{item.entry_id},
|
||||||
#{item.billId},
|
#{item.bill_id},
|
||||||
#{item.itemNo},
|
#{item.item_no},
|
||||||
#{item.categoryCode},
|
#{item.category_code},
|
||||||
#{item.categoryName},
|
#{item.category_name},
|
||||||
#{item.skuCode},
|
#{item.sku_code},
|
||||||
#{item.skuName},
|
#{item.sku_name},
|
||||||
#{item.model},
|
#{item.model},
|
||||||
#{item.houseCode},
|
#{item.house_code},
|
||||||
#{item.batchNo},
|
#{item.batch_no},
|
||||||
#{item.qty},
|
#{item.qty},
|
||||||
#{item.unitCode},
|
#{item.unit_code},
|
||||||
#{item.unit},
|
#{item.unit},
|
||||||
#{item.trackNo},
|
#{item.track_no},
|
||||||
#{item.instockQty}
|
#{item.instock_qty}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|||||||
@@ -5,35 +5,33 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
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_manage.enums.BaseDataEnum;
|
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||||
import org.nl.wms.pm_manage.SourceBillTypeEnum;
|
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||||
import org.nl.wms.pm_manage.listener.PmManageEvent;
|
|
||||||
import org.nl.wms.pm_manage.preceiving.listenerHandler.PReceivingParams;
|
|
||||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||||
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||||
import org.nl.wms.sch_manage.service.core.AbstractTask;
|
import org.nl.wms.sch_manage.service.core.AbstractTask;
|
||||||
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
|
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
|
||||||
import org.nl.wms.sch_manage.service.core.TaskType;
|
import org.nl.wms.sch_manage.service.core.TaskType;
|
||||||
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationEventPublisher;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
;import java.math.BigDecimal;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Liuxy
|
* @Author: Liuxy
|
||||||
@@ -50,7 +48,9 @@ public class BWIPInTask extends AbstractTask {
|
|||||||
@Resource
|
@Resource
|
||||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationEventPublisher eventPublisher;
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
@Autowired
|
||||||
|
private IStructattrService iStructattrService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String create(JSONObject json) {
|
public String create(JSONObject json) {
|
||||||
@@ -136,6 +136,14 @@ public class BWIPInTask extends AbstractTask {
|
|||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void finishTask(SchBaseTask task) {
|
public void finishTask(SchBaseTask task) {
|
||||||
|
// 更新起点
|
||||||
|
iSchBasePointService.update(
|
||||||
|
new UpdateWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, task.getPoint_code1())
|
||||||
|
.set(SchBasePoint::getVehicle_code, null)
|
||||||
|
.set(SchBasePoint::getIos_id, null)
|
||||||
|
.set(SchBasePoint::getPoint_status, IOSEnum.POINT_STATUS.code("无货"))
|
||||||
|
);
|
||||||
// 任务完成
|
// 任务完成
|
||||||
task.setTask_status(TaskStatus.FINISHED.getCode());
|
task.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
task.setRemark("已完成");
|
task.setRemark("已完成");
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.nl.wms.sch_manage.service.core.tasks;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
@@ -11,7 +10,8 @@ import org.nl.common.exception.BadRequestException;
|
|||||||
import org.nl.common.utils.CodeUtil;
|
import org.nl.common.utils.CodeUtil;
|
||||||
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.ext_manage.util.ErpUtil;
|
import org.nl.wms.ext_manage.api.EasApi;
|
||||||
|
import org.nl.wms.ext_manage.api.request.ReceiveOutRequest;
|
||||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||||
@@ -23,9 +23,6 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
|||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
|
||||||
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
||||||
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderBomDao;
|
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderBomDao;
|
||||||
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderDao;
|
import org.nl.wms.welding_manage.service.work_order.dao.WorkOrderDao;
|
||||||
@@ -33,7 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
;import java.util.List;
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Liuxy
|
* @Author: Liuxy
|
||||||
@@ -58,9 +59,9 @@ public class LineCallFullTask extends AbstractTask {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWorkOrderService iWorkOrderService;
|
private IWorkOrderService iWorkOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPmStockReturnService iPmStockReturnService;
|
|
||||||
@Autowired
|
|
||||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||||
|
@Autowired
|
||||||
|
private EasApi easApi;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -196,52 +197,37 @@ public class LineCallFullTask extends AbstractTask {
|
|||||||
WorkOrderDao workOrder = iWorkOrderService.getWorkOrder(workOrderCode);
|
WorkOrderDao workOrder = iWorkOrderService.getWorkOrder(workOrderCode);
|
||||||
List<WorkOrderBomDao> orderBomItems = iWorkOrderService.getOrderBomItem(workOrderCode);
|
List<WorkOrderBomDao> orderBomItems = iWorkOrderService.getOrderBomItem(workOrderCode);
|
||||||
|
|
||||||
// 创建最外层的JSONObject
|
List<ReceiveOutRequest.Entrys> entrys = new ArrayList<>();
|
||||||
JSONObject root = new JSONObject();
|
|
||||||
root.put("method", "DealMaterailReqBill");
|
|
||||||
root.put("type", "MES");
|
|
||||||
// 创建data对象
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
data.put("bizStatus", "02");
|
|
||||||
data.put("mesNo", workOrder.getId());
|
|
||||||
// 创建entrys数组
|
|
||||||
JSONArray entrys = new JSONArray();
|
|
||||||
for (GroupPlate plate : groupList) {
|
for (GroupPlate plate : groupList) {
|
||||||
for (WorkOrderBomDao orderBomItem : orderBomItems) {
|
for (WorkOrderBomDao orderBomItem : orderBomItems) {
|
||||||
if (plate.getMaterial_code().equals(orderBomItem.getMaterial_code())){
|
if (plate.getMaterial_code().equals(orderBomItem.getMaterial_code())){
|
||||||
JSONObject entry = new JSONObject();
|
ReceiveOutRequest.Entrys entry = new ReceiveOutRequest.Entrys();
|
||||||
entry.put("qty", plate.getQty());
|
entry.setSeq(orderBomItem.getItem_no());
|
||||||
entry.put("sourceBillId", workOrder.getOrder_id());
|
entry.setMaterialno(orderBomItem.getMaterial_code());
|
||||||
entry.put("sourceBillEntryId", orderBomItem.getItem_id());
|
entry.setUnitno(orderBomItem.getUnit());
|
||||||
entry.put("sourceBillNo", workOrder.getOrder_code());
|
entry.setQty(plate.getQty());
|
||||||
|
entry.setBaseqty(orderBomItem.getBom_qty());
|
||||||
|
entry.setWarehouseno(orderBomItem.getWarehouse_code().stripTrailingZeros().toPlainString());
|
||||||
|
entry.setSrcbillno(workOrder.getOrder_code());
|
||||||
|
entry.setSrcbillid(workOrder.getOrder_id());
|
||||||
|
entry.setSrcbillentryid(orderBomItem.getItem_id());
|
||||||
// 将entry添加到数组中
|
// 将entry添加到数组中
|
||||||
entrys.add(entry);
|
entrys.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iMdPbGroupplateService.removeById(plate.getGroup_id());
|
iMdPbGroupplateService.removeById(plate.getGroup_id());
|
||||||
}
|
}
|
||||||
// 将entrys数组设置到data中
|
|
||||||
data.put("entrys", entrys);
|
|
||||||
// 将data设置到根对象中
|
|
||||||
root.put("data", data);
|
|
||||||
// ErpUtil.create().login().audit(root.toJSONString());
|
|
||||||
//保存回传单
|
|
||||||
PmStockReturn stockReturn = new PmStockReturn();
|
|
||||||
stockReturn.setRequest_Id(workOrder.getOrder_id());
|
|
||||||
stockReturn.setRequest_type(IOSEnum.BILL_TYPE.code("生产领料"));
|
|
||||||
stockReturn.setStatus(StockReturnStatusEnum.TODO.getCode()); // 0-处理中
|
|
||||||
stockReturn.setCreate_time(DateUtil.now());
|
|
||||||
stockReturn.setRequest_data(root.toJSONString());
|
|
||||||
//调erp业务接口
|
|
||||||
try {
|
|
||||||
ErpUtil.create().login().reqBus(root.toJSONString());
|
|
||||||
stockReturn.setStatus(StockReturnStatusEnum.SUCESS.getCode());
|
|
||||||
} catch (Exception e) {
|
|
||||||
stockReturn.setError_msg(e.getMessage());
|
|
||||||
stockReturn.setStatus(StockReturnStatusEnum.FAIL.getCode());
|
|
||||||
}
|
|
||||||
iPmStockReturnService.save(stockReturn);
|
|
||||||
|
|
||||||
|
ReceiveOutRequest receiveOutRequest = new ReceiveOutRequest();
|
||||||
|
receiveOutRequest.setOrgno(workOrder.getOrg_code());
|
||||||
|
receiveOutRequest.setBillno(workOrderCode);
|
||||||
|
receiveOutRequest.setBiztype("340");
|
||||||
|
receiveOutRequest.setInvscheme("002");
|
||||||
|
receiveOutRequest.setBiztime(LocalDate.now().toString());
|
||||||
|
receiveOutRequest.setCztype("02");
|
||||||
|
receiveOutRequest.setEntrys(entrys);
|
||||||
|
//调erp业务接口
|
||||||
|
easApi.receiveOut(receiveOutRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public class Point2PointTask extends AbstractTask {
|
|||||||
// 创建最外层的JSONObject
|
// 创建最外层的JSONObject
|
||||||
JSONObject root = new JSONObject();
|
JSONObject root = new JSONObject();
|
||||||
root.put("method", "DealLLDBBill");
|
root.put("method", "DealLLDBBill");
|
||||||
root.put("type", "MES");
|
root.put("type", "WMS");
|
||||||
// 创建data对象
|
// 创建data对象
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("billNo", taskObj.getTask_id());
|
data.put("billNo", taskObj.getTask_id());
|
||||||
@@ -202,13 +202,12 @@ public class Point2PointTask extends AbstractTask {
|
|||||||
entry.put("qty", plate.getQty());
|
entry.put("qty", plate.getQty());
|
||||||
entry.put("materialNo", orderBomItem.getMaterial_code());
|
entry.put("materialNo", orderBomItem.getMaterial_code());
|
||||||
entry.put("unitNo", "PCS");
|
entry.put("unitNo", "PCS");
|
||||||
entry.put("receiptWarehouseNo", workOrder.getDefault_warehouse_code());
|
entry.put("receiptWarehouseNo", orderBomItem.getWarehouse_code());
|
||||||
entry.put("issueWarehouseNo", orderBomItem.getWarehouse_code());
|
entry.put("issueWarehouseNo", workOrder.getDefault_warehouse_code());
|
||||||
// 将entry添加到数组中
|
// 将entry添加到数组中
|
||||||
entrys.add(entry);
|
entrys.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iMdPbGroupplateService.removeById(plate.getGroup_id());
|
|
||||||
}
|
}
|
||||||
// 将entrys数组设置到data中
|
// 将entrys数组设置到data中
|
||||||
data.put("entrys", entrys);
|
data.put("entrys", entrys);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public enum IOSEnum {
|
|||||||
BILL_STATUS(MapOf.of("生成","10", "分配中", "20", "分配完", "30", "完成", "99")),
|
BILL_STATUS(MapOf.of("生成","10", "分配中", "20", "分配完", "30", "完成", "99")),
|
||||||
|
|
||||||
// 入库业务类型
|
// 入库业务类型
|
||||||
BILL_TYPE(MapOf.of("生产入库","0001", "采购入库", "0005","生产领料", "0006","库存调拨", "0007", "手工入库", "0009","销售出库","1001","生产出库","1005","调拨出库","1004", "手工出库", "1009","库存调拨", "2001")),
|
BILL_TYPE(MapOf.of("生产入库","0001", "采购入库", "0005","生产领料", "0006", "手工入库", "0009","销售出库","1001","生产出库","1005","调拨出库","1004", "手工出库", "1009","库存调拨", "2001")),
|
||||||
|
|
||||||
//入库分配明细状态
|
//入库分配明细状态
|
||||||
INBILL_DIS_STATUS(MapOf.of("未生成", "00", "生成", "01", "执行中", "02", "完成", "99")),
|
INBILL_DIS_STATUS(MapOf.of("未生成", "00", "生成", "01", "执行中", "02", "完成", "99")),
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
IOStorInvDtl dtl_dto = ioStorInvDtlMapper.selectOne(new LambdaQueryWrapper<IOStorInvDtl>()
|
IOStorInvDtl dtl_dto = ioStorInvDtlMapper.selectOne(new LambdaQueryWrapper<IOStorInvDtl>()
|
||||||
.eq(IOStorInvDtl::getMaterial_code, row.get("material_code"))
|
.eq(IOStorInvDtl::getMaterial_code, row.get("material_code"))
|
||||||
.eq(IOStorInvDtl::getPcsn, row.get("pcsn"))
|
.eq(IOStorInvDtl::getPcsn, row.get("pcsn"))
|
||||||
|
.eq(IOStorInvDtl::getSource_billdtl_id, row.get("source_billdtl_id"))
|
||||||
.eq(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("生成"))
|
.eq(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("生成"))
|
||||||
.eq(IOStorInvDtl::getIostorinv_id, iostorinv_id));
|
.eq(IOStorInvDtl::getIostorinv_id, iostorinv_id));
|
||||||
if (ObjectUtil.isEmpty(dtl_dto)) {
|
if (ObjectUtil.isEmpty(dtl_dto)) {
|
||||||
@@ -212,7 +213,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
|
|
||||||
//判断该载具编号是否已经存在库内
|
//判断该载具编号是否已经存在库内
|
||||||
String storagevehicleCode = row.get("storagevehicle_code").toString();
|
String storagevehicleCode = row.get("storagevehicle_code").toString();
|
||||||
if (!storagevehicleCode.startsWith("VTP")){
|
if (!storagevehicleCode.startsWith("VTP")) {
|
||||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code, storagevehicleCode));
|
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code, storagevehicleCode));
|
||||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||||
@@ -403,7 +404,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
.build());
|
.build());
|
||||||
struct = structattrs.get(0);
|
struct = structattrs.get(0);
|
||||||
} else {
|
} else {
|
||||||
if (StringUtils.isEmpty(map.getString("struct_code"))){
|
if (StringUtils.isEmpty(map.getString("struct_code"))) {
|
||||||
throw new BadRequestException("分配失败,手动分配struct_code为空");
|
throw new BadRequestException("分配失败,手动分配struct_code为空");
|
||||||
}
|
}
|
||||||
struct = iStructattrService.findByCode(map.getString("struct_code"));
|
struct = iStructattrService.findByCode(map.getString("struct_code"));
|
||||||
@@ -693,14 +694,14 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
finish_map.put("inv_code", null);
|
finish_map.put("inv_code", null);
|
||||||
iStructattrService.updateStatusByCode("1", finish_map);
|
iStructattrService.updateStatusByCode("1", finish_map);
|
||||||
// 完成当前任务对应的所有分配明细
|
// 完成当前任务对应的所有分配明细
|
||||||
ioStorInvDisMapper.update(null,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
ioStorInvDisMapper.update(null, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||||
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||||
.in(IOStorInvDis::getIostorinvdis_id,disList.stream()
|
.in(IOStorInvDis::getIostorinvdis_id, disList.stream()
|
||||||
.map(IOStorInvDis::getIostorinvdis_id).collect(Collectors.toList())));
|
.map(IOStorInvDis::getIostorinvdis_id).collect(Collectors.toList())));
|
||||||
// 查询该明细下是否还有未完成的分配明细
|
// 查询该明细下是否还有未完成的分配明细
|
||||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||||
.eq(IOStorInvDis::getIostorinvdtl_id,disList.get(0).getIostorinvdtl_id())
|
.eq(IOStorInvDis::getIostorinvdtl_id, disList.get(0).getIostorinvdtl_id())
|
||||||
.ne(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||||
);
|
);
|
||||||
// final List<AddInvParam> addInvParams = new ArrayList<>();
|
// final List<AddInvParam> addInvParams = new ArrayList<>();
|
||||||
// for (IOStorInvDis invDis : disList) {
|
// for (IOStorInvDis invDis : disList) {
|
||||||
@@ -715,28 +716,28 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
|||||||
// }
|
// }
|
||||||
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||||
// 如果分配明细全部完成则更新明细表状态
|
// 如果分配明细全部完成则更新明细表状态
|
||||||
if (countDis == 0){
|
if (countDis == 0) {
|
||||||
// 更新明细表状态
|
// 更新明细表状态
|
||||||
for (IOStorInvDis ioStorInvDis : disList) {
|
for (IOStorInvDis ioStorInvDis : disList) {
|
||||||
final IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
final IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||||
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(),ioStorInvDtl);
|
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(), ioStorInvDtl);
|
||||||
}
|
}
|
||||||
// 查看明细是否全部完成
|
// 查看明细是否全部完成
|
||||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||||
.eq(IOStorInvDtl::getIostorinv_id,disList.get(0).getIostorinv_id())
|
.eq(IOStorInvDtl::getIostorinv_id, disList.get(0).getIostorinv_id())
|
||||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||||
);
|
);
|
||||||
// 如果明细全部完成则更新主表状态
|
// 如果明细全部完成则更新主表状态
|
||||||
if (countDtl == 0){
|
if (countDtl == 0) {
|
||||||
//更新主表状态
|
//更新主表状态
|
||||||
ioStorInvMapper.update(new IOStorInv(),new LambdaUpdateWrapper<>(IOStorInv.class)
|
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||||
.set(IOStorInv::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||||
.set(IOStorInv::getConfirm_optid, SecurityUtils.getCurrentUserId())
|
.set(IOStorInv::getConfirm_optid, SecurityUtils.getCurrentUserId())
|
||||||
.set(IOStorInv::getConfirm_optname, SecurityUtils.getCurrentNickName())
|
.set(IOStorInv::getConfirm_optname, SecurityUtils.getCurrentNickName())
|
||||||
.set(IOStorInv::getConfirm_time, DateUtil.now())
|
.set(IOStorInv::getConfirm_time, DateUtil.now())
|
||||||
.eq(IOStorInv::getIostorinv_id,disList.get(0).getIostorinv_id())
|
.eq(IOStorInv::getIostorinv_id, disList.get(0).getIostorinv_id())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.wms.ext_manage.service.WmsToErpService;
|
import org.nl.wms.ext_manage.service.WmsToErpService;
|
||||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
import org.nl.wms.warehouse_manage.stockReturn.service.IPmStockReturnService;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
import org.nl.wms.warehouse_manage.stockReturn.service.dao.PmStockReturn;
|
||||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||||
@@ -91,11 +90,7 @@ public class PmStockReturnServiceImpl extends ServiceImpl<PmStockReturnMapper, P
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
JSONObject requestData = parseRequestData(stockReturn.getRequest_data());
|
JSONObject requestData = parseRequestData(stockReturn.getRequest_data());
|
||||||
if (stockReturn.getRequest_type().equals(IOSEnum.BILL_TYPE.code("生产领料"))){
|
|
||||||
wmsToErpService.dealBus(requestData);
|
|
||||||
}else{
|
|
||||||
wmsToErpService.uploadErp(requestData);
|
wmsToErpService.uploadErp(requestData);
|
||||||
}
|
|
||||||
stockReturn.setStatus(StockReturnStatusEnum.SUCESS.getCode());
|
stockReturn.setStatus(StockReturnStatusEnum.SUCESS.getCode());
|
||||||
stockReturn.setError_msg(null);
|
stockReturn.setError_msg(null);
|
||||||
stockReturn.setProcess_time(DateUtil.now());
|
stockReturn.setProcess_time(DateUtil.now());
|
||||||
|
|||||||
@@ -173,6 +173,9 @@ export default {
|
|||||||
orderType: row.order_type,
|
orderType: row.order_type,
|
||||||
red: row.red,
|
red: row.red,
|
||||||
status: row.status
|
status: row.status
|
||||||
|
}).then(res=>{
|
||||||
|
this.crud.notify(res.respMsg)
|
||||||
|
this.crud.init()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user