|
|
|
@ -164,9 +164,11 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
|
|
|
|
|
//wms_raw_order_in_sn
|
|
|
|
|
WmsRawOrderInSn wmsRawOrderInSn = new WmsRawOrderInSn();
|
|
|
|
|
wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsRawOrderInSn.setUserDefined1("1");//
|
|
|
|
|
wmsRawOrderInSn.setUserDefined1("1");//1是收货,2是入库
|
|
|
|
|
wmsRawOrderInSn.setUserDefined2(odsProcureOrder.getIncomeBatchNo());//批次
|
|
|
|
|
wmsRawOrderInSn.setWhCode(odsProcureOrder.getWhCode());//厂库编号
|
|
|
|
|
wmsRawOrderInSn.setWaCode(odsProcureOrder.getWaCode());
|
|
|
|
|
wmsRawOrderInSn.setWlCode("00001-1-01");//先都设置为同一个库位
|
|
|
|
|
wmsRawOrderInSn.setPoNo(order.getProcureCode());//采购单号
|
|
|
|
|
wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目
|
|
|
|
|
wmsRawOrderInSn.setMaterialCode(odsProcureOrder.getMaterialCode());
|
|
|
|
@ -203,24 +205,6 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
|
|
|
|
|
}
|
|
|
|
|
Integer tem = odsProcureOrderMapper.updateRealityNuById(odsProcureOrder);
|
|
|
|
|
//插入检验集计划
|
|
|
|
|
// QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO();
|
|
|
|
|
// qcCheckTaskIncomeDTO.setCheckLoc("mjtest");
|
|
|
|
|
// qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
|
|
|
|
|
//// qcCheckTaskIncomeDTO.setCheckManCode("mobile");
|
|
|
|
|
//// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户");
|
|
|
|
|
// qcCheckTaskIncomeDTO.setSupplierCode(order.getSupplierCode());
|
|
|
|
|
// String name = odsProcureOrderMapper.selectBaseSupplier(odsProcureOrder);
|
|
|
|
|
// qcCheckTaskIncomeDTO.setSupplierName(name);
|
|
|
|
|
// qcCheckTaskIncomeDTO.setOrderType("bc");
|
|
|
|
|
// qcCheckTaskIncomeDTO.setUnit(order.getUnit());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setFactoryCode(odsProcureOrder.getFactoryCode());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setQuality(odsProcureOrder.getPlanNumber());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setMaterialCode(odsProcureOrder.getMaterialCode());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setMaterialName(odsProcureOrder.getSupplierName());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setIncomeBatchNo(odsProcureOrder.getIncomeBatchNo());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setOrderNo(order.getProcureCode());
|
|
|
|
|
// qcCheckTaskIncomeDTO.setIncomeTime(new Date());
|
|
|
|
|
// remoteQualityService.createIncomeTask(qcCheckTaskIncomeDTO);
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -739,9 +723,104 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
|
|
|
|
|
public String PurchaseOrderdeliPdaConfirm(OdsProcureOrder odsProcureOrder) {
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode());
|
|
|
|
|
String result="操作成功";
|
|
|
|
|
List<WmsRawOrderInSn> wmsRawOrderInSn = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder);
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
String formattedDate = dateFormat.format(date);
|
|
|
|
|
WmsRawOrderInSn wmsRawOrderInSn1=new WmsRawOrderInSn();
|
|
|
|
|
OdsProcureOrder order = odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID());
|
|
|
|
|
List<WmsRawOrderInSn> wmsRawOrderInSns = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder);
|
|
|
|
|
WmsRawOrderInSn wmsRawOrderInSnTEM = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaById(odsProcureOrder);
|
|
|
|
|
if(wmsRawOrderInSns.size()>0){
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
result="托盘都已经入库";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
//先sap暂收成功后,我们这边也进行收货
|
|
|
|
|
BigDecimal amount= wmsRawOrderInSnTEM.getAmount();//要入库的数量
|
|
|
|
|
Map paramMap=new HashMap<>();
|
|
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
|
|
/**
|
|
|
|
|
* ZMES_103_MIGO函数取值说明:智慧工厂MIGO-103移动类型收货
|
|
|
|
|
* 字段 类型 长度 小数位 描述
|
|
|
|
|
* EBELN CHAR 10 0 采购凭证号
|
|
|
|
|
* EBELP NUMC 5 0 采购凭证的项目编号
|
|
|
|
|
* MATNR CHAR 18 0 物料号
|
|
|
|
|
* WERKS CHAR 4 0 工厂
|
|
|
|
|
* QUANTITY QUAN 13 3 数量
|
|
|
|
|
* @param mapList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
paramMap.put("EBELN",order.getProcureCode());
|
|
|
|
|
paramMap.put("EBELP",order.getUserDefined3());
|
|
|
|
|
paramMap.put("MATNR",order.getMaterialCode());
|
|
|
|
|
paramMap.put("WERKS",order.getSiteCode());
|
|
|
|
|
paramMap.put("QUANTITY",amount.toString());
|
|
|
|
|
mapList.add(paramMap);
|
|
|
|
|
R result2 = remoteSapService.temporarilyCollected(mapList);
|
|
|
|
|
int code = result2.getCode();
|
|
|
|
|
if (code == 200){//成功
|
|
|
|
|
order.setSapTempStatus("1");//0是失败。1是成功
|
|
|
|
|
order.setSapTempInfor(result2.getMsg());
|
|
|
|
|
odsProcureOrderMapper.updateOdsProcureOrder(order);
|
|
|
|
|
for (WmsRawOrderInSn wmsRawOrderInSn:wmsRawOrderInSns){
|
|
|
|
|
//收货
|
|
|
|
|
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = new WmsOdsMateStorageNewsSn();
|
|
|
|
|
wmsOdsMateStorageNewsSn.setMateOrderInSnId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
|
|
|
|
|
wmsOdsMateStorageNewsSn.setWaCode(wmsRawOrderInSn.getWaCode());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码--现在都设置为00001-1-01
|
|
|
|
|
wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setCreateBy(odsProcureOrder.getCreateBy());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setGmtCreate(new Date());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setUserDefined2(formattedDate);//批次
|
|
|
|
|
wmsOdsMateStorageNewsSn.setFactoryCode(wmsRawOrderInSn.getFactoryCode());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsRawOrderInSn.getFactoryCode());
|
|
|
|
|
wmsOdsMateStorageNewsSn.setActiveFlag("1");
|
|
|
|
|
wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);
|
|
|
|
|
//修改库存
|
|
|
|
|
//2,修改库存---/加库存数量-/-冻结数量
|
|
|
|
|
WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews();
|
|
|
|
|
wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
|
|
|
|
|
wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码
|
|
|
|
|
wmsOdsEmStorageNews.setWaCode(wmsRawOrderInSn.getWaCode());//库位编码
|
|
|
|
|
wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
|
|
|
|
|
wmsOdsEmStorageNews.setAmount(wmsRawOrderInSn.getAmount());
|
|
|
|
|
//添加库存--这个要有个判断有没有这个库存如果没有的话,就插入
|
|
|
|
|
WmsOdsMateStorageNews wmsOdsMateStorageNews = wmsOdsMateStorageNewsMapper.selectByWhCodeAndMate(wmsOdsEmStorageNews);
|
|
|
|
|
if (wmsOdsMateStorageNews == null) {
|
|
|
|
|
WmsOdsMateStorageNews wmsOdsMateStorageNews1 = new WmsOdsMateStorageNews();
|
|
|
|
|
wmsOdsMateStorageNews1.setStorageId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsOdsMateStorageNews1.setWhCode(wmsRawOrderInSn.getWhCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setWlCode(wmsRawOrderInSn.getWlCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setWaCode(wmsRawOrderInSn.getWaCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setAmount(wmsRawOrderInSn.getAmount());
|
|
|
|
|
wmsOdsMateStorageNews1.setStorageAmount(wmsRawOrderInSn.getAmount());
|
|
|
|
|
wmsOdsMateStorageNews1.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
|
|
|
|
|
wmsOdsMateStorageNews1.setStorageType("BC");
|
|
|
|
|
wmsOdsMateStorageNews1.setCreateBy(wmsRawOrderInSn.getCreateBy());
|
|
|
|
|
wmsOdsMateStorageNews1.setGmtCreate(new Date());
|
|
|
|
|
wmsOdsMateStorageNews1.setActiveFlag("1");
|
|
|
|
|
wmsOdsMateStorageNews1.setFactoryCode(wmsRawOrderInSn.getFactoryCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setSapFactoryCode(wmsRawOrderInSn.getSapFactoryCode());
|
|
|
|
|
wmsOdsMateStorageNews1.setUserDefined1(wmsRawOrderInSn.getUserDefined4());//单位
|
|
|
|
|
wmsOdsMateStorageNewsMapper.insertWmsOdsMateStorageNews(wmsOdsMateStorageNews1);
|
|
|
|
|
} else {
|
|
|
|
|
wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews);
|
|
|
|
|
}
|
|
|
|
|
wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn);//入库
|
|
|
|
|
}
|
|
|
|
|
}else {////失败|
|
|
|
|
|
result="暂收失败";
|
|
|
|
|
order.setSapTempInfor(result2.getMsg());
|
|
|
|
|
order.setSapTempStatus("0");//0是失败。1是成功
|
|
|
|
|
odsProcureOrderMapper.updateOdsProcureOrder(order);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -775,7 +854,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
|
|
|
|
|
if (ruslt.getCode()==200){//成功
|
|
|
|
|
odsProcureOrderMapper.updateOdsProcureOrderAddOperationNumber(odsProcureOrder);
|
|
|
|
|
}else {
|
|
|
|
|
result="操作失败";
|
|
|
|
|
result="操作失败:"+ruslt.getMsg();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|