|
|
@@ -1032,16 +1032,18 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R oneClickShipping() {
|
|
|
+ public R oneClickShipping(String appId) {
|
|
|
try {
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
- //获取商城配置
|
|
|
String json = configService.selectConfigByKey("store.config");
|
|
|
StoreConfig config = JSONUtil.toBean(json, StoreConfig.class);
|
|
|
- //验证是否开启微信发货
|
|
|
if (config.getIsWeChatShipping() != null && config.getIsWeChatShipping()) {
|
|
|
- //获取支付信息
|
|
|
- List<FsStorePaymentUsetVo> paymentList = fsStorePaymentMapper.getPaymentUsetInfoList();
|
|
|
+ List<FsStorePaymentUsetVo> paymentList;
|
|
|
+ if (StringUtils.isNotEmpty(appId)) {
|
|
|
+ paymentList = fsStorePaymentMapper.getPaymentUsetInfoListByAppId(appId);
|
|
|
+ } else {
|
|
|
+ paymentList = fsStorePaymentMapper.getPaymentUsetInfoList();
|
|
|
+ }
|
|
|
if (paymentList.isEmpty()) {
|
|
|
return R.ok("操作成功,暂无同步订单信息!");
|
|
|
}
|
|
|
@@ -1051,19 +1053,17 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
for (Map.Entry<String, List<FsStorePaymentUsetVo>> entry : paymentUsetVoMap.entrySet()) {
|
|
|
List<String> successList = new ArrayList<>();
|
|
|
List<String> failedList = new ArrayList<>();
|
|
|
- String appId = entry.getKey();
|
|
|
+ String currentAppId = entry.getKey();
|
|
|
List<FsStorePaymentUsetVo> userPayments = entry.getValue();
|
|
|
- final WxMaService wxService = WxMaConfiguration.getMaService(appId);
|
|
|
+ final WxMaService wxService = WxMaConfiguration.getMaService(currentAppId);
|
|
|
if (!userPayments.isEmpty()) {
|
|
|
for (FsStorePaymentUsetVo v : userPayments) {
|
|
|
- // 上传物流信息到微信
|
|
|
if (uploadShippingInfoToWechat(wxService, v, uploadTime)) {
|
|
|
successList.add(v.getBankTransactionId());
|
|
|
}else {
|
|
|
failedList.add(v.getBankTransactionId());
|
|
|
}
|
|
|
}
|
|
|
- //批量更新数据
|
|
|
if (!successList.isEmpty()) {
|
|
|
fsStorePaymentMapper.batchUpadte(successList);
|
|
|
}
|