Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d1991905d9
@ -26,11 +26,11 @@ export function createGoodsNo() {
|
||||
}
|
||||
|
||||
// 对接扫码枪
|
||||
export function scanCode(data) {
|
||||
export function scanCode(goodsNo) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/scanCode',
|
||||
method: 'put',
|
||||
data: data
|
||||
url: '/business/convenience/goods/scanCode/'+goodsNo,
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
18
fuintAdmin/src/api/convenienceStore/stockstatistic.js
Normal file
18
fuintAdmin/src/api/convenienceStore/stockstatistic.js
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询商品列表
|
||||
export function listStock(query) {
|
||||
return request({
|
||||
url: '/business/convenience/stockStatistic/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供应商详细
|
||||
export function getStock(id) {
|
||||
return request({
|
||||
url: '/business/convenience/stockStatistic/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
9
fuintAdmin/src/api/convenienceStore/stocktrack.js
Normal file
9
fuintAdmin/src/api/convenienceStore/stocktrack.js
Normal file
@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询商品列表
|
||||
export function listTrack(stockId) {
|
||||
return request({
|
||||
url: '/business/convenience/stockTrack/list/'+stockId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
@ -116,7 +116,9 @@
|
||||
<el-table-column label="会员价" prop="memberPrice" align="center"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
<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="updateTime">
|
||||
@ -180,7 +182,7 @@
|
||||
<el-input v-model="form.goodsNo"
|
||||
@keydown.enter.native="getGoods(form)"
|
||||
placeholder="商品的条码信息">
|
||||
<el-button slot="append">查询</el-button>
|
||||
<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>
|
||||
@ -217,7 +219,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="零售价" prop="retailPrice">
|
||||
<el-input v-model="form.retailPrice">
|
||||
<el-input v-model="form.retailPrice" @input="getPrice">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -284,7 +286,7 @@
|
||||
<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-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -413,6 +415,10 @@ export default {
|
||||
computed:{
|
||||
},
|
||||
methods:{
|
||||
// 价格填写
|
||||
getPrice(){
|
||||
this.form.memberPrice = this.form.retailPrice
|
||||
},
|
||||
// 点击标签页
|
||||
handleClick(tab, event) {
|
||||
if (this.activeName == 'goods'){
|
||||
@ -449,11 +455,18 @@ export default {
|
||||
},
|
||||
// 扫描识别商品信息
|
||||
getGoods(form){
|
||||
// console.log(form){goodsNo:form.goodsNo}
|
||||
scanCode({goodsNo:form.goodsNo}).then(response => {
|
||||
console.log(response)
|
||||
// this.form = response.data
|
||||
})
|
||||
if (form.goodsNo!=""){
|
||||
scanCode(form.goodsNo).then(response => {
|
||||
if (response.data!=null && response.data!=""){
|
||||
this.form.goodsNo = response.data.barcode;
|
||||
this.form.name = response.data.goodsName;
|
||||
this.form.buyingPrice = response.data.price;
|
||||
this.form.retailPrice = response.data.price;
|
||||
this.form.memberPrice = response.data.price;
|
||||
this.pinyin();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 生成13位数字条码信息
|
||||
createGoodNo(){
|
||||
|
354
fuintAdmin/src/views/convenienceStore/stockStatistic.vue
Normal file
354
fuintAdmin/src/views/convenienceStore/stockStatistic.vue
Normal file
@ -0,0 +1,354 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索框-->
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="商品分类" prop="cvsGoodId">
|
||||
<el-select
|
||||
v-model="queryParams.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-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select
|
||||
v-model="queryParams.supplierId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
>
|
||||
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="拼音码" prop="pinyinCode">
|
||||
<el-input
|
||||
v-model="queryParams.pinyinCode"
|
||||
placeholder="请输入拼音码"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="条形码" prop="goodsNo">
|
||||
<el-input
|
||||
v-model="queryParams.goodsNo"
|
||||
placeholder="请输入商品条形码"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货架号" prop="shelfNumber">
|
||||
<el-input
|
||||
v-model="queryParams.shelfNumber"
|
||||
placeholder="请输入商品所在货架号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 列表-->
|
||||
<el-card style="margin-top: 20px" >
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div style="font-size: 18px">列表</div>
|
||||
<el-button type="primary">导出</el-button>
|
||||
</div>
|
||||
|
||||
<el-table ref="tables" v-loading="loading" :data="list"
|
||||
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column label="ID" align="center" prop="id"/>
|
||||
<el-table-column label="供应商" align="center" prop="supplierId">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类名称" align="center" prop="cvsGoodId">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="name" width="160" />
|
||||
<el-table-column label="条码" align="center" prop="goodsNo" width="160" />
|
||||
<el-table-column label="货架号" align="center" prop="shelfNumber" />
|
||||
<el-table-column label="零售价" align="center" prop="retailPrice" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
<el-table-column label="当前库存" align="center" prop="stock" />
|
||||
<el-table-column label="当前成本价" align="center" prop="buyingPrice" />
|
||||
<el-table-column label="成本金额" align="center" prop="costAmount" />
|
||||
<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" prop="updateTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="trace(scope.row)"
|
||||
>库存跟踪</el-button>
|
||||
<!-- v-hasPermi="['']"-->
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="库存跟踪"
|
||||
:visible.sync="drawer"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
:before-close="handleClose">
|
||||
<div style="display: grid; place-items: center;">
|
||||
<el-card class="box-card" style="background-color: #f5f5f5">
|
||||
<div slot="header" class="clearfix">
|
||||
<div style="position: relative;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<h2>{{form.name}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>拼音码:</span>
|
||||
<span>{{ form.pinyinCode }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div >
|
||||
<div style="margin-top:-5px;display: flex; justify-content: space-between;">
|
||||
<h3>库存数量</h3>
|
||||
<h3>{{form.stock}}{{form.unit}}</h3>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>更新时间</span>
|
||||
<span>{{ form.updateTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 15px">
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="trackList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column
|
||||
lable="#"
|
||||
type="index"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存更新时间" align="center" prop="createTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据" align="center" prop="document" />
|
||||
<el-table-column label="单号" align="center" prop="oddNumber" />
|
||||
<el-table-column label="变动数量" align="center" prop="changeNumber" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total1>0"
|
||||
:total="total1"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getTrackList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {exportExcelTankApi, getTankApi} from "@/api/oilConfig/oilTank";
|
||||
import {getTrackingApi} from "@/api/oilConfig/oilStatistics";
|
||||
import {getOilNameListApi} from "@/api/oilPrice";
|
||||
import {selectTree} from "@/api/convenienceStore/goods";
|
||||
import {listSupplier} from "@/api/convenienceStore/supplier";
|
||||
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
|
||||
import {getStock, listStock} from "@/api/convenienceStore/stockstatistic";
|
||||
import {listTrack} from "@/api/convenienceStore/stocktrack";
|
||||
|
||||
export default {
|
||||
name: "oilStatistics",
|
||||
dicts: ['zhzt'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
id: '',
|
||||
cvsGoodId: '',
|
||||
supplierId: '',
|
||||
name: '',
|
||||
pinyinCode: '',
|
||||
goodsNo: '',
|
||||
shelfNumber: '',
|
||||
status: '',
|
||||
},
|
||||
queryParam: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
id: '',
|
||||
name: '',
|
||||
},
|
||||
// 商品分类列表
|
||||
cvsGoodList:[],
|
||||
// 供应商列表
|
||||
supplierList:[],
|
||||
// 表格数据
|
||||
list: [],
|
||||
trackList: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
total1: 0,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 弹出层
|
||||
drawer: false,
|
||||
form:{},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getQueryList();
|
||||
},
|
||||
methods: {
|
||||
getTrackList(){
|
||||
this.loading = true;
|
||||
listTrack().then(response => {
|
||||
this.trackList = response.data.records;
|
||||
this.total1 = response.data.total;
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
// 库存跟踪
|
||||
trace(data) {
|
||||
this.drawer=true
|
||||
getStock(data.id).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
this.getTrackList(data.id);
|
||||
},
|
||||
// 查询列表
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStock(this.queryParams).then(response => {
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
selectTree().then(response => {
|
||||
this.cvsGoodList = response.data.records
|
||||
});
|
||||
listSupplier().then(response => {
|
||||
this.supplierList = response.data.records
|
||||
})
|
||||
},
|
||||
// 重置按钮操作
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
||||
this.handleQuery();
|
||||
},
|
||||
// 是否关闭弹框
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// 排序触发事件
|
||||
handleSortChange(column, prop, order) {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 90%;
|
||||
}
|
||||
</style>
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.convenienceSore.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
@ -62,12 +63,10 @@ public class LJGoodsController extends BaseController {
|
||||
* 扫码枪对接
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/scanCode")
|
||||
public ResponseObject scanCode(@Validated @RequestBody Map<String,String> map){
|
||||
System.out.println(map.get("goodsNo"));
|
||||
String goodsNo = map.get("goodsNo");
|
||||
// String result = goodsService.scanCode(goodsNo);
|
||||
return getSuccessResult(1);
|
||||
@GetMapping("/scanCode/{goodsNo}")
|
||||
public ResponseObject scanCode( @PathVariable String goodsNo){
|
||||
JSONObject object = goodsService.scanCode(goodsNo);
|
||||
return getSuccessResult(object.get("data"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.fuint.business.convenienceSore.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/convenience/stockStatistic")
|
||||
public class StockStatisticController extends BaseController {
|
||||
@Autowired
|
||||
private StockStatisticService stockService;
|
||||
|
||||
/**
|
||||
* 根据条件查询库存商品信息
|
||||
* @param stockVo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(StockStatisticVo stockVo,
|
||||
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<StockStatisticVo> list = stockService.selectStockList(page,stockVo);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询库存统计信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject stockInfo(@PathVariable Integer id){
|
||||
StockStatisticVo stockStatisticVo = stockService.selectStockById(id);
|
||||
return getSuccessResult(stockStatisticVo);
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.fuint.business.convenienceSore.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.convenienceSore.entity.StockTrack;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 库存跟踪信息 controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/convenience/stockTrack")
|
||||
public class StockTrackController extends BaseController {
|
||||
@Autowired
|
||||
private StockTrackService trackService;
|
||||
|
||||
/**
|
||||
* 根据条件查询库存跟踪信息
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/{stockId}")
|
||||
public ResponseObject list(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@PathVariable Integer stockId){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<StockTrack> list = trackService.selectStockTrackList(page,stockId);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
}
|
@ -54,7 +54,7 @@ public class LJGoods extends BaseEntity implements Serializable {
|
||||
* 货架号
|
||||
*/
|
||||
@ApiModelProperty("货架号")
|
||||
private Integer shelfNumber;
|
||||
private String shelfNumber;
|
||||
/**
|
||||
* 进货价
|
||||
*/
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.fuint.business.convenienceSore.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 库存统计表(StockStatistic)实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("stock_statistic")
|
||||
@ApiModel(value = "StockStatistic对象", description = "库存统计表")
|
||||
public class StockStatistic extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
@ApiModelProperty("供应商id")
|
||||
private Integer supplierId;
|
||||
/**
|
||||
* 商品分类ID
|
||||
*/
|
||||
@ApiModelProperty("商品分类ID")
|
||||
private Integer cvsGoodId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@ApiModelProperty("商品id")
|
||||
private Integer goodsId;
|
||||
/**
|
||||
* 所属店铺ID
|
||||
*/
|
||||
@ApiModelProperty("所属店铺ID")
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 成本金额
|
||||
*/
|
||||
@ApiModelProperty("成本金额")
|
||||
private Double costAmount;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
package com.fuint.business.convenienceSore.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 库存跟踪表(StockTrack)实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("stock_track")
|
||||
@ApiModel(value = "StockTrack对象", description = "库存跟踪表")
|
||||
public class StockTrack extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 库存统计id
|
||||
*/
|
||||
private Integer stockId;
|
||||
/**
|
||||
* 所属店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 单据
|
||||
*/
|
||||
private String document;
|
||||
/**
|
||||
* 单号
|
||||
*/
|
||||
private String oddNumber;
|
||||
/**
|
||||
* 变动数量
|
||||
*/
|
||||
private Integer changeNumber;
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.convenienceSore.mapper;
|
||||
|
||||
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.StockStatistic;
|
||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface StockStatisticMapper extends BaseMapper<StockStatistic> {
|
||||
/**
|
||||
* 根据条件分页查询库存统计信息
|
||||
* @param page
|
||||
* @param stock
|
||||
* @return
|
||||
*/
|
||||
public IPage<StockStatisticVo> selectStockList(Page page, @Param("stock") StockStatisticVo stock);
|
||||
|
||||
/**
|
||||
* 根据id查询库存统计信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public StockStatisticVo selectStockById(@Param("id") int id);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.fuint.business.convenienceSore.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.convenienceSore.entity.StockTrack;
|
||||
|
||||
public interface StockTrackMapper extends BaseMapper<StockTrack> {
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.StockStatisticMapper">
|
||||
<sql id="selectStock">
|
||||
select st.id, st.supplier_id, st.cvs_good_id, st.goods_id, st.store_id, st.cost_amount, mg.status,
|
||||
mg.name,mg.goods_no,mg.pinyin_code,mg.shelf_number,
|
||||
mg.retail_price,mg.unit,mg.stock,mg.buying_price,mg.update_time
|
||||
from stock_statistic st inner join mt_goods mg on st.goods_id = mg.id
|
||||
</sql>
|
||||
|
||||
<select id="selectStockList" resultType="com.fuint.business.convenienceSore.vo.StockStatisticVo">
|
||||
<include refid="selectStock"></include>
|
||||
<where>
|
||||
st.store_id = #{stock.storeId}
|
||||
<if test="stock.cvsGoodId != null and stock.cvsGoodId != ''">
|
||||
and st.cvs_good_id = #{stock.cvsGoodId}
|
||||
</if>
|
||||
<if test="stock.supplierId != null and stock.supplierId != ''">
|
||||
and st.supplier_id = #{stock.supplierId}
|
||||
</if>
|
||||
<if test="stock.name != null and stock.name != ''">
|
||||
and mg.name like concat('%', #{stock.name}, '%')
|
||||
</if>
|
||||
<if test="stock.pinyinCode != null and stock.pinyinCode != ''">
|
||||
and mg.pinyin_code like concat('%', #{stock.pinyinCode}, '%')
|
||||
</if>
|
||||
<if test="stock.goodsNo != null and stock.goodsNo != ''">
|
||||
and mg.goods_no like concat('%', #{stock.goodsNo}, '%')
|
||||
</if>
|
||||
<if test="stock.shelfNumber != null and stock.shelfNumber != ''">
|
||||
and mg.shelf_number like concat('%', #{stock.shelfNumber}, '%')
|
||||
</if>
|
||||
<if test="stock.status != null and stock.status != ''">
|
||||
and mg.status = #{stock.status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectStockById" resultType="com.fuint.business.convenienceSore.vo.StockStatisticVo"
|
||||
parameterType="java.lang.Integer">
|
||||
<include refid="selectStock"></include>
|
||||
<where>
|
||||
st.id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -2,6 +2,7 @@ package com.fuint.business.convenienceSore.service;
|
||||
|
||||
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.convenienceSore.entity.CvsGoods;
|
||||
import com.fuint.business.convenienceSore.vo.CvsGoodsVo;
|
||||
import io.swagger.models.auth.In;
|
||||
@ -11,7 +12,7 @@ import java.util.List;
|
||||
/**
|
||||
* 便利店商品分类信息 业务层
|
||||
*/
|
||||
public interface CvsGoodsService {
|
||||
public interface CvsGoodsService extends IService<CvsGoods> {
|
||||
/**
|
||||
* 添加商品分类信息
|
||||
* @param cvsGoods
|
||||
|
@ -1,13 +1,15 @@
|
||||
package com.fuint.business.convenienceSore.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
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.convenienceSore.entity.LJGoods;
|
||||
|
||||
/**
|
||||
* 商品信息 业务层
|
||||
*/
|
||||
public interface LJGoodsService {
|
||||
public interface LJGoodsService extends IService<LJGoods> {
|
||||
/**
|
||||
* 根据条件分页查询商品信息
|
||||
* @param page
|
||||
@ -32,7 +34,7 @@ public interface LJGoodsService {
|
||||
* 扫码枪对接
|
||||
* @return
|
||||
*/
|
||||
public String scanCode(String goodNo);
|
||||
public JSONObject scanCode(String goodNo);
|
||||
|
||||
/**
|
||||
* 根据id删除商品信息
|
||||
|
@ -0,0 +1,26 @@
|
||||
package com.fuint.business.convenienceSore.service;
|
||||
|
||||
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.convenienceSore.entity.StockStatistic;
|
||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||
|
||||
/**
|
||||
* 库存统计 业务层
|
||||
*/
|
||||
public interface StockStatisticService extends IService<StockStatistic> {
|
||||
/**
|
||||
* 根据条件分页查询库存统计信息
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public IPage<StockStatisticVo> selectStockList(Page page, StockStatisticVo stockStatisticVo);
|
||||
|
||||
/**
|
||||
* 根据id查询库存统计信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public StockStatisticVo selectStockById(int id);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.convenienceSore.service;
|
||||
|
||||
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.convenienceSore.entity.StockTrack;
|
||||
|
||||
/**
|
||||
* 库存跟踪信息 业务层
|
||||
*/
|
||||
public interface StockTrackService extends IService<StockTrack> {
|
||||
/**
|
||||
* 分页查询库存跟踪信息
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
public IPage<StockTrack> selectStockTrackList(Page page,Integer stockId);
|
||||
|
||||
/**
|
||||
* 增加供应商信息
|
||||
* @param stockTrack
|
||||
* @return
|
||||
*/
|
||||
public int insertStockTrack(StockTrack stockTrack);
|
||||
}
|
@ -2,12 +2,13 @@ package com.fuint.business.convenienceSore.service;
|
||||
|
||||
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.convenienceSore.entity.Supplier;
|
||||
|
||||
/**
|
||||
* 供应商信息 业务层
|
||||
*/
|
||||
public interface SupplierService {
|
||||
public interface SupplierService extends IService<Supplier> {
|
||||
/**
|
||||
* 根据条件分页查询供应商信息
|
||||
* @param page
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -75,10 +76,11 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String scanCode(String goodNo) {
|
||||
public JSONObject scanCode(String goodNo) {
|
||||
String result = HttpUtil.get("https://www.mxnzp.com/api/barcode/goods/details?barcode="
|
||||
+goodNo+"&app_id=oudmngsxohrpsngw&app_secret=FoKv7iOPbT9LmdZpy0kg8CW75Hcc1BJc");
|
||||
return result;
|
||||
+ goodNo + "&app_id=oudmngsxohrpsngw&app_secret=FoKv7iOPbT9LmdZpy0kg8CW75Hcc1BJc");
|
||||
JSONObject object = JSONObject.parseObject(result);
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,42 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
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.StockStatistic;
|
||||
import com.fuint.business.convenienceSore.mapper.StockStatisticMapper;
|
||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 库存统计 业务层
|
||||
*/
|
||||
@Service
|
||||
public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper, StockStatistic> implements StockStatisticService {
|
||||
/**
|
||||
* 根据条件分页查询库存统计信息
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<StockStatisticVo> selectStockList(Page page, StockStatisticVo stockStatisticVo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
stockStatisticVo.setStoreId(storeId);
|
||||
IPage<StockStatisticVo> stockStatisticVoIPage = baseMapper.selectStockList(page, stockStatisticVo);
|
||||
return stockStatisticVoIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询库存统计信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public StockStatisticVo selectStockById(int id) {
|
||||
return baseMapper.selectStockById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.fuint.business.convenienceSore.service.impl;
|
||||
|
||||
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;
|
||||
import com.fuint.business.convenienceSore.entity.StockTrack;
|
||||
import com.fuint.business.convenienceSore.mapper.StockTrackMapper;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 库存跟踪信息 业务层
|
||||
*/
|
||||
@Service
|
||||
public class StockTrackServiceImpl extends ServiceImpl<StockTrackMapper, StockTrack> implements StockTrackService {
|
||||
/**
|
||||
* 分页查询库存跟踪信息
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<StockTrack> selectStockTrackList(Page page,Integer stockId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper<StockTrack> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("stock_id",stockId);
|
||||
IPage<StockTrack> iPage = baseMapper.selectPage(page, queryWrapper);
|
||||
return iPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加供应商信息
|
||||
* @param stockTrack
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insertStockTrack(StockTrack stockTrack) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
stockTrack.setStockId(storeId);
|
||||
if (stockTrack.getOddNumber()!=null && stockTrack.getOddNumber()!=""){
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
stockTrack.setOddNumber(timestamp+randomString);
|
||||
}
|
||||
int row = baseMapper.insert(stockTrack);
|
||||
return row;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.fuint.business.convenienceSore.vo;
|
||||
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class StockStatisticVo extends BaseEntity {
|
||||
// id
|
||||
private Integer id;
|
||||
// 店铺id
|
||||
private Integer storeId;
|
||||
// 供应商id
|
||||
private Integer supplierId;
|
||||
// 商品分类id
|
||||
private Integer cvsGoodId;
|
||||
// 商品id
|
||||
private Integer goodsId;
|
||||
// 商品名称
|
||||
private String name;
|
||||
// 条码
|
||||
private String goodsNo;
|
||||
// 拼音码
|
||||
private String pinyinCode;
|
||||
// 货架号
|
||||
private String shelfNumber;
|
||||
// 零售价
|
||||
private String retailPrice;
|
||||
// 单位
|
||||
private String unit;
|
||||
// 库存
|
||||
private String stock;
|
||||
// 进货价(当前成本价)
|
||||
private String buyingPrice;
|
||||
// 成本金额
|
||||
private Double costAmount;
|
||||
// 状态
|
||||
private String status;
|
||||
}
|
Loading…
Reference in New Issue
Block a user