|
|
@@ -1728,43 +1728,44 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
if (order != null && !order.getPaid().equals(0)) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return "";
|
|
|
- } else if (type.equals(2)) {
|
|
|
- //货到付款
|
|
|
- order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
|
- if (!order.getStatus().equals(OrderInfoEnum.STATUS_0.getValue())) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return "";
|
|
|
- }
|
|
|
}
|
|
|
- //写入公司佣金 当有归属公司时只进行公司分佣
|
|
|
- if (order.getCompanyId() != null && order.getCompanyId() > 0) {
|
|
|
- companyService.addCompanyTuiMoney(order);
|
|
|
- //没有归属公司对个人分佣
|
|
|
- } else if (order.getIsPackage() != 1 && order.getTuiUserId() != null && order.getTuiUserId() > 0) {
|
|
|
- //处理佣金 套餐不分佣金
|
|
|
- FsStoreOrderItemScrm orderItemMap = new FsStoreOrderItemScrm();
|
|
|
- orderItemMap.setOrderId(order.getId());
|
|
|
- List<FsStoreOrderItemScrm> items = storeOrderItemService.selectFsStoreOrderItemList(orderItemMap);
|
|
|
- userService.addTuiMoney(order, items);
|
|
|
- }
|
|
|
- //增加用户购买次数
|
|
|
- userService.incPayCount(order.getUserId());
|
|
|
- //增加状态
|
|
|
- orderStatusService.create(order.getId(), OrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
|
|
|
- OrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
|
|
|
- FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
|
|
|
- storeOrder.setId(order.getId());
|
|
|
- storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
|
|
|
- storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
|
|
|
- storeOrder.setPayTime(new Date());
|
|
|
- fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
|
|
|
- // 添加订单审核
|
|
|
- if (storeOrder.getCompanyId() != null) {
|
|
|
- addOrderAudit(order);
|
|
|
+ }else if (type.equals(2)) {
|
|
|
+ //货到付款
|
|
|
+ order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
|
+ if (!order.getStatus().equals(OrderInfoEnum.STATUS_0.getValue())) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return "";
|
|
|
}
|
|
|
}
|
|
|
+ //写入公司佣金 当有归属公司时只进行公司分佣
|
|
|
+ if (order.getCompanyId() != null && order.getCompanyId() > 0) {
|
|
|
+ companyService.addCompanyTuiMoney(order);
|
|
|
+ //没有归属公司对个人分佣
|
|
|
+ } else if (order.getIsPackage() != 1 && order.getTuiUserId() != null && order.getTuiUserId() > 0) {
|
|
|
+ //处理佣金 套餐不分佣金
|
|
|
+ FsStoreOrderItemScrm orderItemMap = new FsStoreOrderItemScrm();
|
|
|
+ orderItemMap.setOrderId(order.getId());
|
|
|
+ List<FsStoreOrderItemScrm> items = storeOrderItemService.selectFsStoreOrderItemList(orderItemMap);
|
|
|
+ userService.addTuiMoney(order, items);
|
|
|
+ }
|
|
|
+ //增加用户购买次数
|
|
|
+ userService.incPayCount(order.getUserId());
|
|
|
+ //增加状态
|
|
|
+ orderStatusService.create(order.getId(), OrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
|
|
|
+ OrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
|
|
|
+ FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
|
|
|
+ storeOrder.setId(order.getId());
|
|
|
+ storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
|
|
|
+ storeOrder.setStatus(OrderInfoEnum.STATUS_1.getValue());
|
|
|
+ storeOrder.setPayTime(new Date());
|
|
|
+ fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
|
|
|
+ // 添加订单审核
|
|
|
+ if (storeOrder.getCompanyId() != null) {
|
|
|
+ addOrderAudit(order);
|
|
|
+ }
|
|
|
|
|
|
- return "SUCCESS";
|
|
|
+
|
|
|
+ return "SUCCESS";
|
|
|
|
|
|
|
|
|
//非处方直接提交OMS
|
|
|
@@ -3876,6 +3877,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
order.setPayType("2");
|
|
|
BigDecimal payMoney=order.getPayPrice().multiply(new BigDecimal(storeConfig.getPayRate())).divide(new BigDecimal(100));
|
|
|
payMoney=new BigDecimal(payMoney.setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
|
|
|
+ // 如果小程序需要支付的金额小于0.01元,不能走物流代收,让走货到付款 xgb
|
|
|
+ if (payMoney.compareTo(new BigDecimal("0.01")) < 0) {
|
|
|
+ return R.error("物流代收计算支付金额为0,不允许选择物流代收");
|
|
|
+ }
|
|
|
order.setPayDelivery(order.getPayPrice().subtract(payMoney));
|
|
|
order.setPayMoney(payMoney);
|
|
|
}
|
|
|
@@ -4367,7 +4372,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
order.setPayDelivery(BigDecimal.ZERO);
|
|
|
}
|
|
|
else if(param.getPayType().equals(2)){
|
|
|
-
|
|
|
+ // 物流代收
|
|
|
order.setPayType("2");
|
|
|
BigDecimal payMoney=order.getPayPrice().multiply(new BigDecimal(storeConfig.getPayRate())).divide(new BigDecimal(100));
|
|
|
payMoney=new BigDecimal(payMoney.setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
|