|
|
@@ -2856,9 +2856,25 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if(StringUtils.isNotEmpty(orderId)&&order.getOrderId().toString().equals(orderId)){
|
|
|
return R.error("正在支付中...");
|
|
|
}
|
|
|
-
|
|
|
FsUserScrm user=userMapper.selectFsUserById(Long.valueOf(order.getUserId()));
|
|
|
- if(user!=null&& StringUtils.isNotEmpty(user.getMaOpenId())){
|
|
|
+ if(user == null){
|
|
|
+ return R.error("未找到用户信息,请联系管理员!");
|
|
|
+ }
|
|
|
+ String json = configService.selectConfigByKey("his.pay");
|
|
|
+ FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
|
|
|
+ String openId;
|
|
|
+ if(StringUtils.isNotEmpty(user.getMaOpenId())){
|
|
|
+ log.info("用户信息有openid:{}", user.getMaOpenId());
|
|
|
+ openId = user.getMaOpenId();
|
|
|
+ }else{
|
|
|
+ Wrapper<FsUserWx> queryWrapper = Wrappers.<FsUserWx>lambdaQuery()
|
|
|
+ .eq(FsUserWx::getFsUserId, order.getUserId())
|
|
|
+ .eq(FsUserWx::getAppId, fsPayConfig.getAppId());
|
|
|
+ FsUserWx fsUserWx = fsUserWxMapper.selectOne(queryWrapper);
|
|
|
+ log.info("查到的openId信息:{}", fsUserWx);
|
|
|
+ openId = fsUserWx.getOpenId();
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(openId)){
|
|
|
//已改价处理
|
|
|
if(order.getIsEditMoney()!=null&&order.getIsEditMoney()==1){
|
|
|
//改过价不做处理
|
|
|
@@ -2897,8 +2913,6 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
// order.setOrderCode(orderCode);
|
|
|
// if(order.getPayType().equals("1")||order.getPayType().equals("2")){
|
|
|
if((order.getPayType().equals("1")||order.getPayType().equals("2")||order.getPayType().equals("3")) && order.getPayMoney().compareTo(new BigDecimal(0))>0){
|
|
|
- String json = configService.selectConfigByKey("his.pay");
|
|
|
- FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
|
|
|
LiveOrderPayment storePayment=new LiveOrderPayment();
|
|
|
storePayment.setCompanyId(order.getCompanyId());
|
|
|
storePayment.setCompanyUserId(order.getCompanyUserId());
|
|
|
@@ -2910,17 +2924,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
storePayment.setPayTypeCode("weixin");
|
|
|
storePayment.setBusinessType(5);
|
|
|
storePayment.setRemark("直播订单支付");
|
|
|
- if(StringUtils.isNotEmpty(user.getMaOpenId())){
|
|
|
- storePayment.setOpenId(user.getMaOpenId());
|
|
|
- }else{
|
|
|
- Wrapper<FsUserWx> queryWrapper = Wrappers.<FsUserWx>lambdaQuery()
|
|
|
- .eq(FsUserWx::getFsUserId, order.getUserId())
|
|
|
- .eq(FsUserWx::getAppId, fsPayConfig.getAppId());
|
|
|
- FsUserWx fsUserWx = fsUserWxMapper.selectOne(queryWrapper);
|
|
|
- log.info("查到的openId信息:{}", fsUserWx);
|
|
|
- storePayment.setOpenId(fsUserWx.getOpenId());
|
|
|
- }
|
|
|
- log.info("用户openid:{}", storePayment.getOpenId());
|
|
|
+ storePayment.setOpenId(openId);
|
|
|
storePayment.setUserId(user.getUserId());
|
|
|
storePayment.setBusinessId(String.valueOf(order.getOrderId()));
|
|
|
storePayment.setAppId(fsPayConfig.getAppId() == null ? "" : fsPayConfig.getAppId());
|