|
@@ -175,7 +175,20 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
*/
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
- public void addByWdly(Arrival arrival) {
|
|
|
+ public void addByWdly(ArrivalDto arrival) {
|
|
|
+ //获取维多利亚json中的发货id
|
|
|
+ String victoriatouristJson = arrival.getVictoriatouristJson();
|
|
|
+ JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
|
|
|
+ if(ObjectUtil.isEmpty(arrival.getDeliverGoodsId())){
|
|
|
+ arrival.setDeliverGoodsId(json.getLong("deliverGoodsId"));
|
|
|
+ }
|
|
|
+ //根据发货id查采购信息
|
|
|
+ if(ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())){
|
|
|
+ DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(arrival.getDeliverGoodsId());
|
|
|
+ Assert.notEmpty(deliverGoodsInfo,"查询不到发货信息");
|
|
|
+ arrival.setPurchaseId(deliverGoodsInfo.getPurchaseId());
|
|
|
+ }
|
|
|
+
|
|
|
if(ObjectUtil.isEmpty(arrival.getPurchaseId())){
|
|
|
throw new ServiceException("采购id不能为空");
|
|
|
}
|
|
@@ -194,8 +207,8 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
// purchaseService.updateById(purchase);
|
|
|
|
|
|
//创建待入库记录
|
|
|
- String victoriatouristJson = arrival.getVictoriatouristJson();
|
|
|
- JSONObject json = JSONObject.parseObject(victoriatouristJson);
|
|
|
+// String victoriatouristJson = arrival.getVictoriatouristJson();
|
|
|
+// JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
|
|
|
Long deliverGoodsId = json.getLong("deliverGoodsId");
|
|
|
|
|
|
if (ObjectUtil.isEmpty(deliverGoodsId)) {
|