| | |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @RequestMapping(value = "/locDetl/selectAllNumWarning/auth") |
| | | @ManagerAuth(memo = "库存数量预警") |
| | | public R selectAllNumWarning(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | // Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | // for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | // Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | // if (mat != null) { |
| | | // locDetl.sync(mat); |
| | | // } |
| | | // } |
| | | // return R.ok().add(stockStatis); |
| | | |
| | | Page<LocDetlAll> stockStatis = locDetlService.getWarningNumPage(toPage(curr, limit, param, LocDetlAll.class)); |
| | | for (LocDetlAll locDetlAll : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetlAll.getMatnr()); |
| | | if (mat != null) { |
| | | locDetlAll.sync(mat); |
| | | } |
| | | } |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/selectAllWarning/auth") |
| | | @ManagerAuth(memo = "库存预警") |
| | | @ManagerAuth(memo = "库龄预警") |
| | | public Map<String,Object> queryViewStayTimeListByPages(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | |
| | | private Date appe_time; |
| | | private String meno; |
| | | private String manu; |
| | | private Integer inventory_max; |
| | | private Integer inventory_min; |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | |
| | | |
| | | Integer getStockStatisCountAll(Map<String, Object> map); |
| | | |
| | | List<LocDetlAll> getWarningNumList(Map<String, Object> map); |
| | | |
| | | Integer getWarningNumListCount(Map<String, Object> map); |
| | | |
| | | List<LocDetl> getStockStatisExcel(); |
| | | |
| | | @Select("select sum(a.anfme) as sum from asr_loc_detl a left join asr_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr}") |
| | |
| | | Page<LocDetl> getStockStatis(Page<LocDetl> page); |
| | | Page<LocDetlAll> getStockStatisAll(Page<LocDetlAll> page); |
| | | |
| | | Page<LocDetlAll> getWarningNumPage(Page<LocDetlAll> page); |
| | | |
| | | Double sumAll(); |
| | | |
| | | Double getSumAnfme(String matnr); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<LocDetlAll> getWarningNumPage(Page<LocDetlAll> page) { |
| | | page.setRecords(baseMapper.getWarningNumList(page.getCondition())); |
| | | page.setTotal(baseMapper.getWarningNumListCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public Double sumAll() { |
| | | return this.baseMapper.sumAll(); |
| | | } |
| | |
| | | ) b |
| | | </select> |
| | | |
| | | <!-- 数量预警--> |
| | | <select id="getWarningNumList" resultType="com.zy.asrs.entity.result.LocDetlAll"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl_all a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | ) t |
| | | LEFT JOIN man_mat m ON t.matnr = m.matnr |
| | | WHERE t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | and t.anfme > m.inventory_max or t.anfme < m.inventory_min |
| | | |
| | | |
| | | <!-- select * from--> |
| | | <!-- (--> |
| | | <!-- select--> |
| | | <!-- ROW_NUMBER() over (order by sum(a.anfme) desc) as row--> |
| | | <!-- , a.matnr--> |
| | | <!-- , sum(a.anfme) as anfme--> |
| | | <!-- ,m.inventory_max--> |
| | | <!-- ,m.inventory_min--> |
| | | <!-- from asr_loc_detl_all a--> |
| | | <!-- LEFT JOIN man_mat m on a.matnr = m.matnr--> |
| | | <!-- where 1=1--> |
| | | <!-- <include refid="stockOutCondition"></include>--> |
| | | <!-- group by a.matnr,m.inventory_max,m.inventory_min--> |
| | | <!-- ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})--> |
| | | <!-- and t.anfme>t.inventory_max or t.anfme < t.inventory_min--> |
| | | </select> |
| | | |
| | | <select id="getWarningNumListCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | <!-- select count(1) from--> |
| | | <!-- (--> |
| | | <!-- select--> |
| | | <!-- ROW_NUMBER() over (order by sum(a.anfme) desc) as row--> |
| | | <!-- , a.matnr--> |
| | | <!-- , sum(a.anfme) as anfme--> |
| | | <!-- ,m.inventory_max--> |
| | | <!-- ,m.inventory_min--> |
| | | <!-- from asr_loc_detl_all a--> |
| | | <!-- LEFT JOIN man_mat m on a.matnr = m.matnr--> |
| | | <!-- where 1=1--> |
| | | <!-- <include refid="stockOutCondition"></include>--> |
| | | <!-- group by a.matnr,m.inventory_max,m.inventory_min--> |
| | | <!-- ) t--> |
| | | |
| | | select count(1) from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl_all a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | ) t |
| | | LEFT JOIN man_mat m ON t.matnr = m.matnr |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="sumAll" resultType="java.lang.Double"> |
| | | SELECT SUM(anfme) FROM asr_loc_detl_all |
| | | </select> |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'} |
| | | {field: 'anfme', align: 'center',title: '库存数量', style: 'font-weight: bold'}, |
| | | {field: 'inventory_max', align: 'center',title: '库存上限', style: 'font-weight: bold'}, |
| | | {field: 'inventory_min', align: 'center',title: '库存下限', style: 'font-weight: bold'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "anfme") |
| | | arrRemove(detlCols, "field", "zpallet") |
| | |
| | | tableIns = table.render({ |
| | | elem: '#locDetlStatis', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/statis/auth', |
| | | url: baseUrl+'/locDetl/selectAllNumWarning/auth', |
| | | page: true, |
| | | limit: 20, |
| | | limits: [20, 30, 50, 100, 200, 500], |
| | |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'weight', align: 'center',title: '库位总重量', hide: false} |
| | | ,{field: 'weight', align: 'center',title: '库位总重量', hide: true} |
| | | |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true, hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | |
| | | |
| | | // cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} |
| | | ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'} |
| | | // ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ) |
| | | return cols; |
| | |
| | | {field: 'parentName', align: 'center',title: '库区', hide: false}, |
| | | {field: 'createBy$', align: 'center',title: '创建人', hide: false}, |
| | | {field: 'createTime$', align: 'center',title: '创建时间', hide: false}, |
| | | {field: 'status', align: 'center',title: '库位冻结', templet: '#stockFreezeTpl'}, |
| | | // {field: 'status', align: 'center',title: '库位冻结', templet: '#stockFreezeTpl'}, |
| | | {field: 'type$', align: 'center',title: '类型', templet: '#tagTpl', hide: false} |
| | | ]], |
| | | request: { |
| | |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | |
| | | // {field: 'batch', title: '批号'}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | // {field: 'specs', title: '规格'}, |
| | | {field: 'weight', title: '重量'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | console.log(nList); |
| | | for (let xi = 0; xi < nList.length; xi++) { |
| | | if (nList[xi].anfme <= 0){ |
| | | layer.msg('明细修改数量不合法', {icon: 2}); |
| | | layer.msg('明细数量不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | | if (nList[xi].batch == null || nList[xi].batch == ""){ |
| | | layer.msg('批次不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | | if (nList[xi].anfme < nList[xi].workQty){ |
| | |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 200}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'weight', title: '重量', edit: true}, |
| | | {field: 'batch', title: '批次', edit: true}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | |
| | | // {field: 'payment', title: '货物状态',align: 'center', templet: '#payment'}, |
| | |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locDetlStatis/locDetlStatis.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locDetlNumWarning/locDetlNumWarning.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |