|
@@ -57,6 +57,12 @@ import com.fs.his.service.impl.FsPackageOrderServiceImpl;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.FsSubOrderResultVO;
|
|
import com.fs.his.vo.FsSubOrderResultVO;
|
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
|
|
|
+import com.fs.hisStore.domain.FsStorePaymentScrm;
|
|
|
|
|
+import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
|
|
|
|
|
+import com.fs.hisStore.service.IFsStorePaymentScrmService;
|
|
|
|
|
+import com.fs.huifuPay.domain.HuiFuQueryOrderResult;
|
|
|
|
|
+import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayQueryRequest;
|
|
|
|
|
+import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.im.dto.*;
|
|
import com.fs.im.dto.*;
|
|
|
import com.fs.im.service.IImService;
|
|
import com.fs.im.service.IImService;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
import com.fs.im.service.OpenIMService;
|
|
@@ -81,6 +87,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -1069,6 +1077,59 @@ public class Task {
|
|
|
System.out.println(msgResponseDTO);
|
|
System.out.println(msgResponseDTO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ FsStorePaymentScrmMapper fsStorePaymentScrmMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ HuiFuService huiFuService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询同步商城订单的支付转台
|
|
|
|
|
+ */
|
|
|
|
|
+ public void syncOrderPayStatus(){
|
|
|
|
|
+ //查询支付状态是待支付的数据
|
|
|
|
|
+ FsStorePaymentScrm paymentScrm = new FsStorePaymentScrm();
|
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
+ paymentScrm.setStatus(0);
|
|
|
|
|
+ List<FsStorePaymentScrm> fsStorePaymentScrms = fsStorePaymentScrmMapper.selectFsStorePaymentList(paymentScrm);
|
|
|
|
|
+ if(null != fsStorePaymentScrms && !fsStorePaymentScrms.isEmpty()){
|
|
|
|
|
+ for (FsStorePaymentScrm payment : fsStorePaymentScrms) {
|
|
|
|
|
+ if(StringUtils.isBlank(payment.getTradeNo())){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
|
|
|
|
|
+ request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
|
|
|
|
|
+ request.setOrgHfSeqId(payment.getTradeNo());
|
|
|
|
|
+ HuiFuQueryOrderResult o = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ o = huiFuService.queryOrder(request);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("查询失败:"+e.getMessage());
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("汇付返回" + o);
|
|
|
|
|
+ if ("00000000".equals(o.getResp_code()) && "S".equals(o.getTrans_stat())) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Date payTime = formatter.parse(o.getEnd_time());
|
|
|
|
|
+ FsStorePaymentScrm payUpdate = new FsStorePaymentScrm();
|
|
|
|
|
+ payUpdate.setPaymentId(payment.getPaymentId());
|
|
|
|
|
+ payUpdate.setPayTime(payTime);
|
|
|
|
|
+ payUpdate.setStatus(1);
|
|
|
|
|
+ payUpdate.setTradeNo(o.getOrg_hf_seq_id());
|
|
|
|
|
+ payUpdate.setBankSerialNo(o.getParty_order_id());
|
|
|
|
|
+ payUpdate.setBankTransactionId(o.getOut_trans_id());
|
|
|
|
|
+ fsStorePaymentScrmMapper.updateFsStorePayment(payUpdate);
|
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
|
+ log.error("更新失败 payment:{}",payment ,e);
|
|
|
|
|
+// throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// @Autowired
|
|
// @Autowired
|
|
|
// private FsStoreMapper fsStoreMapper;
|
|
// private FsStoreMapper fsStoreMapper;
|
|
|
// @Autowired
|
|
// @Autowired
|