Merge remote-tracking branch 'origin/main'
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.ResponseData;
|
||||
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.dto.WorkOrderDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -74,8 +74,11 @@ public class MesToWmsController {
|
||||
@SaIgnore
|
||||
@Log("工单同步")
|
||||
public ResponseEntity subWorkOrder(@RequestBody List<WorkOrderDto.WorkOrderDataDto> dtos){
|
||||
String[] filter = {"E301050","E301100"};//过滤产线
|
||||
for (WorkOrderDto.WorkOrderDataDto dto : dtos) {
|
||||
iWorkOrderService.insert(dto);
|
||||
if (ArrayUtils.contains(filter, dto.getWorkArea())){
|
||||
iWorkOrderService.insert(dto);
|
||||
}
|
||||
}
|
||||
return ResponseData.build();
|
||||
}
|
||||
@@ -91,7 +94,7 @@ public class MesToWmsController {
|
||||
|
||||
/**
|
||||
* 退料单同步
|
||||
* @param dtos
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("app/restful/api/v3/wms/mesReturnSync")
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -85,13 +86,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
allZD = false;
|
||||
}
|
||||
}
|
||||
if (easMst.getForwardZD()==1){
|
||||
if (Objects.equals(1, easMst.getForwardZD())){
|
||||
if (allZD){
|
||||
//如果全部都是中鼎的则由中鼎回传EAS
|
||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||
}
|
||||
//转发中鼎
|
||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||
easMst.setForwardZD(2);
|
||||
}
|
||||
purchasedtlMapper.batchSave(easDtlList);
|
||||
purchasemstMapper.insert(easMst);
|
||||
@@ -148,13 +150,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
allZD = false;
|
||||
}
|
||||
}
|
||||
if (easMst.getForwardZD()==1){
|
||||
if (Objects.equals(1, easMst.getForwardZD())){
|
||||
if (allZD){
|
||||
//如果全部都是中鼎的则由中鼎回传EAS
|
||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||
}
|
||||
//转发中鼎
|
||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||
easMst.setForwardZD(2);
|
||||
}
|
||||
purchasedtlMapper.batchSave(easDtlList);
|
||||
purchasemstMapper.insert(easMst);
|
||||
@@ -211,13 +214,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
allZD = false;
|
||||
}
|
||||
}
|
||||
if (easMst.getForwardZD()==1){
|
||||
if (Objects.equals(1, easMst.getForwardZD())){
|
||||
if (allZD){
|
||||
//如果全部都是中鼎的则由中鼎回传EAS
|
||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||
}
|
||||
//转发中鼎
|
||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||
easMst.setForwardZD(2);
|
||||
}
|
||||
purchasedtlMapper.batchSave(easDtlList);
|
||||
purchasemstMapper.insert(easMst);
|
||||
@@ -274,13 +278,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
allZD = false;
|
||||
}
|
||||
}
|
||||
if (easMst.getForwardZD()==1){
|
||||
if (Objects.equals(1, easMst.getForwardZD())){
|
||||
if (allZD){
|
||||
//如果全部都是中鼎的则由中鼎回传EAS
|
||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||
}
|
||||
//转发中鼎
|
||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||
easMst.setForwardZD(2);
|
||||
}
|
||||
purchasedtlMapper.batchSave(easDtlList);
|
||||
purchasemstMapper.insert(easMst);
|
||||
@@ -337,13 +342,14 @@ public class InboundEasSyncServiceImpl implements InboundEasSyncService {
|
||||
allZD = false;
|
||||
}
|
||||
}
|
||||
if (easMst.getForwardZD()==1){
|
||||
if (Objects.equals(1, easMst.getForwardZD())){
|
||||
if (allZD){
|
||||
//如果全部都是中鼎的则由中鼎回传EAS
|
||||
easMst.setBill_status(PurchaseBillStatus.COMPLETED.getCode());
|
||||
}
|
||||
//转发中鼎
|
||||
wmsToZDWmdService.syncPurchaseReceiving(billChangeDto);
|
||||
easMst.setForwardZD(2);
|
||||
}
|
||||
purchasedtlMapper.batchSave(easDtlList);
|
||||
purchasemstMapper.insert(easMst);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
FROM v_uc_cgrk06
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
entryid,
|
||||
billid,
|
||||
@@ -49,8 +49,8 @@
|
||||
skuCode,
|
||||
skuName,
|
||||
model,
|
||||
houseCode,
|
||||
batchNo,
|
||||
houseCode,
|
||||
qty,
|
||||
unitCode,
|
||||
unit,
|
||||
@@ -58,7 +58,7 @@
|
||||
FROM V_UC_DBRK02
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
entryid,
|
||||
billid,
|
||||
@@ -68,8 +68,8 @@
|
||||
skuCode,
|
||||
skuName,
|
||||
model,
|
||||
houseCode,
|
||||
batchNo,
|
||||
houseCode,
|
||||
qty,
|
||||
unitCode,
|
||||
unit,
|
||||
@@ -77,7 +77,7 @@
|
||||
FROM V_UC_QTRK04
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
entryid,
|
||||
billid,
|
||||
@@ -87,8 +87,8 @@
|
||||
skuCode,
|
||||
skuName,
|
||||
model,
|
||||
houseCode,
|
||||
batchNo,
|
||||
houseCode,
|
||||
qty,
|
||||
unitCode,
|
||||
unit,
|
||||
@@ -96,7 +96,7 @@
|
||||
FROM V_UC_QTCK03
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
entryid,
|
||||
billid,
|
||||
@@ -106,8 +106,8 @@
|
||||
skuCode,
|
||||
skuName,
|
||||
model,
|
||||
houseCode,
|
||||
batchNo,
|
||||
houseCode,
|
||||
qty,
|
||||
unitCode,
|
||||
unit,
|
||||
|
||||
@@ -47,63 +47,51 @@
|
||||
FROM v_uc_cgrk06
|
||||
WHERE orderNo = #{orderNo}
|
||||
</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
|
||||
billid,
|
||||
orderNo,
|
||||
orderType,
|
||||
supplierCode,
|
||||
supplierName,
|
||||
creator,
|
||||
createTime,
|
||||
modifyDate,
|
||||
status,
|
||||
red
|
||||
billid
|
||||
FROM V_UC_DBRK02
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
billid,
|
||||
orderNo,
|
||||
orderType,
|
||||
supplierCode,
|
||||
supplierName,
|
||||
creator,
|
||||
createTime,
|
||||
modifyDate,
|
||||
status,
|
||||
red
|
||||
billid
|
||||
FROM V_UC_QTRK04
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
billid,
|
||||
orderNo,
|
||||
orderType,
|
||||
supplierCode,
|
||||
supplierName,
|
||||
creator,
|
||||
createTime,
|
||||
modifyDate,
|
||||
status,
|
||||
red
|
||||
billid
|
||||
FROM V_UC_QTCK03
|
||||
WHERE billid = #{bill_id}
|
||||
</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
|
||||
billid,
|
||||
orderNo,
|
||||
orderType,
|
||||
supplierCode,
|
||||
supplierName,
|
||||
creator,
|
||||
createTime,
|
||||
modifyDate,
|
||||
status,
|
||||
red
|
||||
billid
|
||||
FROM V_UC_DBCK01
|
||||
WHERE billid = #{bill_id}
|
||||
</select>
|
||||
|
||||
@@ -71,6 +71,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
||||
}
|
||||
List<SchBasePoint> matPoints = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.isNotNull(SchBasePoint::getVehicle_code)
|
||||
.ne(SchBasePoint::getVehicle_code, "")
|
||||
.eq(SchBasePoint::getRegion_code, portPoint.getRegion_code())
|
||||
.eq(SchBasePoint::getPoint_type, "1"));
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sun.javafx.binding.StringFormatter;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
@@ -14,32 +13,34 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
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.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.ext_manage.service.dto.StructLineOfflineDTO;
|
||||
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.core.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.core.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseRegionService;
|
||||
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.SchBaseRegion;
|
||||
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.dao.IOStorInvDis;
|
||||
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.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.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
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
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
@Autowired
|
||||
private ISchBaseRegionService iSchBaseRegionService;
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
@@ -63,6 +66,8 @@ public class StructOfflineService{
|
||||
private BWIPInTask bwipInTask;
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
@Autowired
|
||||
private IWorkOrderService workOrderService;
|
||||
|
||||
/**
|
||||
* 生成生产入库任务,任务完成
|
||||
@@ -70,6 +75,8 @@ public class StructOfflineService{
|
||||
@Transactional
|
||||
public void offline(StructLineOfflineDTO offlineDTO){
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByCode(offlineDTO.getUnloadPort());
|
||||
WorkOrderDao workOrder = workOrderService.getOne(new LambdaQueryWrapper<WorkOrderDao>()
|
||||
.eq(WorkOrderDao::getOrder_code, offlineDTO.getOrderCode()));
|
||||
if (schBasePoint == null){
|
||||
throw new BadRequestException(String.format("下线失败,下料点%s信息不存在",offlineDTO.getUnloadPort()));
|
||||
}
|
||||
@@ -78,7 +85,7 @@ public class StructOfflineService{
|
||||
throw new BadRequestException("下线失败,下料点没有绑定托盘号");
|
||||
}
|
||||
|
||||
final MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(offlineDTO.getMaterialCode());
|
||||
final MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(workOrder.getProduct_code());
|
||||
if (materialbase == null){
|
||||
throw new BadRequestException("下线失败,物料编码未同步");
|
||||
}
|
||||
@@ -95,11 +102,13 @@ public class StructOfflineService{
|
||||
plate.setQty_unit_name(materialbase.getQty_unit_id());
|
||||
plate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
iMdPbGroupplateService.save(plate);
|
||||
//强制:下线点对应的区域就是半成品库区编码
|
||||
//强制:下线点对应的区域的点位类型说明就是半成品库区编码
|
||||
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()
|
||||
.ioType(StatusEnum.STRATEGY_TYPE.code("入库"))
|
||||
.sect_code(regionCode)
|
||||
.sect_code(region.getPoint_type_explain())
|
||||
.storagevehicle_code(plate.getStoragevehicle_code())
|
||||
.strategyMaters(new ArrayList<>())
|
||||
.build());
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ErpUtil {
|
||||
/**
|
||||
* 审核接口请求
|
||||
*/
|
||||
public void audit(String json){
|
||||
public JSONObject audit(String json){
|
||||
try {
|
||||
call.clearOperation();
|
||||
call.setOperationName("dealTask");
|
||||
@@ -90,7 +90,8 @@ public class ErpUtil {
|
||||
throw new BadRequestException("回传失败:" + resultJson.getString("message"));
|
||||
}
|
||||
log.error("Eas回传接口请求成功!");
|
||||
log.error("Eas回传接口invoke调用结果:" + result.toString());
|
||||
log.error("Eas回传接口invoke调用结果:" + result);
|
||||
return resultJson;
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("erp审核接口请求失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package org.nl.wms.pda_manage.ios_manage.purchase.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class GroupPlateInboundDto {
|
||||
private String vehicle_code;
|
||||
private String sect_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.dto.IOStorInvDisDto;
|
||||
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.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -244,34 +246,35 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
log.info("平库入库:找到虚拟库位{}",JSON.toJSONString(struct));
|
||||
String storagevehicleCode = struct.getStoragevehicle_code();//载具编码
|
||||
boolean flag = false;
|
||||
List<GroupPlate> gpList = new ArrayList<>();
|
||||
for (UsualInboundDto.UsualInboundDtlDto item : usualInboundDto.getDetailList()) {
|
||||
//判断当前物料是否在库内
|
||||
// List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||
// .eq(GroupPlate::getMaterial_code, item.getSku_code())
|
||||
// .eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
||||
// .likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
||||
// if (!inStockGps.isEmpty()){
|
||||
// GroupPlate groupPlate = inStockGps.get(0);
|
||||
// Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||
// .eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||
// .eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
||||
// .last("limit 1"));
|
||||
// if (Objects.equals(structattr.getSect_code(), usualInboundDto.getSect_code())){
|
||||
// //已在库,增加库存
|
||||
// flag = true;
|
||||
// List<AddInvParam> addInvParams = new ArrayList<>();
|
||||
// AddInvParam addParam = new AddInvParam();
|
||||
// addParam.setPcsn(groupPlate.getPcsn());
|
||||
// addParam.setMaterialCode(groupPlate.getMaterial_code());
|
||||
// addParam.setStoragevehicleCode(groupPlate.getStoragevehicle_code());
|
||||
// addParam.setUnitName(groupPlate.getQty_unit_name());
|
||||
// addParam.setUnitId(groupPlate.getQty_unit_id());
|
||||
// addParam.setQty(item.getQty());
|
||||
// addInvParams.add(addParam);
|
||||
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
List<GroupPlate> inStockGps = iMdPbGroupplateService.list(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getMaterial_code, item.getSku_code())
|
||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("入库"))
|
||||
.likeRight(GroupPlate::getStoragevehicle_code, "VTP"));
|
||||
if (!inStockGps.isEmpty()){
|
||||
GroupPlate groupPlate = inStockGps.get(0);
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getStoragevehicle_code, groupPlate.getStoragevehicle_code())
|
||||
.eq(Structattr::getSect_code, usualInboundDto.getSect_code())
|
||||
.last("limit 1"));
|
||||
if (Objects.equals(structattr.getSect_code(), usualInboundDto.getSect_code())){
|
||||
//已在库,增加库存
|
||||
flag = true;
|
||||
List<AddInvParam> addInvParams = new ArrayList<>();
|
||||
AddInvParam addParam = new AddInvParam();
|
||||
addParam.setPcsn(groupPlate.getPcsn());
|
||||
addParam.setMaterialCode(groupPlate.getMaterial_code());
|
||||
addParam.setStoragevehicleCode(groupPlate.getStoragevehicle_code());
|
||||
addParam.setUnitName(groupPlate.getQty_unit_name());
|
||||
addParam.setUnitId(groupPlate.getQty_unit_id());
|
||||
addParam.setQty(item.getQty());
|
||||
addInvParams.add(addParam);
|
||||
iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(item.getSku_code());
|
||||
MdPbMeasureunit unitDao = iMdPbMeasureunitService.getById(materDao.getQty_unit_id());
|
||||
//组盘
|
||||
@@ -291,12 +294,17 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
.create_name(SecurityUtils.getCurrentNickName())
|
||||
.create_time(DateUtil.now())
|
||||
.build();
|
||||
iMdPbGroupplateService.save(plateDao);
|
||||
if (flag){
|
||||
gpList.add(plateDao);
|
||||
}else{
|
||||
iMdPbGroupplateService.save(plateDao);
|
||||
}
|
||||
}
|
||||
if (flag) return;//已存在库存则不用走组盘入库
|
||||
// if (flag) return;//已存在库存则不用走组盘入库
|
||||
GroupPlateInboundDto groupPlateInboundDto = new GroupPlateInboundDto();
|
||||
groupPlateInboundDto.setSect_code(sectDao.getSect_code());
|
||||
groupPlateInboundDto.setVehicle_code(storagevehicleCode);
|
||||
groupPlateInboundDto.setGroupPlateList(gpList);
|
||||
this.submitGroupPlateInbound(groupPlateInboundDto, false);
|
||||
}
|
||||
|
||||
@@ -304,11 +312,17 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
@Transactional
|
||||
public void submitGroupPlateInbound(GroupPlateInboundDto groupPlateInboundDto, Boolean subTask) {
|
||||
// 查询组盘明细
|
||||
List<GroupPlate> plateDaoList = iMdPbGroupplateService.list(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, groupPlateInboundDto.getVehicle_code())
|
||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("组盘"))
|
||||
);
|
||||
List<GroupPlate> plateDaoList;
|
||||
if (groupPlateInboundDto.getGroupPlateList().isEmpty()){
|
||||
plateDaoList = iMdPbGroupplateService.list(
|
||||
new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStoragevehicle_code, groupPlateInboundDto.getVehicle_code())
|
||||
.eq(GroupPlate::getStatus, GROUP_PLATE_STATUS.code("组盘"))
|
||||
);
|
||||
}else {
|
||||
plateDaoList = groupPlateInboundDto.getGroupPlateList();
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(plateDaoList)) {
|
||||
throw new BadRequestException("当前没有可入库的物料!");
|
||||
}
|
||||
@@ -454,7 +468,9 @@ public class InboundPdaServiceImpl implements InboundPdaService {
|
||||
dtl.put("ext_code", plateDao.getExt_code());
|
||||
dtl.put("ext_type", plateDao.getExt_type());
|
||||
dtl.put("source_billdtl_id", plateDao.getExt_dtl_code());
|
||||
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
||||
if (!StrUtil.isEmptyIfStr(plateDao.getExt_code())){
|
||||
dtl.put("callback_strategy", "dealPurchaseRecBillCallback");
|
||||
}
|
||||
// 调用新增入库单
|
||||
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.outBound.dto.LineSideDto;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
|
||||
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.dto.OutBoundDis;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
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 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,
|
||||
instock_qty
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
<foreach collection="entitys" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.entryId},
|
||||
#{item.billId},
|
||||
#{item.itemNo},
|
||||
#{item.categoryCode},
|
||||
#{item.categoryName},
|
||||
#{item.skuCode},
|
||||
#{item.skuName},
|
||||
#{item.entry_id},
|
||||
#{item.bill_id},
|
||||
#{item.item_no},
|
||||
#{item.category_code},
|
||||
#{item.category_name},
|
||||
#{item.sku_code},
|
||||
#{item.sku_name},
|
||||
#{item.model},
|
||||
#{item.houseCode},
|
||||
#{item.batchNo},
|
||||
#{item.house_code},
|
||||
#{item.batch_no},
|
||||
#{item.qty},
|
||||
#{item.unitCode},
|
||||
#{item.unit_code},
|
||||
#{item.unit},
|
||||
#{item.trackNo},
|
||||
#{item.instockQty}
|
||||
#{item.track_no},
|
||||
#{item.instock_qty}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -5,35 +5,33 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
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.UpdateWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.pm_manage.SourceBillTypeEnum;
|
||||
import org.nl.wms.pm_manage.listener.PmManageEvent;
|
||||
import org.nl.wms.pm_manage.preceiving.listenerHandler.PReceivingParams;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
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.core.AbstractTask;
|
||||
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.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
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.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
;import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
@@ -50,7 +48,9 @@ public class BWIPInTask extends AbstractTask {
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
@Autowired
|
||||
private ApplicationEventPublisher eventPublisher;
|
||||
private ISchBasePointService iSchBasePointService;
|
||||
@Autowired
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
@@ -136,6 +136,14 @@ public class BWIPInTask extends AbstractTask {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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.setRemark("已完成");
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.nl.wms.sch_manage.service.core.tasks;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.IdUtil;
|
||||
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.service.ISchBasePointService;
|
||||
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.service.IMdPbGroupplateService;
|
||||
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.dao.WorkOrderBomDao;
|
||||
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.transaction.annotation.Transactional;
|
||||
|
||||
;import java.util.List;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* @Author: Liuxy
|
||||
@@ -58,9 +59,9 @@ public class LineCallFullTask extends AbstractTask {
|
||||
@Autowired
|
||||
private IWorkOrderService iWorkOrderService;
|
||||
@Autowired
|
||||
private IPmStockReturnService iPmStockReturnService;
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupplateService;
|
||||
@Autowired
|
||||
private EasApi easApi;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -196,52 +197,37 @@ public class LineCallFullTask extends AbstractTask {
|
||||
WorkOrderDao workOrder = iWorkOrderService.getWorkOrder(workOrderCode);
|
||||
List<WorkOrderBomDao> orderBomItems = iWorkOrderService.getOrderBomItem(workOrderCode);
|
||||
|
||||
// 创建最外层的JSONObject
|
||||
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();
|
||||
List<ReceiveOutRequest.Entrys> entrys = new ArrayList<>();
|
||||
for (GroupPlate plate : groupList) {
|
||||
for (WorkOrderBomDao orderBomItem : orderBomItems) {
|
||||
if (plate.getMaterial_code().equals(orderBomItem.getMaterial_code())){
|
||||
JSONObject entry = new JSONObject();
|
||||
entry.put("qty", plate.getQty());
|
||||
entry.put("sourceBillId", workOrder.getOrder_id());
|
||||
entry.put("sourceBillEntryId", orderBomItem.getItem_id());
|
||||
entry.put("sourceBillNo", workOrder.getOrder_code());
|
||||
ReceiveOutRequest.Entrys entry = new ReceiveOutRequest.Entrys();
|
||||
entry.setSeq(orderBomItem.getItem_no());
|
||||
entry.setMaterialno(orderBomItem.getMaterial_code());
|
||||
entry.setUnitno(orderBomItem.getUnit());
|
||||
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添加到数组中
|
||||
entrys.add(entry);
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
@@ -186,7 +186,7 @@ public class Point2PointTask extends AbstractTask {
|
||||
// 创建最外层的JSONObject
|
||||
JSONObject root = new JSONObject();
|
||||
root.put("method", "DealLLDBBill");
|
||||
root.put("type", "MES");
|
||||
root.put("type", "WMS");
|
||||
// 创建data对象
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("billNo", taskObj.getTask_id());
|
||||
@@ -202,13 +202,12 @@ public class Point2PointTask extends AbstractTask {
|
||||
entry.put("qty", plate.getQty());
|
||||
entry.put("materialNo", orderBomItem.getMaterial_code());
|
||||
entry.put("unitNo", "PCS");
|
||||
entry.put("receiptWarehouseNo", workOrder.getDefault_warehouse_code());
|
||||
entry.put("issueWarehouseNo", orderBomItem.getWarehouse_code());
|
||||
entry.put("receiptWarehouseNo", orderBomItem.getWarehouse_code());
|
||||
entry.put("issueWarehouseNo", workOrder.getDefault_warehouse_code());
|
||||
// 将entry添加到数组中
|
||||
entrys.add(entry);
|
||||
}
|
||||
}
|
||||
iMdPbGroupplateService.removeById(plate.getGroup_id());
|
||||
}
|
||||
// 将entrys数组设置到data中
|
||||
data.put("entrys", entrys);
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum IOSEnum {
|
||||
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")),
|
||||
|
||||
@@ -187,6 +187,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
IOStorInvDtl dtl_dto = ioStorInvDtlMapper.selectOne(new LambdaQueryWrapper<IOStorInvDtl>()
|
||||
.eq(IOStorInvDtl::getMaterial_code, row.get("material_code"))
|
||||
.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::getIostorinv_id, iostorinv_id));
|
||||
if (ObjectUtil.isEmpty(dtl_dto)) {
|
||||
@@ -212,7 +213,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
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));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
@@ -401,9 +402,9 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
.storagevehicle_code(param.getString("storagevehicle_code"))
|
||||
.strategyMaters(maters)
|
||||
.build());
|
||||
struct = structattrs.get(0);
|
||||
struct = structattrs.get(0);
|
||||
} else {
|
||||
if (StringUtils.isEmpty(map.getString("struct_code"))){
|
||||
if (StringUtils.isEmpty(map.getString("struct_code"))) {
|
||||
throw new BadRequestException("分配失败,手动分配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);
|
||||
iStructattrService.updateStatusByCode("1", finish_map);
|
||||
// 完成当前任务对应的所有分配明细
|
||||
ioStorInvDisMapper.update(null,new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.in(IOStorInvDis::getIostorinvdis_id,disList.stream()
|
||||
ioStorInvDisMapper.update(null, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.in(IOStorInvDis::getIostorinvdis_id, disList.stream()
|
||||
.map(IOStorInvDis::getIostorinvdis_id).collect(Collectors.toList())));
|
||||
// 查询该明细下是否还有未完成的分配明细
|
||||
int countDis = ioStorInvDisMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id,disList.get(0).getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
.eq(IOStorInvDis::getIostorinvdtl_id, disList.get(0).getIostorinvdtl_id())
|
||||
.ne(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("完成"))
|
||||
);
|
||||
// final List<AddInvParam> addInvParams = new ArrayList<>();
|
||||
// for (IOStorInvDis invDis : disList) {
|
||||
@@ -715,28 +716,28 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
// }
|
||||
// iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams);
|
||||
// 如果分配明细全部完成则更新明细表状态
|
||||
if (countDis == 0){
|
||||
if (countDis == 0) {
|
||||
// 更新明细表状态
|
||||
for (IOStorInvDis ioStorInvDis : disList) {
|
||||
final IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(ioStorInvDis.getIostorinvdtl_id());
|
||||
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInvDtlMapper.updateById(ioStorInvDtl);
|
||||
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(),ioStorInvDtl);
|
||||
callbackStrategyPublish.callbackStrategy(ioStorInvDtl.getCallback_strategy(), ioStorInvDtl);
|
||||
}
|
||||
// 查看明细是否全部完成
|
||||
int countDtl = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
|
||||
.eq(IOStorInvDtl::getIostorinv_id,disList.get(0).getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
.eq(IOStorInvDtl::getIostorinv_id, disList.get(0).getIostorinv_id())
|
||||
.ne(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||
);
|
||||
// 如果明细全部完成则更新主表状态
|
||||
if (countDtl == 0){
|
||||
if (countDtl == 0) {
|
||||
//更新主表状态
|
||||
ioStorInvMapper.update(new IOStorInv(),new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||
.set(IOStorInv::getBill_status,IOSEnum.BILL_STATUS.code("完成"))
|
||||
ioStorInvMapper.update(new IOStorInv(), new LambdaUpdateWrapper<>(IOStorInv.class)
|
||||
.set(IOStorInv::getBill_status, IOSEnum.BILL_STATUS.code("完成"))
|
||||
.set(IOStorInv::getConfirm_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(IOStorInv::getConfirm_optname, SecurityUtils.getCurrentNickName())
|
||||
.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.exception.BadRequestException;
|
||||
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.dao.PmStockReturn;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||
@@ -91,11 +90,7 @@ public class PmStockReturnServiceImpl extends ServiceImpl<PmStockReturnMapper, P
|
||||
}
|
||||
try {
|
||||
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.setError_msg(null);
|
||||
stockReturn.setProcess_time(DateUtil.now());
|
||||
|
||||
Reference in New Issue
Block a user