src/main/java/com/zy/asrs/controller/LocDetlController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/entity/LocDetl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/js/locDetlGroup/locDetlGroup.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/js/order/order.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -22,8 +22,10 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import javax.xml.crypto.Data; import java.io.IOException; import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -115,7 +117,9 @@ excludeTrash(param); convert(param, wrapper); allLike(LocDetl.class, param.keySet(), wrapper, condition); if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} if (!Cools.isEmpty(orderByField)) { wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); } if (!row.equals("")){ wrapper.and() .where("loc_no like '" +row +"%'"); @@ -269,6 +273,7 @@ /** * 获取库存总数 * * @return */ @RequestMapping("/locDetl/count") @@ -297,28 +302,37 @@ for (LocDetl locDetl : groupLocDetl) { Mat mat = matService.selectOne(new EntityWrapper<Mat>() .eq("matnr", locDetl.getMatnr())); locDetl.setStoreMax(mat.getStoreMax()); locDetl.setStoreMaxDate(mat.getStoreMaxDate()); locDetl.setStoreMin(mat.getStoreMin()); if (Cools.isEmpty(mat) || Cools.isEmpty(mat.getStoreMax()) || Cools.isEmpty(mat.getStoreMaxDate()) || Cools.isEmpty(mat.getStoreMin())) { continue; } else if (Cools.isEmpty(locDetl.getBatch())) { continue; } else if (locDetl.getBatch().length() != 8) { continue; } try { SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd"); Date maxDate = simple.parse(locDetl.getBatch()); long time = maxDate.getTime(); Date now = new Date(); long time1 = now.getTime(); locDetl.setNowTime((int)((time1 - time)/(1000*60*60*24))); } catch (ParseException e) { e.printStackTrace(); } if (locDetl.getAnfme() > mat.getStoreMax()){ result.add(locDetl); continue; } if (locDetl.getAnfme() < mat.getStoreMin()){ } else if (locDetl.getAnfme() < mat.getStoreMin()) { result.add(locDetl); continue; } if (Cools.isEmpty(locDetl.getBatch())) { continue; } if (locDetl.getBatch().length() != 8){ continue; } try{ SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd"); Date maxDate = simple.parse(locDetl.getBatch()); @@ -332,7 +346,6 @@ if (now.compareTo(maxDate) > 0) { result.add(locDetl); } }catch (Exception e){ continue; } src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -158,6 +158,27 @@ @ApiModelProperty(value= "备注") private String memo; /** * 库存预警数量上限 */ private Double storeMax; /** * 库存预警数量下限 */ private Double storeMin; /** * 库龄预警上限 */ private Integer storeMaxDate; /** * 实际在库天数 */ private Integer nowTime; public String getLocNo$(){ LocMastService service = SpringUtils.getBean(LocMastService.class); LocMast locMast = service.selectById(this.locNo); @@ -168,7 +189,9 @@ } public String getBeBatch$(){ if (null == this.beBatch){ return null; } if (null == this.beBatch) { return null; } switch (this.beBatch){ case 1: return "是"; @@ -180,7 +203,9 @@ } public String getSource$(){ if (null == this.source){ return null; } if (null == this.source) { return null; } switch (this.source){ case 1: return "制造"; @@ -194,7 +219,9 @@ } public String getInspect$(){ if (null == this.inspect){ return null; } if (null == this.inspect) { return null; } switch (this.inspect){ case 1: return "是"; @@ -206,7 +233,9 @@ } public String getDanger$(){ if (null == this.danger){ return null; } if (null == this.danger) { return null; } switch (this.danger){ case 1: return "是"; src/main/webapp/static/js/locDetlGroup/locDetlGroup.js
@@ -1,13 +1,16 @@ var pageCurr; function getCol() { var cols = [ {field: 'matnr', align: 'center',title: '物料号', sort:true} ,{field: 'maktx', align: 'center',title: '物料名称', sort:true} ,{field: 'specs', align: 'center',title: '规格'} ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true} ,{field: 'anfme', align: 'center',title: '数量'} , {field: 'storeMax', align: 'center', title: '数量上限', sort: true} , {field: 'storeMin', align: 'center', title: '数量下限', sort: true} , {field: 'storeMaxDate', align: 'center', title: '库龄上限', sort: true} , {field: 'anfme', align: 'center', title: '实际数量'} , {field: 'nowTime', align: 'center', title: '实际库龄'} ]; @@ -104,7 +107,8 @@ success: function(layero, index){ layer.getChildFrame('#data-detail-submit-edit', index).hide(); clearFormVal(layer.getChildFrame('#detail', index)); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); } }); break; @@ -202,7 +206,8 @@ setFormVal(layer.getChildFrame('#detail', index), data, true); top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); } @@ -222,7 +227,8 @@ setFormVal(layer.getChildFrame('#detail', index), data, false); top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); top.convertDisabled(layer.getChildFrame('#locNo,#matnr', index), true); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); } @@ -250,7 +256,8 @@ setFormVal(layer.getChildFrame('#detail', index), res.data, true); top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); } else if (res.code === 403){ @@ -286,7 +293,8 @@ setFormVal(layer.getChildFrame('#detail', index), res.data, true); top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); } else if (res.code === 403){ @@ -322,7 +330,8 @@ setFormVal(layer.getChildFrame('#detail', index), res.data, true); top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide(); layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); layer.iframeAuto(index); layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"}); layero.find('iframe')[0].contentWindow.layui.form.render('select'); layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); } else if (res.code === 403){ @@ -467,8 +476,7 @@ }); function tableReload(child) { var searchData = { }; var searchData = {}; $.each($('#search-box [name]').serializeArray(), function() { searchData[this.name] = this.value; }); src/main/webapp/static/js/order/order.js
@@ -341,8 +341,17 @@ async: false, success: function (res) { if (res.code === 200){ var bige=true; for (var j = 0; j < xxDataList.length; j++) { if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) { bige=false; break; } } if (bige){ xxDataList.push(res.data); insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); } } else if (res.code === 403){ top.location.href = baseUrl+"/"; }else {