no message

This commit is contained in:
wangh 2024-02-07 11:07:03 +08:00
parent bca15b8ae5
commit dd08ddd5f1
9 changed files with 84 additions and 34 deletions

View File

@ -44,5 +44,7 @@ public interface CardFavorableRecordMapper extends BaseMapper<CardFavorableRecor
boolean updateCardAndActiveById(@Param("cardFavorableId") Integer cardFavorableId, @Param("userId") Integer userId, @Param("storeId") Integer storeId);
CardFavorableAdnUserDTO getInfoById(Integer id);
int updateStatus(Integer id);
}

View File

@ -185,5 +185,11 @@
where id = #{id}
</select>
<update id="updateStatus">
update card_favorable_record
set status = 0
where id = #{id}
</update>
</mapper>

View File

@ -74,5 +74,7 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO);
CardFavorableAdnUserDTO getInfoById(Integer id);
int updateStatus(Integer id);
}

View File

@ -361,5 +361,10 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
public CardFavorableAdnUserDTO getInfoById(Integer id) {
return cardFavorableRecordMapper.getInfoById(id);
}
@Override
public int updateStatus(Integer id) {
return cardFavorableRecordMapper.updateStatus(id);
}
}

View File

@ -17,6 +17,7 @@ import com.fuint.business.convenienceSore.entity.StockStatistic;
import com.fuint.business.convenienceSore.entity.StockTrack;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.LJOrder;
@ -212,12 +213,16 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
baseMapper.updateById(allOrderInfo);
// 处理油品订单
OilOrder oilOrder = new OilOrder();
if (ObjectUtil.isNotEmpty(map.get("isGoods")) && "true".equals(map.get("isGoods"))) {
oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo"));
}
oilOrder = oilOrderService.selectOilOrderByOrderNo(map.get("orderNo"));
// 处理商品订单
LJOrder ljOrder = new LJOrder();
ljOrder = ljOrderService.selectGoodsOrder(map.get("orderNo"));
if (ObjectUtil.isNotEmpty(map.get("isOil")) && "true".equals(map.get("isOil"))) {
ljOrder = ljOrderService.selectGoodsOrder(map.get("orderNo"));
}
// 处理收银台订单
CashierOrder orderNo = new CashierOrder();
@ -227,7 +232,13 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
cashierOrderService.updateById(orderNo);
}
if (ObjectUtil.isNotEmpty(oilOrder)) {
disposeOil(oilOrder,map.get("refundOrderNo"));
// 判断是否推掉优惠卷
boolean ifVou = false;
if (ObjectUtil.isNotEmpty(map.get("isOilVouchers")) && "true".equals(map.get("isOilVouchers"))) {
ifVou = true;
}
disposeOil(oilOrder,map.get("refundOrderNo"),ifVou);
commissionRecordService.addRefundRecord(oilOrder.getOrderNo(),"1",oilOrder.getStaffId(),oilOrder.getStoreId());
}
if (ObjectUtil.isNotEmpty(ljOrder)) {
@ -285,8 +296,11 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Resource
UserBalanceService userBalanceService;
@Resource
CardFavorableRecordService cardFavorableRecordService;
// 处理油品
private void disposeOil(OilOrder oilOrder,String refundOrderNo) {
private void disposeOil(OilOrder oilOrder,String refundOrderNo, boolean ifVou) {
// 处理订单状态
oilOrder.setOrderStatus("refund");
oilOrderService.updateById(oilOrder);
@ -319,8 +333,8 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
userBalanceService.addUserOil(order.getOils(),order.getUserId(),nowAccountInfo.getChainStoreId(),order.getOilCardAmount());
}
// 处理优惠券
if (ObjectUtil.isNotEmpty(order.getCouponId())) {
if (ObjectUtil.isNotEmpty(order.getCouponId()) && ifVou) {
cardFavorableRecordService.updateStatus(order.getCouponId());
}
}

View File

@ -84,7 +84,7 @@ public class GlobalExceptionHandler {
public static boolean containsChinese(String str) {
String regex = "[\\u4e00-\\u9fa5]";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(str);
Matcher matcher = pattern. matcher(str);
return matcher.find();
}

View File

@ -293,6 +293,19 @@
</div>
<div class="tk">退款金额</div>
<div class="tk">退款单号{{ cashierOrder.orderNo }}</div>
<span>退款内容</span>
<br>
<span>商品</span>
<el-checkbox v-model="isGoods">{{cashierOrder.goodsPayAmount}}</el-checkbox>
<br>
<span>油品</span>
<el-checkbox v-model="isOil">{{cashierOrder.oilPayAmount}}</el-checkbox>
<el-checkbox v-model="isOilVouchers">优惠卷</el-checkbox>
<div style="margin: 10px 0">
退款原因<br/>
<el-radio-group v-model="radio1" style="margin: 10px 0">
@ -412,6 +425,9 @@ import {formatDate} from "@/utils";
dateRange: [],
beginTime:"",
endTime:"",
isOilVouchers:false,
isGoods: false,
isOil: false,
//
orderList:[],
//
@ -576,29 +592,30 @@ import {formatDate} from "@/utils";
},
// 退
handleRefund(id){
this.dialogRefund = true;
//退
this.$confirm('是否将该收银台下的订单全部退款, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dialogRefund = true;
cashierOrder(id).then( response => {
this.cashierOrder = response.data
if (response.data.status === "refund") {
this.$message({
type: 'info',
message: '该订单已经退款'
});
this.dialogRefund = false;
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
// this.$confirm('退, ?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// this.dialogRefund = true;
// cashierOrder(id).then( response => {
// this.cashierOrder = response.data
// if (response.data.status === "refund") {
// this.$message({
// type: 'info',
// message: '退'
// });
// this.dialogRefund = false;
// }
// })
// }).catch(() => {
// this.$message({
// type: 'info',
// message: ''
// });
// });
},
async refundConfirmed() {
@ -609,7 +626,10 @@ import {formatDate} from "@/utils";
orderNo: this.cashierOrder.orderNo,
storeId: this.cashierOrder.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund"
type: "canRefund",
isOilVouchers:this.isOilVouchers,
isGoods: this.isGoods,
isOil: this.isOil,
}
await refundApi(map).then(res=>{
this.$message({

View File

@ -510,7 +510,8 @@ export default {
storeId: this.goods.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark,
// refAmount: this.
type: "canRefund"
type: "canRefund",
refType: "goodsRef"
}
await refundApi(map).then(res=>{
if (res.code === 200){

View File

@ -582,8 +582,8 @@
storeId: this.oilOrder.storeId,
refundRemark:this.radio1 +"-"+ this.refundRemark,
type: "canRefund",
refundAmt: this.refundAmt,
refType: "oilOrder",
refundAmt: this.payAmount,
refType: "oilOrder",
}
await refundApi(map).then(res=>{
this.$message({