| | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | |
| | | // @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo())); |
| | | // MatCode mat = matCodeService.selectById(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | VersionUtils.setLocDetl(locDetl, mat); |
| | | } |
| | | } |
| | | // for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | // MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo())); |
| | | //// MatCode mat = matCodeService.selectById(locDetl.getMatnr()); |
| | | // if (mat != null) { |
| | | // VersionUtils.setLocDetl(locDetl, mat); |
| | | // } |
| | | // } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | | //库位报表导出 |
| | | @RequestMapping(value = "/stock/statis/export") |
| | | public void stockStatisExport(HttpServletResponse response) throws IOException { |
| | | List<LocDetl> excel = locDetlService.getStockStatisExcel(); |
| | | public void stockStatisExport(@RequestParam(required = false) String matNo, |
| | | @RequestParam(required = false) String matName, |
| | | @RequestParam(required = false) String supplier, |
| | | @RequestParam(required = false) String str3, |
| | | @RequestParam(required = false) String str4, |
| | | @RequestParam(required = false) String memo, |
| | | HttpServletResponse response) throws IOException { |
| | | LocDetl param = new LocDetl(); |
| | | param.setMatNo(matNo!=null ? matNo : ""); |
| | | param.setMatName(matName!=null ? matName : ""); |
| | | param.setSupplier(supplier!=null ? supplier : ""); |
| | | param.setStr3(str3!=null ? str3 : ""); |
| | | param.setStr4(str4!=null ? str4 : ""); |
| | | param.setMemo(memo!=null ? memo : ""); |
| | | |
| | | List<LocDetl> excel = locDetlService.getStockStatisExcel(param); |
| | | for (LocDetl locDetl : excel) { |
| | | MatCode mat = matCodeService.selectById(locDetl.getMatNo()); |
| | | if (mat != null) { |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | |
| | | Integer getStockStatisCount(Map<String, Object> condition); |
| | | |
| | | List<LocDetl> getStockStatisExcel(); |
| | | List<LocDetl> getStockStatisExcel(LocDetl locDetl); |
| | | |
| | | /** |
| | | * 库存上报ERP时,根据物料汇总查询库存总量 |
| | |
| | | * 导出全部库存统计 |
| | | * @return |
| | | */ |
| | | List<LocDetl> getStockStatisExcel(); |
| | | List<LocDetl> getStockStatisExcel(LocDetl locDetl); |
| | | |
| | | /** |
| | | * 搜索库存统计 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> getStockStatisExcel() { |
| | | return this.baseMapper.getStockStatisExcel(); |
| | | public List<LocDetl> getStockStatisExcel(LocDetl locDetl) { |
| | | return this.baseMapper.getStockStatisExcel(locDetl); |
| | | } |
| | | |
| | | /** |
| | |
| | | <if test="mat_name!=null and mat_name!='' "> |
| | | and mat_name like '%' + #{mat_name} + '%' |
| | | </if> |
| | | <if test="supplier!=null and supplier!=''" > |
| | | and supplier like '%'+#{supplier}+'%' |
| | | </if> |
| | | <if test="str3!=null and str3!=''" > |
| | | and str3 like '%'+#{str3}+'%' |
| | | </if> |
| | | <if test="str4!=null and str4!=''" > |
| | | and str4 like '%'+#{str4}+'%' |
| | | </if> |
| | | <if test="memo!=null and memo!='' "> |
| | | and ( |
| | | mat_no like '%' + #{memo} + '%' |
| | | or mat_name like '%' + #{memo} + '%' |
| | | or qty like '%' + #{memo} + '%' |
| | | or str3 like '%' + #{memo} + '%' |
| | | or unit like '%' + #{memo} + '%' |
| | | or specs like '%' + #{memo} + '%' |
| | | or size like '%' + #{memo} + '%' |
| | | or color like '%' + #{memo} + '%' |
| | | or supplier like '%' + #{memo} + '%' |
| | | or source like '%' + #{memo} + '%' |
| | | or vendor like '%' + #{memo} + '%' |
| | | or qty_box like '%' + #{memo} + '%' |
| | | or str3 like '%' + #{memo} + '%' |
| | | or str4 like '%' + #{memo} + '%' |
| | | or str5 like '%' + #{memo} + '%' |
| | | or memo like '%' + #{memo} + '%' |
| | | ) |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="stockOutCondition2"> |
| | | <if test="matNo!=null and matNo!='' "> |
| | | and mat_no like '%' + #{matNo} + '%' |
| | | </if> |
| | | <if test="matName!=null and matName!='' "> |
| | | and mat_name like '%' + #{matName} + '%' |
| | | </if> |
| | | <if test="supplier!=null and supplier!=''" > |
| | | and supplier like '%'+#{supplier}+'%' |
| | | </if> |
| | | <if test="str3!=null and str3!=''" > |
| | | and str3 like '%'+#{str3}+'%' |
| | | </if> |
| | | <if test="str4!=null and str4!=''" > |
| | | and str4 like '%'+#{str4}+'%' |
| | | </if> |
| | | <if test="memo!=null and memo!='' "> |
| | | and ( |
| | | mat_no like '%' + #{memo} + '%' |
| | | or mat_name like '%' + #{memo} + '%' |
| | | or qty like '%' + #{memo} + '%' |
| | | or str3 like '%' + #{memo} + '%' |
| | | or unit like '%' + #{memo} + '%' |
| | | or specs like '%' + #{memo} + '%' |
| | | or size like '%' + #{memo} + '%' |
| | | or color like '%' + #{memo} + '%' |
| | | or supplier like '%' + #{memo} + '%' |
| | | or source like '%' + #{memo} + '%' |
| | | or vendor like '%' + #{memo} + '%' |
| | | or qty_box like '%' + #{memo} + '%' |
| | | or str3 like '%' + #{memo} + '%' |
| | | or str4 like '%' + #{memo} + '%' |
| | | or str5 like '%' + #{memo} + '%' |
| | | or memo like '%' + #{memo} + '%' |
| | | ) |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | |
| | | select * from |
| | | ( |
| | | select ROW_NUMBER() over (order by a.mat_no) as row, |
| | | a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty from |
| | | a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty,specs,unit,color,qty_box,weight,str4,str5 from |
| | | ( |
| | | select |
| | | mat_name,mat_no,supplier,str3,qty |
| | | mat_name,mat_no,supplier,str3,qty,specs,unit,color,qty_box,weight,str4,str5 |
| | | from asr_loc_detl c |
| | | where 1=1 |
| | | <include refid="stockOutCondition1"></include> |
| | | ) a |
| | | group by a.mat_no,a.mat_name,a.supplier,a.str3 |
| | | group by a.mat_no,a.mat_name,a.supplier,a.str3,a.specs,a.unit,a.color,a.qty_box,a.weight,a.str4,a.str5 |
| | | ) d |
| | | where 1=1 |
| | | and row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="getStockStatisCount" resultType="integer"> |
| | | select count(1) from |
| | | ( |
| | | select ROW_NUMBER() over (order by a.mat_no) as row, |
| | | a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty,specs,unit,color,qty_box,weight,str4,str5 from |
| | | ( |
| | | select |
| | | count(1) |
| | | from asr_loc_detl a |
| | | mat_name,mat_no,supplier,str3,qty,specs,unit,color,qty_box,weight,str4,str5 |
| | | from asr_loc_detl c |
| | | where 1=1 |
| | | <include refid="stockOutCondition1"></include> |
| | | ) a |
| | | group by a.mat_no,a.mat_name,a.supplier,a.str3,a.specs,a.unit,a.color,a.qty_box,a.weight,a.str4,a.str5 |
| | | ) d |
| | | |
| | | <!-- select--> |
| | | <!-- count(1)--> |
| | | <!-- from asr_loc_detl a--> |
| | | <!-- where 1=1--> |
| | | <!-- <include refid="stockOutCondition1"></include>--> |
| | | </select> |
| | | <!-- <select id="getStockStatisExcel" resultType="com.zy.asrs.entity.LocDetl">--> |
| | | <select id="getStockStatisExcel" resultMap="BaseResultMap"> |
| | | select |
| | | ROW_NUMBER() over (order by a.mat_no, sum(a.qty) desc) as row |
| | | , a.mat_no, a.mat_name,a.supplier |
| | | , a.mat_no, a.mat_name,a.supplier,str3,specs,unit,color,qty_box as qtyBox,weight,str4,str5 |
| | | , sum(a.qty) as qty |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | group by a.mat_no,a.mat_name,a.supplier |
| | | <include refid="stockOutCondition2"></include> |
| | | group by a.mat_no,a.mat_name,a.supplier,a.str3,a.specs,a.unit,a.color,a.qty_box,a.weight,a.str4,a.str5 |
| | | </select> |
| | | |
| | | <!-- <select id="getStockSum" resultMap="BaseResultMap">--> |
| | |
| | | cols: [[{field: 'qty', align: 'center', title: '数量', width: 120} |
| | | , {field: 'matNo', align: 'center', title: '产品编码'} |
| | | , {field: 'matName', align: 'center', title: '产品名称'} |
| | | , {field: 'specs', align: 'center',title: '规格'} |
| | | , {field: 'unit', align: 'center',title: '单位', width:80} |
| | | , {field: 'color', align: 'center',title: '颜色'} |
| | | , {field: 'qtyBox', align: 'center',title: '每箱数量(PCS)'} |
| | | , {field: 'weight', align: 'center',title: '每箱重量(KG)'} |
| | | , {field: 'str3', align: 'center',title: '客户名称'} |
| | | , {field: 'str4', align: 'center',title: '项目信息'} |
| | | , {field: 'str5$', align: 'center',title: '类别'} |
| | | , {field: 'supplier', align: 'center', title: '批号'} |
| | | ]], |
| | | request: { |
| | |
| | | case 'exportAll': |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | location.href = baseUrl + "/stock/statis/export"; |
| | | location.href = baseUrl + "/stock/statis/export?matNo="+$("#matNo").val()+"&matName="+$("#matName").val() |
| | | +"&supplier="+$("#supplier").val()+"&str3="+$("#str3").val()+"&str4="+$("#str4").val()+"&memo="+$("#memo").val(); |
| | | layer.closeAll('loading'); |
| | | break; |
| | | } |
| | |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="matNo" name="mat_no" placeholder="产品编码" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="mat_name" placeholder="产品名称" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="matName" name="mat_name" placeholder="产品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="str3" placeholder="客户名称" autocomplete="off"> |
| | | <input class="layui-input" type="text" id="supplier" name="supplier" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" id="str3" name="str3" placeholder="客户名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" id="str4" name="str4" placeholder="项目信息" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" id="memo" name="memo" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" id="refresh-sto" lay-event="syncStok" style="margin-left: 10px">上报库存到ERP</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" lay-event="exportAll" style="float: right">导出</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" lay-event="exportAll" style="float: right;margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="operate"> |