|
@@ -55,9 +55,11 @@ import com.fs.config.cloud.CloudHostProper;
|
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
|
|
+import com.fs.course.domain.FsUserCompanyUser;
|
|
|
import com.fs.course.dto.FsOrderDeliveryNoteDTO;
|
|
import com.fs.course.dto.FsOrderDeliveryNoteDTO;
|
|
|
import com.fs.course.dto.OrderOpenIdTransDTO;
|
|
import com.fs.course.dto.OrderOpenIdTransDTO;
|
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
|
|
|
+import com.fs.course.mapper.FsUserCompanyUserMapper;
|
|
|
import com.fs.erp.domain.*;
|
|
import com.fs.erp.domain.*;
|
|
|
import com.fs.erp.dto.*;
|
|
import com.fs.erp.dto.*;
|
|
|
import com.fs.erp.mapper.FsErpFinishPushMapper;
|
|
import com.fs.erp.mapper.FsErpFinishPushMapper;
|
|
@@ -166,6 +168,9 @@ import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
|
|
|
public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
|
|
|
|
|
private final RedisCache redisCache;
|
|
private final RedisCache redisCache;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsUserCompanyUserMapper fsUserCompanyUserMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LiveOrderMapper baseMapper;
|
|
private LiveOrderMapper baseMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -1467,7 +1472,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
SysConfig sysConfig = configService.selectConfigByConfigKey("app.config");
|
|
SysConfig sysConfig = configService.selectConfigByConfigKey("app.config");
|
|
|
AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
|
|
AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
|
|
|
for (LiveOrderPayment payment : payments) {
|
|
for (LiveOrderPayment payment : payments) {
|
|
|
- if (order.getPayType().equals("99")){
|
|
|
|
|
|
|
+ if (order.getPayType().equals("99")||order.getPayType().equals("5")){
|
|
|
payment.setAppId(config.getAppId());
|
|
payment.setAppId(config.getAppId());
|
|
|
}
|
|
}
|
|
|
// payment.setAppId(config.getAppId());
|
|
// payment.setAppId(config.getAppId());
|
|
@@ -1476,11 +1481,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if ("wxApp".equals(payment.getPayMode())){
|
|
if ("wxApp".equals(payment.getPayMode())){
|
|
|
payType = "wx";
|
|
payType = "wx";
|
|
|
}
|
|
}
|
|
|
- MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
-
|
|
|
|
|
- FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
|
|
|
|
|
|
|
if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
|
|
if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
|
|
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
+ FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
|
|
+
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
payConfig.setAppId(fsPayConfig.getAppId());
|
|
payConfig.setAppId(fsPayConfig.getAppId());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
@@ -1513,6 +1518,9 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return R.error("退款请求失败" + e.getErrCodeDes());
|
|
return R.error("退款请求失败" + e.getErrCodeDes());
|
|
|
}
|
|
}
|
|
|
} else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
|
|
} else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
|
|
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
+ FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
|
|
+
|
|
|
String huifuId = "";
|
|
String huifuId = "";
|
|
|
if (payment.getAppId() != null) {
|
|
if (payment.getAppId() != null) {
|
|
|
if (merchantAppConfig != null) {
|
|
if (merchantAppConfig != null) {
|
|
@@ -1662,7 +1670,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
record.setTransactionId(generateTransactionId());
|
|
record.setTransactionId(generateTransactionId());
|
|
|
record.setOrderId(orderId);
|
|
record.setOrderId(orderId);
|
|
|
record.setOrderNo(orderNo);
|
|
record.setOrderNo(orderNo);
|
|
|
- record.setBusinessType(1); // 1-消费
|
|
|
|
|
|
|
+ record.setBusinessType(2); // 1-消费
|
|
|
if (ObjectUtil.isEmpty(company)){
|
|
if (ObjectUtil.isEmpty(company)){
|
|
|
record.setRemark("直播订单退款,自主下单没有归属公司");
|
|
record.setRemark("直播订单退款,自主下单没有归属公司");
|
|
|
}else {
|
|
}else {
|
|
@@ -1817,7 +1825,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
|
|
AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
|
|
|
|
|
|
|
|
for (LiveOrderPayment payment : payments) {
|
|
for (LiveOrderPayment payment : payments) {
|
|
|
- if (order.getPayType().equals("99")){
|
|
|
|
|
|
|
+ if (order.getPayType().equals("99")||order.getPayType().equals("5")){
|
|
|
payment.setAppId(config.getAppId());
|
|
payment.setAppId(config.getAppId());
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isBlank(payment.getAppId())) {
|
|
if (StringUtils.isBlank(payment.getAppId())) {
|
|
@@ -1827,10 +1835,10 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
if ("wxApp".equals(payment.getPayMode())){
|
|
if ("wxApp".equals(payment.getPayMode())){
|
|
|
payType = "wx";
|
|
payType = "wx";
|
|
|
}
|
|
}
|
|
|
- MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
- FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
|
|
|
|
|
|
|
if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
|
|
if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
|
|
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
+ FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
payConfig.setAppId(payment.getAppId());
|
|
payConfig.setAppId(payment.getAppId());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
@@ -1861,6 +1869,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return R.error("退款请求失败" + e.getErrCodeDes());
|
|
return R.error("退款请求失败" + e.getErrCodeDes());
|
|
|
}
|
|
}
|
|
|
} else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
|
|
} else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
|
|
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
|
|
|
|
|
+ FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
String huifuId = "";
|
|
String huifuId = "";
|
|
|
if (payment.getAppId() != null) {
|
|
if (payment.getAppId() != null) {
|
|
|
if (merchantAppConfig == null){
|
|
if (merchantAppConfig == null){
|
|
@@ -4442,6 +4452,12 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
// if (StringUtils.isEmpty(orderKey)) {
|
|
// if (StringUtils.isEmpty(orderKey)) {
|
|
|
// return R.error("订单已过期");
|
|
// return R.error("订单已过期");
|
|
|
// }
|
|
// }
|
|
|
|
|
+ FsUserCompanyUser fsUserCompanyUser = fsUserCompanyUserMapper.selectFsUserCompanyUserByUserId(Long.valueOf(liveOrder.getUserId()));
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(fsUserCompanyUser)){
|
|
|
|
|
+ liveOrder.setCompanyId(fsUserCompanyUser.getCompanyId());
|
|
|
|
|
+ liveOrder.setCompanyUserId(fsUserCompanyUser.getCompanyUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (liveOrder.getLiveId() == null) return R.error("直播ID不能为空");
|
|
if (liveOrder.getLiveId() == null) return R.error("直播ID不能为空");
|
|
|
if (liveOrder.getProductId() == null) return R.error("购物商品ID不能为空");
|
|
if (liveOrder.getProductId() == null) return R.error("购物商品ID不能为空");
|
|
|
if (liveOrder.getUserName() == null) return R.error("用户名不能为空");
|
|
if (liveOrder.getUserName() == null) return R.error("用户名不能为空");
|
|
@@ -4528,8 +4544,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
|
|
|
|
|
LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveOrder.getLiveId(), Long.parseLong(liveOrder.getUserId()));
|
|
LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveOrder.getLiveId(), Long.parseLong(liveOrder.getUserId()));
|
|
|
if (ObjectUtil.isNotEmpty(liveUserFirstEntry)) {
|
|
if (ObjectUtil.isNotEmpty(liveUserFirstEntry)) {
|
|
|
- liveOrder.setCompanyId(liveUserFirstEntry.getCompanyId());
|
|
|
|
|
- liveOrder.setCompanyUserId(liveUserFirstEntry.getCompanyUserId());
|
|
|
|
|
|
|
+// liveOrder.setCompanyId(liveUserFirstEntry.getCompanyId());
|
|
|
|
|
+// liveOrder.setCompanyUserId(liveUserFirstEntry.getCompanyUserId());
|
|
|
liveOrder.setTuiUserId(liveUserFirstEntry.getCompanyUserId());
|
|
liveOrder.setTuiUserId(liveUserFirstEntry.getCompanyUserId());
|
|
|
}
|
|
}
|
|
|
String orderSn = OrderCodeUtils.getOrderSn();
|
|
String orderSn = OrderCodeUtils.getOrderSn();
|