| | |
| | | |
| | | /** |
| | | * 批量修改物料状态 |
| | | * @param loc_no |
| | | * @param matnr |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/locDetl/getAllLocDetlData") |
| | | @ManagerAuth |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status) { |
| | | return locDetlService.getAllLocDetlData(loc_no, matnr, mat_status); |
| | | @ManagerAuth(memo = "批量修改物料状态") |
| | | public R getAllLocDetlData(@RequestBody JSONObject param) { |
| | | List<LocDetl> list = JSONObject.parseArray(param.getJSONArray("list").toJSONString(), LocDetl.class); |
| | | Integer result = locDetlService.getAllLocDetlData(list); |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | /** |
| | | * 查询总库存(立库+平仓) |
| | | */ |
| | | @RequestMapping(value = "/locDetl/queryAllMatDetl") |
| | | @ManagerAuth(memo = "查询总库存") |
| | | public R queryAllMatDetl(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | return R.ok(locDetlService.queryAllMatDetl(toPage(curr, limit, param, LocDetl.class))); |
| | | } |
| | | } |
| | |
| | | |
| | | List<LocDetl> getAllLocDetlData(@Param("loc_no") String loc_no, @Param("matnr") String matnr); |
| | | |
| | | void updateMatStatus(List<LocDetl> AllLocDetlData); |
| | | Integer updateMatStatus(List<LocDetl> list); |
| | | |
| | | @Update("update asr_loc_detl set anfme=#{anfme}, modi_time = getDate() where loc_no = #{locNo} and matnr = #{matnr}") |
| | | int updateAnfme(Double anfme, String locNo, String matnr); |
| | |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.matnr = #{matnr} AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") |
| | | List<String> selectSameDetlToday(@Param("matnr") String matnr, @Param("start") Integer start, @Param("end") Integer end); |
| | | |
| | | List<LocDetl> queryAllMatDetl(Map<String, Object> map); |
| | | |
| | | Integer queryAllMatDetlPageCount(Map<String, Object> map); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 批量修改物料状态 |
| | | * @param loc_no |
| | | * @param matnr |
| | | * @return |
| | | */ |
| | | List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status); |
| | | Integer getAllLocDetlData(List<LocDetl> list); |
| | | |
| | | Page<LocDetl> queryAllMatDetl(Page<LocDetl> page); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> getAllLocDetlData(String loc_no, String matnr, String mat_status) { |
| | | List<LocDetl> allLocDetlData = baseMapper.getAllLocDetlData(loc_no, matnr); |
| | | for (int i = 0; i < allLocDetlData.size(); i++) { |
| | | allLocDetlData.get(i).setMatStatus(mat_status); |
| | | } |
| | | baseMapper.updateMatStatus(allLocDetlData); |
| | | return baseMapper.getAllLocDetlData(loc_no, matnr); |
| | | public Integer getAllLocDetlData(List<LocDetl> list) { |
| | | return baseMapper.updateMatStatus(list); |
| | | } |
| | | |
| | | @Override |
| | | public Page<LocDetl> queryAllMatDetl(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.queryAllMatDetl(page.getCondition())); |
| | | page.setTotal(baseMapper.queryAllMatDetlPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | } |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocDetl"> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="lgnum" property="lgnum" /> |
| | | <result column="type" property="type" /> |
| | | <result column="mnemonic" property="mnemonic" /> |
| | | <result column="supplier" property="supplier" /> |
| | | <result column="warehouse" property="warehouse" /> |
| | | <result column="brand" property="brand" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="altme" property="altme" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="bname" property="bname" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="mat_status" property="matStatus" /> |
| | | <result column="loc_no" property="locNo"/> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="lgnum" property="lgnum"/> |
| | | <result column="type" property="type"/> |
| | | <result column="mnemonic" property="mnemonic"/> |
| | | <result column="supplier" property="supplier"/> |
| | | <result column="warehouse" property="warehouse"/> |
| | | <result column="brand" property="brand"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="altme" property="altme"/> |
| | | <result column="zpallet" property="zpallet"/> |
| | | <result column="bname" property="bname"/> |
| | | <result column="memo" property="memo"/> |
| | | <result column="modi_user" property="modiUser"/> |
| | | <result column="modi_time" property="modiTime"/> |
| | | <result column="appe_user" property="appeUser"/> |
| | | <result column="appe_time" property="appeTime"/> |
| | | <result column="mat_status" property="matStatus"/> |
| | | </resultMap> |
| | | |
| | | <sql id="stockOutCondition"> |
| | |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="sumLocDetlCondition"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and t.loc_no like '%' + #{loc_no} + '%' |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and t.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and t.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | | <if test="type!=null and type!='' "> |
| | | and t.type like '%' + #{type} + '%' |
| | | </if> |
| | | <if test="lgnum!=null and lgnum!='' "> |
| | | and t.lgnum like '%' + #{lgnum} + '%' |
| | | </if> |
| | | <if test="anfme!=null and anfme!='' "> |
| | | and t.anfme like '%' + #{anfme} + '%' |
| | | </if> |
| | | <if test="supplier!=null and supplier!=null"> |
| | | and t.supplier like '%' + #{supplier} + '%' |
| | | </if> |
| | | <if test="mnemonic!=null and mnemonic!=null"> |
| | | and t.mnemonic like '%' + #{mnemonic} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row, |
| | | a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | <include refid="stockOutCondition"></include> |
| | | select |
| | | ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row, |
| | | a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | <include refid="stockOutCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | |
| | | brand,anfme,altme,zpallet,bname,memo,modi_user, modi_time,appe_user, |
| | | appe_time,mat_status from asr_loc_detl where 1 = 1 |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and loc_no = #{loc_no,jdbcType=VARCHAR} |
| | | and loc_no = #{loc_no,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and matnr = #{matnr,jdbcType=VARCHAR} |
| | | and matnr = #{matnr,jdbcType=VARCHAR} |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | </foreach> |
| | | END; |
| | | </update> |
| | | |
| | | <select id="queryAllMatDetl" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select ROW_NUMBER() over (order by c.matnr,c.loc_no) as row,* from (select a.loc_no,a.matnr, a.maktx, a.lgnum, a.type, a.mnemonic, a.supplier, a.anfme from asr_loc_detl a |
| | | union |
| | | select b.warehouse as loc_no,matnr, b.maktx, b.lgnum, b.type, b.mnemonic, b.supplier, b.anfme from asr_loc_normal b) c |
| | | ) t where 1=1 |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and t.loc_no = #{loc_no} |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and t.matnr = #{matnr} |
| | | </if> |
| | | and t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="queryAllMatDetlPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select count(1) from |
| | | ( |
| | | select ROW_NUMBER() over (order by c.matnr,c.loc_no) as row,* from (select a.loc_no,a.matnr, a.maktx, a.lgnum, a.type, a.mnemonic, a.supplier, a.anfme from asr_loc_detl a |
| | | union |
| | | select b.warehouse as loc_no,matnr, b.maktx, b.lgnum, b.type, b.mnemonic, b.supplier, b.anfme from asr_loc_normal b) c |
| | | ) t where 1=1 |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and t.loc_no = #{loc_no} |
| | | </if> |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and t.matnr = #{matnr} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | ,{field: 'str3', align: 'center',title: '规格型号'} |
| | | ,{field: 'str1', align: 'center',title: '基本单位', hide: true} |
| | | ,{field: 'str4', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'str5', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'str5', align: 'center',title: '生产单号'} |
| | | ,{field: 'str6', align: 'center',title: '通知单号'} |
| | | ,{field: 'str7', align: 'center',title: '默认仓库', hide: true} |
| | | // ,{field: 'str8', align: 'center',title: '品牌'} |
| | |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 500} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'mnemonic', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号', hide: true} |
| | | ,{field: 'warehouse', align: 'center',title: '生产单号'} |
| | | ,{field: 'mnemonic', align: 'center',title: '生产单号'} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | // ,{field: 'warehouse', align: 'center',title: '产地'} |
| | | // ,{field: 'brand', align: 'center',title: '品牌'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | // ,{field: 'altme', align: 'center',title: '单位'} |
| | |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 400} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'mnemonic', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'mnemonic', align: 'center',title: '生产单号'} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | // ,{field: 'warehouse', align: 'center',title: '库区'} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [{field: 'locNo$', align: 'center',title: '库位号'}]; |
| | | var cols = [ |
| | | {type: 'checkbox', fixed: 'left'}, |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push( |
| | | {field: 'matStatus', align: 'center',title: '物料状态', width: 100, templet: '#matStatus'} |
| | |
| | | function showMatStatus() { |
| | | var layer = layui.layer; |
| | | var table = layui.table; |
| | | // // 获取选中行 |
| | | // var checkStatus = table.checkStatus('chooseData'); |
| | | // // 选择行数据 |
| | | // var checkData = checkStatus.data; |
| | | // if (checkData.length == 0) { |
| | | // layer.msg("请选择数据"); |
| | | // return; |
| | | // } |
| | | // 获取选中行 |
| | | var checkStatus = table.checkStatus('locDetl'); |
| | | // 选择行数据 |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length == 0) { |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | | |
| | | matStatusConfirm = layer.open({ |
| | | type: 2, |
| | |
| | | btn: ['确定'], |
| | | success: function (layero, index) { |
| | | // 成功打开弹窗 |
| | | tableReload(false); |
| | | // tableReload(false); |
| | | }, |
| | | yes: function (index, layero) { |
| | | // 子页面 |
| | |
| | | var forms = matStatus.forms; |
| | | var cho = forms[0][0].value; |
| | | // 入参拼接 |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | const param = { |
| | | loc_no: searchData.loc_no, |
| | | matnr: searchData.matnr, |
| | | matStatusFlag: cho, |
| | | if (checkData && checkData.length > 0) { |
| | | checkData.map(function (item) { |
| | | item.matStatus = cho; |
| | | }); |
| | | } |
| | | param = { |
| | | list: checkData, |
| | | }; |
| | | // 更新物料状态 |
| | | console.log('选择数据', checkData); |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/getAllLocDetlData?loc_no=" + param.loc_no + "&matnr=" + param.matnr + "&mat_status=" + param.matStatusFlag, |
| | | url: baseUrl+"/locDetl/getAllLocDetlData", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: JSON.stringify(param), |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'GET', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | console.log('返回值', res); |
| | | // 关闭弹窗 |
| | |
| | | } |
| | | ]; |
| | | locNormalCols.map(function (item) { |
| | | if (item.field === 'supplier') { |
| | | if (item.field === 'supplier' || item.field === 'mnemonic') { |
| | | item.edit = 'text'; |
| | | } |
| | | }) |
| | |
| | | } |
| | | ]; |
| | | matCols.map(function (item) { |
| | | if (item.field === 'str6') { |
| | | if (item.field === 'str6' || item.field === 'str5') { |
| | | item.edit = 'text'; |
| | | item.style = 'color: blue;font-weight: bold'; |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | var tableIns; |
| | | |
| | | function getCol() { |
| | | var sumCol = [ |
| | | {field: 'matnr', align: 'center',title: '物料编码'} |
| | | ,{field: 'maktx', align: 'center',title: '物料名称', width: 500} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '物料类别'} |
| | | ,{field: 'mnemonic', align: 'center',title: '生产单号'} |
| | | ,{field: 'supplier', align: 'center',title: '通知单号'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ]; |
| | | var cols = [{field: 'locNo', align: 'center', title: '库位号'}]; |
| | | cols.push.apply(cols, sumCol); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#sumLocDetl', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/locDetl/queryAllMatDetl', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index') || 0; |
| | | if (data.elem.checked) { |
| | | res.data[_index][data.value] = 'Y'; |
| | | } else { |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | /* 搜索 */ |
| | | form.on('submit(search)',function () { |
| | | tableReload(false); |
| | | }); |
| | | /* 重置 */ |
| | | form.on('submit(reset)',function () { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | }); |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | /* 表格数据重载 */ |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr - 1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | } |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <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="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="物料编码" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form"> |
| | | <table id="sumLocDetl" lay-filter="sumLocDetl"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <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/pakStore/sumLocDetl.js" charset="utf-8"></script> |
| | | |
| | | |
| | | |
| | | </body> |
| | | </html> |
| | | |