Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -19,9 +19,13 @@ import java.util.Map;
|
||||
public interface TbCreditBuyerOrderMapper extends BaseMapper<TbCreditBuyerOrder> {
|
||||
|
||||
List<CreditBuyerOrderDTO> getList(Map<String, Object> params);
|
||||
|
||||
long getCount(Map<String, Object> params);
|
||||
|
||||
BigDecimal getSumPayAmount(Map<String, Object> params);
|
||||
|
||||
BigDecimal getSumPaidAmount(Map<String, Object> params);
|
||||
|
||||
BigDecimal getSumUnpaidAmount(Map<String, Object> params);
|
||||
|
||||
CreditBuyerOrderDTO getOne(Map<String, Object> params);
|
||||
|
||||
@@ -81,6 +81,11 @@ public class TbCreditBuyerOrderServiceImpl extends ServiceImpl<TbCreditBuyerOrde
|
||||
Map<String, Object> data = new HashMap<>(4);
|
||||
// 总交易笔数
|
||||
data.put("count", count);
|
||||
|
||||
// 总交易金额
|
||||
BigDecimal payAmount = baseMapper.getSumPayAmount(params);
|
||||
data.put("payAmountTotal", payAmount);
|
||||
|
||||
// 未支付
|
||||
params.put("status", "unpaid");
|
||||
long unpaidCount = baseMapper.getCount(params);
|
||||
|
||||
@@ -49,9 +49,9 @@ import java.time.Instant;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
@Service
|
||||
@@ -86,9 +86,11 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||
public JSONObject binding(BindingDto bindingDto) {
|
||||
TbShopInfo tbShopInfo = tbShopInfoRepository.findById(bindingDto.getShopId()).orElseGet(null);
|
||||
TbMerchantAccount account = merchantAccountRepository.findByAccount(tbShopInfo.getAccount());
|
||||
boolean isNew = true;
|
||||
if (org.apache.commons.lang3.StringUtils.isBlank(bindingDto.getAccount())) {
|
||||
if (tbShopInfo != null) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(account.getBindAccount())) {
|
||||
isNew = false;
|
||||
bindingDto.setAccount(account.getBindAccount());
|
||||
} else {
|
||||
return null;
|
||||
@@ -98,7 +100,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("account", bindingDto.getAccount());
|
||||
JSONObject data = bindService.binding(param);
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(bindingDto.getAccount())) {
|
||||
if (isNew) {
|
||||
account.setBindAccount(bindingDto.getAccount());
|
||||
account.setArticle(bindingDto.getArticle());
|
||||
account.setTaxAmount(bindingDto.getTaxAmount());
|
||||
|
||||
@@ -51,6 +51,12 @@
|
||||
order by t1.order_id desc
|
||||
</select>
|
||||
|
||||
<select id="getSumPayAmount" resultType="decimal">
|
||||
select ifnull(sum(t1.pay_amount),0) from view_credit_buyer_order t1
|
||||
<include refid="commonWhere" />
|
||||
order by t1.order_id desc
|
||||
</select>
|
||||
|
||||
<select id="getSumPaidAmount" resultType="decimal">
|
||||
select ifnull(sum(t1.paid_amount),0) from view_credit_buyer_order t1
|
||||
<include refid="commonWhere" />
|
||||
|
||||
Reference in New Issue
Block a user