|
@@ -19,6 +19,7 @@ import com.fjhx.purchase.entity.arrival.dto.ArrivalSelectDto;
|
|
|
import com.fjhx.purchase.entity.arrival.po.Arrival;
|
|
|
import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
|
|
|
import com.fjhx.purchase.entity.arrival.vo.ArrivalVo;
|
|
|
+import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
|
|
|
import com.fjhx.purchase.entity.purchase.po.Purchase;
|
|
|
import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
|
|
|
import com.fjhx.purchase.entity.subscribe.po.Subscribe;
|
|
@@ -37,6 +38,7 @@ import com.fjhx.wms.entity.stock.po.StockWait;
|
|
|
import com.fjhx.wms.entity.stock.po.StockWaitDetails;
|
|
|
import com.fjhx.wms.service.stock.StockWaitDetailsService;
|
|
|
import com.fjhx.wms.service.stock.StockWaitService;
|
|
|
+import com.obs.services.internal.ServiceException;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -152,21 +154,29 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void addByWdly(Arrival arrival) {
|
|
|
-
|
|
|
arrival.setCode(CodeEnum.ARRIVAL.getCode());
|
|
|
this.save(arrival);
|
|
|
|
|
|
//修改采购状态
|
|
|
- Purchase purchase = new Purchase();
|
|
|
- purchase.setArrivalStatus(arrival.getArrivalStatus());
|
|
|
- purchase.setId(arrival.getPurchaseId());
|
|
|
- purchaseService.updateById(purchase);
|
|
|
+// Purchase purchase = new Purchase();
|
|
|
+// purchase.setArrivalStatus(arrival.getArrivalStatus());
|
|
|
+// purchase.setId(arrival.getPurchaseId());
|
|
|
+// purchaseService.updateById(purchase);
|
|
|
|
|
|
//创建待入库记录
|
|
|
String victoriatouristJson = arrival.getVictoriatouristJson();
|
|
|
JSONObject json = JSONObject.parseObject(victoriatouristJson);
|
|
|
+ Long deliverGoodsId = json.getLong("deliverGoodsId");
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(deliverGoodsId)){
|
|
|
+ throw new ServiceException("发货id不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询发货信息 获取 采购id
|
|
|
+ DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(deliverGoodsId);
|
|
|
+
|
|
|
//去申购单取入库仓库id
|
|
|
- PurchaseDetail one = purchaseDetailService.getOne(q -> q.eq(PurchaseDetail::getPurchaseId, arrival.getPurchaseId()));
|
|
|
+ PurchaseDetail one = purchaseDetailService.getOne(q -> q.eq(PurchaseDetail::getPurchaseId, deliverGoodsInfo.getPurchaseId()));
|
|
|
Long subscribeDetailId = one.getSubscribeDetailId();
|
|
|
SubscribeDetail byId = subscribeDetailService.getById(subscribeDetailId);
|
|
|
Subscribe byId1 = subscribeService.getById(byId.getSubscribeId());
|
|
@@ -181,7 +191,6 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
CompanyInfo logisticsCompanyCode = companyInfoService.getOne(q -> q.eq(CompanyInfo::getCode, json.getString("logisticsCompanyCode")));
|
|
|
json.put("logisticsCompanyName",logisticsCompanyCode.getName());
|
|
|
//修改发货记录的状态为到货
|
|
|
- Long deliverGoodsId = json.getLong("deliverGoodsId");
|
|
|
wdlyService.updateDeliverGoodsStatus(deliverGoodsId);
|
|
|
|
|
|
//----------
|