Merge branch 'master' of https://gitee.com/nny_1/oilSystem
This commit is contained in:
commit
2a586c09ba
@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询商品列表
|
// 查询库存统计列表
|
||||||
export function listStock(query) {
|
export function listStock(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/stockStatistic/list',
|
url: '/business/convenience/stockStatistic/list',
|
||||||
@ -9,10 +9,20 @@ export function listStock(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询供应商详细
|
// 查询库存统计详细
|
||||||
export function getStock(id) {
|
export function getStock(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/stockStatistic/' + id,
|
url: '/business/convenience/stockStatistic/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 导出库存统计信息
|
||||||
|
export function exportStocks() {
|
||||||
|
return request({
|
||||||
|
url: '/business/convenience/stockStatistic/export',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
<el-card style="margin-top: 20px" >
|
<el-card style="margin-top: 20px" >
|
||||||
<div style="display: flex;justify-content: space-between">
|
<div style="display: flex;justify-content: space-between">
|
||||||
<div style="font-size: 18px">列表</div>
|
<div style="font-size: 18px">列表</div>
|
||||||
<el-button type="primary">导出</el-button>
|
<el-button type="primary" @click="dialogVisible = true">导出</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table ref="tables" v-loading="loading" :data="list"
|
<el-table ref="tables" v-loading="loading" :data="list"
|
||||||
@ -205,17 +205,29 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="导出状态"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="20%"
|
||||||
|
style="margin-top: 200px"
|
||||||
|
:before-close="handleClose">
|
||||||
|
<span>导出文档已生成,请点击下载按钮进行下载</span>
|
||||||
|
<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>
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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 {selectTree} from "@/api/convenienceStore/goods";
|
||||||
import {listSupplier} from "@/api/convenienceStore/supplier";
|
import {listSupplier} from "@/api/convenienceStore/supplier";
|
||||||
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
|
import {exportStock, exportStocks, getStock, listStock} from "@/api/convenienceStore/stockstatistic";
|
||||||
import {getStock, listStock} from "@/api/convenienceStore/stockstatistic";
|
|
||||||
import {listTrack} from "@/api/convenienceStore/stocktrack";
|
import {listTrack} from "@/api/convenienceStore/stocktrack";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -224,6 +236,7 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
@ -269,9 +282,14 @@ export default {
|
|||||||
this.getQueryList();
|
this.getQueryList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTrackList(){
|
exportStock(){
|
||||||
|
exportStocks().then(() => {})
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
// 获取库存跟踪信息
|
||||||
|
getTrackList(stockId){
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listTrack().then(response => {
|
listTrack(stockId).then(response => {
|
||||||
this.trackList = response.data.records;
|
this.trackList = response.data.records;
|
||||||
this.total1 = response.data.total;
|
this.total1 = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -1,19 +1,28 @@
|
|||||||
package com.fuint.business.convenienceSore.controller;
|
package com.fuint.business.convenienceSore.controller;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||||
|
import com.fuint.business.userManager.listener.EasyExcelListener;
|
||||||
import com.fuint.framework.web.BaseController;
|
import com.fuint.framework.web.BaseController;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/business/convenience/stockStatistic")
|
@RequestMapping("/business/convenience/stockStatistic")
|
||||||
public class StockStatisticController extends BaseController {
|
public class StockStatisticController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StockStatisticService stockService;
|
private StockStatisticService stockService;
|
||||||
|
@Autowired
|
||||||
|
private EasyExcelListener listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件查询库存商品信息
|
* 根据条件查询库存商品信息
|
||||||
@ -41,4 +50,27 @@ public class StockStatisticController extends BaseController {
|
|||||||
StockStatisticVo stockStatisticVo = stockService.selectStockById(id);
|
StockStatisticVo stockStatisticVo = stockService.selectStockById(id);
|
||||||
return getSuccessResult(stockStatisticVo);
|
return getSuccessResult(stockStatisticVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, HttpServletRequest request) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
String filenames = "商品-库存统计";
|
||||||
|
String userAgent = request.getHeader("User-Agent");
|
||||||
|
if (userAgent.contains("MSIE") || userAgent.contains("Trident")) {
|
||||||
|
filenames = URLEncoder.encode(filenames, "UTF-8");
|
||||||
|
} else {
|
||||||
|
filenames = new String(filenames.getBytes("UTF-8"), "ISO-8859-1");
|
||||||
|
}
|
||||||
|
response.setContentType("application/json.ms-exce");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.addHeader("Content-Disposition", "filename=" + filenames + ".xlsx");
|
||||||
|
|
||||||
|
List<StockStatisticVo> list = stockService.selectStocks();
|
||||||
|
|
||||||
|
EasyExcel.write(response.getOutputStream(), StockStatisticVo.class).sheet("sheet").doWrite(list);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import com.fuint.business.convenienceSore.entity.StockStatistic;
|
|||||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface StockStatisticMapper extends BaseMapper<StockStatistic> {
|
public interface StockStatisticMapper extends BaseMapper<StockStatistic> {
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询库存统计信息
|
* 根据条件分页查询库存统计信息
|
||||||
@ -16,6 +18,13 @@ public interface StockStatisticMapper extends BaseMapper<StockStatistic> {
|
|||||||
*/
|
*/
|
||||||
public IPage<StockStatisticVo> selectStockList(Page page, @Param("stock") StockStatisticVo stock);
|
public IPage<StockStatisticVo> selectStockList(Page page, @Param("stock") StockStatisticVo stock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<StockStatisticVo> selectStocks(@Param("storeId") Integer storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询库存统计信息
|
* 根据id查询库存统计信息
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -42,4 +42,11 @@
|
|||||||
st.id = #{id}
|
st.id = #{id}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectStocks" resultType="com.fuint.business.convenienceSore.vo.StockStatisticVo"
|
||||||
|
parameterType="java.lang.Integer">
|
||||||
|
<include refid="selectStock"></include>
|
||||||
|
<where>
|
||||||
|
st.store_id = #{storeId}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.fuint.business.convenienceSore.entity.StockStatistic;
|
import com.fuint.business.convenienceSore.entity.StockStatistic;
|
||||||
|
import com.fuint.business.convenienceSore.entity.StockTrack;
|
||||||
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
import com.fuint.business.convenienceSore.vo.StockStatisticVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存统计 业务层
|
* 库存统计 业务层
|
||||||
*/
|
*/
|
||||||
@ -17,10 +20,23 @@ public interface StockStatisticService extends IService<StockStatistic> {
|
|||||||
*/
|
*/
|
||||||
public IPage<StockStatisticVo> selectStockList(Page page, StockStatisticVo stockStatisticVo);
|
public IPage<StockStatisticVo> selectStockList(Page page, StockStatisticVo stockStatisticVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有库存统计信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<StockStatisticVo> selectStocks();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询库存统计信息
|
* 根据id查询库存统计信息
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public StockStatisticVo selectStockById(int id);
|
public StockStatisticVo selectStockById(int id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加库存统计信息
|
||||||
|
* @param stock
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int insertStock(StockStatistic stock);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@ import com.fuint.common.dto.AccountInfo;
|
|||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存统计 业务层
|
* 库存统计 业务层
|
||||||
*/
|
*/
|
||||||
@ -30,6 +32,18 @@ public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper,
|
|||||||
return stockStatisticVoIPage;
|
return stockStatisticVoIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有库存统计信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<StockStatisticVo> selectStocks() {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
List<StockStatisticVo> list = baseMapper.selectStocks(storeId);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询库存统计信息
|
* 根据id查询库存统计信息
|
||||||
* @param id
|
* @param id
|
||||||
@ -39,4 +53,13 @@ public class StockStatisticServiceImpl extends ServiceImpl<StockStatisticMapper,
|
|||||||
public StockStatisticVo selectStockById(int id) {
|
public StockStatisticVo selectStockById(int id) {
|
||||||
return baseMapper.selectStockById(id);
|
return baseMapper.selectStockById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertStock(StockStatistic stock) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
stock.setStoreId(storeId);
|
||||||
|
int row = baseMapper.insert(stock);
|
||||||
|
return row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package com.fuint.business.convenienceSore.vo;
|
package com.fuint.business.convenienceSore.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.fuint.framework.entity.BaseEntity;
|
import com.fuint.framework.entity.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
public class StockStatisticVo extends BaseEntity {
|
public class StockStatisticVo extends BaseEntity {
|
||||||
// id
|
// id
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@ -18,22 +19,31 @@ public class StockStatisticVo extends BaseEntity {
|
|||||||
// 商品id
|
// 商品id
|
||||||
private Integer goodsId;
|
private Integer goodsId;
|
||||||
// 商品名称
|
// 商品名称
|
||||||
|
@ExcelProperty(value = "商品名称")
|
||||||
private String name;
|
private String name;
|
||||||
// 条码
|
// 条码
|
||||||
|
@ExcelProperty(value = "商品条码")
|
||||||
private String goodsNo;
|
private String goodsNo;
|
||||||
// 拼音码
|
// 拼音码
|
||||||
|
@ExcelProperty(value = "拼音码")
|
||||||
private String pinyinCode;
|
private String pinyinCode;
|
||||||
// 货架号
|
// 货架号
|
||||||
|
@ExcelProperty(value = "货架号")
|
||||||
private String shelfNumber;
|
private String shelfNumber;
|
||||||
// 零售价
|
// 零售价
|
||||||
|
@ExcelProperty(value = "零售价")
|
||||||
private String retailPrice;
|
private String retailPrice;
|
||||||
// 单位
|
// 单位
|
||||||
|
@ExcelProperty(value = "单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
// 库存
|
// 库存
|
||||||
|
@ExcelProperty(value = "库存")
|
||||||
private String stock;
|
private String stock;
|
||||||
// 进货价(当前成本价)
|
// 进货价(当前成本价)
|
||||||
|
@ExcelProperty(value = "当前成本价")
|
||||||
private String buyingPrice;
|
private String buyingPrice;
|
||||||
// 成本金额
|
// 成本金额
|
||||||
|
@ExcelProperty(value = "成本金额")
|
||||||
private Double costAmount;
|
private Double costAmount;
|
||||||
// 状态
|
// 状态
|
||||||
private String status;
|
private String status;
|
||||||
|
@ -104,7 +104,5 @@ public class ExportController extends BaseController{
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,66 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="app-center">
|
||||||
|
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<i class="el-icon-back"></i>
|
||||||
|
<span>会员详情</span>
|
||||||
|
</div>
|
||||||
|
<div>基础资料</div>
|
||||||
|
<div class="vip-my-top">
|
||||||
|
<!-- -->
|
||||||
|
<div class="f-box">
|
||||||
|
<div class="imgtoux"><el-avatar :size="80" :src="circleUrl"></el-avatar></div>
|
||||||
<div>
|
<div>
|
||||||
详情页
|
<el-button type="warning" plain round>绑定实体卡</el-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" plain round>会员充值</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card">
|
||||||
|
</el-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "index"
|
name: "index",
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.app-center{
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.vip-my-top{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.f-box{
|
||||||
|
width: 20%;
|
||||||
|
|
||||||
|
}
|
||||||
|
.imgtoux{
|
||||||
|
width: 80px;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user