1
This commit is contained in:
parent
1616a61843
commit
9800c2695f
@ -64,7 +64,7 @@ public class IndependentAccountServiceImpl implements IndependentAccountService
|
||||
}
|
||||
|
||||
IndependentAccount independentAccount = independentAccountDao.selectOne(new LambdaQueryWrapper<IndependentAccount>().eq(IndependentAccount::getProxyId, proxyOperater.getPkId()).eq(IndependentAccount::getStatus, 0), false);
|
||||
if(ObjectUtils.isEmpty(proxyOperater)){
|
||||
if(ObjectUtils.isEmpty(independentAccount)){
|
||||
independentAccount = new IndependentAccount();
|
||||
independentAccount.setIndependentAccountBegin(new Date());
|
||||
independentAccount.setStatus(0);
|
||||
@ -112,10 +112,10 @@ public class IndependentAccountServiceImpl implements IndependentAccountService
|
||||
|
||||
private static <T> T calculate(T baseNum, T addNum){
|
||||
BigDecimal va = new BigDecimal(String.valueOf((ObjectUtils.isEmpty(baseNum) ? 0 : baseNum))).add(new BigDecimal(String.valueOf(addNum)));
|
||||
if(baseNum instanceof Integer){
|
||||
if(addNum instanceof Integer){
|
||||
return (T)Integer.valueOf(va.intValue());
|
||||
}
|
||||
if(baseNum instanceof Double){
|
||||
if(addNum instanceof Double){
|
||||
return (T)Double.valueOf(va.doubleValue());
|
||||
}
|
||||
return baseNum;
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -19,6 +20,7 @@ import com.evotech.hd.cloud.mqtt.message.dto.newer.req.battery.BatterySwapReq;
|
||||
import com.evotech.hd.cloud.mqtt.message.dto.newer.state.OrderStatusData;
|
||||
import com.evotech.hd.cloud.mqtt.message.handle.MessageUtilService;
|
||||
import com.evotech.hd.cloud.service.OrderSwapBatteryService;
|
||||
import com.evotech.hd.cloud.service.TaxPointService;
|
||||
import com.evotech.hd.cloud.service.TradeService;
|
||||
import com.evotech.hd.cloud.service.WalletAccountService;
|
||||
import com.evotech.hd.cloud.service.newthread.GZHTemplateMessageService;
|
||||
@ -86,6 +88,8 @@ public class OrderSwapBatteryServiceImpl implements OrderSwapBatteryService {
|
||||
private BatteryStationDao batteryStationDao;
|
||||
@Resource
|
||||
private GZHTemplateMessageService gzhTemplateMessageService;
|
||||
@Resource
|
||||
TaxPointService taxPointService;
|
||||
|
||||
@Override
|
||||
public Result<Integer> addPre(OrderSwapBatteryPre osbp) {
|
||||
@ -475,6 +479,14 @@ public class OrderSwapBatteryServiceImpl implements OrderSwapBatteryService {
|
||||
order.setTradeNo(trade.getOutTradeNo());
|
||||
order.setUptime(null);
|
||||
orderSwapBatteryDao.updateById(order);
|
||||
|
||||
//税点信息记录
|
||||
try {
|
||||
taxPointService.addTaxPoint(order.getPkId(), order.getOrderNo(), Double.valueOf(order.getAmount()), order.getStationCode());
|
||||
} catch (Exception e) {
|
||||
log.error("余额支付=====生成税点信息异常,订单信息{}; 异常信息{}", JSON.toJSONString(order), e.getMessage());
|
||||
}
|
||||
|
||||
return new Result<String>().success("OK");
|
||||
}
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
select
|
||||
account.pk_id,
|
||||
account.proxy_id,
|
||||
account.porxy_name,
|
||||
account.proxy_name,
|
||||
ifnull(account.order_count, 0) as order_count,
|
||||
ifnull(account.account_total_amount, 0) as account_total_amount,
|
||||
ifnull(account.order_total_amount, 0) as order_total_amount,
|
||||
@ -39,7 +39,7 @@
|
||||
account.independent_account_end,
|
||||
account.status
|
||||
from hd_resource.yt_t_proxy_operater proxy
|
||||
left join yt_t_independent_account account on account.porxy_id = proxy.pk_id
|
||||
left join yt_t_independent_account account on account.proxy_id = proxy.pk_id
|
||||
where
|
||||
account.status = #{params.status}
|
||||
<if test="params.proxyId != null ">
|
||||
@ -50,27 +50,22 @@
|
||||
|
||||
<select id="countAmount" resultMap="BaseResultMap">
|
||||
select
|
||||
account.pk_id,
|
||||
account.proxy_id,
|
||||
account.porxy_name,
|
||||
sum(ifnull(account.order_count, 0)) as order_count,
|
||||
sum(ifnull(account.account_total_amount, 0)) as account_total_amount,
|
||||
sum(ifnull(account.order_total_amount, 0)) as order_total_amount,
|
||||
sum(ifnull(account.tax_point_total_amount, 0)) as tax_point_total_amount,
|
||||
sum(ifnull(account.total_amount, 0)) as total_amount,
|
||||
sum(ifnull(account.handling_fee, 0)) as handling_fee,
|
||||
sum(ifnull(account.total_handling_fee, 0)) as total_handling_fee,
|
||||
account.independent_account_begin,
|
||||
account.independent_account_end,
|
||||
account.status
|
||||
sum(ifnull(account.total_handling_fee, 0)) as total_handling_fee
|
||||
|
||||
from hd_resource.yt_t_proxy_operater proxy
|
||||
left join yt_t_independent_account account on account.porxy_id = proxy.pk_id
|
||||
left join yt_t_independent_account account on account.proxy_id = proxy.pk_id
|
||||
where
|
||||
account.status = #{params.status}
|
||||
<if test="params.proxyId != null ">
|
||||
and account.proxy_id = #{params.proxyId}
|
||||
</if>
|
||||
order by account.pk_id desc
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -1,18 +1,14 @@
|
||||
package com.evotech.hd.wechat.utils.wechatpay;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||
import com.evotech.hd.common.core.entity.cloud.WalletAccount;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.evotech.hd.common.core.dao.wechat.WechatPayPreOrderDao;
|
||||
import com.evotech.hd.common.core.dao.wechat.WechatUserDao;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.TradeDetail;
|
||||
import com.evotech.hd.common.core.entity.cloud.WalletAccount;
|
||||
import com.evotech.hd.common.core.entity.wechat.WechatPayAttach;
|
||||
import com.evotech.hd.common.core.entity.wechat.WechatPayPreOrder;
|
||||
import com.evotech.hd.common.core.entity.wechat.WechatUser;
|
||||
@ -22,12 +18,13 @@ import com.evotech.hd.common.core.enums.WechatPayApiTypeEnums;
|
||||
import com.evotech.hd.wechat.service.rpc.CloudService;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction.TradeTypeEnum;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class WechatPayComponent {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user