no message

This commit is contained in:
wangh 2024-02-06 15:48:25 +08:00
parent 614387248f
commit 7e48ac59dd
13 changed files with 180 additions and 33 deletions

View File

@ -174,5 +174,13 @@ public class CardFavorableRecordController extends BaseController {
public ResponseObject selectCount(@Param("cardFuelDiesel") CardFavorableRecord cardFavorableRecord) { public ResponseObject selectCount(@Param("cardFuelDiesel") CardFavorableRecord cardFavorableRecord) {
return getSuccessResult(this.cardFavorableRecordService.selectCount(cardFavorableRecord)); return getSuccessResult(this.cardFavorableRecordService.selectCount(cardFavorableRecord));
} }
/**
* 查询优惠券信息
*/
@GetMapping("getInfoById/{id}")
public ResponseObject getInfoById(@PathVariable("id") Integer id) {
return getSuccessResult(this.cardFavorableRecordService.getInfoById(id));
}
} }

View File

@ -15,4 +15,7 @@ public class CardFavorableAdnUserDTO extends CardFavorable {
private List<Integer> gradeIds; private List<Integer> gradeIds;
//天数 //天数
private Integer days; private Integer days;
//优惠卷名称
private String favorableName;
} }

View File

@ -4,6 +4,7 @@ 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.marketingActivity.activeExchange.dto.PaymentActiveDTO; import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableAdnUserDTO;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS; import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS;
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;
@ -41,5 +42,7 @@ public interface CardFavorableRecordMapper extends BaseMapper<CardFavorableRecor
List<CardFavorableRecordVO> getCanUserCardFavorableList(@Param("paymentActiveDTO") PaymentActiveDTO paymentActiveDTO); List<CardFavorableRecordVO> getCanUserCardFavorableList(@Param("paymentActiveDTO") PaymentActiveDTO paymentActiveDTO);
boolean updateCardAndActiveById(@Param("cardFavorableId") Integer cardFavorableId, @Param("userId") Integer userId, @Param("storeId") Integer storeId); boolean updateCardAndActiveById(@Param("cardFavorableId") Integer cardFavorableId, @Param("userId") Integer userId, @Param("storeId") Integer storeId);
CardFavorableAdnUserDTO getInfoById(Integer id);
} }

View File

@ -176,5 +176,14 @@
and mt_user_id = #{userId} and mt_user_id = #{userId}
and store_id = #{storeId} and store_id = #{storeId}
</update> </update>
<select id="getInfoById"
resultType="com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableAdnUserDTO">
select cf.name favorableName
from card_favorable_record cfr
LEFT JOIN card_favorable_record cf ON cf.id = cfr.card_favorable_id
where id = #{id}
</select>
</mapper> </mapper>

View File

@ -72,5 +72,7 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
* @return * @return
*/ */
boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO); boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO);
CardFavorableAdnUserDTO getInfoById(Integer id);
} }

View File

@ -355,5 +355,11 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
} }
return flag; return flag;
} }
@Override
public CardFavorableAdnUserDTO getInfoById(Integer id) {
return cardFavorableRecordMapper.getInfoById(id);
}
} }

View File

