便利店

This commit is contained in:
cun-nan 2023-10-28 13:33:42 +08:00
parent f8bf519927
commit 217a549247
28 changed files with 168 additions and 92 deletions

View File

@ -22,7 +22,8 @@ export function getStock(id) {
export function exportStocks() {
return request({
url: '/business/convenience/stockStatistic/export',
method: 'get'
method: 'post',
responseType:'blob'
})
}

View File

@ -59,3 +59,11 @@ export function delUser(id) {
method: 'delete'
})
}
//下载示例文件
export function exportUsers() {
return request({
url: '/excel/export',
method: 'get'
})
}

View File

@ -101,13 +101,13 @@
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" align="center" width="160"/>
<el-table-column label="供应商" prop="supplierId" align="center">
<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"/>
<el-table-column label="拼音码" prop="pinyinCode" align="center" width="120"/>
<el-table-column label="货架号" prop="shelfNumber" align="center"/>
<el-table-column label="库存" prop="stock" align="center"/>
<el-table-column label="单位" prop="unit" align="center"/>
@ -571,6 +571,7 @@ export default {
this.$modal.confirm('确定删除"' + name + '"的商品信息?').then(function() {
return delLJGoods(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
@ -618,7 +619,7 @@ export default {
<style lang="scss" scoped>
.app-container{
width: 100%;
height: 100vh;
height: 100%;
background: #f6f8f9;
}
</style>

View File

@ -251,8 +251,8 @@ export default {
}],
//
queryParams: {
pageNum: 1,
pageSize: 5,
page: 1,
pageSize: 10,
name:'',
status: '',
},
@ -290,72 +290,16 @@ export default {
},
//
handleAdd() {
this.reset()
this.open = true;
this.title = "新增分类";
},
//
editeCategory(val){
// this.editForm .categoryName = ''
// this.editForm.pid = ''
// this.editForm.status = 'qy'
// this.editForm.sorted = 0
if(val.pid !== 0){
this.isShow = true
}
this.editDialogFormVisible = true
// selectParentById(val).then(response=>{
// this.editForm.categoryName = response.data
// })
},
//
cancelEdite(){
this.editDialogFormVisible = false
},
//
saveEdite(){
this.editDialogFormVisible = false
},
//
delCategory(id){
deleteBYId(id).then(res=>{
// console.log(res)
})
},
//
insertGoods(){
this.resetForm('form')
this.form.name = ''
this.form.pid = ''
this.form.status = 'qy'
this.form.sorted = 0
this.dialogFormVisible = true
this.getFirstMenu();
},
//
getFirstMenu(){
list(this.form).then(response=>{
this.goodsOptions = response.data
})
},
//
onQuery(){
selectTree(this.goodsQueryForm).then(response=>{
if (response.code === 200) {
if(response.data == null){
this.tableData = []
this.total = 0;
this.$message('查询成功');
}else{
this.tableData = response.data.records
this.total = response.data.total;
this.$message('查询成功');
}
} else {
this.$message('查询失败,请联系管理员');
}
})
},
//
handleQuery() {
this.queryParams.page = 1;
@ -419,6 +363,9 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if(this.form.pid==""){
this.form.pid = 0
}
if (this.form.id) {
updateCevGood(this.form).then(response => {
this.$modal.msgSuccess("分类更新成功");
@ -458,6 +405,7 @@ export default {
// return deleteMember(row.id);
return deleteBYId(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
@ -491,7 +439,7 @@ export default {
}
.app-container{
width: 100%;
height: 100%;
height: 100vh;
background: #f6f8f9;
}
</style>

View File

@ -216,8 +216,8 @@
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="exportStock">
<!-- -->
<a href="/dev-api/business/convenience/stockStatistic/export"> </a>
<!-- <a href="/dev-api/business/convenience/stockStatistic/export"> </a>-->
</el-button>
</span>
</el-dialog>
@ -227,7 +227,7 @@
<script>
import {selectTree} from "@/api/convenienceStore/goods";
import {listSupplier} from "@/api/convenienceStore/supplier";
import {exportStock, exportStocks, getStock, listStock} from "@/api/convenienceStore/stockstatistic";
import {exportStocks, getStock, listStock} from "@/api/convenienceStore/stockstatistic";
import {listTrack} from "@/api/convenienceStore/stocktrack";
export default {
@ -283,7 +283,10 @@ export default {
},
methods: {
exportStock(){
exportStocks().then(() => {})
exportStocks().then(response => {
const blob = new Blob([response], { type: 'application/json' })
this.$download.saveAs(blob,'商品-库存统计.xlsx')
})
this.dialogVisible = false
},
//

View File

@ -236,6 +236,7 @@ export default {
this.$modal.confirm('确定删除"' + name + '"的供应商信息?').then(function() {
return delSupplier(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});

View File

@ -193,7 +193,7 @@
<dict-tag :options="dict.type.yhlx" :value="scope.row.discountType"/>
</template>
</el-table-column>
<el-table-column label="优惠详情" align="center" width="140">.
<el-table-column label="优惠详情" align="center" width="170">.
<template slot-scope="scope">
<p v-if="scope.row.discountType=='优惠活动组'">
关联优惠组{{scope.row.promotionGroup}}
@ -1032,7 +1032,7 @@ export default {
this.userList = response.data.records;
});
},
//
//
reset() {
this.form = {
id: '', name: '',discountType:'自定义优惠',gasolineDiscount:'无优惠',
@ -1082,6 +1082,7 @@ export default {
},
//
handleAdd() {
this.reset();
this.open = true;
this.title = "新增认证类型";
},
@ -1264,6 +1265,7 @@ export default {
this.title = "会员认证结果";
this.result = response.data;
this.reset2();
this.getListMember();
})
}
});
@ -1271,10 +1273,11 @@ export default {
//
handleDelete(row) {
const name = row.name
this.$modal.confirm('确定删除"' + name + '"的固定等级信息?').then(function() {
this.$modal.confirm('所绑定的认证会员信息将会失效!!确定删除"' + name + '"的固定等级信息?').then(function() {
// return deleteMember(row.id);
return delFixingLevel(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
@ -1286,6 +1289,7 @@ export default {
// return deleteMember(row.id);
return delCertifiedMember(row.id);
}).then(() => {
this.queryParam.page = 1
this.getListMember();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});

View File

@ -452,7 +452,7 @@
import { getMemberList, updateMemberStatus, getMemberInfo, saveMember, deleteMember } from "@/api/member";
import balanceRecharge from "./balanceRecharge";
import pointRecharge from "./pointRecharge";
import {addUser, delUser, getUser, listStatistic, listUser, updateUser} from "@/api/staff/user/user";
import {addUser, delUser, exportUsers, getUser, listStatistic, listUser, updateUser} from "@/api/staff/user/user";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {ljStoreList} from "@/api/staff/store";
import {getSysConfig} from "@/api/staff/user/sysconfig";
@ -558,6 +558,10 @@ export default {
this.getConfig();
},
methods: {
exportUser(){
console.log(1)
exportUsers().then(response => {})
},
//
goDedi(id){
this.$router.push({
@ -707,6 +711,7 @@ export default {
//
cancel() {
this.open = false;
this.openUser = false;
this.reset();
},
//
@ -746,6 +751,7 @@ export default {
// return deleteMember(row.id);
return delUser(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});

View File

@ -851,6 +851,7 @@ export default {
this.$modal.confirm('是否确认删除"' + name + '"的员工信息?').then(function() {
return delStaff(row.id);
}).then(() => {
this.queryParams.page = 1
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});

View File

@ -597,7 +597,7 @@ export default {
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
form: { id: '', grade: 0, name: '',gasoline:'',dieselOil:'',naturalGas:'',preferential:'自定义优惠',
form: { id: '', grade: 0, name: '',gasoline:1,dieselOil:1,naturalGas:1,preferential:'自定义优惠',
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
status: 'qy' },
@ -729,7 +729,7 @@ export default {
//
getList() {
this.loading = true;
listUserGrade().then(response => {
listUserGrade(this.queryParams).then(response => {
this.list = response.data.records;
this.total = response.data.total;
this.loading = false;
@ -784,7 +784,7 @@ export default {
//
reset() {
this.form = {
id: '', grade: 0, name: '',gasoline:'',dieselOil:'',naturalGas:'',preferential:'自定义优惠',
id: '', grade: 0, name: '',gasoline:1,dieselOil:1,naturalGas:1,preferential:'自定义优惠',
gasolineDiscount:'无优惠',dieselDiscount:'无优惠',naturalGasDiscount:'无优惠',promotionGroup:'',
// catchCondition: '', userPrivilege: '', catchType: '', catchValue: '', validDay: '',discount: '', speedPoint: '',
status: 'qy'
@ -877,6 +877,7 @@ export default {
// return deleteUserGrade(row.id);
return delUserGrade(row.id);
}).then(() => {
this.queryParams.page = 1
this.$modal.msgSuccess("删除成功");
this.getList();
}).catch(() => {});

View File

@ -36,7 +36,7 @@ public class CvsGoodsController extends BaseController {
/**分页查询*/
@GetMapping("/selectTree")
private ResponseObject selectTree(CvsGoods goods,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<CvsGoodsVo> list = cvsGoodsService.selectTree(page,goods);

View File

@ -31,7 +31,7 @@ public class LJGoodsController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(LJGoods goods,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@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);

View File

@ -33,7 +33,7 @@ public class StockStatisticController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(StockStatisticVo stockVo,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<StockStatisticVo> list = stockService.selectStockList(page,stockVo);
@ -51,7 +51,7 @@ public class StockStatisticController extends BaseController {
return getSuccessResult(stockStatisticVo);
}
@GetMapping("/export")
@PostMapping("/export")
public void export(HttpServletResponse response, HttpServletRequest request) {
try {
@ -73,4 +73,6 @@ public class StockStatisticController extends BaseController {
e.printStackTrace();
}
}
}

View File

@ -26,7 +26,7 @@ public class StockTrackController extends BaseController {
* @return
*/
@GetMapping("/list/{stockId}")
public ResponseObject list(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
public ResponseObject list(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@PathVariable Integer stockId){
Page page =new Page(pageNo,pageSize);

View File

@ -28,7 +28,7 @@ public class SupplierController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(Supplier supplier,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<Supplier> list = supplierService.selectSupplierList(page,supplier);

View File

@ -33,10 +33,24 @@ public interface StockStatisticService extends IService<StockStatistic> {
*/
public StockStatisticVo selectStockById(int id);
/**
* 根据商品id查询库存统计信息
* @param goodsId
* @return
*/
public StockStatistic selectStockByGoodsId(int goodsId);
/**
* 增加库存统计信息
* @param stock
* @return
*/
public int insertStock(StockStatistic stock);
/**
* 根据商品id删除库存统计信息
* @param goodsId
* @return
*/
public void deleteStock(Integer goodsId);
}

View File

@ -34,8 +34,11 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
if(CollectionUtil.isNotEmpty(cvsGoodsList)){
return -1;
}else {
AccountInfo nowAccountInfo1 = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo1.getStoreId();
cvsGoods.setStoreId(storeId);
int insertGoods = baseMapper.insert(cvsGoods);
cvsGoods.setCode(cvsGoods.getPid()+","+cvsGoods.getId()+",");
cvsGoods.setCode(String.valueOf(cvsGoods.getId()+cvsGoods.getPid()));
baseMapper.updateById(cvsGoods);
return insertGoods;
}

View File

@ -6,10 +6,15 @@ 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.LJGoods;
import com.fuint.business.convenienceSore.entity.StockStatistic;
import com.fuint.business.convenienceSore.entity.StockTrack;
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.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Random;
@ -19,6 +24,11 @@ import java.util.Random;
*/
@Service
public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> implements LJGoodsService {
@Autowired
private StockStatisticService stockService;
@Autowired
private StockTrackService trackService;
/**
* 根据条件分页查询商品信息
* @param page
@ -90,6 +100,7 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
@Override
public void deleteLJGoodsById(Integer id) {
baseMapper.deleteById(id);
stockService.deleteStock(id);
}
/**
@ -103,6 +114,24 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
Integer storeId = nowAccountInfo.getStoreId();
goods.setStoreId(storeId);
int row = baseMapper.insert(goods);
// 添加库存统计信息
StockStatistic stock = new StockStatistic();
stock.setStoreId(storeId);
stock.setGoodsId(goods.getId());
stock.setCvsGoodId(goods.getCvsGoodId());
stock.setSupplierId(goods.getSupplierId());
Double costAmount = goods.getBuyingPrice()*goods.getStock();
stock.setCostAmount(costAmount);
stockService.insertStock(stock);
// 查询插入的库存统计信息
StockStatistic stockStatistic = stockService.selectStockByGoodsId(goods.getId());
// 添加库存跟踪信息
StockTrack stockTrack = new StockTrack();
stockTrack.setStockId(stockStatistic.getId());
stockTrack.setStoreId(storeId);
stockTrack.setDocument("商品初始化");
stockTrack.setChangeNumber(goods.getStock());
trackService.insertStockTrack(stockTrack);
return row;
}

View File

@ -1,5 +1,6 @@
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;
@ -54,12 +55,39 @@ public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper,
return baseMapper.selectStockById(id);
}
/**
* 根据商品id查询库存统计信息
* @param goodsId
* @return
*/
@Override
public StockStatistic selectStockByGoodsId(int goodsId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("goods_id",goodsId);
StockStatistic stockStatistic = baseMapper.selectOne(queryWrapper);
return stockStatistic;
}
/**
* 添加库存统计信息
* @param stock
* @return
*/
@Override
public int insertStock(StockStatistic stock) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
stock.setStoreId(storeId);
int row = baseMapper.insert(stock);
return row;
}
/**
* 根据商品id删除库存统计信息
* @param goodsId
* @return
*/
@Override
public void deleteStock(Integer goodsId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("goods_id",goodsId);
baseMapper.delete(queryWrapper);
}
}

View File

@ -43,9 +43,6 @@ public class StockTrackServiceImpl extends ServiceImpl<StockTrackMapper, StockTr
*/
@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());

View File

@ -31,7 +31,7 @@ public class CertifiedMemberController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(CertifiedMember certifiedMember,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<CertifiedMember> list = certifiedMemberService.selectCertifiedMemberList(page,certifiedMember);

View File

@ -94,8 +94,12 @@ public class ExportController extends BaseController{
LJUser ljUser = new LJUser();
ljUser.setUserNo("51246214");
ljUser.setName("会员");
ljUser.setOpenId("15245698512");
ljUser.setMobile("15245698512");
ljUser.setIdcard("845126542514568542");
ljUser.setPoint(1);
ljUser.setAddress("山东省济南市");
ljUser.setSecondCard("15245698513");
List<LJUser> list = new ArrayList<>();

View File

@ -28,7 +28,7 @@ public class FixingLevelController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(FixingLevel fixingLevel,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<FixingLevel> list = fixingLevelService.selectFixingLevelList(page,fixingLevel);

View File

@ -30,7 +30,7 @@ public class LJUserController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(LJUser user,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<LJUser> list = userService.selectUserList(page,user);

View File

@ -28,7 +28,7 @@ public class LJUserGradeController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(LJUserGrade userGrade,
@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<LJUserGrade> list = userGradeService.selectUserGradeList(page,userGrade);

View File

@ -30,6 +30,13 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
*/
public CertifiedMember selectCertifiedMemberByUserId(int userId);
/**
* 根据固定等级id删除认证会员信息
* @param fixingLevelId
* @return
*/
public void deleteCertifiedMemberByFixingLevelId(int fixingLevelId);
/**
* 根据会员手机号查询认证会员信息
* @param mobile

View File

@ -73,6 +73,18 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
return certifiedMember;
}
/**
* 根据固定等级id删除认证会员信息
* @param fixingLevelId
* @return
*/
@Override
public void deleteCertifiedMemberByFixingLevelId(int fixingLevelId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fixing_level_id",fixingLevelId);
baseMapper.delete(queryWrapper);
}
/**
* 根据会员手机号查询认证会员信息
* @param mobile

View File

@ -8,10 +8,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.userManager.entity.FixingLevel;
import com.fuint.business.userManager.entity.LJUserGrade;
import com.fuint.business.userManager.mapper.FixingLevelMapper;
import com.fuint.business.userManager.service.CertifiedMemberService;
import com.fuint.business.userManager.service.FixingLevelService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -19,6 +21,9 @@ import org.springframework.stereotype.Service;
*/
@Service
public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, FixingLevel> implements FixingLevelService {
@Autowired
private CertifiedMemberService certifiedMemberService;
/**
* 根据条件分页查询固定等级信息
* @param page
@ -60,6 +65,7 @@ public class FixingLevelServiceImpl extends ServiceImpl<FixingLevelMapper, Fixin
*/
@Override
public void deleteFixingLevelById(Integer id) {
certifiedMemberService.deleteCertifiedMemberByFixingLevelId(id);
baseMapper.deleteById(id);
}