@ -44,6 +44,9 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
@Autowired
private WmsRawOutstockMapper wmsRawOutstockMapper ;
@Autowired
private WmsRawOutstockDetailMapper wmsRawOutstockDetailMapper ;
@Autowired
private WmsProductInstockMapper wmsProductInstockMapper ;
@ -71,7 +74,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return
* /
@Override
// @Transactional
@Transactional
public int synchronizeInventoryInformationToERP ( ) {
WmsRawInstock wmsRawInstock = new WmsRawInstock ( ) ;
int result = 0 ;
@ -105,9 +108,24 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
rawInstock . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsRawInstockMapper . updateWmsRawInstock ( rawInstock ) ;
}
data . put ( "FDate" , DateUtils . getTime ( ) ) ;
String fdate = DateUtils . getTime ( ) ;
if ( instock . getApplyDate ( ) ! = null ) {
fdate = DateUtils . parseDateToStr ( DateUtils . YYYY_MM_DD_HH_MM_SS , instock . getApplyDate ( ) ) ;
}
String specificationParameter = instock . getSpecificationParameter ( ) ;
if ( StringUtils . isEmpty ( specificationParameter ) ) {
specificationParameter = instock . getMaterialSpec ( ) ;
}
if ( StringUtils . isEmpty ( specificationParameter ) ) {
specificationParameter = "无" ;
}
data . put ( "FDate" , fdate ) ;
data . put ( "FMaterialId" , instock . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , instock . getSpecificationParameter ( ) ) ;
data . put ( "FAuxPropId" , specificationParameter) ;
data . put ( "FSrcBillNo" , instock . getSrcBillNo ( ) ) ;
data . put ( "FUnitID" , instock . getUnitCode ( ) ) ;
data . put ( "FRealQty" , FRealQty ) ;
@ -115,17 +133,23 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
data . put ( "FSupplierCode" , supplierCode ) ;
data . put ( "FTondBase" , projectNo ) ;
String params = data . toJSONString ( ) ;
R < AjaxResult > paramsResult = remoteJindieService . savePurchaseStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult . toString ( ) ) ;
throw new ServiceException ( "同步原材料入库失败" + paramsResult . toString ( ) ) ;
try {
R < AjaxResult > paramsResult = remoteJindieService . savePurchaseStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeInventoryInformationToERP同步原材料入库成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeInventoryInformationToERP同步原材料入库失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "同步原材料入库失败" + paramsResult . toString ( ) ) ;
}
} catch ( Exception e ) {
log . error ( "同步原材料入库失败" + e . getMessage ( ) ) ;
throw new RuntimeException ( "同步原材料入库失败" + e . getMessage ( ) ) ;
}
}
/ * *
@ -134,21 +158,24 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return
* /
@Override
@Transactional
public int synchronizeRawMaterialDeliveryInformationToERP ( ) {
int result = 0 ;
WmsRawOutstock otherRawOutstock = new WmsRawOutstock ( ) ;
otherRawOutstock . setTaskTypeStr ( WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL
+ "," + WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER ) ;
List < WmsRawOutstock > otherRawOutstockList = wmsRawOutstockMapper . selectWmsRawOutstockERPNotSynchronized ( otherRawOutstock ) ;
Map < Long , List < WmsRawOutstock > > otherMaterialIdMap = otherRawOutstockList . stream ( ) . collect ( Collectors . groupingBy ( WmsRawOutstock : : getMaterialId ) ) ;
//领料
WmsRawOutstockDetail otherRawOutstockDetail = new WmsRawOutstockDetail ( ) ;
otherRawOutstockDetail . setTaskTypeStr ( WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING + "," + WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL
+ "," + WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_AUTO_OUTSTOCK + "," + WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_OTHER ) ;
List < WmsRawOutstockDetail > otherRawOutstockDetailList = wmsRawOutstockDetailMapper . selectWmsRawOutstockDetailERPNotSynchronized ( otherRawOutstockDetail ) ;
Map < Long , List < WmsRawOutstockDetail > > otherMaterialIdMap = otherRawOutstockDetailList . stream ( ) . collect ( Collectors . groupingBy ( WmsRawOutstockDetail : : getMaterialId ) ) ;
for ( Long materialId : otherMaterialIdMap . keySet ( ) ) {
result + = syncOutstockInformation ( otherMaterialIdMap , materialId , "" ) ;
}
WmsRawOutstock returnRawOutstock = new WmsRawOutstock ( ) ;
returnRawOutstock . setTaskType ( WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK ) ;
List < WmsRawOutstock > returnOutstockList = wmsRawOutstockMapper . selectWmsRawOutstockERPNotSynchronized ( returnRawOutstock ) ;
Map < Long , List < WmsRawOutstock > > returnMaterialIdMap = returnOutstockList . stream ( ) . collect ( Collectors . groupingBy ( WmsRawOutstock : : getMaterialId ) ) ;
//退货出库
WmsRawOutstockDetail returnRawOutstockDetail = new WmsRawOutstockDetail ( ) ;
returnRawOutstockDetail . setTaskType ( WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK ) ;
List < WmsRawOutstockDetail > returnRawOutstockDetailList = wmsRawOutstockDetailMapper . selectWmsRawOutstockDetailERPNotSynchronized ( returnRawOutstockDetail ) ;
Map < Long , List < WmsRawOutstockDetail > > returnMaterialIdMap = returnRawOutstockDetailList . stream ( ) . collect ( Collectors . groupingBy ( WmsRawOutstockDetail : : getMaterialId ) ) ;
for ( Long materialId : returnMaterialIdMap . keySet ( ) ) {
result + = syncOutstockInformation ( returnMaterialIdMap , materialId , WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK ) ;
}
@ -162,7 +189,7 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
* @return
* /
@Override
// @Transactional
@Transactional
public int synchronizeRawReturnInformationToERP ( ) {
WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail ( ) ;
int result = 0 ;
@ -191,25 +218,35 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
JSONObject data = new JSONObject ( ) ;
double FRealQty = wmsRawReturnDetaiList . stream ( ) . mapToDouble ( item - > item . getReturnAmount ( ) . subtract ( item . getErpAmount ( ) ) . doubleValue ( ) ) . sum ( ) ;
WmsRawReturnDetail rawReturnDetail = wmsRawReturnDetaiList . get ( 0 ) ;
String specificationParameter = StringUtils . isNotEmpty ( mesPurchaseOrder . getSpecificationParameter ( ) ) ? mesPurchaseOrder . getSpecificationParameter ( ) : rawReturnDetail . getMaterialSpec ( ) ;
if ( StringUtils . isNotEmpty ( specificationParameter ) ) {
for ( WmsRawReturnDetail wmsRawReturnDetail : wmsRawReturnDetaiList ) {
wmsRawReturnDetail . setErpStatus ( "1" ) ; //同步ERP状态(0:失败,1成功)
wmsRawReturnDetail . setErpAmount ( wmsRawReturnDetail . getReturnAmount ( ) ) ;
wmsRawReturnDetail . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsRawReturnDetailMapper . updateWmsRawReturnDetail ( wmsRawReturnDetail ) ;
}
data . put ( "FDate" , DateUtils . getTime ( ) ) ;
data . put ( "FMaterialId" , rawReturnDetail . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , specificationParameter ) ;
data . put ( "FSrcBillNo" , srcBillNo ) ;
data . put ( "FUnitID" , rawReturnDetail . getUnitCode ( ) ) ;
data . put ( "FRealQty" , FRealQty ) ;
data . put ( "FStockId" , wmsConfig . getfStockId ( ) ) ;
data . put ( "FSupplierCode" , supplierCode ) ;
data . put ( "FTondBase" , projectNo ) ;
String params = data . toJSONString ( ) ;
String specificationParameter = StringUtils . isNotEmpty ( mesPurchaseOrder . getSpecificationParameter ( ) ) ?
mesPurchaseOrder . getSpecificationParameter ( ) : rawReturnDetail . getMaterialSpec ( ) ;
if ( StringUtils . isEmpty ( specificationParameter ) ) {
specificationParameter = "无" ;
}
for ( WmsRawReturnDetail wmsRawReturnDetail : wmsRawReturnDetaiList ) {
wmsRawReturnDetail . setErpStatus ( "1" ) ; //同步ERP状态(0:失败,1成功)
wmsRawReturnDetail . setErpAmount ( wmsRawReturnDetail . getReturnAmount ( ) ) ;
wmsRawReturnDetail . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsRawReturnDetailMapper . updateWmsRawReturnDetail ( wmsRawReturnDetail ) ;
}
String fdate = DateUtils . getTime ( ) ;
if ( rawReturnDetail . getReturnTime ( ) ! = null ) {
fdate = DateUtils . parseDateToStr ( DateUtils . YYYY_MM_DD_HH_MM_SS , rawReturnDetail . getReturnTime ( ) ) ;
}
data . put ( "FDate" , fdate ) ;
data . put ( "FMaterialId" , rawReturnDetail . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , specificationParameter ) ;
data . put ( "FSrcBillNo" , srcBillNo ) ;
data . put ( "FUnitID" , rawReturnDetail . getUnitCode ( ) ) ;
data . put ( "FRealQty" , FRealQty ) ;
data . put ( "FStockId" , wmsConfig . getfStockId ( ) ) ;
data . put ( "FSupplierCode" , supplierCode ) ;
data . put ( "FTondBase" , projectNo ) ;
String params = data . toJSONString ( ) ;
try {
R < AjaxResult > paramsResult = remoteJindieService . savePurchaseStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
@ -221,27 +258,31 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
log . error ( "synchronizeInventoryInformationToERP同步原材料退库失败:" + paramsResult . toString ( ) ) ;
throw new ServiceException ( "同步原材料入库失败" + paramsResult . toString ( ) ) ;
}
} catch ( Exception e ) {
log . error ( "synchronizeInventoryInformationToERP同步原材料退库失败:" + e . getMessage ( ) ) ;
throw new ServiceException ( "同步原材料入库失败" + e . getMessage ( ) ) ;
}
}
}
@Transactional ( propagation = Propagation . REQUIRES_NEW )
public int syncOutstockInformation ( Map < Long , List < WmsRawOutstock > > materialIdMap , Long materialId , String taskType ) {
public int syncOutstockInformation ( Map < Long , List < WmsRawOutstock Detail > > materialIdMap , Long materialId , String taskType ) {
int result = 0 ;
List < WmsRawOutstock > wmsRawOutstock List = materialIdMap . get ( materialId ) ;
List < WmsRawOutstock Detail > wmsRawOutstock Detail List = materialIdMap . get ( materialId ) ;
JSONObject data = new JSONObject ( ) ;
double FRealQty = wmsRawOutstock List. stream ( ) . mapToDouble ( item - > item . get Real OutstockAmount( ) . subtract ( item . getErpAmount ( ) ) . doubleValue ( ) ) . sum ( ) ;
WmsRawOutstock outstock = wmsRawOutstock List. get ( 0 ) ;
for ( WmsRawOutstock wmsRawOutstock : wmsRawOutstock List) {
if ( wmsRawOutstock . getRealOutstock Amount( ) . equals ( wmsRawOutstock . getOutstockAmount ( ) ) ) {
wmsRawOutstock . setErpStatus ( "1" ) ; //同步ERP状态(0:失败,1成功,2同步中)
double FRealQty = wmsRawOutstock Detail List. stream ( ) . mapToDouble ( item - > item . get OutstockAmount( ) . subtract ( item . getErpAmount ( ) ) . doubleValue ( ) ) . sum ( ) ;
WmsRawOutstock Detail outstock Detail = wmsRawOutstock Detail List. get ( 0 ) ;
for ( WmsRawOutstock Detail wmsRawOutstock Detail : wmsRawOutstock Detail List) {
if ( wmsRawOutstock Detail. getPlan Amount( ) . equals ( wmsRawOutstock Detail . getOutstockAmount ( ) ) ) {
wmsRawOutstock Detail . setErpStatus ( "1" ) ; //同步ERP状态(0:失败,1成功,2同步中)
} else {
wmsRawOutstock . setErpStatus ( "2" ) ; //同步ERP状态(0:失败,1成功,2同步中)
wmsRawOutstock Detail . setErpStatus ( "2" ) ; //同步ERP状态(0:失败,1成功,2同步中)
}
wmsRawOutstock . setErpAmount ( wmsRawOutstock . get Real OutstockAmount( ) ) ;
wmsRawOutstock . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsRawOutstock Mapper. updateWmsRawOutstock ( wmsRawOutstock ) ;
wmsRawOutstock Detail . setErpAmount ( wmsRawOutstock Detail . get OutstockAmount( ) ) ;
wmsRawOutstock Detail . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsRawOutstock Detail Mapper. updateWmsRawOutstock Detail ( wmsRawOutstock Detail ) ;
}
if ( StringUtils . isNotEmpty ( taskType ) & & taskType . equals ( WmsConstants . WMS_RAW_OUTSTOCK_TASK_TYPE_RETURN_OUTSTOCK ) ) {
@ -251,27 +292,48 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
}
// model.put("F_TOND_Combo", "一般领料"); //领料类型(必填项)
data . put ( "FDate" , DateUtils . getTime ( ) ) ;
data . put ( "FMaterialId" , outstock . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , outstock . getSpecificationParameter ( ) = = null ? "" : outstock . getSpecificationParameter ( ) ) ;
data . put ( "FUnitID" , outstock . getUnitCode ( ) ) ;
String fdate = DateUtils . getTime ( ) ;
if ( outstockDetail . getOutstockTime ( ) ! = null ) {
fdate = DateUtils . parseDateToStr ( DateUtils . YYYY_MM_DD_HH_MM_SS , outstockDetail . getOutstockTime ( ) ) ;
}
String barcodeSpec = outstockDetail . getBarcodeSpec ( ) ;
String materialSpec = outstockDetail . getMaterialSpec ( ) ;
if ( StringUtils . isEmpty ( barcodeSpec ) ) {
if ( StringUtils . isNotEmpty ( materialSpec ) ) {
barcodeSpec = materialSpec ;
} else {
barcodeSpec = "无" ;
}
}
data . put ( "FDate" , fdate ) ;
data . put ( "FMaterialId" , outstockDetail . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , barcodeSpec ) ;
data . put ( "FUnitID" , outstockDetail . getUnitCode ( ) ) ;
data . put ( "FQty" , FRealQty ) ;
data . put ( "FPrice" , outstock . getPrice ( ) ) ;
data . put ( "FPrice" , outstock Detail . getPrice ( ) ) ;
data . put ( "FStockId" , wmsConfig . getfStockId ( ) ) ;
String params = data . toJSONString ( ) ;
R < AjaxResult > paramsResult = remoteJindieService . saveOtherOutStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult . toString ( ) ) ;
try {
R < AjaxResult > paramsResult = remoteJindieService . saveOtherOutStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeRawMaterialDeliveryInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + paramsResult . toString ( ) ) ;
}
return result ;
} catch ( Exception e ) {
log . error ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + e . getMessage ( ) ) ;
throw new RuntimeException ( "synchronizeRawMaterialDeliveryInformationToERP失败:" + e . getMessage ( ) ) ;
}
return result ;
}
/ * *
@ -311,24 +373,41 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
wmsProductInstockMapper . updateWmsProductInstock ( wmsProductInstock ) ;
}
data . put ( "FDate" , DateUtils . getTime ( ) ) ;
String fdate = DateUtils . getTime ( ) ;
if ( instock . getApplyDate ( ) ! = null ) {
fdate = DateUtils . parseDateToStr ( DateUtils . YYYY_MM_DD_HH_MM_SS , instock . getApplyDate ( ) ) ;
}
String specificationParameter = StringUtils . isNotEmpty ( instock . getSpecificationParameter ( ) ) ?
instock . getSpecificationParameter ( ) : instock . getMaterialSpec ( ) ;
if ( StringUtils . isEmpty ( specificationParameter ) ) {
specificationParameter = "无" ;
}
data . put ( "FDate" , fdate ) ;
data . put ( "FMaterialId" , instock . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , instock . getSpecificationParameter ( ) = = null ? "B" : instock . getSpecificationParameter ( ) ) ;
data . put ( "FAuxPropId" , specificationParameter) ;
data . put ( "FUnitID" , instock . getUnitCode ( ) ) ;
data . put ( "FQty" , FRealQty ) ;
data . put ( "FPrice" , instock . getPrice ( ) ) ;
data . put ( "FStockId" , wmsConfig . getfStockId ( ) ) ;
String params = data . toJSONString ( ) ;
R < AjaxResult > paramsResult = remoteJindieService . saveOtherInStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeProductInstockInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeProductInstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeProductInstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
try {
R < AjaxResult > paramsResult = remoteJindieService . saveOtherInStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeProductInstockInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeProductInstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeProductInstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
}
} catch ( Exception e ) {
log . error ( "synchronizeProductInstockInformationToERP失败:" + e . getMessage ( ) ) ;
throw new RuntimeException ( "synchronizeProductInstockInformationToERP失败:" + e . getMessage ( ) ) ;
}
}
@ -368,26 +447,44 @@ public class WmsErpScheduledTaskServiceImpl implements IWmsErpScheduledTaskServi
wmsProductOutstock . setUpdateDate ( DateUtils . getNowDate ( ) ) ;
wmsProductOutstockMapper . updateWmsProductOutstock ( wmsProductOutstock ) ;
}
data . put ( "FDate" , DateUtils . getTime ( ) ) ;
String fdate = DateUtils . getTime ( ) ;
if ( outstock . getApplyDate ( ) ! = null ) {
fdate = DateUtils . parseDateToStr ( DateUtils . YYYY_MM_DD_HH_MM_SS , outstock . getApplyDate ( ) ) ;
}
String specificationParameter = StringUtils . isNotEmpty ( outstock . getSpecificationParameter ( ) ) ?
outstock . getSpecificationParameter ( ) : outstock . getMaterialSpec ( ) ;
if ( StringUtils . isEmpty ( specificationParameter ) ) {
specificationParameter = "无" ;
}
data . put ( "FDate" , fdate ) ;
data . put ( "FMaterialId" , outstock . getMaterialCode ( ) ) ;
data . put ( "FAuxPropId" , outstock . getSpecificationParameter ( ) = = null ? "无" : outstock . getSpecificationParameter ( ) ) ;
data . put ( "FAuxPropId" , specificationParameter) ;
data . put ( "FUnitID" , outstock . getUnitCode ( ) ) ;
data . put ( "FQty" , FRealQty ) ;
data . put ( "FPrice" , outstock . getPrice ( ) ) ;
data . put ( "FStockId" , wmsConfig . getfStockId ( ) ) ;
data . put ( "FTONDCombo" , "一般领料" ) ;
String params = data . toJSONString ( ) ;
R < AjaxResult > paramsResult = remoteJindieService . saveOtherOutStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeProductOutstockInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeProductOutstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeProductOutstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
try {
R < AjaxResult > paramsResult = remoteJindieService . saveOtherOutStorage ( params , SecurityConstants . INNER ) ;
String paramsResultData = paramsResult . getMsg ( ) ;
JSONObject jsonObject = JSONObject . parseObject ( paramsResultData ) ;
Boolean isSuccess = ( Boolean ) jsonObject . get ( "IsSuccess" ) ;
if ( isSuccess ) {
result + + ;
log . info ( "synchronizeProductOutstockInformationToERP成功:" + paramsResult . toString ( ) ) ;
} else {
log . error ( "synchronizeProductOutstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
throw new RuntimeException ( "synchronizeProductOutstockInformationToERP失败:" + paramsResult . toString ( ) ) ;
}
} catch ( Exception e ) {
log . error ( "synchronizeProductOutstockInformationToERP失败:" + e . getMessage ( ) ) ;
throw new RuntimeException ( "synchronizeProductOutstockInformationToERP失败:" + e . getMessage ( ) ) ;
}
}