|
@@ -56,6 +56,8 @@ import com.fs.his.service.IFsStorePaymentService;
|
|
import com.fs.his.utils.PhoneUtil;
|
|
import com.fs.his.utils.PhoneUtil;
|
|
import com.fs.his.vo.FsStorePaymentExcelVO;
|
|
import com.fs.his.vo.FsStorePaymentExcelVO;
|
|
import com.fs.his.vo.FsStorePaymentVO;
|
|
import com.fs.his.vo.FsStorePaymentVO;
|
|
|
|
+import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
|
|
+import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
import com.fs.hisStore.param.FsStorePaymentGetWxaCodeParam;
|
|
import com.fs.hisStore.param.FsStorePaymentGetWxaCodeParam;
|
|
import com.fs.hisStore.param.FsStorePaymentPayParam;
|
|
import com.fs.hisStore.param.FsStorePaymentPayParam;
|
|
import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
@@ -64,6 +66,7 @@ import com.fs.huifuPay.domain.HuiFuRefundResult;
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
|
|
+import com.fs.huifuPay.sdk.opps.core.utils.HuiFuUtils;
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
@@ -126,6 +129,8 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
@Autowired
|
|
@Autowired
|
|
private FsStorePaymentMapper fsStorePaymentMapper;
|
|
private FsStorePaymentMapper fsStorePaymentMapper;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private FsStorePaymentScrmMapper fsStorePaymentScrmMapper;
|
|
|
|
+ @Autowired
|
|
private TzBankService tzBankService;
|
|
private TzBankService tzBankService;
|
|
@Autowired
|
|
@Autowired
|
|
private IFsInquiryOrderService inquiryOrderService;
|
|
private IFsInquiryOrderService inquiryOrderService;
|
|
@@ -1473,6 +1478,41 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional
|
|
|
|
+ public String payConfirm(String payCode, String tradeNo, String bankTransactionId, String bankSerialNo) {
|
|
|
|
+ try {
|
|
|
|
+ //更新订单状态
|
|
|
|
+ FsStorePayment storePayment=fsStorePaymentMapper.selectFsStorePaymentByPaymentCode(payCode);
|
|
|
|
+ if(!storePayment.getStatus().equals(0)){
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ storePayment.setStatus(1);
|
|
|
|
+ storePayment.setPayTime(new Date());
|
|
|
|
+ storePayment.setTradeNo(tradeNo);
|
|
|
|
+ storePayment.setBankSerialNo(bankSerialNo);
|
|
|
|
+ storePayment.setBankTransactionId(bankTransactionId);
|
|
|
|
+ fsStorePaymentMapper.updateFsStorePayment(storePayment);
|
|
|
|
+ //增加佣金
|
|
|
|
+// if(storePayment.getCompanyId()!=null&&storePayment.getCompanyId()>0){
|
|
|
|
+// companyService.addCompanyPaymentMoney(storePayment);
|
|
|
|
+// }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ //更新订单状态
|
|
|
|
+ FsStorePaymentScrm storePayment=fsStorePaymentScrmMapper.selectFsStorePaymentByPaymentCode(payCode);
|
|
|
|
+ if(!storePayment.getStatus().equals(0)){
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ storePayment.setStatus(1);
|
|
|
|
+ storePayment.setPayTime(new Date());
|
|
|
|
+ storePayment.setTradeNo(tradeNo);
|
|
|
|
+ storePayment.setBankSerialNo(bankSerialNo);
|
|
|
|
+ storePayment.setBankTransactionId(bankTransactionId);
|
|
|
|
+ fsStorePaymentScrmMapper.updateFsStorePayment(storePayment);
|
|
|
|
+ }
|
|
|
|
+ return "SUCCESS";
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public R paymentByWxaCode(FsStorePaymentPayParam param) {
|
|
public R paymentByWxaCode(FsStorePaymentPayParam param) {
|
|
FsUser user = userMapper.selectFsUserById(param.getUserId());
|
|
FsUser user = userMapper.selectFsUserById(param.getUserId());
|
|
@@ -1549,6 +1589,14 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
o.setTransAmt(storePayment.getPayMoney().toString());
|
|
o.setTransAmt(storePayment.getPayMoney().toString());
|
|
o.setGoodsDesc("商城订单支付");
|
|
o.setGoodsDesc("商城订单支付");
|
|
o.setAppId(appId);
|
|
o.setAppId(appId);
|
|
|
|
+ //公司分账
|
|
|
|
+ try {
|
|
|
|
+ HuiFuUtils.doDiv(o,company.getCompanyId());
|
|
|
|
+ //存储分账明细
|
|
|
|
+ HuiFuUtils.saveDivItem(o, storePayment.getPayCode(), storePayment.getPayCode());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("-------------微信收款分账出错:{}", e.getMessage());
|
|
|
|
+ }
|
|
HuifuCreateOrderResult result = huiFuService.createOrder(o);
|
|
HuifuCreateOrderResult result = huiFuService.createOrder(o);
|
|
if(result.getResp_code()!=null&&(result.getResp_code().equals("00000000")||result.getResp_code().equals("00000100"))){
|
|
if(result.getResp_code()!=null&&(result.getResp_code().equals("00000000")||result.getResp_code().equals("00000100"))){
|
|
FsStorePayment mt=new FsStorePayment();
|
|
FsStorePayment mt=new FsStorePayment();
|