|
@@ -14,12 +14,18 @@ import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
|
|
|
+import com.fs.erp.service.impl.JSTErpOrderServiceImpl;
|
|
|
import com.fs.his.domain.FsPayConfig;
|
|
import com.fs.his.domain.FsPayConfig;
|
|
|
import com.fs.his.domain.MerchantAppConfig;
|
|
import com.fs.his.domain.MerchantAppConfig;
|
|
|
import com.fs.his.mapper.MerchantAppConfigMapper;
|
|
import com.fs.his.mapper.MerchantAppConfigMapper;
|
|
|
import com.fs.live.domain.LiveCart;
|
|
import com.fs.live.domain.LiveCart;
|
|
|
import com.fs.live.service.ILiveCartService;
|
|
import com.fs.live.service.ILiveCartService;
|
|
|
import com.fs.live.vo.LiveCartVo;
|
|
import com.fs.live.vo.LiveCartVo;
|
|
|
|
|
+import com.fs.erp.dto.ErpOrderQueryRequert;
|
|
|
|
|
+import com.fs.erp.dto.ErpOrderQueryResponse;
|
|
|
|
|
+import com.fs.erp.domain.ErpOrderQuery;
|
|
|
|
|
+import com.fs.erp.domain.ErpDeliverys;
|
|
|
|
|
+import com.fs.erp.service.IErpOrderService;
|
|
|
import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
|
import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
@@ -90,6 +96,10 @@ public class LiveCartController extends AppBaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CloudHostProper cloudHostProper;
|
|
private CloudHostProper cloudHostProper;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询购物车列表
|
|
* 查询购物车列表
|
|
|
*/
|
|
*/
|
|
@@ -194,50 +204,6 @@ public class LiveCartController extends AppBaseController
|
|
|
MerchantAppConfigMapper merchantAppConfigMapper;
|
|
MerchantAppConfigMapper merchantAppConfigMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private WxPayService wxPayService;
|
|
private WxPayService wxPayService;
|
|
|
- @GetMapping("/test1")
|
|
|
|
|
- public void test1() {
|
|
|
|
|
- FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectCoursePlaySourceConfigByAppId("wx9bb2cd1e3afe714e");
|
|
|
|
|
- if (fsCoursePlaySourceConfig == null) {
|
|
|
|
|
- throw new CustomException("未找到appId对应的小程序配置: " );
|
|
|
|
|
- }
|
|
|
|
|
- Long merchantConfigId = fsCoursePlaySourceConfig.getMerchantConfigId();
|
|
|
|
|
- if (merchantConfigId == null || merchantConfigId <= 0) {
|
|
|
|
|
- throw new CustomException("小程序没有配置商户信息");
|
|
|
|
|
- }
|
|
|
|
|
- MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigById(fsCoursePlaySourceConfig.getMerchantConfigId());
|
|
|
|
|
- FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
|
|
- WxPayConfig payConfig = new WxPayConfig();
|
|
|
|
|
- payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
|
|
|
- payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
|
|
|
- payConfig.setMchKey(fsPayConfig.getWxMchKey());
|
|
|
|
|
- payConfig.setKeyPath(fsPayConfig.getKeyPath());
|
|
|
|
|
- payConfig.setSubAppId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
|
|
|
- payConfig.setSubMchId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
|
|
|
- wxPayService.setConfig(payConfig);
|
|
|
|
|
- WxPayRefundRequest refundRequest = new WxPayRefundRequest();
|
|
|
|
|
- refundRequest.setOutTradeNo("live-live-" + "2017147035307872256");
|
|
|
|
|
- refundRequest.setOutRefundNo("live-live-" + "2017147035307872256");
|
|
|
|
|
- refundRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen("0.10"));
|
|
|
|
|
- refundRequest.setRefundFee(WxPayUnifiedOrderRequest.yuanToFen("0.10"));
|
|
|
|
|
- try {
|
|
|
|
|
- WxPayRefundResult refundResult = wxPayService.refund(refundRequest);
|
|
|
|
|
- WxPayRefundQueryResult refundQueryResult = wxPayService.refundQuery("", refundResult.getOutTradeNo(), refundResult.getOutRefundNo(), refundResult.getRefundId());
|
|
|
|
|
- if(refundQueryResult!=null&&refundQueryResult.getResultCode().equals("SUCCESS")){
|
|
|
|
|
- FsStorePaymentScrm paymentMap=new FsStorePaymentScrm();
|
|
|
|
|
- paymentMap.setPaymentId(41868L);
|
|
|
|
|
- paymentMap.setStatus(-1);
|
|
|
|
|
- paymentMap.setRefundTime(DateUtils.getNowDate());
|
|
|
|
|
- paymentMap.setRefundMoney(BigDecimal.valueOf(0.1));
|
|
|
|
|
- fsStorePaymentScrmMapper.updateFsStorePayment(paymentMap);
|
|
|
|
|
- log.error("成功");
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- log.error("失败");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (WxPayException e) {
|
|
|
|
|
- log.error("失败");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|