|
@@ -261,9 +261,7 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
|
|
|
|
|
// 给明细赋值
|
|
// 给明细赋值
|
|
|
Double qty = 0.0d;
|
|
Double qty = 0.0d;
|
|
|
- Set<InOutboundDetail> inOutSet = new HashSet<>();
|
|
|
|
|
Product product = null;
|
|
Product product = null;
|
|
|
- InOutboundDetail inOutboundDetail = null;
|
|
|
|
|
for (PurchaseDetail puDetail : purchase.getPurchaseDetails()) {
|
|
for (PurchaseDetail puDetail : purchase.getPurchaseDetails()) {
|
|
|
// 如果当前采购单明细的状态不是待出货状态,则处理下一条明细是否转出货
|
|
// 如果当前采购单明细的状态不是待出货状态,则处理下一条明细是否转出货
|
|
|
qty = 0.0d;
|
|
qty = 0.0d;
|
|
@@ -304,9 +302,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
product.setErpReserve(NumberUtil.sub(product.getErpReserve(), qty));
|
|
product.setErpReserve(NumberUtil.sub(product.getErpReserve(), qty));
|
|
|
productService.save(product);
|
|
productService.save(product);
|
|
|
|
|
|
|
|
- inOutboundDetail = new InOutboundDetail(product, puDetail, qty);
|
|
|
|
|
- inOutSet.add(inOutboundDetail);
|
|
|
|
|
-
|
|
|
|
|
InvoiceFPurchaseDetail inFpuD = new InvoiceFPurchaseDetail(puDetail, qty);
|
|
InvoiceFPurchaseDetail inFpuD = new InvoiceFPurchaseDetail(puDetail, qty);
|
|
|
String detailId = createNumberService.generateVoucherId(EncodingRulesConstant.INVOICE_DETAIL_FROMPURCHASE,
|
|
String detailId = createNumberService.generateVoucherId(EncodingRulesConstant.INVOICE_DETAIL_FROMPURCHASE,
|
|
|
"trade$invoice_fmpu_dt", 9);
|
|
"trade$invoice_fmpu_dt", 9);
|
|
@@ -349,13 +344,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
inFpu.setInfpuRemark(purchase.getPurchaseRemark());
|
|
inFpu.setInfpuRemark(purchase.getPurchaseRemark());
|
|
|
inFpu.setSendType(purchase.getSendType());
|
|
inFpu.setSendType(purchase.getSendType());
|
|
|
inFpu.setInvoiceFPurchaseDetails(IpDetails);
|
|
inFpu.setInvoiceFPurchaseDetails(IpDetails);
|
|
|
-
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(inOutSet)){
|
|
|
|
|
- CommodityInOutbound commodityInOutbound = commodityInOutboundService.produceCommodityInOutbound(inOutSet, InOutBoundType.SELL_OUTBOUND);
|
|
|
|
|
- if (commodityInOutbound != null) {
|
|
|
|
|
- commodityInOutboundService.save(commodityInOutbound);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
// 设置采购单关联属性
|
|
// 设置采购单关联属性
|
|
|
purchase.addInid(inFpu.getInvoiceid());
|
|
purchase.addInid(inFpu.getInvoiceid());
|
|
|
return inFpu;
|
|
return inFpu;
|
|
@@ -688,7 +676,7 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
JSONObject logisticsJson = jObj.getJSONObject("logisticsInfo");
|
|
JSONObject logisticsJson = jObj.getJSONObject("logisticsInfo");
|
|
|
- if (logisticsJson != null){
|
|
|
|
|
|
|
+ if (logisticsJson != null) {
|
|
|
Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisticsJson.getString("companyName"), logisticsJson.getString("number"));
|
|
Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisticsJson.getString("companyName"), logisticsJson.getString("number"));
|
|
|
invoiceFPurchase.setLogistics(logistics);
|
|
invoiceFPurchase.setLogistics(logistics);
|
|
|
}
|
|
}
|
|
@@ -718,9 +706,9 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
purchase.setSendName(SystemSession.getUser().getUserName());
|
|
purchase.setSendName(SystemSession.getUser().getUserName());
|
|
|
purchase.setSenduu(SystemSession.getUser().getUserUU());
|
|
purchase.setSenduu(SystemSession.getUser().getUserUU());
|
|
|
purchase.setSendTime(new Date());
|
|
purchase.setSendTime(new Date());
|
|
|
- //如果不是优软商城店铺,则代表店铺直售
|
|
|
|
|
Order order = null;
|
|
Order order = null;
|
|
|
Double qty = 0.0d;
|
|
Double qty = 0.0d;
|
|
|
|
|
+ //如果不是优软商城店铺,则代表店铺直售
|
|
|
if(!purchase.getStoreid().equals(sysConf.getStoreid())) {
|
|
if(!purchase.getStoreid().equals(sysConf.getStoreid())) {
|
|
|
order = orderDao.findByOrderid(purchase.getOrderid());
|
|
order = orderDao.findByOrderid(purchase.getOrderid());
|
|
|
order.addInInds(inFpu.getInvoiceid());
|
|
order.addInInds(inFpu.getInvoiceid());
|
|
@@ -759,6 +747,18 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
purchase.setStatusInBound(userUU);
|
|
purchase.setStatusInBound(userUU);
|
|
|
}
|
|
}
|
|
|
purchaseDao.save(purchase);
|
|
purchaseDao.save(purchase);
|
|
|
|
|
+ String orderid = "";
|
|
|
|
|
+ Long orderId = null;
|
|
|
|
|
+ if (order != null) {
|
|
|
|
|
+ orderid = order.getOrderid();
|
|
|
|
|
+ orderId = order.getId();
|
|
|
|
|
+ }
|
|
|
|
|
+ String purchaseid = purchase.getPurchaseid();
|
|
|
|
|
+ Long purchaseId = purchase.getId();
|
|
|
|
|
+ CommodityInOutbound commodityInOutbound = commodityInOutboundService.sellOutBound(inFpu, orderid, orderId, purchaseid, purchaseId);
|
|
|
|
|
+ if (commodityInOutbound != null) {
|
|
|
|
|
+ commodityInOutboundService.save(commodityInOutbound);
|
|
|
|
|
+ }
|
|
|
return ResultMap.success("ok");
|
|
return ResultMap.success("ok");
|
|
|
}
|
|
}
|
|
|
|
|
|