@ -30,6 +30,9 @@ import com.fuint.business.petrolStationManagement.entity.OilTracking;
import com.fuint.business.petrolStationManagement.service.OilGunService; import com.fuint.business.petrolStationManagement.service.OilGunService;
import com.fuint.business.petrolStationManagement.service.OilTankService; import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.service.OilTrackingService; import com.fuint.business.petrolStationManagement.service.OilTrackingService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtOpenGiftMapper; import com.fuint.repository.mapper.MtOpenGiftMapper;
import com.fuint.repository.model.MtOrderGoods; import com.fuint.repository.model.MtOrderGoods;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -170,10 +173,10 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
// BigDecimal payMoneyBig = new BigDecimal(allOrderInfo.getPayMoney().toString()); // BigDecimal payMoneyBig = new BigDecimal(allOrderInfo.getPayMoney().toString());
// BigDecimal payMoneyBefBig = payMoneyBig.multiply(new BigDecimal("100")).stripTrailingZeros(); // BigDecimal payMoneyBefBig = payMoneyBig.multiply(new BigDecimal("100")).stripTrailingZeros();
// 退款金额(暂不支持部分退款) // 退款金额(暂不支持部分退款)
// BigDecimal refundAmtBig = new BigDecimal(map.get("refundAmt")); BigDecimal refundAmtBig = new BigDecimal(map.get("refundAmt"));
// BigDecimal refundAmtBefBig = refundAmtBig.multiply(new BigDecimal("100")); BigDecimal refundAmtBefBig = refundAmtBig.multiply(new BigDecimal("100"));
map.put("totalAmt",money.toString()); map.put("totalAmt",money.toString());
map.put("refundAmt",money.toString()); map.put("refundAmt",refundAmtBefBig.toString());
map.put("orderNo",allOrderInfo.getOrderNo()); map.put("orderNo",allOrderInfo.getOrderNo());
map.put("payType",allOrderInfo.getPayType()); map.put("payType",allOrderInfo.getPayType());
@ -208,11 +211,17 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
allOrderInfo.setRefOrderNo(map.get("refundOrderNo")); allOrderInfo.setRefOrderNo(map.get("refundOrderNo"));
baseMapper.updateById(allOrderInfo); baseMapper.updateById(allOrderInfo);
// 处理油品订单 // 处理油品订单
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo")); OilOrder oilOrder = new OilOrder();
oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo"));
// 处理商品订单 // 处理商品订单
LJOrder ljOrder = ljOrderService.selectGoodsOrder(map.get("orderNo")); LJOrder ljOrder = new LJOrder();
ljOrder = ljOrderService.selectGoodsOrder(map.get("orderNo"));
// 处理收银台订单 // 处理收银台订单
CashierOrder orderNo = cashierOrderService.selectCashierOrder(map.get("orderNo")); CashierOrder orderNo = new CashierOrder();
orderNo = cashierOrderService.selectCashierOrder(map.get("orderNo"));
if (ObjectUtil.isNotEmpty(orderNo)) { if (ObjectUtil.isNotEmpty(orderNo)) {
orderNo.setStatus("refund"); orderNo.setStatus("refund");
cashierOrderService.updateById(orderNo); cashierOrderService.updateById(orderNo);
@ -264,7 +273,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
// 商户号 // 商户号
map.put("mchntCd", merchantConfig.getMchntCd()); map.put("mchntCd", merchantConfig.getMchntCd());
// 生成退款id // 生成退款id
map.put("refundOrderNo",allOrderInfo.getOrderNo() + "_rref"); map.put("refundOrderNo",allOrderInfo.getOrderNo() + "_ref");
map.put("publicKey",merchantConfig.getPublicKey()); map.put("publicKey",merchantConfig.getPublicKey());
map.put("privateKey",merchantConfig.getPrivateKey()); map.put("privateKey",merchantConfig.getPrivateKey());
return map; return map;
@ -273,12 +282,18 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Resource @Resource
OilGunService oilGunService; OilGunService oilGunService;
@Resource
UserBalanceService userBalanceService;
// 处理油品 // 处理油品
private void disposeOil(OilOrder oilOrder,String refundOrderNo) { private void disposeOil(OilOrder oilOrder,String refundOrderNo) {
// 处理订单状态 // 处理订单状态
oilOrder.setOrderStatus("refund"); oilOrder.setOrderStatus("refund");
oilOrderService.updateById(oilOrder); oilOrderService.updateById(oilOrder);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 获取所有当前订单的数据 // 获取所有当前订单的数据
List<OilOrder> oilOrders = oilOrderService.selectOilOrder(oilOrder.getOrderNo()); List<OilOrder> oilOrders = oilOrderService.selectOilOrder(oilOrder.getOrderNo());
// 获取油罐数据 // 获取油罐数据
@ -296,12 +311,17 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
OilTracking insert = oilTrackingService.insert(oilTracking); OilTracking insert = oilTrackingService.insert(oilTracking);
// 处理储值卡 // 处理储值卡
// if (ObjectUtil.isNotEmpty()) {} if (ObjectUtil.isNotEmpty(order.getBalanceAmount())) {
userBalanceService.addUserBalance(order.getUserId(),nowAccountInfo.getChainStoreId(),order.getBalanceAmount());
}
// 处理屯油卡 // 处理屯油卡
// if (ObjectUtil.isNotEmpty()) {} if (ObjectUtil.isNotEmpty(order.getOilCardAmount())) {
userBalanceService.addUserOil(order.getOils(),order.getUserId(),nowAccountInfo.getChainStoreId(),order.getOilCardAmount());
}
// 处理优惠券 // 处理优惠券
// if (ObjectUtil.isNotEmpty()) {} if (ObjectUtil.isNotEmpty(order.getCouponId())) {
}
} }

