|
@@ -25,8 +25,6 @@ import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
|
|
|
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.purchase.vo.PurchaseDetailVo;
|
|
|
-import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
|
|
|
import com.fjhx.purchase.entity.subscribe.po.Subscribe;
|
|
|
import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
|
|
|
import com.fjhx.purchase.mapper.arrival.ArrivalMapper;
|
|
@@ -37,13 +35,10 @@ import com.fjhx.purchase.service.purchase.PurchaseDetailService;
|
|
|
import com.fjhx.purchase.service.purchase.PurchaseService;
|
|
|
import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
|
|
|
import com.fjhx.purchase.service.subscribe.SubscribeService;
|
|
|
-import com.fjhx.purchase.util.code.CodeEnum;
|
|
|
-import com.fjhx.supply.entity.supplier.po.SupplierInfo;
|
|
|
import com.fjhx.supply.service.supplier.SupplierInfoService;
|
|
|
import com.fjhx.wms.entity.stock.emums.StockWaitType;
|
|
|
import com.fjhx.wms.entity.stock.po.StockWait;
|
|
|
import com.fjhx.wms.entity.stock.po.StockWaitDetails;
|
|
|
-import com.fjhx.wms.entity.stock.vo.StockVo;
|
|
|
import com.fjhx.wms.service.stock.StockWaitDetailsService;
|
|
|
import com.fjhx.wms.service.stock.StockWaitService;
|
|
|
import com.obs.services.internal.ServiceException;
|
|
@@ -127,7 +122,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void add(Arrival arrival) {
|
|
|
- arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(),null));
|
|
|
+ arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
|
|
|
// arrival.setCode(CodeEnum.ARRIVAL.getCode());
|
|
|
this.save(arrival);
|
|
|
//修改采购状态
|
|
@@ -179,23 +174,23 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
//获取维多利亚json中的发货id
|
|
|
String victoriatouristJson = arrival.getVictoriatouristJson();
|
|
|
JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
|
|
|
- if(ObjectUtil.isEmpty(arrival.getDeliverGoodsId())){
|
|
|
+ if (ObjectUtil.isEmpty(arrival.getDeliverGoodsId())) {
|
|
|
arrival.setDeliverGoodsId(json.getLong("deliverGoodsId"));
|
|
|
}
|
|
|
//根据发货id查采购信息
|
|
|
- if(ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())){
|
|
|
+ if (ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())) {
|
|
|
DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(arrival.getDeliverGoodsId());
|
|
|
- Assert.notEmpty(deliverGoodsInfo,"查询不到发货信息");
|
|
|
+ Assert.notEmpty(deliverGoodsInfo, "查询不到发货信息");
|
|
|
arrival.setPurchaseId(deliverGoodsInfo.getPurchaseId());
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtil.isEmpty(arrival.getPurchaseId())){
|
|
|
+ if (ObjectUtil.isEmpty(arrival.getPurchaseId())) {
|
|
|
throw new ServiceException("采购id不能为空");
|
|
|
}
|
|
|
Purchase purchase0 = purchaseService.getById(arrival.getPurchaseId());
|
|
|
- Assert.notEmpty(purchase0,"无法获取到采购信息");
|
|
|
+ Assert.notEmpty(purchase0, "无法获取到采购信息");
|
|
|
arrival.setSupplyId(purchase0.getSupplyId());
|
|
|
- arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(),null));
|
|
|
+ arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
|
|
|
// arrival.setCode(CodeEnum.ARRIVAL.getCode());
|
|
|
arrival.setStatus(1);//设置到货
|
|
|
this.save(arrival);
|
|
@@ -247,7 +242,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
//将业务信息设置成采购id和采购编码
|
|
|
stockWait.setBusinessId(purchase.getId());
|
|
|
String victoriatouristJson2 = purchase.getVictoriatouristJson();
|
|
|
- JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2):new JSONObject();
|
|
|
+ JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2) : new JSONObject();
|
|
|
// stockWait.setBusinessCode(purchase.getCode());
|
|
|
stockWait.setBusinessCode(json2.getString("contractCode"));
|
|
|
|
|
@@ -323,7 +318,7 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
BigDecimal count = arrivalDetails.stream()
|
|
|
.map(ArrivalDetail::getCount)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (purchaseDetail.getCount().compareTo(count) == 0) {
|
|
|
+ if (count.compareTo(purchaseDetail.getCount()) >= 0) {
|
|
|
flag++;
|
|
|
}
|
|
|
}
|
|
@@ -350,5 +345,4 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|