|
@@ -101,7 +101,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
* "postage": "15",
|
|
* "postage": "15",
|
|
* "postageFlag": 1, //运费标志:0包邮 -1到付 1遵循运费规则
|
|
* "postageFlag": 1, //运费标志:0包邮 -1到付 1遵循运费规则
|
|
* "userBeans": 100,//抵扣采美豆数量
|
|
* "userBeans": 100,//抵扣采美豆数量
|
|
- * "rebateFlag":0
|
|
|
|
|
|
+ * "rebateFlag":0,
|
|
|
|
+ * "rebateFee":0.00 //普通订单返佣服务费
|
|
* },
|
|
* },
|
|
* "orderInvoice": //【发票信息】
|
|
* "orderInvoice": //【发票信息】
|
|
* {"type": 0 // 不开发票 }
|
|
* {"type": 0 // 不开发票 }
|
|
@@ -250,8 +251,14 @@ public class SubmitServiceImpl implements SubmitService {
|
|
}
|
|
}
|
|
orderParamBo.setOrderInvoice(invoice);
|
|
orderParamBo.setOrderInvoice(invoice);
|
|
}
|
|
}
|
|
- // 返佣订单标识 0非返佣订单,1返佣订单
|
|
|
|
|
|
+ // 返佣订单标识 0非返佣订单,1返佣订单,2普通订单含有返佣服务费
|
|
Integer rebateFlag = (Integer) payInfo.get("rebateFlag");
|
|
Integer rebateFlag = (Integer) payInfo.get("rebateFlag");
|
|
|
|
+ // rebateflag=2时,有rebateFee
|
|
|
|
+ if (null != rebateFlag && 2 == rebateFlag) {
|
|
|
|
+ String re = (String) payInfo.get("rebateFee");
|
|
|
|
+ Double rebateFee = Double.parseDouble(re);
|
|
|
|
+ orderParamBo.setRebateFee(rebateFee);
|
|
|
|
+ }
|
|
orderParamBo.setRebateFlag(rebateFlag);
|
|
orderParamBo.setRebateFlag(rebateFlag);
|
|
// 售后条款id
|
|
// 售后条款id
|
|
Integer clauseId = (Integer) payInfo.get("clauseId");
|
|
Integer clauseId = (Integer) payInfo.get("clauseId");
|
|
@@ -480,7 +487,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
OrderProductPo dbProduct = submitMapper.getProductDetails(productId);
|
|
OrderProductPo dbProduct = submitMapper.getProductDetails(productId);
|
|
OrderProductPo product = new OrderProductPo();
|
|
OrderProductPo product = new OrderProductPo();
|
|
BeanUtils.copyProperties(dbProduct, product);
|
|
BeanUtils.copyProperties(dbProduct, product);
|
|
- log.info("splitcode-----------------------》"+product.getSplitCode());
|
|
|
|
|
|
+ log.info("splitcode-----------------------》" + product.getSplitCode());
|
|
if (null == product) {
|
|
if (null == product) {
|
|
return ResponseJson.error("订单商品不存在!", null);
|
|
return ResponseJson.error("订单商品不存在!", null);
|
|
}
|
|
}
|
|
@@ -772,7 +779,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
// 需要支付金额 shouldPayFee +运费
|
|
// 需要支付金额 shouldPayFee +运费
|
|
needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getShouldPayFee()).doubleValue());
|
|
needPayAmount.set(MathUtil.add(needPayAmount.get(), product.getShouldPayFee()).doubleValue());
|
|
// 不包含单品满减的子订单需付金额
|
|
// 不包含单品满减的子订单需付金额
|
|
- realNeedPay.set(MathUtil.add(realNeedPay.get(),product.getRealProductFee()).doubleValue());
|
|
|
|
|
|
+ realNeedPay.set(MathUtil.add(realNeedPay.get(), product.getRealProductFee()).doubleValue());
|
|
// 统计 总金额 包括税费
|
|
// 统计 总金额 包括税费
|
|
shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getTotalFee()).doubleValue());
|
|
shopProductFee.set(MathUtil.add(shopProductFee.get(), product.getTotalFee()).doubleValue());
|
|
// 统计子订单内可参与店铺促销的商品总金额
|
|
// 统计子订单内可参与店铺促销的商品总金额
|
|
@@ -953,7 +960,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
couponAmount = coupon.getCouponAmount();
|
|
couponAmount = coupon.getCouponAmount();
|
|
}
|
|
}
|
|
// 美博会临时设置,7260,7261临时套餐商品,不可使用优惠券
|
|
// 美博会临时设置,7260,7261临时套餐商品,不可使用优惠券
|
|
- if(productIdList.contains(7260)||productIdList.contains(7261)){
|
|
|
|
|
|
+ if (productIdList.contains(7260) || productIdList.contains(7261)) {
|
|
couponAmount = 0d;
|
|
couponAmount = 0d;
|
|
}
|
|
}
|
|
mainOrder.setCouponAmount(couponAmount);
|
|
mainOrder.setCouponAmount(couponAmount);
|
|
@@ -1054,6 +1061,9 @@ public class SubmitServiceImpl implements SubmitService {
|
|
// 是否返佣订单
|
|
// 是否返佣订单
|
|
Integer rebateFlag = (null == orderParamBo.getRebateFlag() ? 0 : orderParamBo.getRebateFlag());
|
|
Integer rebateFlag = (null == orderParamBo.getRebateFlag() ? 0 : orderParamBo.getRebateFlag());
|
|
mainOrder.setRebateFlag(rebateFlag);
|
|
mainOrder.setRebateFlag(rebateFlag);
|
|
|
|
+ if (2 == rebateFlag) {
|
|
|
|
+ mainOrder.setRebateFee(orderParamBo.getRebateFee());
|
|
|
|
+ }
|
|
|
|
|
|
// 判断前端传入orderShouldPayFee订单应付金额,和后台计算应付金额对比
|
|
// 判断前端传入orderShouldPayFee订单应付金额,和后台计算应付金额对比
|
|
log.info("【提交订单】>>>>>后台计算payableAmount:" + payableAmount.get() + " ,前端传入orderShouldPayFee:" + orderParamBo.getOrderShouldPayFee());
|
|
log.info("【提交订单】>>>>>后台计算payableAmount:" + payableAmount.get() + " ,前端传入orderShouldPayFee:" + orderParamBo.getOrderShouldPayFee());
|
|
@@ -1106,7 +1116,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
List<OrderShopPo> shops = submitMapper.findShops(productIdList);
|
|
List<OrderShopPo> shops = submitMapper.findShops(productIdList);
|
|
//子订单分多子订单,满减分摊到原子订单分开的子订单,无满减重算佣金/应付
|
|
//子订单分多子订单,满减分摊到原子订单分开的子订单,无满减重算佣金/应付
|
|
//重组订单
|
|
//重组订单
|
|
- shopOrderList= findSplitShopOrder(orderProductList, shopOrderList, shops, orderParamBo);
|
|
|
|
|
|
+ shopOrderList = findSplitShopOrder(orderProductList, shopOrderList, shops, orderParamBo);
|
|
//线上支付分摊优惠总和到子订单
|
|
//线上支付分摊优惠总和到子订单
|
|
//经理折扣+优惠券+满减 提交订单的时候无经理折扣
|
|
//经理折扣+优惠券+满减 提交订单的时候无经理折扣
|
|
double allDiscount = MathUtil.add(couponAmount, promotionFullReduction.get()).doubleValue();
|
|
double allDiscount = MathUtil.add(couponAmount, promotionFullReduction.get()).doubleValue();
|
|
@@ -1558,14 +1568,14 @@ public class SubmitServiceImpl implements SubmitService {
|
|
}
|
|
}
|
|
log.info("**********************微信模板消息推送*****************************");
|
|
log.info("**********************微信模板消息推送*****************************");
|
|
List<Integer> productIds = orderClubMapper.getProductOrder(mainOrder.getOrderId());
|
|
List<Integer> productIds = orderClubMapper.getProductOrder(mainOrder.getOrderId());
|
|
- if (0 == mainOrder.getSecondHandOrderFlag() && 0 == mainOrder.getRebateFlag() && (null != productIds && !productIds.contains(6060)) && mainOrder.getOrderType()!=0) {
|
|
|
|
|
|
+ if (0 == mainOrder.getSecondHandOrderFlag() && 0 == mainOrder.getRebateFlag() && (null != productIds && !productIds.contains(6060)) && mainOrder.getOrderType() != 0) {
|
|
log.info("*******获取公众名" + orderClubMapper.getOrderIds(mainOrder.getOrderId()).toString());
|
|
log.info("*******获取公众名" + orderClubMapper.getOrderIds(mainOrder.getOrderId()).toString());
|
|
String name = "0";
|
|
String name = "0";
|
|
try {
|
|
try {
|
|
String accessToken = weChatService.getAccessToken();
|
|
String accessToken = weChatService.getAccessToken();
|
|
// orderClubMapper.getOpenidunionId(orderClubMapper.getUserId(mainOrder.getOrderId()))
|
|
// orderClubMapper.getOpenidunionId(orderClubMapper.getUserId(mainOrder.getOrderId()))
|
|
List<String> openidList = orderClubMapper.getOpenidListByPermission(orderParamBo.getUnionId());
|
|
List<String> openidList = orderClubMapper.getOpenidListByPermission(orderParamBo.getUnionId());
|
|
- orderClubMapper.AddUnionId(orderParamBo.getUnionId(),mainOrder.getOrderId());
|
|
|
|
|
|
+ orderClubMapper.AddUnionId(orderParamBo.getUnionId(), mainOrder.getOrderId());
|
|
openidList.removeIf(Objects::isNull);
|
|
openidList.removeIf(Objects::isNull);
|
|
String i = orderClubMapper.getOrderIds(mainOrder.getOrderId()).toString();
|
|
String i = orderClubMapper.getOrderIds(mainOrder.getOrderId()).toString();
|
|
if (i.length() < 10) {
|
|
if (i.length() < 10) {
|
|
@@ -1597,7 +1607,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
/*
|
|
/*
|
|
* 下单推送(自主订单才推送)
|
|
* 下单推送(自主订单才推送)
|
|
*/
|
|
*/
|
|
- if(orderClubMapper.getProductOrder(mainOrder.getOrderId()).contains(6060)) {
|
|
|
|
|
|
+ if (orderClubMapper.getProductOrder(mainOrder.getOrderId()).contains(6060)) {
|
|
if (StringUtils.isNotBlank(orderParamBo.getBindMobile()) && 0 == mainOrder.getRebateFlag() && 1 == mainOrder.getOrderType()) {
|
|
if (StringUtils.isNotBlank(orderParamBo.getBindMobile()) && 0 == mainOrder.getRebateFlag() && 1 == mainOrder.getOrderType()) {
|
|
String shortLink = remoteCallService.getShortLink(8, 3, domain + "/user/order/detail.html?orderId=" + mainOrder.getOrderId());
|
|
String shortLink = remoteCallService.getShortLink(8, 3, domain + "/user/order/detail.html?orderId=" + mainOrder.getOrderId());
|
|
String name = orderProductList.get(0).getName();
|
|
String name = orderProductList.get(0).getName();
|
|
@@ -1644,8 +1654,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
//统计拆分的shop
|
|
//统计拆分的shop
|
|
//List<OrderShopPo> collect = shops.stream().filter(s -> shops.stream().filter(so -> so.getShopId().equals(s.getShopId())).count() > 1).collect(Collectors.toList());
|
|
//List<OrderShopPo> collect = shops.stream().filter(s -> shops.stream().filter(so -> so.getShopId().equals(s.getShopId())).count() > 1).collect(Collectors.toList());
|
|
//对拆分的shop重新计算子订单佣金,应付,不计入店铺满减
|
|
//对拆分的shop重新计算子订单佣金,应付,不计入店铺满减
|
|
- log.info("原shoporderlist--------------------》"+shopOrderList);
|
|
|
|
- log.info("原orderproductlist--------------------》"+orderProductList);
|
|
|
|
|
|
+ log.info("原shoporderlist--------------------》" + shopOrderList);
|
|
|
|
+ log.info("原orderproductlist--------------------》" + orderProductList);
|
|
ArrayList<OrderShopPo> orderShopPos = new ArrayList<>();
|
|
ArrayList<OrderShopPo> orderShopPos = new ArrayList<>();
|
|
for (OrderShopPo shop : shops) {
|
|
for (OrderShopPo shop : shops) {
|
|
// 供应商名称
|
|
// 供应商名称
|