|
@@ -14,7 +14,6 @@ import java.util.stream.Collectors;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
-import cn.hutool.core.date.DateTime;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.net.URLDecoder;
|
|
import cn.hutool.core.net.URLDecoder;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
@@ -28,7 +27,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.fs.api.param.OrderListParam;
|
|
import com.fs.api.param.OrderListParam;
|
|
import com.fs.api.vo.OrderListVO;
|
|
import com.fs.api.vo.OrderListVO;
|
|
import com.fs.api.vo.ProductListVO;
|
|
import com.fs.api.vo.ProductListVO;
|
|
-import com.fs.common.annotation.DataScope;
|
|
|
|
import com.fs.common.config.FSSysConfig;
|
|
import com.fs.common.config.FSSysConfig;
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
@@ -74,32 +72,26 @@ import com.fs.store.service.handler.PaymentHandler;
|
|
import com.fs.store.service.handler.PaymentHandlerHolder;
|
|
import com.fs.store.service.handler.PaymentHandlerHolder;
|
|
import com.fs.store.service.handler.param.PayProcessContext;
|
|
import com.fs.store.service.handler.param.PayProcessContext;
|
|
import com.fs.store.vo.*;
|
|
import com.fs.store.vo.*;
|
|
-import com.fs.pay.service.IPayService;
|
|
|
|
-import com.fs.pay.service.dto.RefundDTO;
|
|
|
|
-import com.fs.system.domain.SysConfig;
|
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.tzBank.TzBankService;
|
|
import com.fs.tzBank.TzBankService;
|
|
import com.fs.tzBank.utils.TzConfigUtils;
|
|
import com.fs.tzBank.utils.TzConfigUtils;
|
|
import com.fs.wx.miniapp.config.WxMaConfiguration;
|
|
import com.fs.wx.miniapp.config.WxMaConfiguration;
|
|
import com.fs.wx.miniapp.config.WxMaProperties;
|
|
import com.fs.wx.miniapp.config.WxMaProperties;
|
|
-import com.fs.wx.pay.config.WxPayProperties;
|
|
|
|
-import com.hc.openapi.tool.util.Ids;
|
|
|
|
import lombok.Synchronized;
|
|
import lombok.Synchronized;
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.aop.framework.AopContext;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
|
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
-import javax.swing.plaf.TableHeaderUI;
|
|
|
|
-
|
|
|
|
import static com.fs.store.constants.StoreConstants.DELIVERY;
|
|
import static com.fs.store.constants.StoreConstants.DELIVERY;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -109,6 +101,7 @@ import static com.fs.store.constants.StoreConstants.DELIVERY;
|
|
* @date 2022-03-15
|
|
* @date 2022-03-15
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
|
|
+@EnableAspectJAutoProxy(proxyTargetClass = true,exposeProxy = true)
|
|
public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
{
|
|
{
|
|
|
|
|
|
@@ -136,7 +129,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
private IFsUserBillService billService;
|
|
private IFsUserBillService billService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- RedisCache redisCache;
|
|
|
|
|
|
+ private RedisCache redisCache;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IFsStoreCartService cartService;
|
|
private IFsStoreCartService cartService;
|
|
@@ -156,15 +149,15 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
@Autowired
|
|
@Autowired
|
|
private FSSysConfig sysConfig;
|
|
private FSSysConfig sysConfig;
|
|
@Autowired
|
|
@Autowired
|
|
- IErpOrderService erpOrderService;
|
|
|
|
|
|
+ private IErpOrderService erpOrderService;
|
|
@Autowired
|
|
@Autowired
|
|
- IFsStorePaymentService paymentService;
|
|
|
|
|
|
+ private IFsStorePaymentService paymentService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- IFsStoreProductPackageService productPackageService;
|
|
|
|
|
|
+ private IFsStoreProductPackageService productPackageService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- ICompanyUserService companyUserService;
|
|
|
|
|
|
+ private ICompanyUserService companyUserService;
|
|
@Autowired
|
|
@Autowired
|
|
private IFsStoreProductAttrValueService attrValueService;
|
|
private IFsStoreProductAttrValueService attrValueService;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -186,17 +179,17 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
@Autowired
|
|
@Autowired
|
|
private FsStoreOrderItemMapper fsStoreOrderItemMapper;
|
|
private FsStoreOrderItemMapper fsStoreOrderItemMapper;
|
|
@Autowired
|
|
@Autowired
|
|
- ICompanyDeptService companyDeptService;
|
|
|
|
|
|
+ private ICompanyDeptService companyDeptService;
|
|
@Autowired
|
|
@Autowired
|
|
- IFsPrescribeService prescribeService;
|
|
|
|
|
|
+ private IFsPrescribeService prescribeService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- PayService ybPayService;
|
|
|
|
|
|
+ private PayService ybPayService;
|
|
@Autowired
|
|
@Autowired
|
|
- HuiFuService huiFuService;
|
|
|
|
|
|
+ private HuiFuService huiFuService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- TzBankService tzBankService;
|
|
|
|
|
|
+ private TzBankService tzBankService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IFsCouponScheduleService fsCouponScheduleService;
|
|
private IFsCouponScheduleService fsCouponScheduleService;
|
|
@@ -407,8 +400,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
vo.setItems(items);
|
|
vo.setItems(items);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //List<FsStoreOrderItemVO> items=storeOrderItemService.selectFsStoreOrderItemListByOrderId(vo.getId());
|
|
|
|
- //vo.setItems(items);
|
|
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
@@ -878,6 +869,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
|
|
|
//未支付取消订单
|
|
//未支付取消订单
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
public void cancelOrder(Long orderId) {
|
|
public void cancelOrder(Long orderId) {
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
if(order.getStatus()==OrderInfoEnum.STATUS_0.getValue()){
|
|
if(order.getStatus()==OrderInfoEnum.STATUS_0.getValue()){
|
|
@@ -894,14 +886,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
//添加记录
|
|
//添加记录
|
|
orderStatusService.create(order.getId(), OrderLogEnum.CANCEL_ORDER.getValue(),
|
|
orderStatusService.create(order.getId(), OrderLogEnum.CANCEL_ORDER.getValue(),
|
|
OrderLogEnum.CANCEL_ORDER.getDesc());
|
|
OrderLogEnum.CANCEL_ORDER.getDesc());
|
|
-// if(order.getPaid()==1){
|
|
|
|
-// //更新OMS
|
|
|
|
-// ErpRefundUpdateRequest request=new ErpRefundUpdateRequest();
|
|
|
|
-// request.setTid(order.getOrderCode());
|
|
|
|
-// request.setOid(order.getOrderCode());
|
|
|
|
-// request.setRefund_state(1);
|
|
|
|
-// erpOrderService.refundUpdate(request);
|
|
|
|
-// }
|
|
|
|
TemplateBean templateBean = TemplateBean.builder()
|
|
TemplateBean templateBean = TemplateBean.builder()
|
|
.orderId(order.getId().toString())
|
|
.orderId(order.getId().toString())
|
|
.orderCode(order.getOrderCode().toString())
|
|
.orderCode(order.getOrderCode().toString())
|
|
@@ -914,7 +898,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- @Transactional
|
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
public void refundPrescribeOrder(Long orderId) {
|
|
public void refundPrescribeOrder(Long orderId) {
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
if(order!=null&&order.getStatus()==OrderInfoEnum.STATUS_1.getValue()&&order.getRefundStatus()==0){
|
|
if(order!=null&&order.getStatus()==OrderInfoEnum.STATUS_1.getValue()&&order.getRefundStatus()==0){
|
|
@@ -957,18 +941,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- //小雨点退款
|
|
|
|
-// RefundDTO refundDTO=new RefundDTO();
|
|
|
|
-// refundDTO.setMerchOrderNo(Ids.oid());
|
|
|
|
-// refundDTO.setAmount(payment.getPayMoney().toString());
|
|
|
|
-// if(payment.getIsPayRemain()!=null&&payment.getIsPayRemain().equals(1)){
|
|
|
|
-// refundDTO.setOrigMerchOrderNo("store_remain-"+payment.getPayCode());
|
|
|
|
-// }
|
|
|
|
-// else{
|
|
|
|
-// refundDTO.setOrigMerchOrderNo("store-"+payment.getPayCode());
|
|
|
|
-// }
|
|
|
|
-// payService.refundOrder(refundDTO);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1446,12 +1418,14 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public synchronized R finishOrder(Long orderId) {
|
|
|
|
- return finishStoreOrder(orderId);
|
|
|
|
|
|
+ public synchronized R finishOrder(Long orderId) {
|
|
|
|
+ IFsStoreOrderService fsStoreOrderService = (IFsStoreOrderService) AopContext.currentProxy();
|
|
|
|
+ return fsStoreOrderService.finishStoreOrder(orderId);
|
|
}
|
|
}
|
|
|
|
|
|
- @Transactional
|
|
|
|
- R finishStoreOrder(Long orderId){
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
|
|
|
|
+ public R finishStoreOrder(Long orderId){
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
FsStoreOrder order= fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
if(order.getStatus()==OrderInfoEnum.STATUS_2.getValue()){
|
|
if(order.getStatus()==OrderInfoEnum.STATUS_2.getValue()){
|
|
order.setFinishTime(new Date());
|
|
order.setFinishTime(new Date());
|