bug
This commit is contained in:
parent
63f4fcfbf4
commit
206f171544
@ -9,6 +9,15 @@ export function listLJGoods(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询商品列表
|
||||
export function queryGoodsVoList(query) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/queryGoodsVoList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询商品详细
|
||||
export function getLJGoods(id) {
|
||||
return request({
|
||||
|
@ -7,10 +7,18 @@
|
||||
<el-tab-pane label="商品回收站" name="recovery"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form-item label="商品分类" prop="cvsGoodId">
|
||||
<el-cascader v-model="cvsGoodId"
|
||||
:options="cvsGoodOptions"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable></el-cascader>
|
||||
<el-select
|
||||
v-model="form.cvsGoodId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
<!-- <el-cascader v-model="cvsGoodId"-->
|
||||
<!-- :options="cvsGoodOptions"-->
|
||||
<!-- :props="{ checkStrictly: true }"-->
|
||||
<!-- clearable></el-cascader>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select
|
||||
@ -193,18 +201,18 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属分类" prop="cvsGoodId">
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="form.cvsGoodId"-->
|
||||
<!-- placeholder="全部"-->
|
||||
<!-- clearable-->
|
||||
<!-- style="width: 300px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>-->
|
||||
<!-- </el-select>-->
|
||||
<el-cascader v-model="cvsGoodId"
|
||||
:options="cvsGoodOptions"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable></el-cascader>
|
||||
<el-select
|
||||
v-model="form.cvsGoodId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
<!-- <el-cascader v-model="cvsGoodId"-->
|
||||
<!-- :options="cvsGoodOptions"-->
|
||||
<!-- :props="{ checkStrictly: true }"-->
|
||||
<!-- clearable></el-cascader>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -3,11 +3,11 @@
|
||||
<el-card style="margin-top: 20px;">
|
||||
<!-- 查询类别 -->
|
||||
<el-form :inline="true" :model="queryParams">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入分类名称" clearable @keyup.enter.native="handleQuery"></el-input>
|
||||
<el-form-item label="品类名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入品类名称" clearable @keyup.enter.native="handleQuery"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable >
|
||||
<el-select v-model="queryParams.status" placeholder="请选择品类状态" clearable >
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
@ -30,18 +30,52 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd"
|
||||
>添加分类</el-button>
|
||||
<!-- <div class="tTop">分类列表-->
|
||||
<!-- <el-button type="primary" @click="insertGoods" >添加分类</el-button>-->
|
||||
>添加品类</el-button>
|
||||
<!-- <div class="tTop">品类列表-->
|
||||
<!-- <el-button type="primary" @click="insertGoods" >添加品类</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- default-expand-all二级菜单默认展开 -->
|
||||
<!-- 分类列表 -->
|
||||
<el-table ref="tables" v-loading="loading" :data="list" row-key="id"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
||||
@sort-change="handleSortChange">
|
||||
<!-- 品类列表 -->
|
||||
<!-- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
|
||||
<el-table ref="tables" v-loading="loading" :data="list" row-key="id" @expand-change="onExpand">
|
||||
<!-- @selection-change="handleSelectionChange" :default-sort="defaultSort"-->
|
||||
<!-- @sort-change="handleSortChange">-->
|
||||
<el-table-column type="expand" :key="1">
|
||||
<template slot-scope="props">
|
||||
<el-table ref="tables" :data="goodsList">
|
||||
<el-table-column type="index" width="80" align="center" label="序号"/>
|
||||
<el-table-column label="分类名称" prop="cvsGoodId" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="name" align="center" width="160"/>
|
||||
<el-table-column label="供应商" prop="supplierId" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="条码" prop="goodsNo" align="center" width="160"/>
|
||||
<el-table-column label="拼音码" prop="pinyinCode" align="center" width="120"/>
|
||||
<el-table-column label="货架号" prop="shelfNumber" align="center" width="60"/>
|
||||
<el-table-column label="库存" prop="stock" align="center" width="100"/>
|
||||
<el-table-column label="单位" prop="unit" align="center" width="60"/>
|
||||
<el-table-column label="进货价" prop="buyingPrice" align="center" width="70"/>
|
||||
<el-table-column label="零售价" prop="retailPrice" align="center" width="70"/>
|
||||
<el-table-column label="会员价" prop="memberPrice" align="center" width="70"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status=='qy'">上架</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.status=='jy'">下架</el-tag>
|
||||
<!-- <dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime"/>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="80" align="center" label="序号"/>
|
||||
<el-table-column label="分类名称" align="center" prop="name"/>
|
||||
<el-table-column label="品类名称" align="center" prop="name"/>
|
||||
<el-table-column label="商品编号" align="center" prop="code"/>
|
||||
<el-table-column label="排序" align="center" prop="sorted" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
@ -96,7 +130,7 @@
|
||||
<!-- width="180">-->
|
||||
<!-- </el-table-column> –>-->
|
||||
<!-- <el-table-column label="ID" prop="id" align="center" width="60"/>-->
|
||||
<!-- <el-table-column prop="categoryName" align="center" label="分类名称" width="180" />-->
|
||||
<!-- <el-table-column prop="categoryName" align="center" label="品类名称" width="180" />-->
|
||||
<!-- <el-table-column prop="sorted" align="center" label="排序"/>-->
|
||||
<!-- <el-table-column prop="status" align="center" label="状态" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
@ -119,17 +153,17 @@
|
||||
<el-dialog :title="title" :visible.sync="open" class="roll-dialog"
|
||||
:close-on-click-modal="false" append-to-body width="500px">
|
||||
<el-form :model="form" :inline="true" :rules="rules" ref="form" >
|
||||
<el-form-item label="上级分类" >
|
||||
<el-select v-model="form.pid" placeholder="请选择上级分类">
|
||||
<el-option label="无上级" :value="0">无上级</el-option>
|
||||
<el-option
|
||||
v-for="item in goodsOptions"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类名称" prop="name" style="margin-left: -8px;">
|
||||
<!-- <el-form-item label="上级品类" >-->
|
||||
<!-- <el-select v-model="form.pid" placeholder="请选择上级品类">-->
|
||||
<!-- <el-option label="无上级" :value="0">无上级</el-option>-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in goodsOptions"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="品类名称" prop="name" style="margin-left: -8px;">
|
||||
<el-input v-model="form.name" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序规则">
|
||||
@ -148,10 +182,10 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 修改类别对话框 -->
|
||||
<!-- <el-dialog title="修改分类" :visible.sync="editDialogFormVisible" width="500px">-->
|
||||
<!-- <el-dialog title="修改品类" :visible.sync="editDialogFormVisible" width="500px">-->
|
||||
<!-- <el-form :model="editForm" :inline="true" :rules="rules" ref="editForm" >-->
|
||||
<!-- <el-form-item label="上级分类" v-if="isShow">-->
|
||||
<!-- <el-select v-model="editForm.pid" placeholder="请选择上级分类">-->
|
||||
<!-- <el-form-item label="上级品类" v-if="isShow">-->
|
||||
<!-- <el-select v-model="editForm.pid" placeholder="请选择上级品类">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in goodsOptions"-->
|
||||
<!-- :label="item.categoryName"-->
|
||||
@ -159,7 +193,7 @@
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="分类名称" prop="categoryName" style="margin-left: -8px;">-->
|
||||
<!-- <el-form-item label="品类名称" prop="categoryName" style="margin-left: -8px;">-->
|
||||
<!-- <el-input v-model="editForm.categoryName" style="width: 300px;"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="排序规则">-->
|
||||
@ -192,6 +226,7 @@ import {
|
||||
import {delUser, getUser} from "@/api/staff/user/user";
|
||||
import {getAccount, getAccountList} from "@/api/system/account";
|
||||
import {addFixingLevel, updateFixingLevel} from "@/api/staff/user/fixinglevel";
|
||||
import {queryGoodsVoList} from "@/api/convenienceStore/ljgoods";
|
||||
export default {
|
||||
dicts:['zhzt'],
|
||||
data() {
|
||||
@ -207,6 +242,7 @@ export default {
|
||||
total: 0,
|
||||
// 表格数据
|
||||
list: [],
|
||||
goodsList: [],
|
||||
//是否修改一二级菜单
|
||||
isShow:false,
|
||||
// 默认排序
|
||||
@ -259,7 +295,7 @@ export default {
|
||||
//校验规则
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入分类名称', trigger: 'blur' },
|
||||
{ required: true, message: '请输入品类名称', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
|
||||
@ -291,7 +327,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true;
|
||||
this.title = "新增分类";
|
||||
this.title = "新增品类";
|
||||
},
|
||||
//获取父类
|
||||
getFirstMenu(){
|
||||
@ -310,7 +346,7 @@ export default {
|
||||
dooSubmit(){
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
//新增一级分类
|
||||
//新增一级品类
|
||||
if(this.form.pid == '' || this.form.pid == undefined ){
|
||||
this.form.pid = 0
|
||||
}
|
||||
@ -357,6 +393,20 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
onExpand(row, expandedRows){
|
||||
this.$message.success(row)
|
||||
// 判断当前展开行
|
||||
if (expandedRows.find(ele => ele === row)) {
|
||||
// debugger
|
||||
this.curElementId = row.id // 获取当前行ID
|
||||
this.getGoodsList(curElementId) // 获取列表
|
||||
}
|
||||
},
|
||||
getGoodsList(cvsGoodsId){
|
||||
queryGoodsVoList({cvsGoodId:cvsGoodsId}).then(res => {
|
||||
this.goodsList = res.data
|
||||
})
|
||||
},
|
||||
// 取消查询
|
||||
resetForm(){
|
||||
this.goodsQueryForm.name = ''
|
||||
@ -373,21 +423,21 @@ export default {
|
||||
if (this.form.id) {
|
||||
updateCevGood(this.form).then(response => {
|
||||
if (response.data==1){
|
||||
this.$modal.msgSuccess("分类更新成功");
|
||||
this.$modal.msgSuccess("品类更新成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getFirstMenu();
|
||||
}else {
|
||||
this.$modal.msgError("分类名称已存在,修改失败");
|
||||
this.$modal.msgError("品类名称已存在,修改失败");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
insertCvsGoods(this.form).then(response => {
|
||||
if (response.data == -1){
|
||||
this.$modal.msgError("分类名称已存在,添加失败");
|
||||
this.$modal.msgError("品类名称已存在,添加失败");
|
||||
}else {
|
||||
this.$modal.msgSuccess("分类添加成功");
|
||||
this.$modal.msgSuccess("品类添加成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getFirstMenu();
|
||||
@ -409,13 +459,13 @@ export default {
|
||||
selectParentById(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "编辑分类";
|
||||
this.title = "编辑品类";
|
||||
});
|
||||
},
|
||||
// 删除按钮操作
|
||||
handleDelete(row) {
|
||||
const name = row.name
|
||||
this.$modal.confirm('确定删除"' + name + '"的分类信息?').then(function() {
|
||||
this.$modal.confirm('确定删除"' + name + '"的品类信息?').then(function() {
|
||||
// return deleteMember(row.id);
|
||||
return deleteBYId(row.id);
|
||||
}).then(() => {
|
||||
|
@ -365,7 +365,7 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="礼品卡充值" name="literCard">
|
||||
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
|
||||
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -806,7 +806,6 @@
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
|
||||
<el-input
|
||||
v-model="form1.cardChildPhones"
|
||||
@input="setCardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
|
||||
/>
|
||||
@ -1413,12 +1412,15 @@ export default {
|
||||
confirm1(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form2.userId = this.id
|
||||
giftCardExchange(this.form2).then(res => {
|
||||
if (res.data.id == '' || res.data.id == null) {
|
||||
this.$message.error('兑换失败!');
|
||||
} else {
|
||||
this.$message.success('兑换成功!');
|
||||
this.openRecharge = false
|
||||
this.form2.number = ''
|
||||
this.form2.cardPassword = ''
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||
import com.fuint.business.convenienceSore.vo.LjGoodsVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -47,6 +48,12 @@ public class LJGoodsController extends BaseController {
|
||||
return getSuccessResult(goods);
|
||||
}
|
||||
|
||||
@GetMapping("/queryGoodsVoList")
|
||||
public ResponseObject queryGoodsVoList(LJGoods goods){
|
||||
List<LjGoodsVo> ljGoodsVos = goodsService.selectGoodsVoList(goods);
|
||||
return getSuccessResult(ljGoodsVos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.vo.LjGoodsVo;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LJGoodsMapper extends BaseMapper<LJGoods> {
|
||||
/**
|
||||
* 根据条件分页查询会员信息
|
||||
@ -21,4 +24,10 @@ public interface LJGoodsMapper extends BaseMapper<LJGoods> {
|
||||
int subtractGoodesStockByLock(@Param("id") Integer id, @Param("stock") Integer stock);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有商品列表信息
|
||||
* @return
|
||||
*/
|
||||
public List<LjGoodsVo> selectGoodsVoList(@Param("goods") LJGoods goods);
|
||||
}
|
||||
|
@ -37,10 +37,26 @@
|
||||
or shelf_number like concat('%', #{goods.remark}, '%')
|
||||
)
|
||||
</if>
|
||||
order by sort
|
||||
</where>
|
||||
order by sort
|
||||
</select>
|
||||
<select id="selectGoodsVoList" resultType="com.fuint.business.convenienceSore.vo.LjGoodsVo"
|
||||
parameterType="com.fuint.business.convenienceSore.entity.LJGoods">
|
||||
select mg.*,sup.name supplierName,cg.name cvsGoodName from mt_goods mg
|
||||
left join supplier sup on mg.supplier_id = sup.id
|
||||
left join cvs_goods cg on mg.cvs_good_id = cg.id
|
||||
<where>
|
||||
mg.store_id = #{goods.storeId} and mg.if_delete = '0'
|
||||
<if test="goods.cvsGoodId != null and goods.cvsGoodId != ''">
|
||||
and cvs_good_id = #{goods.cvsGoodId}
|
||||
</if>
|
||||
<if test="goods.supplierId != null and goods.supplierId != ''">
|
||||
and supplier_id = #{goods.supplierId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="subtractGoodesStockByLock">
|
||||
update mt_goods set
|
||||
stock = stock - #{stock}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.convenienceSore.dto.LJGoodsDto;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.vo.LjGoodsVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -27,6 +28,12 @@ public interface LJGoodsService extends IService<LJGoods> {
|
||||
*/
|
||||
public List<LJGoods> selectGoodsList();
|
||||
|
||||
/**
|
||||
* 查询所有商品列表信息
|
||||
* @return
|
||||
*/
|
||||
public List<LjGoodsVo> selectGoodsVoList(LJGoods goods);
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -16,6 +16,7 @@ import com.fuint.business.convenienceSore.mapper.LJGoodsMapper;
|
||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.business.convenienceSore.vo.LjGoodsVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.RedisLock;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
@ -71,6 +72,13 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LjGoodsVo> selectGoodsVoList(LJGoods goods) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
goods.setStoreId(nowAccountInfo.getStoreId());
|
||||
return baseMapper.selectGoodsVoList(goods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.fuint.business.convenienceSore.vo;
|
||||
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LjGoodsVo extends LJGoods {
|
||||
// 分类名称
|
||||
private String cvsGoodName;
|
||||
// 供应商名称
|
||||
private String supplierName;
|
||||
}
|
@ -34,4 +34,11 @@ public interface GrowthValueChangeService {
|
||||
* @return
|
||||
*/
|
||||
public int updateGrowthValueChange(GrowthValueChange growthValueChange);
|
||||
|
||||
/**
|
||||
* 退款时成长值记录变化
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
void refundGrowthValueChange(String orderNo,Integer userId,Integer storeId);
|
||||
}
|
||||
|
@ -145,6 +145,9 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
OilTrackingService oilTrackingService;
|
||||
@Resource
|
||||
CommissionRecordService commissionRecordService;
|
||||
@Resource
|
||||
GrowthValueChangeService growthValueChangeService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int refund(Map<String, String> map) {
|
||||
@ -219,6 +222,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
commissionRecordService.addRefundRecord(ljOrder.getOrderNo(),"2",ljOrder.getStaffId(),ljOrder.getStoreId());
|
||||
}
|
||||
|
||||
growthValueChangeService.refundGrowthValueChange(oilOrder.getOrderNo(),oilOrder.getUserId(),oilOrder.getStoreId());
|
||||
if (flag) {
|
||||
return 1;// 当前为现金支付
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.business.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -7,12 +9,22 @@ import com.fuint.business.order.entity.GrowthValueChange;
|
||||
import com.fuint.business.order.mapper.GrowthValueChangeMapper;
|
||||
import com.fuint.business.order.service.GrowthValueChangeService;
|
||||
import com.fuint.business.order.vo.GrowthValueChangeVo;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeMapper, GrowthValueChange> implements GrowthValueChangeService {
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
@Autowired
|
||||
private LJUserService userService;
|
||||
|
||||
@Override
|
||||
public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
@ -34,4 +46,34 @@ public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeM
|
||||
public int updateGrowthValueChange(GrowthValueChange growthValueChange) {
|
||||
return baseMapper.updateById(growthValueChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refundGrowthValueChange(String orderNo,Integer userId,Integer storeId) {
|
||||
// 根据订单号和成长值变化状态搜索成长值记录信息
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("order_no",orderNo);
|
||||
queryWrapper.eq("change_type","1");
|
||||
queryWrapper.eq("user_id",userId);
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
GrowthValueChange growthValueChange = baseMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(growthValueChange)){
|
||||
GrowthValueChange growthValueChange1 = new GrowthValueChange();
|
||||
growthValueChange1.setUserId(userId);
|
||||
growthValueChange1.setStoreId(storeId);
|
||||
growthValueChange1.setChainStoreId(store.getChainStoreId());
|
||||
growthValueChange1.setFromType("订单退款");
|
||||
growthValueChange1.setChangeType("0");
|
||||
growthValueChange1.setGrowthValue(-growthValueChange.getGrowthValue());
|
||||
growthValueChange1.setAfterTheChange(growthValueChange.getAfterTheChange()-growthValueChange.getGrowthValue());
|
||||
growthValueChange1.setOrderNo(orderNo);
|
||||
LJUserVo userVo = userService.selectUserById(userId, storeId);
|
||||
if (ObjectUtil.isNotEmpty(userVo)){
|
||||
this.insertGrowthValueChange(growthValueChange1);
|
||||
userVo.setGrowthValue(growthValueChange.getAfterTheChange()+growthValueChange.getGrowthValue());
|
||||
userService.updateUser(userVo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1227,7 +1227,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
*/
|
||||
@Override
|
||||
public void addOilTrack(JSONObject oilOrder,Integer storeId){
|
||||
OilTank oilTank = oilTankService.queryById(Integer.valueOf(oilOrder.get("tankId").toString()));
|
||||
// OilTank oilTank = oilTankService.queryById(Integer.valueOf(oilOrder.get("tankId").toString()));
|
||||
// 添加库存跟踪信息
|
||||
OilTracking oilTracking = new OilTracking();
|
||||
oilTracking.setDocument("油品出售");
|
||||
@ -1244,9 +1244,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilTrackingService.insert(oilTracking);
|
||||
|
||||
// 修改油罐容量
|
||||
Double storedQuantity = oilTank.getStoredQuantity();
|
||||
oilTank.setStoredQuantity(storedQuantity-Double.parseDouble(oilOrder.get("liters").toString()));
|
||||
oilTankService.update(oilTank);
|
||||
// Double storedQuantity = oilTank.getStoredQuantity();
|
||||
// oilTank.setStoredQuantity(storedQuantity-Double.parseDouble(oilOrder.get("liters").toString()));
|
||||
// oilTankService.update(oilTank);
|
||||
oilTankService.subtractStoredQuantityByLock(Integer.valueOf(oilOrder.get("tankId").toString()),oilNum);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1274,8 +1275,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilTracking.setTankId(oilOrder.getTankId());
|
||||
oilTrackingService.insert(oilTracking);
|
||||
|
||||
oilTank.setStoredQuantity(storedQuantity-oilOrder.getOilNum());
|
||||
oilTankService.update(oilTank);
|
||||
oilTankService.subtractStoredQuantityByLock(oilOrder.getTankId(),oilOrder.getOilNum());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
10
fuintCashierWeb/src/api/cashier/giftCard/giftcard.js
Normal file
10
fuintCashierWeb/src/api/cashier/giftCard/giftcard.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 测试支付接口
|
||||
export function giftCardExchange(query) {
|
||||
return request({
|
||||
url: '/business/marketingActivity/cardGift/exchange',
|
||||
method: 'get',
|
||||
data:query
|
||||
})
|
||||
}
|
@ -366,6 +366,28 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="礼品卡兑换电子储值卡余额" name="giftCard">
|
||||
<el-form ref="form" :model="form2" :rules="rules1" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="卡号" prop="number" style="width: 500px">
|
||||
<el-input v-model="form2.number" placeholder="请输入卡号" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="卡密" prop="cardPassword" style="width: 500px">
|
||||
<el-input v-model="form2.cardPassword" placeholder="请输入卡密" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="margin: 20px 0;text-align: center">
|
||||
<el-button type="primary" @click="confirm1()">确认充值</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -585,7 +607,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
|
||||
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column type="index" width="80" align="center" label="序号"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
@ -670,7 +692,7 @@
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||
<el-table-column type="index" width="80" align="center" label="序号"/>
|
||||
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center" />
|
||||
<el-table-column label="订单号" prop="orderNo" align="center" />
|
||||
<el-table-column label="订单金额" prop="amount" align="center" />
|
||||
@ -779,8 +801,9 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
|
||||
<el-input
|
||||
v-model.number="cardChildPhones"
|
||||
v-model="form1.cardChildPhones"
|
||||
placeholder="请输入子卡手机号"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -829,6 +852,7 @@ import {ljStoreInfo} from "@/api/cashier/user/store";
|
||||
import {getUserGradeInfo} from "@/api/cashier/usergrade";
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {getSysConfig} from "@/api/cashier/user/sysconfig";
|
||||
import {giftCardExchange} from "@/api/cashier/giftCard/giftcard";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -962,6 +986,7 @@ export default {
|
||||
form: {},
|
||||
refuelMoney:0,
|
||||
form1: {},
|
||||
form2: {},
|
||||
cardChildPhones: '',
|
||||
// 加油总金额
|
||||
allAmount:0,
|
||||
@ -998,6 +1023,11 @@ export default {
|
||||
fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}],
|
||||
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
|
||||
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
|
||||
},
|
||||
// 表单校验
|
||||
rules1: {
|
||||
number: [{required: true, message: "请输入卡号", trigger: "blur"}],
|
||||
cardPassword: [{required: true, message: "请输入卡密", trigger: "blur"}],
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1088,7 +1118,7 @@ export default {
|
||||
submitSubCard(){
|
||||
this.$refs["form1"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form1.cardChildPhones = this.cardChildPhones
|
||||
// this.form1.cardChildPhones = this.cardChildPhones
|
||||
if (this.form1.id) {
|
||||
editCardValueChild(this.form1).then(res => {
|
||||
if (res.data==1){
|
||||
@ -1259,6 +1289,22 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
confirm1(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
giftCardExchange(this.form2).then(res => {
|
||||
if (res.data.id == '' || res.data.id == null) {
|
||||
this.$message.error('兑换失败!');
|
||||
} else {
|
||||
this.$message.success('兑换成功!');
|
||||
this.openRecharge = false
|
||||
this.form2.number = ''
|
||||
this.form2.cardPassword = ''
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 存油卡查询
|
||||
async getCardFuelDieselList() {
|
||||
let quy = {
|
||||
|
Loading…
Reference in New Issue
Block a user