View File

@ -7,4 +7,8 @@ import com.fuint.business.userManager.vo.UserBalanceVo;
public interface UserBalanceMapper extends BaseMapper<UserBalance> { public interface UserBalanceMapper extends BaseMapper<UserBalance> {
int subtractUserBalanceByLock(UserBalanceVo balance); int subtractUserBalanceByLock(UserBalanceVo balance);
int updateRefuelMoney(UserBalance userBalance);
int addUserBalance(Integer id, Double changeCardBalance);
} }

View File

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.userManager.mapper.UserBalanceMapper"> <mapper namespace="com.fuint.business.userManager.mapper.UserBalanceMapper">
<update id="subtractUserBalanceByLock"> <update id="subtractUserBalanceByLock">
update mt_user_balance update mt_user_balance
<set> <set>
@ -17,4 +18,18 @@
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateRefuelMoney">
update mt_user_balance
set
refuel_money = #{refuelMoney}
where id = #{id}
</update>
<update id="addUserBalance">
update mt_user_balance
set
card_balance = card_balance +#{changeCardBalance}
where id = #{id}
</update>
</mapper> </mapper>

View File

@ -64,4 +64,8 @@ public interface UserBalanceService extends IService<UserBalance> {
int subtractUserBalanceByLock(UserBalanceVo balance); int subtractUserBalanceByLock(UserBalanceVo balance);
int addUserOil(String oilId, Integer userId, Integer chainStoreId, Double changeOil);
int addUserBalance(Integer userId, Integer chainStoreId, Double changeBalance);
} }

View File

@ -1,6 +1,9 @@
package com.fuint.business.userManager.service.impl; package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.entity.LJStore;
@ -14,11 +17,14 @@ import com.fuint.business.userManager.vo.UserBalanceVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.RedisLock; import com.fuint.common.util.RedisLock;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
@ -58,12 +64,45 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
public int addUserBalanceByLock(UserBalanceVo balance) { public int addUserBalanceByLock(Integer oilId, Integer userId, Integer changeBalance) {
int row = baseMapper.updateById(balance); // int row = baseMapper.addUserBalance(balance);
return 0;
}
// 增加用户的油品信息
@Override
public int addUserOil(String oilId, Integer userId, Integer chainStoreId, Double changeOil) {
UserBalance userBalance = selectUserBalance(userId, chainStoreId);
if(ObjectUtil.isNotEmpty(userBalance)&& ObjectUtil.isNotEmpty(userBalance.getRefuelMoney())) {
List<Map<String, String>> resultMapList = JSON.parseObject(userBalance.getRefuelMoney(), new TypeReference<List<Map<String, Object>>>() {});
for (Map<String, String> stringStringMap : resultMapList) {
if (oilId.equals(stringStringMap.get("oilType"))) {
BigDecimal resRefuelMoney = new BigDecimal(stringStringMap.get("refuelMoney"));
BigDecimal refuelMoney = resRefuelMoney.add(new BigDecimal(changeOil.toString()));
stringStringMap.put("refuelMoney",resRefuelMoney.toString());
break;
}
}
String jsonString = JSON.toJSONString(resultMapList);
userBalance.setRefuelMoney(jsonString);
}
int row = baseMapper.updateRefuelMoney(userBalance);
return row; return row;
} }
// 增加用户余额信息
@Override
public int addUserBalance(Integer userId, Integer chainStoreId, Double changeBalance) {
UserBalance userBalance = selectUserBalance(userId, chainStoreId);
return baseMapper.addUserBalance(userBalance.getId(), changeBalance);
}
@Resource @Resource
RedisLock redisLock; RedisLock redisLock;

View File

@ -8,3 +8,13 @@ export function listCardFavorableRecord(cardValueRecord) {
params: cardValueRecord params: cardValueRecord
}) })
} }
// 根据id查询
export function getInfoByIdApi(id) {
return request({
url: '/business/marketingActivity/cardFavorableRecord/getInfoById/'+id,
method: 'get',
// params: cardValueRecord
})
}

