|
|
|
@ -39,6 +39,7 @@ import co.yixiang.modules.cart.domain.YxStoreCart;
|
|
|
|
|
import co.yixiang.modules.cart.service.YxStoreCartService; |
|
|
|
|
import co.yixiang.modules.cart.service.mapper.StoreCartMapper; |
|
|
|
|
import co.yixiang.modules.cart.vo.YxStoreCartQueryVo; |
|
|
|
|
import co.yixiang.modules.inform.service.SendMsgService; |
|
|
|
|
import co.yixiang.modules.order.domain.YxExpress; |
|
|
|
|
import co.yixiang.modules.order.domain.YxStoreOrder; |
|
|
|
|
import co.yixiang.modules.order.domain.YxStoreOrderCartInfo; |
|
|
|
@ -186,6 +187,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
@Autowired |
|
|
|
|
private ApplicationEventPublisher publisher; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SendMsgService sendMsgService; |
|
|
|
|
@Autowired |
|
|
|
|
private StoreAfterSalesService storeAfterSalesService; |
|
|
|
|
|
|
|
|
@ -205,30 +208,15 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
Map<String, ArrayList> cartGroup = yxStoreCartService.getUserProductCartList(uid, |
|
|
|
|
cartIds, ShopConstants.ZSW_ONE_NUM); |
|
|
|
|
List<YxStoreCartQueryVo> list = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(cartGroup.get("invalidProductList"))) { |
|
|
|
|
throw new YshopException("有失效的商品请重新提交"); |
|
|
|
|
}; |
|
|
|
|
cartGroup.get("cartList").forEach(item->{ |
|
|
|
|
YxStoreBrandCart yxStoreBrandCart=(YxStoreBrandCart)item; |
|
|
|
|
if (ObjectUtil.isNotEmpty(yxStoreBrandCart.getInvalidProductList())) { |
|
|
|
|
throw new YshopException("有失效的商品请重新提交"); |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isEmpty(yxStoreBrandCart.getValidProductList())) { |
|
|
|
|
throw new YshopException("请提交购买的商品"); |
|
|
|
|
} |
|
|
|
|
list.addAll(yxStoreBrandCart.getValidProductList()); |
|
|
|
|
// Class jsonClass = item.getClass();//通过item,获取运行时类的对象
|
|
|
|
|
// Field invalidProductList = null;
|
|
|
|
|
// Field validProductList = null;
|
|
|
|
|
// try {
|
|
|
|
|
// //获取item中的invalidProductList属性
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(item.getClass().getDeclaredField("invalidProductList"))) {
|
|
|
|
|
// throw new YshopException("有失效的商品请重新提交");
|
|
|
|
|
// }
|
|
|
|
|
// if (ObjectUtil.isEmpty(item.getClass().getDeclaredField("validProductList"))) {
|
|
|
|
|
// throw new YshopException("请提交购买的商品");
|
|
|
|
|
// }
|
|
|
|
|
// } catch (NoSuchFieldException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
}); |
|
|
|
|
OtherDto other = new OtherDto(); |
|
|
|
|
other.setIntegralRatio(systemConfigService.getData(SystemConfigConstants.INTERGRAL_RATIO)); |
|
|
|
@ -932,7 +920,13 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
|
|
|
|
|
this.regressionCoupon(order, 0); |
|
|
|
|
|
|
|
|
|
yxStoreOrderMapper.deleteById(order.getId()); |
|
|
|
|
//更新订单状态
|
|
|
|
|
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(YxStoreOrder::getOrderId, orderId); |
|
|
|
|
YxStoreOrder storeOrder = new YxStoreOrder(); |
|
|
|
|
storeOrder.setStatus(OrderStatusEnum.STATUS_8.getValue()); |
|
|
|
|
yxStoreOrderMapper.update(storeOrder, wrapper); |
|
|
|
|
// yxStoreOrderMapper.deleteById(order.getId());
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1102,7 +1096,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
orderStatusService.create(order.getId(), |
|
|
|
|
OrderLogEnum.REFUND_ORDER_APPLY.getValue(), |
|
|
|
|
"用户申请退款,原因:" + text); |
|
|
|
|
|
|
|
|
|
//申请退款企业微信
|
|
|
|
|
sendMsgService.inform(Long.valueOf(orderId),1); |
|
|
|
|
//模板消息发布事件
|
|
|
|
|
TemplateBean templateBean = TemplateBean.builder() |
|
|
|
|
.orderId(order.getOrderId()) |
|
|
|
@ -1141,6 +1136,11 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue()) |
|
|
|
|
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_0.getValue()); |
|
|
|
|
break; |
|
|
|
|
case STATUS_8: |
|
|
|
|
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue()) |
|
|
|
|
.eq(YxStoreOrder::getRefundStatus, OrderInfoEnum.REFUND_STATUS_0.getValue()) |
|
|
|
|
.eq(YxStoreOrder::getStatus, OrderInfoEnum.STATUS_8.getValue()); |
|
|
|
|
break; |
|
|
|
|
//待发货
|
|
|
|
|
case STATUS_1: |
|
|
|
|
wrapper.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue()) |
|
|
|
@ -1560,8 +1560,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|
|
|
|
BillDetailEnum.TYPE_3.getValue(), |
|
|
|
|
orderInfo.getPayPrice().doubleValue(), userInfo.getNowMoney().doubleValue(), |
|
|
|
|
payTypeMsg + orderInfo.getPayPrice() + "元购买商品"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//支付成功企业微信
|
|
|
|
|
sendMsgService.inform(Long.valueOf(orderId),0); |
|
|
|
|
//模板消息支付成功发布事件
|
|
|
|
|
TemplateBean templateBean = TemplateBean.builder() |
|
|
|
|
.orderId(orderInfo.getOrderId()) |
|
|
|
|