|
@@ -15,7 +15,9 @@ import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
|
|
|
import com.ruoyi.ams.config.domain.dto.LotattDTO;
|
|
|
import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
|
|
|
import com.ruoyi.ams.config.service.IFlowConfigHeaderService;
|
|
|
+import com.ruoyi.ams.erp.domain.ErpBarcodes;
|
|
|
import com.ruoyi.ams.erp.domain.ErpOrderList;
|
|
|
+import com.ruoyi.ams.erp.service.IErpBarcodesService;
|
|
|
import com.ruoyi.ams.inv.domain.ActTransactionLog;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotAtt;
|
|
|
import com.ruoyi.ams.inv.domain.InvLotLocId;
|
|
@@ -60,6 +62,7 @@ import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
|
|
|
import com.ruoyi.ams.asn.mapper.WmsDocAsnHeaderMapper;
|
|
|
import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
|
|
|
import com.ruoyi.ams.asn.service.IWmsDocAsnHeaderService;
|
|
|
+import sun.jvm.hotspot.gc_implementation.g1.HeapRegionSetBase;
|
|
|
|
|
|
/**
|
|
|
* 入库单Service业务层处理
|
|
@@ -104,7 +107,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
@Autowired
|
|
|
private IBaseLocationInfoService baseLocationInfoService;
|
|
|
@Autowired
|
|
|
- private IWcsTaskService wcsTaskService;
|
|
|
+ private IErpBarcodesService erpBarcodesService;
|
|
|
@Autowired
|
|
|
private IWmsDocAsnHeaderService iWmsDocAsnHeaderService;
|
|
|
|
|
@@ -729,4 +732,122 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
|
|
|
wmsDocAsnHeader.setEdiSendFlag("N");
|
|
|
wmsDocAsnHeaderMapper.insertWmsDocAsnHeader(wmsDocAsnHeader);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 在erp_barcodes中插入入库单扫描记录,其实是关联批次插入数据
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public AjaxResult synchronizeErpBarcodeList(String asnNo) {
|
|
|
+
|
|
|
+ WmsDocAsnHeader docAsnHeader = iWmsDocAsnHeaderService.selectWmsDocAsnHeaderByAsnNo(asnNo);
|
|
|
+ if (null == docAsnHeader) return AjaxResult.error("查无入库单数据");
|
|
|
+
|
|
|
+ WmsDocAsnDetails asnDetailsQuery = new WmsDocAsnDetails();
|
|
|
+ asnDetailsQuery.setAsnNo(asnNo);
|
|
|
+ List<WmsDocAsnDetails> docAsnDetailsList = wmsDocAsnDetailsMapper.selectWmsDocAsnDetailsList(asnDetailsQuery);
|
|
|
+ if (null == docAsnDetailsList || docAsnDetailsList.size() == 0) return AjaxResult.error("查无入库单明细数据");
|
|
|
+
|
|
|
+ //根据入库单号关联批次表,查询当前入库单内所有成品条码,在下方循环中,每匹配一个成品数据,则在数组中删除一条
|
|
|
+ List<InvLotAtt> serialNumAttributes = invLotAttService.queryAttributesByAsnno(asnNo);
|
|
|
+ Iterator<InvLotAtt> attIterator = serialNumAttributes.iterator();
|
|
|
+
|
|
|
+ ErpBarcodes erpBarcodes;
|
|
|
+ for (WmsDocAsnDetails docAsnDetails : docAsnDetailsList) {
|
|
|
+
|
|
|
+ erpBarcodes = new ErpBarcodes();
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 1,若当前SKU是成品
|
|
|
+ * 入库数代表插入多少条扫描记录
|
|
|
+ **/
|
|
|
+ boolean isProduct = false;
|
|
|
+ for (InvLotAtt invLotAtt : serialNumAttributes) {
|
|
|
+
|
|
|
+ if (docAsnDetails.getSku().equals(invLotAtt.getSku())) {
|
|
|
+
|
|
|
+ isProduct = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isProduct) {
|
|
|
+
|
|
|
+ for (int i = 0; i < docAsnDetails.getReceivedQty().intValue(); i++) {
|
|
|
+
|
|
|
+ erpBarcodes.setQty(BigDecimal.ONE);
|
|
|
+ //ERP单号ORDER_NAME
|
|
|
+ erpBarcodes.setErpNo(docAsnHeader.getAsnReference1());
|
|
|
+ //项次(ORDER_NO)
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setErpName(docAsnDetails.getdEdi01());
|
|
|
+ //ERP单据类型
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setErpType(docAsnHeader.gethEdi02());
|
|
|
+ //ERP出入库类型
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setType(docAsnHeader.gethEdi03());
|
|
|
+ //仓库编号
|
|
|
+ erpBarcodes.setStockId(String.valueOf(Constant.WAREHOUSE_ID));
|
|
|
+ //产品条码 + 托盘号 + 批次号
|
|
|
+ while (attIterator.hasNext()) {
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 目前bas_sku没存是否成品字段,先通过此种方式判断匹配关系
|
|
|
+ * 匹配成功后删除数组中的成品条码,防止重复添加
|
|
|
+ */
|
|
|
+ InvLotAtt invLotAtt = attIterator.next();
|
|
|
+ if (invLotAtt.getSku().equals(docAsnDetails.getSku())) {
|
|
|
+
|
|
|
+ erpBarcodes.setBarcode(invLotAtt.getLotatt02());
|
|
|
+ erpBarcodes.setBoxNo(invLotAtt.getLotatt07());
|
|
|
+ erpBarcodes.setLotnum(invLotAtt.getLotnum());
|
|
|
+ attIterator.remove();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //库位号为空,查不出来
|
|
|
+ erpBarcodes.setLocationNo("");
|
|
|
+ erpBarcodes.setCreateBy("SYSTEM");
|
|
|
+ erpBarcodesService.insertErpBarcodes(erpBarcodes);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ //入库数
|
|
|
+ erpBarcodes.setQty(docAsnDetails.getReceivedQty());
|
|
|
+ //条码,物料
|
|
|
+ erpBarcodes.setBarcode(docAsnDetails.getSku());
|
|
|
+ //ERP单号ORDER_NAME
|
|
|
+ erpBarcodes.setErpNo(docAsnHeader.getAsnReference1());
|
|
|
+ //项次(ORDER_NO)
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setErpName(docAsnDetails.getdEdi01());
|
|
|
+ //ERP单据类型
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setErpType(docAsnHeader.gethEdi02());
|
|
|
+ //ERP出入库类型
|
|
|
+ // TODO 待确认
|
|
|
+ erpBarcodes.setType(docAsnHeader.gethEdi03());
|
|
|
+ //仓库编号
|
|
|
+ erpBarcodes.setStockId(String.valueOf(Constant.WAREHOUSE_ID));
|
|
|
+ //托盘号,查询本张入库单当前物料所入的所有托盘
|
|
|
+ InvLotAtt invLotAttQuery = new InvLotAtt();
|
|
|
+ invLotAttQuery.setSku(docAsnDetails.getSku());
|
|
|
+ invLotAttQuery.setLotatt08(docAsnDetails.getAsnNo());
|
|
|
+ List<InvLotAtt> invLotAttList = invLotAttService.selectInvLotAttList(invLotAttQuery);
|
|
|
+ StringBuilder boxNo = new StringBuilder();
|
|
|
+ for (InvLotAtt invLotAtt : invLotAttList) {
|
|
|
+
|
|
|
+ boxNo.append(invLotAtt.getLotatt07()).append(",");
|
|
|
+ erpBarcodes.setLotnum(invLotAtt.getLotnum());
|
|
|
+ }
|
|
|
+ erpBarcodes.setBoxNo(boxNo.toString());
|
|
|
+ //库位号为空,查不出来
|
|
|
+ erpBarcodes.setLocationNo("");
|
|
|
+ erpBarcodes.setCreateBy("SYSTEM");
|
|
|
+ erpBarcodesService.insertErpBarcodes(erpBarcodes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return AjaxResult.success("条码扫描记录表插入成功");
|
|
|
+ }
|
|
|
}
|