View File

@ -252,11 +252,11 @@
<div class="tk">订单金额</div> <div class="tk">订单金额</div>
<div class="tk">退款单号{{ oilOrder.orderNo }}</div> <div class="tk">退款单号{{ oilOrder.orderNo }}</div>
<!-- <el-input placeholder="请输入退款金额" v-model="refundRemark"></el-input>--> <!-- <el-input placeholder="请输入退款金额" v-model="refundAmt"></el-input>-->
<!-- 是否推掉优惠券--> <!-- 是否推掉优惠券-->
<br> <br>
<span>是否退掉优惠券: </span> <span>是否退掉优惠券: </span>
<el-checkbox>优惠卷信息</el-checkbox> <el-checkbox v-model="isOilVouchers">优惠卷信息</el-checkbox>
<div style="margin: 10px 0"> <div style="margin: 10px 0">
退款原因<br/> 退款原因<br/>
@ -327,6 +327,7 @@
import {getOrderInfoApi, refundApi} from "@/api/cashier/refund"; import {getOrderInfoApi, refundApi} from "@/api/cashier/refund";
import {exportExcelOilOrderApi} from "@/api/order/exportExcel"; import {exportExcelOilOrderApi} from "@/api/order/exportExcel";
import {getLodop} from "@/api/LodopFuncs"; import {getLodop} from "@/api/LodopFuncs";
import {getInfoByIdApi} from "@/api/cashier/cardfavorablerecord";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
@ -340,7 +341,8 @@
radio1:"油号选错", radio1:"油号选错",
dialogRefund:false, dialogRefund:false,
loading: false, loading: false,
// 退
isOilVouchers:false,
// //
staffList:[], staffList:[],
// //
@ -367,6 +369,8 @@
// //
userList:[], userList:[],
// 退
refundAmt:0,
orderStatistics: { orderStatistics: {
numberOfOilPens:'0', numberOfOilPens:'0',
theTotalAmountOfOil:'0', theTotalAmountOfOil:'0',
@ -529,16 +533,17 @@
this.oilOrder = response.data this.oilOrder = response.data
}) })
let title = '是否将该收银台下的订单全部退款' let title = ''
await getOrderInfoApi({orderNo: this.oilOrder.orderNo, await getOrderInfoApi({orderNo: this.oilOrder.orderNo,
type: 'oil'}).then(res=>{ type: 'oil'}).then(res=>{
if (res.code === 200) { if (res.code === 200) {
if (res.data.type === "1") { if (res.data.type === "1") {
title = '该订单下有其它商品订单,是否一并退款' title = '该订单下有其它商品订单,退款之后商品将不能图退款'
this.oilOrder.payAmount = res.data.money this.oilOrder.payAmount = res.data.money
} }
} }
}); });
if (title) {
//退 //退
this.$confirm(title+', 是否继续?', '提示', { this.$confirm(title+', 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -553,20 +558,31 @@
message: '已取消退款' message: '已取消退款'
}); });
}); });
} else {
this.dialogRefund = true;
}
}, },
async refundConfirmed() { async refundConfirmed() {
// if (!this.refundAmt) {
// this.$message({
// type: 'info',
// message: '退'
// });
// return
// }
this.dialogRefund = false; this.dialogRefund = false;
this.loading = true; this.loading = true;
console.log("cashierOrder",this.cashierOrder) console.log("cashierOrder",this.cashierOrder)
let map={ let map={
// 退
isOilVouchers : this.isOilVouchers,
orderNo: this.oilOrder.orderNo, orderNo: this.oilOrder.orderNo,
storeId: this.oilOrder.storeId, storeId: this.oilOrder.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark, refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund", type: "canRefund",
refundAmt: this.refundAmt,
refType: "oilOrder", refType: "oilOrder",
} }
await refundApi(map).then(res=>{ await refundApi(map).then(res=>{
@ -580,6 +596,14 @@
this.getList(); this.getList();
}, },
//
getInfoById() {
getInfoByIdApi().then(res=>{
})
},
// id // id
queryStaf(list,id){ queryStaf(list,id){
let name = ""; let name = "";