|
|
@@ -18,7 +18,13 @@ import com.uas.platform.b2c.logistics.model.InvoiceFPurchaseDetail;
|
|
|
import com.uas.platform.b2c.logistics.model.Logistics;
|
|
|
import com.uas.platform.b2c.logistics.service.InvoiceFPurchaseService;
|
|
|
import com.uas.platform.b2c.logistics.service.LogisticsOldService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.CommodityInOutbound;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.InOutboundDetail;
|
|
|
+import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.CommodityInOutboundService;
|
|
|
import com.uas.platform.b2c.prod.commodity.service.ProductService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.type.InOutBoundType;
|
|
|
import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
|
|
|
import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
|
|
|
import com.uas.platform.b2c.trade.order.dao.OrderDao;
|
|
|
@@ -37,6 +43,9 @@ import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
+import com.uas.sso.util.FlexJsonUtil;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
@@ -49,6 +58,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
+import java.beans.beancontext.BeanContextMembershipListener;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
@@ -72,6 +82,8 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
|
|
|
private final ProductService productService;
|
|
|
|
|
|
+ private final CommodityInOutboundService commodityInOutboundService;
|
|
|
+
|
|
|
private static final TradeBufferedLogger logger = BufferedLoggerManager
|
|
|
.getLogger(TradeBufferedLogger.class);
|
|
|
|
|
|
@@ -80,7 +92,7 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
@Autowired
|
|
|
public InvoiceFPurchaseServiceImpl(InvoiceFPurchaseDao inFpuDao, CreateNumberService createNumberService,
|
|
|
EnterpriseDao enterpriseDao, PurchaseDao purchaseDao, LogisticsDao logisticsDao,
|
|
|
- LogisticsCompanyCodeDao logisticsCompanyCodeDao, OrderDao orderDao, SysConf sysConf, LogisticsOldService logisticsService, ProductService productService) {
|
|
|
+ LogisticsCompanyCodeDao logisticsCompanyCodeDao, OrderDao orderDao, SysConf sysConf, LogisticsOldService logisticsService, ProductService productService, CommodityInOutboundService commodityInOutboundService) {
|
|
|
this.inFpuDao = inFpuDao;
|
|
|
this.createNumberService = createNumberService;
|
|
|
this.enterpriseDao = enterpriseDao;
|
|
|
@@ -91,6 +103,7 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
this.sysConf = sysConf;
|
|
|
this.logisticsService = logisticsService;
|
|
|
this.productService = productService;
|
|
|
+ this.commodityInOutboundService = commodityInOutboundService;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -193,6 +206,132 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
return inFpu;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 采购转出货
|
|
|
+ *
|
|
|
+ * @param purchase the puid 采购单号\
|
|
|
+ * @param shipList
|
|
|
+ * @return InvoiceFPurchase 返回InvoiceFPurchase对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public InvoiceFPurchase createInvoiceFPurchase(Purchase purchase, List<Map<Long, Double>> shipList) {
|
|
|
+ if (purchase == null) {
|
|
|
+ throw new IllegalOperatorException("传入信息为空");
|
|
|
+ }
|
|
|
+ if (purchase.getStatus() != Status.TOBESHIPPED.value() && purchase.getStatus() != Status.CONFIRMED.value()) {
|
|
|
+ throw new IllegalAccessError(
|
|
|
+ "采购单" + purchase.getPurchaseid() + "的状态是" + Status.valueOf(purchase.getStatus()).getPhrase() + ",不能转出货");
|
|
|
+ }
|
|
|
+ Long uu = SystemSession.getUser().getUserUU();
|
|
|
+ Date date = new Date();
|
|
|
+ InvoiceFPurchase inFpu = new InvoiceFPurchase(purchase);
|
|
|
+
|
|
|
+ //保存适用配送规则和自提点信息
|
|
|
+ if (purchase.getJsonRule() != null){
|
|
|
+ inFpu.setJsonRule(purchase.getJsonRule());
|
|
|
+ }
|
|
|
+ if (purchase.getJsonTakeSelf() != null){
|
|
|
+ inFpu.setJsonTakeSelf(purchase.getJsonTakeSelf());
|
|
|
+ }
|
|
|
+ // 生成出货单号
|
|
|
+ String invoiceid = createNumberService.generateVoucherId(EncodingRulesConstant.INVOICE_FROMPURCHASE,
|
|
|
+ "trade$invoice_fmpu", 8);
|
|
|
+ inFpu.setInvoiceid(invoiceid);
|
|
|
+ Double taxes = 0d;//税金
|
|
|
+ Double price = 0d;//价税合计
|
|
|
+ Double ensurePrice = 0D; //实际价格
|
|
|
+ Double number = 0d;//数量
|
|
|
+ Short detno = 1;
|
|
|
+
|
|
|
+ // 保存所有出货单明细编号ID
|
|
|
+ List<String> detailIds = new LinkedList<>();
|
|
|
+ Set<InvoiceFPurchaseDetail> IpDetails = new HashSet<>();
|
|
|
+
|
|
|
+ // 给明细赋值
|
|
|
+ Double qty = 0.0d;
|
|
|
+ Set<InOutboundDetail> inOutSet = new HashSet<>();
|
|
|
+ Product product = null;
|
|
|
+ InOutboundDetail inOutboundDetail = null;
|
|
|
+ for (PurchaseDetail puDetail : purchase.getPurchaseDetails()) {
|
|
|
+ // 如果当前采购单明细的状态不是待出货状态,则处理下一条明细是否转出货
|
|
|
+ qty = 0.0d;
|
|
|
+ for (Map<Long, Double> map : shipList) {
|
|
|
+ qty = map.get(puDetail.getId());
|
|
|
+ }
|
|
|
+ if (Status.TOBESHIPPED.value() != puDetail.getStatus() || NumberUtil.compare(qty, DoubleConstant.zero) < 1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ product = productService.findProductByProdNum(puDetail.getGoodsnumber());
|
|
|
+ if (product == null) {
|
|
|
+ throw new IllegalOperatorException("找不到物料信息");
|
|
|
+ }
|
|
|
+ if (NumberUtil.compare(product.getErpReserve(), qty) < 0) {
|
|
|
+ throw new IllegalOperatorException("型号为" + product.getPcmpcode() + "的物料库存信息不足");
|
|
|
+ }
|
|
|
+ List<Double> qties = new ArrayList<>();
|
|
|
+ qties.add(puDetail.getShipQty());
|
|
|
+ qties.add(qty);
|
|
|
+ double remainder = NumberUtil.sub(puDetail.getNumber(), qty);
|
|
|
+ if (NumberUtil.compare(remainder, DoubleConstant.zero) < 0) {
|
|
|
+ throw new IllegalOperatorException("出货明细" + puDetail.getCmpCode() + "的出货数超过待出货数");
|
|
|
+ }
|
|
|
+ product.setErpReserve(NumberUtil.sub(product.getErpReserve(), qty));
|
|
|
+ productService.save(product);
|
|
|
+
|
|
|
+ inOutboundDetail = new InOutboundDetail(product, puDetail, qty);
|
|
|
+ inOutSet.add(inOutboundDetail);
|
|
|
+
|
|
|
+ InvoiceFPurchaseDetail inFpuD = new InvoiceFPurchaseDetail(puDetail, qty);
|
|
|
+ String detailId = createNumberService.generateVoucherId(EncodingRulesConstant.INVOICE_DETAIL_FROMPURCHASE,
|
|
|
+ "trade$invoice_fmpu_dt", 9);
|
|
|
+ inFpuD.setDetailid(detailId);
|
|
|
+ inFpuD.setDetno(detno++);
|
|
|
+ inFpuD.setInvoiceFPurchase(inFpu);
|
|
|
+ inFpuD.setStatus(Status.TOBESHIPPED.value());
|
|
|
+ inFpuD.setStoreid(puDetail.getStoreid());
|
|
|
+ puDetail.setInpdetailid(detailId);
|
|
|
+ puDetail.setShipQty(NumberUtil.add(puDetail.getShipQty(), qty));
|
|
|
+ purchase.setShipQty(NumberUtil.add(purchase.getShipQty(), qty));
|
|
|
+ detailIds.add(inFpuD.getDetailid());
|
|
|
+ IpDetails.add(inFpuD);
|
|
|
+ // 计算总金额、数量和税金
|
|
|
+ price = NumberUtil.add(price, NumberUtil.mul(qty, puDetail.getTaxUnitPrice()));
|
|
|
+ number = NumberUtil.add(number, qty);
|
|
|
+ ensurePrice = NumberUtil.add(ensurePrice, price);
|
|
|
+ taxes = NumberUtil.add(taxes, NumberUtil.sub(NumberUtil.mul(qty, puDetail.getTaxUnitPrice()), NumberUtil.mul(qty, puDetail.getUnitprice())));
|
|
|
+ }
|
|
|
+ Enterprise enterprise = enterpriseDao.findByUu(purchase.getSellerenuu());
|
|
|
+ if (enterprise == null) {
|
|
|
+ throw new IllegalOperatorException("该供应商不存在");
|
|
|
+ }
|
|
|
+ // 给属性赋值
|
|
|
+ inFpu.setCreattime(date);
|
|
|
+ inFpu.setSellername(enterprise.getEnName());
|
|
|
+ taxes = NumberUtil.pricesScaleTwo(taxes);
|
|
|
+ inFpu.setTaxes(taxes);
|
|
|
+ price = NumberUtil.pricesScaleTwo(price);
|
|
|
+ inFpu.setPrice(price);
|
|
|
+ //添加运费
|
|
|
+ ensurePrice = NumberUtil.add(ensurePrice, inFpu.getFare());
|
|
|
+ ensurePrice = NumberUtil.pricesScaleTwo(ensurePrice);
|
|
|
+ inFpu.setEnsurePrice(ensurePrice);
|
|
|
+ inFpu.setNumber(number);
|
|
|
+ inFpu.setStatusToBeShipped(uu);
|
|
|
+ inFpu.setInfpuRemark(purchase.getPurchaseRemark());
|
|
|
+ inFpu.setSendType(purchase.getSendType());
|
|
|
+ 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());
|
|
|
+ return inFpu;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<InvoiceFPurchase> findToBeShipped() {
|
|
|
return inFpuDao.findByStatus(Status.TOBESHIPPED.value());
|
|
|
@@ -254,12 +393,8 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
InvoiceFPurchase invoiceFPurchase = inFpuDao.getOne(id);
|
|
|
Purchase purchase = purchaseDao.findOne(invoiceFPurchase.getPuid());
|
|
|
-// String deliveryType = sendInfo.getString("deliveryType");
|
|
|
Integer sendType = Integer.parseInt(sendInfo.getString("sendType"));
|
|
|
|
|
|
-// if(StringUtils.isEmpty(deliveryType)) {
|
|
|
-// return new ResultMap(CodeType.NO_INFO, "配送方式的信息为空,请重新操作");
|
|
|
-// }
|
|
|
if (sendType == null){
|
|
|
return new ResultMap(CodeType.NO_INFO, "配送方式的信息为空,请重新操作");
|
|
|
}
|
|
|
@@ -278,31 +413,12 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisticsJson.getString("companyName"), logisticsJson.getString("number"));
|
|
|
invoiceFPurchase.setLogistics(logistics);
|
|
|
}
|
|
|
-// if("logistics".equals(deliveryType)) {
|
|
|
-// JSONObject logisjson= sendInfo.getJSONObject("logisticsInfo");
|
|
|
-// Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisjson.getString("companyName"), logisjson.getString("number"));
|
|
|
-// invoiceFPurchase.setLogistics(logistics);
|
|
|
-//
|
|
|
-// }else if("selfDelivery".equals(deliveryType)){
|
|
|
-// JSONObject logisticsJson= sendInfo.getJSONObject("selfDeliveryPerson");
|
|
|
-// String name = logisticsJson.getString("name");
|
|
|
-// if(StringUtils.isEmpty(name)) {
|
|
|
-// return new ResultMap(CodeType.NO_INFO, "送货人信息为空,请重新操作");
|
|
|
-// }
|
|
|
-// String phone = logisticsJson.getString("phone");
|
|
|
-// if(StringUtils.isEmpty(phone)) {
|
|
|
-// return new ResultMap(CodeType.NO_INFO, "送货人电话信息为空,请重新操作");
|
|
|
-// }
|
|
|
-// invoiceFPurchase.setSelfDeliveryName(name);
|
|
|
-// invoiceFPurchase.setSelfDeliveryPhone(phone);
|
|
|
-// }
|
|
|
|
|
|
String jsonSdAddress = sendInfo.getString("jsonSdAddress");
|
|
|
if(StringUtils.isEmpty(jsonSdAddress)) {
|
|
|
return new ResultMap(CodeType.NO_INFO, "发货人的地址信息为空,请重新操作");
|
|
|
}
|
|
|
invoiceFPurchase.setJsonSdAddress(jsonSdAddress);
|
|
|
-// invoiceFPurchase.setDeliveryType(deliveryType);
|
|
|
invoiceFPurchase.setSendType(sendType);
|
|
|
|
|
|
invoiceFPurchase.setStatusInBound(userUU);
|
|
|
@@ -326,13 +442,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
if (inFpu.getLogistics() != null){
|
|
|
purchase.setLgtId(inFpu.getLogistics().getId());
|
|
|
}
|
|
|
-// if("logistics".equals(inFpu.getDeliveryType())) {
|
|
|
-// purchase.setLgtId(inFpu.getLogistics().getId());
|
|
|
-// }else {
|
|
|
-// purchase.setSelfDeliveryName(inFpu.getSelfDeliveryName());
|
|
|
-// purchase.setSelfDeliveryPhone(inFpu.getSelfDeliveryPhone());
|
|
|
-// }
|
|
|
-// purchase.setDeliveryType(inFpu.getDeliveryType());
|
|
|
|
|
|
purchase.setJsonSdAddress(inFpu.getJsonSdAddress());
|
|
|
purchase.setSendName(SystemSession.getUser().getUserName());
|
|
|
@@ -349,12 +458,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
if (inFpu.getLogistics() != null){
|
|
|
order.setLgtId(inFpu.getLogistics().getId());
|
|
|
}
|
|
|
-// if("logistics".equals(inFpu.getDeliveryType())) {
|
|
|
-// order.setLgtId(inFpu.getLogistics().getId());
|
|
|
-// }else {
|
|
|
-// order.setSelfDeliveryName(inFpu.getSelfDeliveryName());
|
|
|
-// order.setSelfDeliveryPhone(inFpu.getSelfDeliveryPhone());
|
|
|
-// }
|
|
|
order.setJsonSdAddress(inFpu.getJsonSdAddress());
|
|
|
order.setStatusInBound(userUU);
|
|
|
order.setSendstatus(Status.NOT_UPLOAD.value());// 将订单设置为未下载状态,以便erp下载
|
|
|
@@ -363,13 +466,6 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
}
|
|
|
orderDao.save(order);
|
|
|
}
|
|
|
-
|
|
|
- //从标准品中做出库动作
|
|
|
-// ResultMap resultMap = productService.deductRepositoryQty(purchase);
|
|
|
-// if(resultMap.getCode() != CodeType.OK.code()) {
|
|
|
-// return resultMap;
|
|
|
-// }
|
|
|
-
|
|
|
return ResultMap.success(inFpu);
|
|
|
}
|
|
|
|
|
|
@@ -478,18 +574,107 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
|
|
|
jsonObject.put("logisticsInfo", logisticsInfo);
|
|
|
jsonObject.put("sendType", purchase.getSendType());
|
|
|
saveInvoiceFPurchaseList(jsonObject, invoiceFpurc.getId());
|
|
|
+ }
|
|
|
|
|
|
-// Logistics logist = new Logistics();
|
|
|
-// logist.setCompanyName(invoice.getCompanyName());
|
|
|
-// logist.setNumber(invoice.getCompanyNumber());
|
|
|
-// logisticsDao.save(logist);
|
|
|
-// invoiceFpurc.setLogistics(logist);
|
|
|
-// invoiceFpurc.setStatusInBound(SystemSession.getUser().getUserUU());
|
|
|
-// inFpuDao.save(invoiceFpurc);
|
|
|
-// purchase.setStatusInBound(SystemSession.getUser().getUserUU());
|
|
|
-// purchase.setLgtId(invoiceFpurc.getLogistics().getId());
|
|
|
-// purchaseDao.save(purchase);
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 卖家发货
|
|
|
+ *
|
|
|
+ * @param shiInfo 发货信息,
|
|
|
+ * @param id 采购单信息
|
|
|
+ * @return 返回发货单
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultMap ship(String shiInfo, Long id) {
|
|
|
+ if (StringUtilB2C.isEmpty(shiInfo)) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "发货信息为空");
|
|
|
+ }
|
|
|
+ if (id == null) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "采购单信息为空");
|
|
|
+ }
|
|
|
+ Purchase purchase = purchaseDao.findOne(id);
|
|
|
+ if (purchase == null) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "找不到对应的采购单");
|
|
|
+ }
|
|
|
+ JSONObject jObj = FlexJsonUtil.fromJson(shiInfo, JSONObject.class);
|
|
|
+
|
|
|
+ Long userUU = SystemSession.getUser().getUserUU();
|
|
|
+ String shipStr = jObj.getString("shipList");
|
|
|
+ if (org.apache.commons.lang.StringUtils.isEmpty(shipStr)) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "发货明细缺失");
|
|
|
+ }
|
|
|
+ List<Map<Long, Double>> shipList = FlexJsonUtils.fromJsonArray(shipStr, Map.class);
|
|
|
+ InvoiceFPurchase invoiceFPurchase = createInvoiceFPurchase(purchase, shipList);
|
|
|
+ Integer sendType = Integer.parseInt(jObj.getString("sendType"));
|
|
|
+
|
|
|
+ if (sendType == null){
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "配送方式的信息为空,请重新操作");
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject logisticsJson = jObj.getJSONObject("logisticsInfo");
|
|
|
+ if (logisticsJson != null){
|
|
|
+ Logistics logistics = logisticsService.bornLogisticsByCompanyNameAndNum(logisticsJson.getString("companyName"), logisticsJson.getString("number"));
|
|
|
+ invoiceFPurchase.setLogistics(logistics);
|
|
|
+ }
|
|
|
+
|
|
|
+ String jsonSdAddress = jObj.getString("jsonSdAddress");
|
|
|
+ if(StringUtils.isEmpty(jsonSdAddress)) {
|
|
|
+ return new ResultMap(CodeType.NO_INFO, "发货人的地址信息为空,请重新操作");
|
|
|
+ }
|
|
|
+ invoiceFPurchase.setJsonSdAddress(jsonSdAddress);
|
|
|
+ invoiceFPurchase.setSendType(sendType);
|
|
|
+
|
|
|
+ invoiceFPurchase.setStatusInBound(userUU);
|
|
|
+ Set<InvoiceFPurchaseDetail> invoiceFPurchaseDetails = invoiceFPurchase.getInvoiceFPurchaseDetails();
|
|
|
+ for (InvoiceFPurchaseDetail detail : invoiceFPurchaseDetails) {
|
|
|
+ if(Status.UNAVAILABLE_PERSONAL.value() == detail.getStatus()
|
|
|
+ || Status.UNAVAILABLE_DISAGREE.value() == detail.getStatus()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ detail.setStatus(Status.INBOUND.value());
|
|
|
+ }
|
|
|
+ InvoiceFPurchase inFpu = inFpuDao.save(invoiceFPurchase);
|
|
|
+
|
|
|
+
|
|
|
+ if (inFpu.getLogistics() != null) {
|
|
|
+ purchase.setLgtId(inFpu.getLogistics().getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ purchase.setJsonSdAddress(inFpu.getJsonSdAddress());
|
|
|
+ purchase.setSendName(SystemSession.getUser().getUserName());
|
|
|
+ purchase.setSenduu(SystemSession.getUser().getUserUU());
|
|
|
+ purchase.setSendTime(new Date());
|
|
|
+ purchase.addInid(inFpu.getInvoiceid());
|
|
|
+
|
|
|
+ if(NumberUtil.compare(purchase.getQty(), purchase.getShipQty()) < 1) {
|
|
|
+ //如果不是优软商城店铺,则代表店铺直售
|
|
|
+ if(!purchase.getStoreid().equals(sysConf.getStoreid())) {
|
|
|
+ Order order = orderDao.findByOrderid(purchase.getOrderid());
|
|
|
+ if(order == null) {
|
|
|
+ return new ResultMap(CodeType.NOT_PERMIT, "您订单的信息有误,请重新提交");
|
|
|
+ }
|
|
|
+ if (inFpu.getLogistics() != null){
|
|
|
+ order.setLgtId(inFpu.getLogistics().getId());
|
|
|
+ }
|
|
|
+ order.setJsonSdAddress(inFpu.getJsonSdAddress());
|
|
|
+ order.setStatusInBound(userUU);
|
|
|
+ order.setSendstatus(Status.NOT_UPLOAD.value());// 将订单设置为未下载状态,以便erp下载
|
|
|
+ for (OrderDetail detail : order.getOrderDetails()) {
|
|
|
+ detail.setStatusInBound(userUU);
|
|
|
+ }
|
|
|
+ orderDao.save(order);
|
|
|
+ }
|
|
|
+ Set<PurchaseDetail> purchaseDetails = purchase.getPurchaseDetails();
|
|
|
+ for (PurchaseDetail purchaseDetail : purchaseDetails) {
|
|
|
+ if (Status.TOBESHIPPED.value() == purchaseDetail.getStatus()) {
|
|
|
+ purchaseDetail.setStatusInBound(userUU);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ purchase.setStatusInBound(userUU);
|
|
|
+ }
|
|
|
+
|
|
|
+ purchaseDao.save(purchase);
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|