|
@@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
24
|
24
|
import com.alibaba.excel.EasyExcel;
|
25
|
25
|
import com.alibaba.fastjson.JSONObject;
|
26
|
26
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
27
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
27
|
28
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
28
|
29
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
29
|
30
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -116,7 +117,7 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
|
116
|
117
|
if (CommConstant.ITEM_TYPE_RECHARGE.equals(orderType) || CommConstant.ITEM_TYPE_REFUND.equals(orderType)) {
|
117
|
118
|
result = taOrgOrderMapper.orderListByRechargeOrRefund(pg, orderType, orgId, tradeNo, isOffline, tradingStatus, startDate, endDate, miniAppName);
|
118
|
119
|
result.getRecords().forEach(e -> {
|
119
|
|
- if (!StringUtils.isEmpty(e.getCertificateUrl())){
|
|
120
|
+ if (!StringUtils.isEmpty(e.getCertificateUrl())) {
|
120
|
121
|
e.setCertificateUrlList(Arrays.asList(e.getCertificateUrl().split(",")));
|
121
|
122
|
}
|
122
|
123
|
});
|
|
@@ -270,16 +271,16 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
|
270
|
271
|
|
271
|
272
|
// 查询账户信息
|
272
|
273
|
QueryWrapper<TaOrgAccount> orgAccountQueryWrapper = new QueryWrapper<>();
|
273
|
|
- orgAccountQueryWrapper.eq("org_id",orgId);
|
274
|
|
- orgAccountQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
|
274
|
+ orgAccountQueryWrapper.eq("org_id", orgId);
|
|
275
|
+ orgAccountQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
|
275
|
276
|
TaOrgAccount taOrgAccount = taOrgAccountMapper.selectOne(orgAccountQueryWrapper);
|
276
|
|
- if(taOrgAccount == null){
|
|
277
|
+ if (taOrgAccount == null) {
|
277
|
278
|
responseBean.addError("账户不存在");
|
278
|
279
|
return responseBean;
|
279
|
280
|
}
|
280
|
281
|
|
281
|
282
|
// 1.校验账户金额
|
282
|
|
- if(amount > CommonUtils.fenToYuan(taOrgAccount.getAvailableBalance())){
|
|
283
|
+ if (amount > CommonUtils.fenToYuan(taOrgAccount.getAvailableBalance())) {
|
283
|
284
|
responseBean.addError("账户可用余额不足,请稍后再试");
|
284
|
285
|
return responseBean;
|
285
|
286
|
}
|
|
@@ -335,6 +336,8 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
|
335
|
336
|
return responseBean;
|
336
|
337
|
}
|
337
|
338
|
|
|
339
|
+ // 5.更新账户新金额
|
|
340
|
+ taOrgAccountMapper.updateAvailableBalanceById(taOrgAccount.getAccountId(), CommonUtils.yuanToFen(amount));
|
338
|
341
|
responseBean.addSuccess(taOrgOrder);
|
339
|
342
|
return responseBean;
|
340
|
343
|
}
|
|
@@ -350,7 +353,14 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
|
350
|
353
|
QueryWrapper<TaOrgAccountCertificate> queryWrapper = new QueryWrapper<>();
|
351
|
354
|
queryWrapper.eq("order_id", r.getOrderId());
|
352
|
355
|
queryWrapper.eq("org_id", orgId);
|
353
|
|
- r.setCertificateList(taOrgAccountCertificateMapper.selectList(queryWrapper));
|
|
356
|
+ List<TaOrgAccountCertificate> accountCertificates = taOrgAccountCertificateMapper.selectList(queryWrapper);
|
|
357
|
+ if (CollectionUtils.isNotEmpty(accountCertificates)) {
|
|
358
|
+ List<String> certificateUrlList = new ArrayList<>();
|
|
359
|
+ accountCertificates.stream().forEach(e -> {
|
|
360
|
+ certificateUrlList.add(e.getUrl());
|
|
361
|
+ });
|
|
362
|
+ r.setCertificateUrlList(certificateUrlList);
|
|
363
|
+ }
|
354
|
364
|
});
|
355
|
365
|
}
|
356
|
366
|
responseBean.addSuccess(pg);
|
|
@@ -379,7 +389,14 @@ public class TaOrgOrderServiceImpl extends ServiceImpl<TaOrgOrderMapper, TaOrgOr
|
379
|
389
|
QueryWrapper<TaOrgAccountCertificate> queryWrapper = new QueryWrapper<>();
|
380
|
390
|
queryWrapper.eq("order_id", r.getOrderId());
|
381
|
391
|
queryWrapper.eq("org_id", orgId);
|
382
|
|
- r.setCertificateList(taOrgAccountCertificateMapper.selectList(queryWrapper));
|
|
392
|
+ List<TaOrgAccountCertificate> accountCertificates = taOrgAccountCertificateMapper.selectList(queryWrapper);
|
|
393
|
+ if (CollectionUtils.isNotEmpty(accountCertificates)) {
|
|
394
|
+ List<String> certificateUrlList = new ArrayList<>();
|
|
395
|
+ accountCertificates.stream().forEach(e -> {
|
|
396
|
+ certificateUrlList.add(e.getUrl());
|
|
397
|
+ });
|
|
398
|
+ r.setCertificateUrlList(certificateUrlList);
|
|
399
|
+ }
|
383
|
400
|
});
|
384
|
401
|
}
|
385
|
402
|
responseBean.addSuccess(pg);
|