|
@@ -552,21 +552,34 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
storeOrder.setServiceFee(config.getServiceFee());
|
|
|
}
|
|
|
|
|
|
+ //后台制单处理
|
|
|
+ if(param.getPayPrice()!=null&¶m.getPayPrice().compareTo(BigDecimal.ZERO)>0){
|
|
|
+ if (param.getPayPrice().compareTo(dto.getTotalPrice()) > 0) {
|
|
|
+ return R.error("改价价格不能大于商品总价");
|
|
|
+ }
|
|
|
+ storeOrder.setPayPrice(param.getPayPrice());
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ storeOrder.setPayPrice(dto.getPayPrice());
|
|
|
+ }
|
|
|
|
|
|
+ //付款方式
|
|
|
if(param.getPayType().equals("1")){
|
|
|
//全款支付
|
|
|
storeOrder.setStatus(0);
|
|
|
}
|
|
|
else if(param.getPayType().equals("2")){
|
|
|
- //货到付款
|
|
|
+ //物流代收
|
|
|
storeOrder.setStatus(1);
|
|
|
}
|
|
|
- //后台制单处理
|
|
|
- if(param.getPayPrice()!=null&¶m.getPayPrice().compareTo(BigDecimal.ZERO)>0){
|
|
|
- storeOrder.setPayPrice(param.getPayPrice());
|
|
|
- }
|
|
|
- else{
|
|
|
- storeOrder.setPayPrice(dto.getPayPrice());
|
|
|
+ else if(param.getPayType().equals("3")){
|
|
|
+ //货到付款
|
|
|
+ storeOrder.setStatus(1);
|
|
|
+ BigDecimal amount = param.getAmount(); //货到付款 自定义代收金额
|
|
|
+ if (amount != null && amount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ storeOrder.setPayMoney(amount);
|
|
|
+ storeOrder.setPayDelivery(storeOrder.getPayPrice().subtract(amount) );
|
|
|
+ }
|
|
|
}
|
|
|
storeOrder.setOrderCreateType(param.getOrderCreateType());
|
|
|
Long prescribe = carts.stream().filter(item -> item.getProductType()!=null&&item.getProductType()==2).count();
|
|
@@ -654,7 +667,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
//添加支付到期时间
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(storeOrder.getCreateTime());
|
|
|
- calendar.add(Calendar.MINUTE,config.getUnPayTime());
|
|
|
+ if (config.getUnPayTime() != null){
|
|
|
+ calendar.add(Calendar.MINUTE,config.getUnPayTime());
|
|
|
+ }
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String payLimitTime = format.format(calendar.getTime() );
|
|
|
//删除推荐订单KEY
|
|
@@ -981,6 +996,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
createParam.setPaymentId(param.getPaymentId());
|
|
|
createParam.setPayPrice(param.getPayPrice());
|
|
|
createParam.setCustomerId(param.getCustomerId());
|
|
|
+ createParam.setAmount(param.getAmount());
|
|
|
return this.createOrder(param.getUserId(),createParam);
|
|
|
}
|
|
|
else{
|
|
@@ -2041,9 +2057,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
if(money==null){
|
|
|
return R.error("请输入价格");
|
|
|
}
|
|
|
- if(money.compareTo(BigDecimal.ZERO)<=0){
|
|
|
- return R.error("价格应大于0");
|
|
|
- }
|
|
|
+// if(money.compareTo(BigDecimal.ZERO)<=0){
|
|
|
+// return R.error("价格应大于0");
|
|
|
+// }
|
|
|
String key=redisCache.getCacheObject("createOrderKey:"+createOrderKey);
|
|
|
if (StringUtils.isEmpty(key)) {
|
|
|
throw new CustomException("订单已过期",501);
|