This commit is contained in:
cun-nan 2024-02-03 13:47:34 +08:00
parent 4f377a7212
commit e38c87edaf
25 changed files with 505 additions and 156 deletions

View File

@ -77,3 +77,12 @@ export function delLJGoods(id) {
method: 'delete'
})
}
// 根据商品条码查询商品详细
export function editStatus(data) {
return request({
url: '/business/convenience/goods/edit',
method: 'post',
data: data
})
}

View File

@ -89,27 +89,25 @@
</el-card>
<el-card style="margin-top: 20px">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>新增商品</el-button>
<el-table ref="tables" v-loading="loading" :data="list">
<!--
@selection-change="handleSelectionChange" :default-sort="defaultSort"
@sort-change="handleSortChange"-->
<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>
<div>
<el-button
type="primary"
@click="batchGrounding('qy')"
>商品上架</el-button>
<el-button
type="primary"
@click="batchGrounding('jy')"
>商品下架</el-button>
</div>
<el-table ref="tables" v-loading="loading" :data="list"
@selection-change="handleSelectionChange"
tooltip-effect="dark">
<el-table-column type="selection" width="55"/>
<!-- <el-table-column type="index" width="80" align="center" label="序号"/>-->
<el-table-column label="分类名称" prop="cvsGoodName" align="center" width="120"/>
<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="supplierName" align="center" width="120"/>
<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"/>
@ -120,8 +118,8 @@
<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>
<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>
@ -130,14 +128,14 @@
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" v-if="activeName=='goods'" align="center" width="200" fixed='right'>
<el-table-column label="操作" v-if="activeName=='goods'" align="center" width="190" fixed='right'>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
>商品维护</el-button>
<el-button
size="mini"
type="text"
@ -187,9 +185,9 @@
placeholder="商品的条码信息">
<el-button slot="append" @click="getGoods(form)">查询</el-button>
</el-input>
<div style="text-align: right;color: grey;font-size: 12px">
商品无条码您可以<span style="color: #00afff" @click="createGoodNo">生成条码</span>
</div>
<!-- <div style="text-align: right;color: grey;font-size: 12px">-->
<!-- 商品无条码您可以<span style="color: #00afff" @click="createGoodNo">生成条码</span>-->
<!-- </div>-->
</el-form-item>
</el-col>
</el-row>
@ -205,6 +203,7 @@
v-model="form.cvsGoodId"
placeholder="全部"
clearable
disabled
style="width: 300px"
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
@ -219,7 +218,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="进货单价" prop="buyingPrice">
<el-input v-model="form.buyingPrice" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
<el-input disabled v-model="form.buyingPrice" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -242,7 +241,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="拼音码" prop="pinyinCode">
<el-input v-model="form.pinyinCode" placeholder="输入商品名称自动回填"/>
<el-input v-model="form.pinyinCode" disabled placeholder="输入商品名称自动回填"/>
</el-form-item>
</el-col>
<el-col :span="8">
@ -266,7 +265,7 @@
</el-col>
<el-col :span="16">
<el-form-item label="初始库存" prop="stock">
<el-input v-model="form.stock" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" :disabled="isAdd" placeholder="0"/>
<el-input v-model="form.stock" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" :disabled="true" placeholder="0"/>
</el-form-item>
</el-col>
</el-row>
@ -286,6 +285,7 @@
<el-autocomplete
popper-class="my-autocomplete"
style="width: 94%"
disabled
v-model="supplier"
:fetch-suggestions="querySearch"
placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即可自动添加"
@ -310,20 +310,22 @@
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>
<!-- <el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio label="qy" value="qy">上架</el-radio>
<el-radio label="jy" value="jy">下架</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-alert
type="error"
style="margin-top: 15px"
:closable="false">
<p v-for="(item,index) in stockType" :id="index">
{{item}}
</p>
</el-alert>
<!-- <el-alert-->
<!-- type="error"-->
<!-- style="margin-top: 15px"-->
<!-- :closable="false">-->
<!-- <p v-for="(item,index) in stockType" :id="index">-->
<!-- {{item}}-->
<!-- </p>-->
<!-- </el-alert>-->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
@ -340,7 +342,7 @@ import {addSupplier, getSupplier, listSupplier} from "@/api/convenienceStore/sup
import {
addLJGoods,
createGoodsNo,
delLJGoods,
delLJGoods, editStatus,
getLJGoods,
listLJGoods, queryLJGoods, scanCode,
updateLJGoods
@ -405,6 +407,7 @@ export default {
},
//
showSearch: true,
ids:[],
//
rules: {
goodsNo: [
@ -658,7 +661,7 @@ export default {
//
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
const id = row.id;
getLJGoods(id).then(response => {
this.form = response.data;
this.cvsGoodOptions.forEach(item => {
@ -741,7 +744,23 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.multiple = !selection.length
},
//
batchGrounding(val){
let name = ""
if (val=='qy'){
name = '上架'
}else {
name = '下架'
}
if (this.ids && this.ids.length>0){
editStatus({ids:this.ids.toString(),status:val}).then(res => {
this.$message.success(name+"成功")
this.getList();
})
}else {
this.$message.error("请选择需要"+name+"的商品")
}
},
//
handleSortChange(column, prop, order) {

View File

@ -37,32 +37,20 @@
<!-- default-expand-all二级菜单默认展开 -->
<!-- 品类列表 -->
<!-- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"-->
<el-table ref="tables" v-loading="loading" :data="list" row-key="id" @expand-change="onExpand">
<el-table ref="tables" v-loading="loading" :data="list" row-key="id">
<!-- @selection-change="handleSelectionChange" :default-sort="defaultSort"-->
<!-- @sort-change="handleSortChange">-->
<el-table-column type="expand" :key="1">
<el-table-column type="expand" >
<template slot-scope="props">
<el-table ref="tables" :data="goodsList">
<el-table ref="tables" :data="props.row.goodsVoList">
<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="商品名称" prop="name" align="center"/>
<el-table-column label="供应商" prop="supplierName" align="center"/>
<el-table-column label="条码" prop="goodsNo" align="center" width="250"/>
<el-table-column label="拼音码" prop="pinyinCode" align="center"/>
<el-table-column label="货架号" prop="shelfNumber" align="center" />
<el-table-column label="库存" prop="stock" align="center"/>
<el-table-column label="单位" prop="unit" align="center"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<el-tag v-if="scope.row.status=='qy'">上架</el-tag>
@ -93,14 +81,20 @@
<span>{{ getName(scope.row.createBy) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120" fixed='right'>
<el-table-column label="操作" align="center" width="300" fixed='right'>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="addGoods(scope.row)"
>添加商品信息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
>修改品类信息</el-button>
<el-button
size="mini"
type="text"
@ -119,34 +113,6 @@
@pagination="getList"
/>
<!-- <el-table-->
<!-- :data="list"-->
<!-- style="width: 100%;margin-bottom: 20px;"-->
<!-- row-key="id"-->
<!-- :tree-props="{children: 'children', hasChildren: 'hasChildren'}">-->
<!-- &lt;!&ndash; <el-table-column-->
<!-- prop="id"-->
<!-- label="序号"-->
<!-- width="180">-->
<!-- </el-table-column> &ndash;&gt;-->
<!-- <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="sorted" align="center" label="排序"/>-->
<!-- <el-table-column prop="status" align="center" label="状态" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="createTime" align="center" label="创建时间" width="180" />-->
<!-- <el-table-column prop="createBy" align="center" label="创建人" width="180" />-->
<!-- <el-table-column label="操作" align="center" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="primary" @click="editeCategory(scope.row)" size="mini">编辑</el-button>-->
<!-- <el-button type="danger" @click="delCategory(scope.row.id)" size="mini">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
</el-card>
<!-- 添加类别对话框 -->
@ -181,35 +147,122 @@
</div>
</el-dialog>
<!-- 修改类别对话框 -->
<!-- <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-option-->
<!-- v-for="item in goodsOptions"-->
<!-- :label="item.categoryName"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <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="排序规则">-->
<!-- <el-input-number v-model="editForm.sorted" @change="handleChange" :min="0" :max="10" style="width: 300px;"></el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item >-->
<!-- <el-radio-group v-model="editForm.status">-->
<!-- <el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button @click="cancelEdite"> </el-button>-->
<!-- <el-button type="primary" @click="saveEdite"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- 添加或修改对话框 -->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openGoods" append-to-body>
<el-form ref="form1" :model="form1" :rules="rules1" label-width="90px">
<el-row>
<el-col :span="24">
<el-form-item label="商品条码" prop="goodsNo">
<el-input v-model="form1.goodsNo"
@keydown.enter.native="getGoods(form1)"
:disabled="title == '编辑商品'"
clearable
placeholder="商品的条码信息">
<el-button slot="append" @click="getGoods(form1)">查询</el-button>
</el-input>
<div style="text-align: right;color: grey;font-size: 12px">
商品无条码您可以<span style="color: #00afff" @click="createGoodNo">生成条码</span>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="商品名称" prop="name">
<el-input v-model="form1.name" @input="pinyin" placeholder="请输入商品名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属分类" prop="cvsGoodId">
<el-select
v-model="form1.cvsGoodId"
placeholder="全部"
clearable
style="width: 300px"
>
<el-option v-for="item in goodsOptions" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="拼音码" prop="pinyinCode">
<el-input v-model="form1.pinyinCode" placeholder="输入商品名称自动回填"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="unit">
<el-input v-model="form1.unit" placeholder="如:个、瓶、包"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="货架号" prop="shelfNumber">
<el-input v-model="form1.shelfNumber" placeholder="如1-2-2"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="是否使用积分抵扣" prop="canUsePoint" label-width="110">
<el-radio-group v-model="form1.canUsePoint">
<el-radio v-for="dict in dict.type.yes_or_no" :label="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="供应商" prop="supplierId">
<el-autocomplete
popper-class="my-autocomplete"
style="width: 94%"
v-model="supplier"
:fetch-suggestions="querySearch"
placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即可自动添加"
@change="addSupplier"
@select="selectSupplier">
<template slot-scope="{ item }">
<div style="display: flex;justify-content: space-between">
<span class="name">{{ item.name }}</span>
<!-- <span class="addr">{{ item.memberPrice }}</span>-->
</div>
</template>
</el-autocomplete>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="排序" prop="sort">
<el-input-number v-model="form1.sort" :min="0" label="0"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form1.status">
<!-- <el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>-->
<el-radio label="qy" value="qy">上架</el-radio>
<el-radio label="jy" value="jy">下架</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-alert
type="error"
style="margin-top: 15px"
:closable="false">
<p v-for="(item,index) in stockType" :id="index">
{{item}}
</p>
</el-alert>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -223,12 +276,13 @@ import {
selectParentById,
updateCevGood
} from "@/api/convenienceStore/goods.js";
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";
import {getAccount} from "@/api/system/account";
import {addLJGoods, createGoodsNo, queryGoodsVoList, queryLJGoods, scanCode} from "@/api/convenienceStore/ljgoods";
import pinyin from "js-pinyin";
import {getSysConfig} from "@/api/staff/user/sysconfig";
import {addSupplier, listSupplier} from "@/api/convenienceStore/supplier";
export default {
dicts:['zhzt'],
dicts:['zhzt','yes_or_no'],
data() {
return {
creatName:'',
@ -236,13 +290,16 @@ export default {
title: "",
//
open: false,
openGoods: false,
//
loading: true,
supplier: "",
//
total: 0,
//
list: [],
goodsList: [],
stockType: [],
//
isShow:false,
//
@ -275,6 +332,14 @@ export default {
status:'qy',
sorted:0,
},
//
form1:{
status:'jy',
canUsePoint:'no',
stock:0,
sort:0,
buyingPrice:0,retailPrice:0,memberPrice:0
},
tableData: [{
id: '',
pid:'',
@ -292,12 +357,40 @@ export default {
status: '',
},
aa:[],
supplierList:[],
//
rules: {
name: [
{ required: true, message: '请输入品类名称', trigger: 'blur' },
],
},
//
rules1: {
goodsNo: [
{ required: true, message: "商品条码不能为空", trigger: "blur" },
],
name: [
{ required: true, message: "商品名称不能为空", trigger: "blur" },
],
cvsGoodId: [
{ required: true, message: "请选择商品分类", trigger: "blur" },
],
pinyinCode: [
{ required: true, message: "商品拼音码不能为空", trigger: "blur" },
],
unit: [
{ required: true, message: "请输入商品单位", trigger: "blur" },
],
canUsePoint: [
{ required: true, message: "请选择是否能使用积分抵扣", trigger: "blur" },
],
supplierId: [
{ required: true, message: "请选择供应商", trigger: "change" },
],
status: [
{ required: true, message: "请选择商品状态", trigger: "blur" },
],
},
};
@ -305,8 +398,133 @@ export default {
created(){
this.getList();
this.getFirstMenu();
this.getType();
this.getSuppilers();
},
methods: {
getSuppilers(val){
listSupplier().then(response => {
this.supplierList = response.data.records
if (val){
this.supplierList.forEach(item => {
if (item.name = val){
this.form.supplierId = item.id
}
})
}
})
},
//
getType(){
getSysConfig('stock_type').then(response => {
this.stockType = response.data.split(";")
});
},
//
getGoods(form1){
if (form1.goodsNo!=""){
scanCode(form1.goodsNo).then(response => {
if (response.data!=null && response.data!=""){
this.form1.goodsNo = response.data.barcode;
this.form1.name = response.data.goodsName;
this.pinyin();
this.$forceUpdate()
}
})
}
},
// 13
createGoodNo(){
createGoodsNo().then(response => {
this.form1.goodsNo = response.data
this.$forceUpdate()
})
},
//
pinyin(){
let pinyin = require("js-pinyin");
pinyin.setOptions({ checkPolyphone: false, charCase: 1 });
this.form1.pinyinCode = pinyin.getCamelChars(this.form1.name)
},
//
querySearch(queryString, cb) {
let _this = this;
let results = _this.supplierList;
if (queryString != ""){
results = [];
let falg = false;
_this.supplierList.forEach(item => {
console.log(item)
if(item.name.includes(queryString)){
results.push(item)
falg = true
}
})
if (!falg){
}
}
cb(results);
},
//
selectSupplier(data){
this.supplier = data.name;
this.form1.supplierId = data.id
this.$forceUpdate()
},
addSupplier(val){
// console.log(val,222)
if (!val){
return;
}
addSupplier({name:val,remark:"添加商品自动添加"}).then(res => {
// console.log(res)
if (res.data==1){
this.$modal.msgSuccess("已为您自动添加此供应商")
this.getSuppilers(val)
}
})
},
//
submitForm1: function() {
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1) {
queryLJGoods({goodsNo: this.form1.goodsNo}).then(response => {
if (response.data != null) {
this.$modal.msgError("商品已存在");
} else {
addLJGoods(this.form1).then(response => {
if (response.data == 1) {
this.$modal.msgSuccess("商品信息新增成功");
this.openGoods = false;
this.getList();
} else {
this.$message.error("商品信息新增失败")
}
});
}
})
}
}
});
},
//
cancel1() {
this.openGoods = false;
this.reset1();
},
//
reset1() {
this.form1 = {
status:'jy',
canUsePoint:'no',
stock:0,
sort:0,
}
},
//
reset() {
this.form = {
@ -393,14 +611,10 @@ export default {
this.loading = false;
});
},
onExpand(row, expandedRows){
this.$message.success(row)
onExpand(row){
//
if (expandedRows.find(ele => ele === row)) {
// debugger
this.curElementId = row.id // ID
this.getGoodsList(curElementId) //
}
// this.getGoodsList(row.id) //
},
getGoodsList(cvsGoodsId){
queryGoodsVoList({cvsGoodId:cvsGoodsId}).then(res => {
@ -452,6 +666,13 @@ export default {
this.open = false;
this.reset();
},
//
addGoods(data){
this.openGoods = true
this.form1.cvsGoodId = data.id
this.supplier = ""
this.title = "添加商品信息"
},
//
handleUpdate(row) {
this.reset();

View File

@ -38,7 +38,7 @@ public class LJGoodsController extends BaseController {
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<LJGoods> list = goodsService.selectLJGoodsList(page,goods);
IPage<LjGoodsVo> list = goodsService.selectLJGoodsList(page,goods);
return getSuccessResult(list);
}
@ -127,6 +127,19 @@ public class LJGoodsController extends BaseController {
return getSuccessResult(goodsService.updateLJGoods(goods));
}
/**
* 修改商品信息
* @param map
* @return
*/
@PostMapping("edit")
public ResponseObject updateStatus(@RequestBody Map<String,String> map){
String ids = map.get("ids");
String status = map.get("status");
goodsService.batchGrounding(ids,status);
return getSuccessResult("OK");
}
/**
* 修改该商品库存
* @param goods

View File

@ -17,7 +17,7 @@ public interface LJGoodsMapper extends BaseMapper<LJGoods> {
* @param goods
* @return
*/
public IPage<LJGoods> selectLJGoodsList(Page page, @Param("goods") LJGoods goods);
public IPage<LjGoodsVo> selectLJGoodsList(Page page, @Param("goods") LJGoods goods);

View File

@ -2,43 +2,45 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.convenienceSore.mapper.LJGoodsMapper">
<sql id="selectLJGoods">
select * from mt_goods
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
</sql>
<select id="selectLJGoodsList" resultType="com.fuint.business.convenienceSore.entity.LJGoods">
<select id="selectLJGoodsList" resultType="com.fuint.business.convenienceSore.vo.LjGoodsVo">
<include refid="selectLJGoods"></include>
<where>
store_id = #{goods.storeId} and is_recovery = #{goods.isRecovery} and if_delete = '0'
mg.store_id = #{goods.storeId} and mg.is_recovery = #{goods.isRecovery} and mg.if_delete = '0'
<if test="goods.cvsGoodId != null and goods.cvsGoodId != ''">
and cvs_good_id = #{goods.cvsGoodId}
and mg.cvs_good_id = #{goods.cvsGoodId}
</if>
<if test="goods.supplierId != null and goods.supplierId != ''">
and supplier_id = #{goods.supplierId}
and mg.supplier_id = #{goods.supplierId}
</if>
<if test="goods.name != null and goods.name != ''">
and name like concat('%', #{goods.name}, '%')
and mg.name like concat('%', #{goods.name}, '%')
</if>
<if test="goods.pinyinCode != null and goods.pinyinCode != ''">
and pinyin_code like concat('%', #{goods.pinyinCode}, '%')
and mg.pinyin_code like concat('%', #{goods.pinyinCode}, '%')
</if>
<if test="goods.goodsNo != null and goods.goodsNo != ''">
and goods_no like concat('%', #{goods.goodsNo}, '%')
and mg.goods_no like concat('%', #{goods.goodsNo}, '%')
</if>
<if test="goods.shelfNumber != null and goods.shelfNumber != ''">
and shelf_number like concat('%', #{goods.shelfNumber}, '%')
and mg.shelf_number like concat('%', #{goods.shelfNumber}, '%')
</if>
<if test="goods.status != null and goods.status != ''">
and status = #{goods.status}
and mg.status = #{goods.status}
</if>
<if test="goods.remark != null and goods.remark != ''">
and(
name like concat('%', #{goods.remark}, '%')
or pinyin_code like concat('%', #{goods.remark}, '%')
or shelf_number like concat('%', #{goods.remark}, '%')
mg.name like concat('%', #{goods.remark}, '%')
or mg.pinyin_code like concat('%', #{goods.remark}, '%')
or mg.shelf_number like concat('%', #{goods.remark}, '%')
)
</if>
</where>
order by sort
order by mg.sort
</select>
<select id="selectGoodsVoList" resultType="com.fuint.business.convenienceSore.vo.LjGoodsVo"
parameterType="com.fuint.business.convenienceSore.entity.LJGoods">
@ -54,6 +56,7 @@
and supplier_id = #{goods.supplierId}
</if>
</where>
order by sort
</select>

View File

@ -8,19 +8,21 @@ 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 org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 商品信息 业务层
*/
@Transactional
public interface LJGoodsService extends IService<LJGoods> {
/**
* 根据条件分页查询商品信息
* @param page
* @return
*/
public IPage<LJGoods> selectLJGoodsList(Page page, LJGoods goods);
public IPage<LjGoodsVo> selectLJGoodsList(Page page, LJGoods goods);
/**
* 查询所有商品列表信息
@ -80,6 +82,11 @@ public interface LJGoodsService extends IService<LJGoods> {
*/
public int updateLJGoods(LJGoods goods);
/**
* 批量上架下架商品信息
* @param ids
*/
void batchGrounding(String ids,String status);
/**
* 修改商品库存

View File

@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.convenienceSore.entity.SaleDetail;
import com.fuint.business.convenienceSore.vo.SaleDetailVo;
import org.springframework.transaction.annotation.Transactional;
/**
* 销售详情信息 业务层
*/
@Transactional
public interface SaleDetailService extends IService<SaleDetail> {
/**
* 根据条件分页查询销售详情信息

View File

@ -8,12 +8,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.convenienceSore.entity.CvsGoods;
import com.fuint.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.mapper.CvsGoodsMapper;
import com.fuint.business.convenienceSore.service.CvsGoodsService;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.vo.CvsGoodsTree;
import com.fuint.business.convenienceSore.vo.CvsGoodsVo;
import com.fuint.business.convenienceSore.vo.LjGoodsVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
@ -26,6 +30,8 @@ import java.util.stream.Collectors;
*/
@Service
public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> implements CvsGoodsService {
@Autowired
private LJGoodsService goodsService;
/**
* 添加商品分类信息
@ -93,7 +99,15 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
cvsVoParent.setChildren(getChildrenData(cvsVoParent, CvsGoodsVoList));
return cvsVoParent;
}).collect(Collectors.toList());
for (CvsGoodsVo cvsGoodsVo : CvsGoodsVoTree) {
LJGoods goods = new LJGoods();
goods.setCvsGoodId(cvsGoodsVo.getId());
List<LjGoodsVo> ljGoodsVos = goodsService.selectGoodsVoList(goods);
cvsGoodsVo.setGoodsVoList(ljGoodsVos);
}
cvsGoodsPage.setRecords(CvsGoodsVoTree);
return cvsGoodsPage;
}else {
return null;

View File

@ -52,11 +52,11 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
* @return
*/
@Override
public IPage<LJGoods> selectLJGoodsList(Page page, LJGoods goods) {
public IPage<LjGoodsVo> selectLJGoodsList(Page page, LJGoods goods) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
goods.setStoreId(storeId);
IPage<LJGoods> goodsIPage = baseMapper.selectLJGoodsList(page, goods);
IPage<LjGoodsVo> goodsIPage = baseMapper.selectLJGoodsList(page, goods);
return goodsIPage;
}
@ -181,8 +181,7 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
stock.setGoodsId(goods.getId());
stock.setCvsGoodId(goods.getCvsGoodId());
stock.setSupplierId(goods.getSupplierId());
Double costAmount = goods.getBuyingPrice()*goods.getStock();
stock.setCostAmount(costAmount);
stock.setCostAmount(0.00);
stock.setIfDelete("0");
stockService.insertStock(stock);
// 查询插入的库存统计信息
@ -208,6 +207,22 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
return row;
}
@Override
public void batchGrounding(String ids,String status) {
String[] split = ids.split(",");
for (String s : split) {
LJGoods ljGoods = this.selectLJGoodsById(Integer.parseInt(s));
if (ObjectUtil.isNotEmpty(ljGoods)){
if (status.equals("qy") && ljGoods.getStock()==0){
ljGoods.setStatus("jy");
}else {
ljGoods.setStatus(status);
}
this.updateLJGoods(ljGoods);
}
}
}
@Override
@Transactional

View File

@ -43,4 +43,9 @@ public class CvsGoodsVo extends BaseEntity {
*/
private List<CvsGoodsVo> children;
/**
* 子节点
*/
private List<LjGoodsVo> goodsVoList;
}

View File

@ -88,6 +88,14 @@ public class OilOrder extends BaseEntity implements Serializable {
* 优惠金额
*/
private Double discountAmount;
/**
* 优惠金额
*/
private Double balanceAmount;
/**
* 优惠金额
*/
private Double oilCardAmount;
/**
* 实付金额
*/

View File

@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
@Transactional
public interface AllOrderInfoService {
/**

View File

@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public interface CardBalanceChangeService extends IService<CardBalanceChange> {
/**
* 添加用户余额变化信息

View File

@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.CardValueChildOrder;
import com.fuint.business.order.vo.CardValueChildOrderVo;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public interface CardValueChildOrderService {
/**
* 根据条件分页查询子卡订单信息

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.CashierOrder;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@ -11,6 +12,7 @@ import java.util.Map;
/**
* 收银员订单信息 业务层
*/
@Transactional
public interface CashierOrderService extends IService<CashierOrder> {
/**
* 根据条件分页查询订单信息

View File

@ -2,12 +2,14 @@ package com.fuint.business.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.CreditUnit;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 挂账单位信息 业务层
*/
@Transactional
public interface CreditUnitService extends IService<CreditUnit> {
/**
* 查询所有挂账单位信息

View File

@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.vo.GrowthValueChangeVo;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public interface GrowthValueChangeService {
/**
* 根据条件分页查询成长值变化记录信息

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.HangBill;
import com.fuint.business.order.entity.ReturnRecord;
import com.fuint.business.order.vo.HangBillVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@ -13,6 +14,7 @@ import java.util.Map;
/**
* 挂账记录信息 业务层
*/
@Transactional
public interface HangBillService extends IService<HangBill> {
/**
* 根据条件分页查询油品订单信息

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.vo.LJOrderVo;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@ -12,6 +13,7 @@ import java.util.Map;
/**
* 订单信息 业务层
*/
@Transactional
public interface LJOrderService extends IService<LJOrder> {
/**
* 根据条件分页查询订单信息

View File

@ -6,12 +6,14 @@ import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.order.entity.OrderGoods;
import com.fuint.business.order.vo.OrderGoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 商品订单记录 业务层
*/
@Transactional
public interface OrderGoodsService extends IService<OrderGoods> {
/**
* 根据订单id查询商品订单信息

View File

@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.order.entity.ReturnRecord;
import com.fuint.business.order.vo.ReturnRecordVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 挂账归还记录表 业务层
*/
@Transactional
public interface ReturnRecordService extends IService<ReturnRecord> {
/**
* 根据挂账记录id查询归还信息

View File

@ -202,6 +202,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String goodsOrder = map.get("goodsOrder");
// 囤油卡变化之后的信息
String refuelMoney = map.get("refuelMoney");
// 储值卡消费金额
String balanceAmount = map.get("balanceAmount");
// 囤油卡消费升数
String oilCardAmount = map.get("oilCardAmount");
// 支付类型
String payType = map.get("payType");
// 油品订单金额
@ -351,6 +355,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayAmount(oilActualPay);
order.setOrderNo(orderNo);
order.setDiscountAmount(oilDiscount);
order.setBalanceAmount(Double.valueOf(balanceAmount));
order.setOilCardAmount(Double.valueOf(oilCardAmount));
if (payType.equals("CASH")){
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo);
}
@ -1001,6 +1007,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String cardFavorableId = map.get("cardFavorableId");
// 活动类型
String type = map.get("type");
String balanceAmountSale = map.get("balanceAmountSale");
String oilCardAmountSale = map.get("oilCardAmountSale");
Integer tankId = Integer.valueOf(map.get("tankId"));
Map<String, Object> applet = new HashMap<>();
@ -1136,6 +1144,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 修改订单的优惠金额和支付金额
oilOrder.setDiscountAmount(Double.valueOf(discountAmount));
oilOrder.setPayAmount(payAmount);
oilOrder.setBalanceAmount(Double.valueOf(balanceAmountSale));
oilOrder.setOilCardAmount(Double.valueOf(oilCardAmountSale));
if (StringUtils.isNotEmpty(activeId)){
oilOrder.setActiveId(Integer.valueOf(activeId));
}

View File

@ -2530,6 +2530,8 @@
this.map.oilDiscount = (this.oilDiscount + this.goodsDiscount + this.fullReduction + this.couponAmount).toFixed(2) ;
this.map.goodsDiscount = this.goodsDiscount;
this.map.goodsNum = this.goodsTotal;
this.map.balanceAmount = this.consumeAmount;
this.map.oilCardAmount = this.consumeRefuelMoney;
this.map.oilOrder = JSON.stringify(this.oilOrder);
this.map.goodsOrder = JSON.stringify(this.goodsOrder);
this.map.authCode = this.authCode;

View File

@ -311,6 +311,8 @@
activeId:this.preferentialData.activeId,
cardFavorableId:this.preferentialData.cardFavorableId,
type:this.preferentialData.type,
balanceAmount:this.balanceRedece,
oilCardAmountSale:this.oilCardRedece,
};
let _this = this;
request({