|
@@ -32,9 +32,12 @@ import com.fs.his.mapper.FsHfpayConfigMapper;
|
|
|
import com.fs.his.service.IMerchantAppConfigService;
|
|
import com.fs.his.service.IMerchantAppConfigService;
|
|
|
import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderItemScrm;
|
|
import com.fs.hisStore.domain.FsStoreOrderItemScrm;
|
|
|
|
|
+import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
|
import com.fs.hisStore.domain.FsStoreProductScrm;
|
|
import com.fs.hisStore.domain.FsStoreProductScrm;
|
|
|
|
|
+import com.fs.hisStore.enums.OrderInfoEnum;
|
|
|
import com.fs.hisStore.param.FsStorePaymentParam;
|
|
import com.fs.hisStore.param.FsStorePaymentParam;
|
|
|
import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
|
|
import com.fs.hisStore.service.IFsStoreOrderItemScrmService;
|
|
|
|
|
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
|
import com.fs.hisStore.service.IFsStoreProductScrmService;
|
|
import com.fs.hisStore.service.IFsStoreProductScrmService;
|
|
|
import com.fs.hisStore.service.IFsStorePaymentScrmService;
|
|
import com.fs.hisStore.service.IFsStorePaymentScrmService;
|
|
|
import com.fs.hisStore.vo.FsStorePaymentVO;
|
|
import com.fs.hisStore.vo.FsStorePaymentVO;
|
|
@@ -99,6 +102,8 @@ public class FsStorePaymentScrmController extends BaseController
|
|
|
private IFsStoreOrderItemScrmService fsStoreOrderItemService;
|
|
private IFsStoreOrderItemScrmService fsStoreOrderItemService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IFsStoreProductScrmService fsStoreProductService;
|
|
private IFsStoreProductScrmService fsStoreProductService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsStoreOrderScrmService fsStoreOrderScrmService;
|
|
|
/**
|
|
/**
|
|
|
* 查询支付明细列表
|
|
* 查询支付明细列表
|
|
|
*/
|
|
*/
|
|
@@ -210,7 +215,7 @@ public class FsStorePaymentScrmController extends BaseController
|
|
|
public R refundStorePayment(@RequestBody FsStorePaymentScrm fsStorePayment)
|
|
public R refundStorePayment(@RequestBody FsStorePaymentScrm fsStorePayment)
|
|
|
{
|
|
{
|
|
|
FsStorePaymentScrm payment=fsStorePaymentService.selectFsStorePaymentById(fsStorePayment.getPaymentId());
|
|
FsStorePaymentScrm payment=fsStorePaymentService.selectFsStorePaymentById(fsStorePayment.getPaymentId());
|
|
|
- String businessOrderId = fsStorePayment.getBusinessOrderId();
|
|
|
|
|
|
|
+ String businessOrderId = payment.getBusinessOrderId();
|
|
|
if (StringUtils.isEmpty(businessOrderId)) {
|
|
if (StringUtils.isEmpty(businessOrderId)) {
|
|
|
return R.error("没有关联的订单");
|
|
return R.error("没有关联的订单");
|
|
|
}
|
|
}
|
|
@@ -273,6 +278,18 @@ public class FsStorePaymentScrmController extends BaseController
|
|
|
payment.setStatus(-1);
|
|
payment.setStatus(-1);
|
|
|
payment.setRefundTime(new Date());
|
|
payment.setRefundTime(new Date());
|
|
|
fsStorePaymentService.updateFsStorePayment(payment);
|
|
fsStorePaymentService.updateFsStorePayment(payment);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(payment.getBusinessOrderId())) {
|
|
|
|
|
+ Long orderId = Long.valueOf(payment.getBusinessOrderId());
|
|
|
|
|
+ FsStoreOrderScrm order = fsStoreOrderScrmService.selectFsStoreOrderById(orderId);
|
|
|
|
|
+ if (order != null) {
|
|
|
|
|
+ order.setStatus(OrderInfoEnum.STATUS_NE2.getValue());
|
|
|
|
|
+ order.setRefundPrice(payment.getRefundMoney());
|
|
|
|
|
+ order.setRefundStatus(OrderInfoEnum.REFUND_STATUS_2.getValue());
|
|
|
|
|
+ order.setRefundReason("销售主动退款");
|
|
|
|
|
+ order.setRefundReasonTime(new Date());
|
|
|
|
|
+ fsStoreOrderScrmService.updateFsStoreOrder(order);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//收款 减去所有
|
|
//收款 减去所有
|
|
|
if(payment.getCompanyId()!=null&&payment.getCompanyId()>0){
|
|
if(payment.getCompanyId()!=null&&payment.getCompanyId()>0){
|
|
|
companyService.subCompanyPaymentMoney(payment);
|
|
companyService.subCompanyPaymentMoney(payment);
|