|
@@ -176,6 +176,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public ResponseJson<Map<String, Object>> generateOrder(SubmitDto submitDto) {
|
|
|
+ log.info("submitDto==="+submitDto);
|
|
|
// 获取机构用户Id
|
|
|
Integer clubUserId = baseMapper.getUserIdByClubId(submitDto.getClubId());
|
|
|
if (null == clubUserId || clubUserId == 0) {
|
|
@@ -310,6 +311,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
orderParamBo.setRebateFlag(rebateFlag);
|
|
|
// 售后条款id
|
|
|
Integer clauseId = (Integer) payInfo.get("clauseId");
|
|
|
+ Integer isColdChina = (Integer) payInfo.get("isColdChina");
|
|
|
orderParamBo.setClauseId(clauseId);
|
|
|
// 购买类型:(1自主下单,2直接购买 3协销下单)
|
|
|
orderParamBo.setCartType(submitDto.getCartType());
|
|
@@ -347,6 +349,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
orderParamBo.setClubCouponId(submitDto.getClubCouponId());
|
|
|
orderParamBo.setOrderSeen(submitDto.getOrderSeen());
|
|
|
orderParamBo.setOrderMiniType(submitDto.getOrderMiniType());
|
|
|
+ orderParamBo.setIsColdChain(isColdChina);
|
|
|
/*
|
|
|
* 保存订单
|
|
|
*/
|
|
@@ -447,6 +450,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
AtomicDouble payableAmount = new AtomicDouble(0);
|
|
|
// 余额支付金额
|
|
|
AtomicDouble balancePayFee = new AtomicDouble(0);
|
|
|
+ // 冷链运输费
|
|
|
+ AtomicDouble isColdChina = new AtomicDouble(0);
|
|
|
// 统计销量用
|
|
|
JSONArray salesInfo = new JSONArray();
|
|
|
|
|
@@ -556,6 +561,15 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (null == product) {
|
|
|
return ResponseJson.error("订单商品不存在!", null);
|
|
|
}
|
|
|
+ // 联合丽格冷链费商品
|
|
|
+ if (7502 == product.getProductId()) {
|
|
|
+ if (productNum >= 100) {
|
|
|
+ isColdChina.set(0.00d);
|
|
|
+ } else {
|
|
|
+ isColdChina.set(700.00d);
|
|
|
+ orderParamBo.setOrderShouldPayFee(MathUtil.sub(orderParamBo.getOrderShouldPayFee(), isColdChina.get()).doubleValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
// 是否二手商品
|
|
|
if (null != product.getProductCategory() && 2 == product.getProductCategory()) {
|
|
|
secondHandOrderFlag = true;
|
|
@@ -1430,7 +1444,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
* 设置邮费子订单( 0包邮 -1到付 1遵循运费规则)
|
|
|
* 采美豆抵扣不生成
|
|
|
*/
|
|
|
- if (1 == mainOrder.getPostageFlag() && 0 == mainOrder.getUserBeans()) {
|
|
|
+ log.info("PostageFlag===="+mainOrder.getPostageFlag()+"====UserBeans=====***"+mainOrder.getUserBeans());
|
|
|
+ if (( 1 == mainOrder.getPostageFlag() && 0 == mainOrder.getUserBeans() ) || ( 0 == mainOrder.getPostageFlag() && 0 != organizeId )) {
|
|
|
// 获取 邮费商品 productId 999 skuId 1
|
|
|
OrderProductPo postageProduct = submitMapper.getProductDetails(1);
|
|
|
// 生成子订单编号
|
|
@@ -1454,6 +1469,13 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
postageOrder.setSplitCode(Constant.CUSTOMERNUM);
|
|
|
postageOrder.setRealPay(mainOrder.getPostage());
|
|
|
postageOrder.setEachDiscount(0d);
|
|
|
+ // 冷链运输费
|
|
|
+ if (1 == orderParamBo.getIsColdChain()) {
|
|
|
+ postageOrder.setIsColdChina(1);
|
|
|
+ mainOrder.setPostage(MathUtil.add(mainOrder.getPostage(), isColdChina.get()).doubleValue());
|
|
|
+ } else {
|
|
|
+ postageOrder.setIsColdChina(0);
|
|
|
+ }
|
|
|
//运费商品供应商Id默认998
|
|
|
postageOrder.setShopId(postageProduct.getShopId());
|
|
|
postageOrder.setProductAmount(mainOrder.getPostage());
|