11.14
This commit is contained in:
parent
6907e0b430
commit
28d72ff386
@ -185,5 +185,9 @@ public class OilOrder extends BaseEntity implements Serializable {
|
|||||||
private Long deptId;
|
private Long deptId;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<Long> storeIds;
|
private List<Long> storeIds;
|
||||||
|
/**
|
||||||
|
* 储值卡赠送金额消费
|
||||||
|
*/
|
||||||
|
private Double balanceGiftAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,7 +636,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
order.setBalanceAmount(Double.valueOf(balanceAmount));
|
order.setBalanceAmount(Double.valueOf(balanceAmount));
|
||||||
order.setOilCardAmount(Double.valueOf(oilCardAmount));
|
order.setOilCardAmount(Double.valueOf(oilCardAmount));
|
||||||
order.setActiveAmount(activeAmount);
|
order.setActiveAmount(activeAmount);
|
||||||
|
order.setBalanceGiftAmount( this.countCardBalance(Double.valueOf(balanceAmount), userId, storeId, orderNo));
|
||||||
order.setStoreId(storeId);
|
order.setStoreId(storeId);
|
||||||
order.setUserId(userId);
|
order.setUserId(userId);
|
||||||
order.setStaffId(staffId);
|
order.setStaffId(staffId);
|
||||||
@ -1935,20 +1935,35 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||||
if (ObjectUtil.isNotEmpty(balance)) {
|
if (ObjectUtil.isNotEmpty(balance)) {
|
||||||
// 修改余额信息
|
|
||||||
Double beforeBalance = balance.getCardBalance();
|
|
||||||
Double afterBalance = beforeBalance - amount;
|
//计算余额
|
||||||
if ((beforeBalance - amount) < 0.0) {
|
//消费金额
|
||||||
|
BigDecimal num1 = new BigDecimal(amount.toString());
|
||||||
|
//总余额
|
||||||
|
BigDecimal num2 = new BigDecimal(balance.getCardBalance().toString());
|
||||||
|
//赠送余额
|
||||||
|
BigDecimal num3 = new BigDecimal(balance.getGiveAmount().toString());
|
||||||
|
//总本金
|
||||||
|
BigDecimal num4 = num2.subtract(num3);
|
||||||
|
//赠送余额比例金额
|
||||||
|
BigDecimal num5 =num3.divide(num4,2,BigDecimal.ROUND_DOWN).multiply(num1).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
|
//剩余赠送余额
|
||||||
|
BigDecimal num6 =num3.subtract(num5);
|
||||||
|
//修改余额信息
|
||||||
|
BigDecimal num7 =num2.subtract(num1);
|
||||||
|
|
||||||
|
if (num7.doubleValue() < 0.0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cardBalanceChange.setAfterTheChange(afterBalance);
|
cardBalanceChange.setAfterTheChange(num7.doubleValue());
|
||||||
balance.setCardBalance(afterBalance);
|
balance.setCardBalance(num7.doubleValue());
|
||||||
|
balance.setGiveAmount(num6.doubleValue());
|
||||||
// 修改加油次数
|
// 修改加油次数
|
||||||
Integer consumeNum = balance.getConsumeNum();
|
Integer consumeNum = balance.getConsumeNum();
|
||||||
balance.setConsumeNum(consumeNum + 1);
|
balance.setConsumeNum(consumeNum + 1);
|
||||||
userBalanceService.updateUserBalance(balance);
|
userBalanceService.updateUserBalance(balance);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加余额记录信息
|
// 添加余额记录信息
|
||||||
cardBalanceChange.setUserId(userId);
|
cardBalanceChange.setUserId(userId);
|
||||||
cardBalanceChange.setChangeType("0");
|
cardBalanceChange.setChangeType("0");
|
||||||
@ -1956,7 +1971,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cardBalanceChange.setBalance(amount);
|
cardBalanceChange.setBalance(amount);
|
||||||
cardBalanceChange.setOrderNo(orderNo);
|
cardBalanceChange.setOrderNo(orderNo);
|
||||||
cardBalanceChange.setStoreId(storeId);
|
cardBalanceChange.setStoreId(storeId);
|
||||||
|
|
||||||
cardBalanceChangeService.insertCardBalance(cardBalanceChange);
|
cardBalanceChangeService.insertCardBalance(cardBalanceChange);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2416,4 +2430,31 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
}
|
}
|
||||||
return baseMapper.selectList(queryWrapper);
|
return baseMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算储值赠送金额的话费
|
||||||
|
*
|
||||||
|
* @param amount
|
||||||
|
* @param userId
|
||||||
|
* @param storeId
|
||||||
|
*/
|
||||||
|
private Double countCardBalance(Double amount, Integer userId, Integer storeId, String orderNo) {
|
||||||
|
// 根据用户id查询用户余额信息
|
||||||
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
|
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||||
|
|
||||||
|
//消费金额
|
||||||
|
BigDecimal num1 = new BigDecimal(amount.toString());
|
||||||
|
//总余额
|
||||||
|
BigDecimal num2 = new BigDecimal(balance.getCardBalance().toString());
|
||||||
|
//赠送余额
|
||||||
|
BigDecimal num3 = new BigDecimal(balance.getGiveAmount().toString());
|
||||||
|
//总本金
|
||||||
|
BigDecimal num4 = num2.subtract(num3);
|
||||||
|
//赠送余额比例金额
|
||||||
|
BigDecimal num5 = num3.divide(num4, 2, BigDecimal.ROUND_DOWN).multiply(num1).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
|
|
||||||
|
return num5.doubleValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.fuint.business.userManager.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LJUserDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//会员人数
|
||||||
|
private Integer userNum ;
|
||||||
|
// 注销会员人数
|
||||||
|
private Integer logOffUserNum ;
|
||||||
|
// 会员总积分
|
||||||
|
private Integer allPoints ;
|
||||||
|
// 消耗积分
|
||||||
|
private Integer consumePoints ;
|
||||||
|
// 会员累计充值
|
||||||
|
private Double accumulateRecharge ;
|
||||||
|
// 会员总余额
|
||||||
|
private Double allBalance ;
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.fuint.business.userManager.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LJUserStaticesDto implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
// 充值总额
|
||||||
|
private Double rechargeAmount;
|
||||||
|
// 充值本金
|
||||||
|
private Double rechargePrincipal;
|
||||||
|
// 充值赠送
|
||||||
|
private Double rechargeGive;
|
||||||
|
// 消费总额
|
||||||
|
private Double consumeAmount;
|
||||||
|
// 消费本金
|
||||||
|
private Double consumePrincipal ;
|
||||||
|
// 消费赠送
|
||||||
|
private Double consumeGive;
|
||||||
|
// 退款总额
|
||||||
|
private Double refundAmount;
|
||||||
|
// 退款本金
|
||||||
|
private Double refundPrincipal;
|
||||||
|
// 退款赠送
|
||||||
|
private Double refundGive0;
|
||||||
|
// 注销总额
|
||||||
|
private Double logOffAmount;
|
||||||
|
// 注销本金
|
||||||
|
private Double logOffPrincipal;
|
||||||
|
// 注销赠送
|
||||||
|
private Double logOffGive;
|
||||||
|
// 会员总余额
|
||||||
|
private Double userBalance;
|
||||||
|
// 剩余本金
|
||||||
|
private Double residuePrincipal;
|
||||||
|
// 剩余赠送
|
||||||
|
private Double residueGive;
|
||||||
|
}
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.userGroup.entity.UserGroup;
|
import com.fuint.business.userGroup.entity.UserGroup;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserDto;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserStaticesDto;
|
||||||
import com.fuint.business.userManager.entity.LJUser;
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
import com.fuint.business.userManager.vo.LJUserVo;
|
import com.fuint.business.userManager.vo.LJUserVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -112,4 +114,8 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
|||||||
Integer selectUserCountByChainStoreId(@Param("chainStoreId") Integer chainStoreId);
|
Integer selectUserCountByChainStoreId(@Param("chainStoreId") Integer chainStoreId);
|
||||||
|
|
||||||
List<LJUserVo> findUserList(@Param("user") LJUserVo user);
|
List<LJUserVo> findUserList(@Param("user") LJUserVo user);
|
||||||
|
|
||||||
|
LJUserDto queryUserMsg(@Param("storeId") Integer storeId);
|
||||||
|
|
||||||
|
LJUserStaticesDto selectAmountStatistics(@Param("storeId") Integer storeId);
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,8 @@
|
|||||||
mub.card_balance cardBalance,
|
mub.card_balance cardBalance,
|
||||||
mub.points,
|
mub.points,
|
||||||
mub.growth_value growthValue,
|
mub.growth_value growthValue,
|
||||||
mub.refuel_money refuelMoney
|
mub.refuel_money refuelMoney,
|
||||||
|
mub.give_amount giveAmount
|
||||||
from mt_user mu
|
from mt_user mu
|
||||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||||
where mu.id = #{userId}
|
where mu.id = #{userId}
|
||||||
@ -419,6 +420,33 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryUserMsg" resultType="com.fuint.business.userManager.dto.LJUserDto">
|
||||||
|
select (SELECT count(id) from mt_user_balance where user_status = 0) as userNum,
|
||||||
|
sum(CASE WHEN mub.user_status = 1 THEN 1 ELSE 0 END) as logOffUserNum,
|
||||||
|
sum(mub.points) as allPoints,
|
||||||
|
sum(mub.used_points) as consumePoints,
|
||||||
|
sum(CASE WHEN cbc.change_type = 1 THEN cbc.balance ELSE 0 END) as accumulateRecharge,
|
||||||
|
sum(mub.card_balance) as allBalance
|
||||||
|
FROM mt_user mu
|
||||||
|
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||||
|
left join card_balance_change cbc on cbc.user_id=mu.id
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAmountStatistics" resultType="com.fuint.business.userManager.dto.LJUserStaticesDto">
|
||||||
|
select (SELECT count(id) from mt_user_balance where user_status = 0) as userNum,
|
||||||
|
sum(CASE WHEN mub.user_status = 1 THEN 1 ELSE 0 END) as logOffUserNum,
|
||||||
|
sum(mub.points) as allPoints,
|
||||||
|
sum(mub.used_points) as consumePoints,
|
||||||
|
sum(CASE WHEN cbc.change_type = 1 THEN cbc.balance ELSE 0 END) as accumulateRecharge,
|
||||||
|
sum(mub.card_balance) as allBalance
|
||||||
|
FROM mt_user mu
|
||||||
|
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||||
|
left join card_balance_change cbc on cbc.user_id=mu.id
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="findUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
<select id="findUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||||
SELECT
|
SELECT
|
||||||
mu.*
|
mu.*
|
||||||
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.fuint.business.userGroup.entity.UserGroup;
|
import com.fuint.business.userGroup.entity.UserGroup;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserDto;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserStaticesDto;
|
||||||
import com.fuint.business.userManager.entity.LJUser;
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
import com.fuint.business.userManager.vo.LJUserVo;
|
import com.fuint.business.userManager.vo.LJUserVo;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -197,13 +199,13 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
* 会员分析-会员统计-会员人数
|
* 会员分析-会员统计-会员人数
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String,Object> selectUserNum();
|
LJUserDto selectUserNum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员分析-会员统计-会员金额统计
|
* 会员分析-会员统计-会员金额统计
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String,Object> selectAmountStatistics();
|
LJUserStaticesDto selectAmountStatistics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员分析-会员统计-会员发放积分统计
|
* 会员分析-会员统计-会员发放积分统计
|
||||||
|
@ -104,4 +104,5 @@ public interface UserBalanceService extends IService<UserBalance> {
|
|||||||
* @param orderNo 订单号
|
* @param orderNo 订单号
|
||||||
*/
|
*/
|
||||||
void growthValue(Integer userId, Integer chainStoreId,Integer storeId, String consumptioType, Double money,String fromType, String orderNo);
|
void growthValue(Integer userId, Integer chainStoreId,Integer storeId, String consumptioType, Double money,String fromType, String orderNo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ import com.fuint.business.order.service.OilOrderService;
|
|||||||
import com.fuint.business.storeInformation.entity.LJStore;
|
import com.fuint.business.storeInformation.entity.LJStore;
|
||||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||||
import com.fuint.business.userGroup.entity.UserGroup;
|
import com.fuint.business.userGroup.entity.UserGroup;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserDto;
|
||||||
|
import com.fuint.business.userManager.dto.LJUserStaticesDto;
|
||||||
import com.fuint.business.userManager.entity.*;
|
import com.fuint.business.userManager.entity.*;
|
||||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||||
import com.fuint.business.userManager.mapper.MtInvitationMapper;
|
import com.fuint.business.userManager.mapper.MtInvitationMapper;
|
||||||
@ -811,142 +813,149 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> selectUserNum() {
|
public LJUserDto selectUserNum() {
|
||||||
Map<String, Object> map = new HashMap<>();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
List<LJUserVo> ljUserVos = selectUsersList();
|
LJUserDto ljUserDto = ljUserMapper.queryUserMsg(nowAccountInfo.getStoreId());
|
||||||
// 会员人数
|
// Map<String, Object> map = new HashMap<>();
|
||||||
Integer userNum = 0;
|
//
|
||||||
// 注销会员人数
|
// List<LJUserVo> ljUserVos = selectUsersList();
|
||||||
Integer logOffUserNum = 0;
|
//
|
||||||
// 会员总积分
|
//// 会员人数
|
||||||
Integer allPoints = 0;
|
// Integer userNum = 0;
|
||||||
// 消耗积分
|
//// 注销会员人数
|
||||||
Integer consumePoints = 0;
|
// Integer logOffUserNum = 0;
|
||||||
// 会员累计充值
|
//// 会员总积分
|
||||||
Double accumulateRecharge = 0.0;
|
// Integer allPoints = 0;
|
||||||
// 会员总余额
|
//// 消耗积分
|
||||||
Double allBalance = 0.0;
|
// Integer consumePoints = 0;
|
||||||
|
//// 会员累计充值
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVos)){
|
// Double accumulateRecharge = 0.0;
|
||||||
userNum = ljUserVos.size();
|
//// 会员总余额
|
||||||
Integer points = 0;
|
// Double allBalance = 0.0;
|
||||||
Double usedAmount = 0.0;
|
//
|
||||||
Double giveAmount = 0.0;
|
// if (ObjectUtil.isNotEmpty(ljUserVos)){
|
||||||
for (LJUserVo ljUserVo : ljUserVos) {
|
// userNum = ljUserVos.size();
|
||||||
points += ljUserVo.getPoints();
|
// Integer points = 0;
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVo.getUsedPoints())) consumePoints += ljUserVo.getUsedPoints();
|
// Double usedAmount = 0.0;
|
||||||
allBalance += ljUserVo.getCardBalance();
|
// Double giveAmount = 0.0;
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVo.getUsedAmount())) usedAmount += ljUserVo.getUsedAmount();
|
// for (LJUserVo ljUserVo : ljUserVos) {
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) giveAmount += ljUserVo.getGiveAmount();
|
// points += ljUserVo.getPoints();
|
||||||
if (ljUserVo.getUserStatus().equals("1")){
|
// if (ObjectUtil.isNotEmpty(ljUserVo.getUsedPoints())) consumePoints += ljUserVo.getUsedPoints();
|
||||||
logOffUserNum += 1;
|
// allBalance += ljUserVo.getCardBalance();
|
||||||
}
|
// if (ObjectUtil.isNotEmpty(ljUserVo.getUsedAmount())) usedAmount += ljUserVo.getUsedAmount();
|
||||||
}
|
// if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) giveAmount += ljUserVo.getGiveAmount();
|
||||||
allPoints = points + consumePoints;
|
// if (ljUserVo.getUserStatus().equals("1")){
|
||||||
accumulateRecharge = allBalance + usedAmount + giveAmount;
|
// logOffUserNum += 1;
|
||||||
allBalance += giveAmount;
|
// }
|
||||||
}
|
// }
|
||||||
|
// allPoints = points + consumePoints;
|
||||||
map.put("userNum",userNum);
|
// accumulateRecharge = allBalance + usedAmount + giveAmount;
|
||||||
map.put("logOffUserNum",logOffUserNum);
|
// allBalance += giveAmount;
|
||||||
map.put("allPoints",allPoints);
|
// }
|
||||||
map.put("consumePoints",consumePoints);
|
//
|
||||||
map.put("accumulateRecharge",accumulateRecharge);
|
// map.put("userNum",userNum);
|
||||||
map.put("allBalance",allBalance);
|
// map.put("logOffUserNum",logOffUserNum);
|
||||||
return map;
|
// map.put("allPoints",allPoints);
|
||||||
|
// map.put("consumePoints",consumePoints);
|
||||||
|
// map.put("accumulateRecharge",accumulateRecharge);
|
||||||
|
// map.put("allBalance",allBalance);
|
||||||
|
return ljUserDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> selectAmountStatistics() {
|
public LJUserStaticesDto selectAmountStatistics() {
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
// 充值总额
|
|
||||||
Double rechargeAmount = 0.0;
|
|
||||||
// 充值本金
|
|
||||||
Double rechargePrincipal = 0.0;
|
|
||||||
// 充值赠送
|
|
||||||
Double rechargeGive = 0.0;
|
|
||||||
// 消费总额
|
|
||||||
Double consumeAmount = 0.0;
|
|
||||||
// 消费本金
|
|
||||||
Double consumePrincipal = 0.0;
|
|
||||||
// 消费赠送
|
|
||||||
Double consumeGive = 0.0;
|
|
||||||
// 退款总额
|
|
||||||
Double refundAmount = 0.0;
|
|
||||||
// 退款本金
|
|
||||||
Double refundPrincipal = 0.0;
|
|
||||||
// 退款赠送
|
|
||||||
Double refundGive = 0.0;
|
|
||||||
// 注销总额
|
|
||||||
Double logOffAmount = 0.0;
|
|
||||||
// 注销本金
|
|
||||||
Double logOffPrincipal = 0.0;
|
|
||||||
// 注销赠送
|
|
||||||
Double logOffGive = 0.0;
|
|
||||||
// 会员总余额
|
|
||||||
Double userBalance = 0.0;
|
|
||||||
// 剩余本金
|
|
||||||
Double residuePrincipal = 0.0;
|
|
||||||
// 剩余赠送
|
|
||||||
Double residueGive = 0.0;
|
|
||||||
BigDecimal bigDecimal = new BigDecimal("0");
|
|
||||||
List<CardBalanceChange> cardBalanceChanges1 = cardBalanceChangeService.selectList("1");
|
|
||||||
if (ObjectUtil.isNotEmpty(cardBalanceChanges1)) {
|
|
||||||
for (CardBalanceChange cardBalanceChange : cardBalanceChanges1) {
|
|
||||||
rechargePrincipal += cardBalanceChange.getBalance();
|
|
||||||
if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
|
||||||
rechargeGive += cardBalanceChange.getGiveBalance();
|
|
||||||
}
|
|
||||||
rechargeAmount += rechargePrincipal + rechargeGive;
|
|
||||||
}
|
|
||||||
List<CardBalanceChange> cardBalanceChanges = cardBalanceChangeService.selectList("0");
|
|
||||||
if (ObjectUtil.isNotEmpty(cardBalanceChanges)) {
|
|
||||||
for (CardBalanceChange cardBalanceChange : cardBalanceChanges) {
|
|
||||||
if (cardBalanceChange.getFromType().equals("油品订单消费")){
|
|
||||||
consumePrincipal += cardBalanceChange.getBalance();
|
|
||||||
if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
|
||||||
consumeGive += cardBalanceChange.getGiveBalance();
|
|
||||||
}else {
|
|
||||||
refundPrincipal += cardBalanceChange.getBalance();
|
|
||||||
if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
|
||||||
refundGive += cardBalanceChange.getGiveBalance();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
consumeAmount = consumePrincipal + consumeGive;
|
|
||||||
refundAmount = refundPrincipal + refundGive;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<LJUserVo> ljUserVos = selectUsersList();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVos)){
|
LJUserStaticesDto ljUserStaticesDto = ljUserMapper.selectAmountStatistics(nowAccountInfo.getStoreId());
|
||||||
for (LJUserVo ljUserVo : ljUserVos) {
|
// Map<String, Object> map = new HashMap<>();
|
||||||
residuePrincipal += ljUserVo.getCardBalance();
|
//// 充值总额
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) residueGive += ljUserVo.getGiveAmount();
|
// Double rechargeAmount = 0.0;
|
||||||
|
//// 充值本金
|
||||||
if (ljUserVo.getUserStatus().equals("1")){
|
// Double rechargePrincipal = 0.0;
|
||||||
logOffPrincipal += ljUserVo.getCardBalance();
|
//// 充值赠送
|
||||||
if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) logOffGive += ljUserVo.getGiveAmount();
|
// Double rechargeGive = 0.0;
|
||||||
}
|
//// 消费总额
|
||||||
}
|
// Double consumeAmount = 0.0;
|
||||||
logOffAmount = logOffPrincipal + logOffGive;
|
//// 消费本金
|
||||||
userBalance = residuePrincipal + residueGive;
|
// Double consumePrincipal = 0.0;
|
||||||
}
|
//// 消费赠送
|
||||||
|
// Double consumeGive = 0.0;
|
||||||
map.put("rechargeAmount",rechargeAmount);
|
//// 退款总额
|
||||||
map.put("rechargePrincipal",rechargePrincipal);
|
// Double refundAmount = 0.0;
|
||||||
map.put("rechargeGive",rechargeGive);
|
//// 退款本金
|
||||||
map.put("consumeAmount",consumeAmount);
|
// Double refundPrincipal = 0.0;
|
||||||
map.put("consumePrincipal",consumePrincipal);
|
//// 退款赠送
|
||||||
map.put("consumeGive",consumeGive);
|
// Double refundGive = 0.0;
|
||||||
map.put("refundAmount",refundAmount);
|
//// 注销总额
|
||||||
map.put("refundPrincipal",refundPrincipal);
|
// Double logOffAmount = 0.0;
|
||||||
map.put("refundGive",refundGive);
|
//// 注销本金
|
||||||
map.put("logOffAmount",logOffAmount);
|
// Double logOffPrincipal = 0.0;
|
||||||
map.put("logOffPrincipal",logOffPrincipal);
|
//// 注销赠送
|
||||||
map.put("logOffGive",logOffGive);
|
// Double logOffGive = 0.0;
|
||||||
map.put("userBalance",userBalance);
|
//// 会员总余额
|
||||||
map.put("residuePrincipal",residuePrincipal);
|
// Double userBalance = 0.0;
|
||||||
map.put("residueGive",residueGive);
|
//// 剩余本金
|
||||||
return map;
|
// Double residuePrincipal = 0.0;
|
||||||
|
//// 剩余赠送
|
||||||
|
// Double residueGive = 0.0;
|
||||||
|
// BigDecimal bigDecimal = new BigDecimal("0");
|
||||||
|
// List<CardBalanceChange> cardBalanceChanges1 = cardBalanceChangeService.selectList("1");
|
||||||
|
// if (ObjectUtil.isNotEmpty(cardBalanceChanges1)) {
|
||||||
|
// for (CardBalanceChange cardBalanceChange : cardBalanceChanges1) {
|
||||||
|
// rechargePrincipal += cardBalanceChange.getBalance();
|
||||||
|
// if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
||||||
|
// rechargeGive += cardBalanceChange.getGiveBalance();
|
||||||
|
// }
|
||||||
|
// rechargeAmount += rechargePrincipal + rechargeGive;
|
||||||
|
// }
|
||||||
|
// List<CardBalanceChange> cardBalanceChanges = cardBalanceChangeService.selectList("0");
|
||||||
|
// if (ObjectUtil.isNotEmpty(cardBalanceChanges)) {
|
||||||
|
// for (CardBalanceChange cardBalanceChange : cardBalanceChanges) {
|
||||||
|
// if (cardBalanceChange.getFromType().equals("油品订单消费")){
|
||||||
|
// consumePrincipal += cardBalanceChange.getBalance();
|
||||||
|
// if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
||||||
|
// consumeGive += cardBalanceChange.getGiveBalance();
|
||||||
|
// }else {
|
||||||
|
// refundPrincipal += cardBalanceChange.getBalance();
|
||||||
|
// if (ObjectUtil.isNotEmpty(cardBalanceChange.getGiveBalance()))
|
||||||
|
// refundGive += cardBalanceChange.getGiveBalance();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// consumeAmount = consumePrincipal + consumeGive;
|
||||||
|
// refundAmount = refundPrincipal + refundGive;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<LJUserVo> ljUserVos = selectUsersList();
|
||||||
|
// if (ObjectUtil.isNotEmpty(ljUserVos)){
|
||||||
|
// for (LJUserVo ljUserVo : ljUserVos) {
|
||||||
|
// residuePrincipal += ljUserVo.getCardBalance();
|
||||||
|
// if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) residueGive += ljUserVo.getGiveAmount();
|
||||||
|
//
|
||||||
|
// if (ljUserVo.getUserStatus().equals("1")){
|
||||||
|
// logOffPrincipal += ljUserVo.getCardBalance();
|
||||||
|
// if (ObjectUtil.isNotEmpty(ljUserVo.getGiveAmount())) logOffGive += ljUserVo.getGiveAmount();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// logOffAmount = logOffPrincipal + logOffGive;
|
||||||
|
// userBalance = residuePrincipal + residueGive;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// map.put("rechargeAmount",rechargeAmount);
|
||||||
|
// map.put("rechargePrincipal",rechargePrincipal);
|
||||||
|
// map.put("rechargeGive",rechargeGive);
|
||||||
|
// map.put("consumeAmount",consumeAmount);
|
||||||
|
// map.put("consumePrincipal",consumePrincipal);
|
||||||
|
// map.put("consumeGive",consumeGive);
|
||||||
|
// map.put("refundAmount",refundAmount);
|
||||||
|
// map.put("refundPrincipal",refundPrincipal);
|
||||||
|
// map.put("refundGive",refundGive);
|
||||||
|
// map.put("logOffAmount",logOffAmount);
|
||||||
|
// map.put("logOffPrincipal",logOffPrincipal);
|
||||||
|
// map.put("logOffGive",logOffGive);
|
||||||
|
// map.put("userBalance",userBalance);
|
||||||
|
// map.put("residuePrincipal",residuePrincipal);
|
||||||
|
// map.put("residueGive",residueGive);
|
||||||
|
return ljUserStaticesDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -568,6 +568,7 @@ export default {
|
|||||||
dicts: ['CardCoupon_type'],
|
dicts: ['CardCoupon_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
orderNo:'',
|
||||||
disOil: 0.00,
|
disOil: 0.00,
|
||||||
disGoods: 0.00,
|
disGoods: 0.00,
|
||||||
loadingPreferential: false,
|
loadingPreferential: false,
|
||||||
@ -1053,6 +1054,7 @@ export default {
|
|||||||
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
|
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
|
||||||
if (response.data != null) {
|
if (response.data != null) {
|
||||||
const payStatus = response.data.payStatus
|
const payStatus = response.data.payStatus
|
||||||
|
this_.orderNo=response.data.paymentNo
|
||||||
if (payStatus === "unpaid") {
|
if (payStatus === "unpaid") {
|
||||||
this_.isQuery = true;
|
this_.isQuery = true;
|
||||||
} else if (payStatus === "paid") {
|
} else if (payStatus === "paid") {
|
||||||
@ -1118,7 +1120,6 @@ export default {
|
|||||||
this.$message.error('请选择输入充值本金');
|
this.$message.error('请选择输入充值本金');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(selectCard,1122)
|
|
||||||
this.payForm.rechargeBalance = selectCard.rechargeBalance
|
this.payForm.rechargeBalance = selectCard.rechargeBalance
|
||||||
this.payForm.lockupPrice = selectCard.lockupPrice
|
this.payForm.lockupPrice = selectCard.lockupPrice
|
||||||
this.payForm.realyPayBills = selectCard.rechargeBalance
|
this.payForm.realyPayBills = selectCard.rechargeBalance
|
||||||
@ -1227,8 +1228,13 @@ export default {
|
|||||||
console.log(1226)
|
console.log(1226)
|
||||||
let payTypeText = payTypeMap[this.payForm.paymentType]
|
let payTypeText = payTypeMap[this.payForm.paymentType]
|
||||||
let actualPay = this.payForm.paymentType == 'CASH' ? this.payForm.authCode:this.payForm.realyPayBills
|
let actualPay = this.payForm.paymentType == 'CASH' ? this.payForm.authCode:this.payForm.realyPayBills
|
||||||
|
let mm=[]
|
||||||
|
mm.push({
|
||||||
|
orderNo:this.orderNo,
|
||||||
|
payUser:this.chooseVipUser.mobile
|
||||||
|
})
|
||||||
let a = {
|
let a = {
|
||||||
|
oilOrder:mm,
|
||||||
// 充值金额
|
// 充值金额
|
||||||
realyPayBills:this.payForm.realyPayBills,
|
realyPayBills:this.payForm.realyPayBills,
|
||||||
//赠送金额
|
//赠送金额
|
||||||
@ -1430,10 +1436,11 @@ export default {
|
|||||||
|
|
||||||
let isPaySuccess = false;
|
let isPaySuccess = false;
|
||||||
console.log(_this.payForm, 1089)
|
console.log(_this.payForm, 1089)
|
||||||
|
_this.payForm.cardCouponList=null
|
||||||
// 调用 支付接口 并产生 订单 返回订单号
|
// 调用 支付接口 并产生 订单 返回订单号
|
||||||
await addLJGoods(_this.payForm).then(async response => {
|
await addLJGoods(_this.payForm).then(async response => {
|
||||||
_this.orderNo = response.data.orderNo;
|
_this.orderNo = response.data.orderNo;
|
||||||
|
this.orderNo = response.data.orderNo;
|
||||||
//支付成功 后需要打印小票
|
//支付成功 后需要打印小票
|
||||||
console.log("支付成功", response)
|
console.log("支付成功", response)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user