From 2f449b5ad9039735807cad8b3f0acd2dbf5bb67e Mon Sep 17 00:00:00 2001 From: e Date: Sun, 20 Jan 2019 08:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=82=A8=E4=BD=8D=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bireport/entity/RpPeriodInOutEntity.java | 25 ++++ .../wm/controller/WmInQmIController.java | 131 ++++++++++-------- src/main/java/com/zzjee/wmutil/wmUtil.java | 20 +++ .../com/zzjee/bireport/rpPeriodInOutList.jsp | 6 +- 4 files changed, 121 insertions(+), 61 deletions(-) diff --git a/src/main/java/com/zzjee/bireport/entity/RpPeriodInOutEntity.java b/src/main/java/com/zzjee/bireport/entity/RpPeriodInOutEntity.java index fbb5a773..68de920c 100644 --- a/src/main/java/com/zzjee/bireport/entity/RpPeriodInOutEntity.java +++ b/src/main/java/com/zzjee/bireport/entity/RpPeriodInOutEntity.java @@ -69,11 +69,17 @@ public class RpPeriodInOutEntity implements java.io.Serializable { @Excel(name="规格") private String goodsGuige; /**入库数量*/ + @Excel(name="期初数量") + private String goodsQc; + /**入库数量*/ @Excel(name="入库数量") private String goodsIn; /**出库数量*/ @Excel(name="出库数量") private String goodsOut; + /**入库数量*/ + @Excel(name="期末数量") + private String goodsQm; /**现库存*/ @Excel(name="现库存") private String goodsNow; @@ -352,6 +358,25 @@ public class RpPeriodInOutEntity implements java.io.Serializable { public void setGoodsIn(String goodsIn){ this.goodsIn = goodsIn; } + + + @Column(name ="GOODS_QC",nullable=true,length=32) + public String getGoodsQc() { + return goodsQc; + } + + public void setGoodsQc(String goodsQc) { + this.goodsQc = goodsQc; + } + @Column(name ="GOODS_QM",nullable=true,length=32) + public String getGoodsQm() { + return goodsQm; + } + + public void setGoodsQm(String goodsQm) { + this.goodsQm = goodsQm; + } + /** *方法: 取得java.lang.String *@return: java.lang.String 出库数量 diff --git a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java index 3c8112e7..7faf89f6 100644 --- a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java +++ b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java @@ -4,10 +4,7 @@ import com.zzjee.api.ResultDO; import com.zzjee.md.entity.MdCusEntity; import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MvGoodsEntity; -import com.zzjee.wm.entity.WmImNoticeHEntity; -import com.zzjee.wm.entity.WmImNoticeIEntity; -import com.zzjee.wm.entity.WmInQmIEntity; -import com.zzjee.wm.entity.WmToUpGoodsEntity; +import com.zzjee.wm.entity.*; import com.zzjee.wm.service.WmInQmIServiceI; import java.util.ArrayList; @@ -129,7 +126,26 @@ public class WmInQmIController extends BaseController { } // cq.like("imNoticeId", "RK%"); cq.add(); + this.wmInQmIService.getDataGridReturn(cq, true); + List resultold = dataGrid.getResults(); + List resultnew = new ArrayList<>(); + for(WmInQmIEntity t:resultold){ + if (StringUtil.isEmpty(t.getGoodsName())){ + try{ + MvGoodsEntity goods = systemService.findUniqueByProperty(MvGoodsEntity.class, "goodsCode", t.getGoodsId()); + if(goods!=null){ + t.setGoodsName(goods.getGoodsName()); + } + }catch (Exception e){ + + } + + } + + resultnew.add(t); + } + dataGrid.setResults(resultnew); TagUtil.datagrid(response, dataGrid); } @RequestMapping(params = "datagridt") @@ -153,6 +169,24 @@ public class WmInQmIController extends BaseController { cq.like("imNoticeId", "TH%"); cq.add(); this.wmInQmIService.getDataGridReturn(cq, true); + List resultold = dataGrid.getResults(); + List resultnew = new ArrayList<>(); + for(WmInQmIEntity t:resultold){ + if (StringUtil.isEmpty(t.getGoodsName())){ + try{ + MvGoodsEntity goods = systemService.findUniqueByProperty(MvGoodsEntity.class, "goodsCode", t.getGoodsId()); + if(goods!=null){ + t.setGoodsName(goods.getGoodsName()); + } + }catch (Exception e){ + + } + + } + + resultnew.add(t); + } + dataGrid.setResults(resultnew); TagUtil.datagrid(response, dataGrid); } /** @@ -232,13 +266,11 @@ public class WmInQmIController extends BaseController { wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode()); wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName()); wmToUpGoodsEntity.setActTypeCode("01"); - String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '" - + wmInQmIEntity.getBinId() + "'"; - Map binMap = systemService.findOneForJdbc(sql); - if (binMap == null) { - +// String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '" +// + wmInQmIEntity.getBinId() + "'"; +// Map binMap = systemService.findOneForJdbc(sql); + if (!wmUtil.checkbin(wmInQmIEntity.getBinId())) { return false; - } try { @@ -398,18 +430,17 @@ public class WmInQmIController extends BaseController { return j; // TODO: handle exception } + if(StringUtil.isNotEmpty(wmInQmI.getBinId())){ + if(!wmUtil.checkbin(wmInQmI.getBinId())){ + j.setSuccess(false); + message = wmInQmI.getBinId()+"储位不存在"; + return j; + } + } try { //托盘占用判断 if("yes".equals(ResourceUtil.getConfigByName("usetuopan"))){ -// String tsql = "select bin_id as tinid from wv_stock where kuctype = '库存' and goods_qua <> 0 and bin_id = '" -// + wmInQmI.getTinId() + "'"; -// Map tinMap = systemService.findOneForJdbc(tsql); -// if (tinMap != null) { -// j.setSuccess(false); -// message = "托盘已被占用"; -// j.setMsg(message); -// return j; -// } + }else{ if (StringUtil.isEmpty(wmInQmI.getTinId())){ wmInQmI.setTinId(ResourceUtil.getConfigByName("tuopanma")); @@ -574,21 +605,24 @@ public class WmInQmIController extends BaseController { request.getParameter("id")); String binid = request.getParameter("binid"); + + if(StringUtil.isNotEmpty(binid)){ + if(!wmUtil.checkbin(binid)){ + j.setSuccess(false); + message = wmInQmI.getBinId()+"储位不存在"; + return j; + } + } + + if(StringUtil.isEmpty(binid)){ message = "储位不能为空"; j.setSuccess(false); }else{ - String sql = "select binid from wv_avabin where binid = '" - + binid - + "'"; - Map binMap = systemService.findOneForJdbc(sql); - if(binMap==null||binMap.isEmpty()){ - message = "储位不能用"; - j.setSuccess(false); - }else{ + t.setBinId(binid); systemService.updateEntitie(t); - } +// } } @@ -613,38 +647,15 @@ public class WmInQmIController extends BaseController { WmInQmIEntity t = wmInQmIService.get(WmInQmIEntity.class, wmInQmI.getId()); try { -// if(StringUtil.isNotEmpty(wmInQmI.getBinId())){ -// String sql = "select binid from wv_avabin where binid = '" -// + wmInQmI.getBinId() -// + "'"; -// Map binMap = systemService.findOneForJdbc(sql); -// if(wmInQmI.getBinId().equals(t.getBinId())){//没有更改则绕过盘点 -// binMap.put("bin", "1"); -// } -// -// if (binMap != null) { -// sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ting_yong = 'N' and md.ku_wei_bian_ma = '" -// + wmInQmI.getBinId() + "' limit 1"; -// binMap = systemService.findOneForJdbc(sql); -// if (binMap != null) { -// MyBeanUtils.copyBeanNotNull2Bean(wmInQmI, t); -// t.setBaseUnit(null); -// wmInQmIService.saveOrUpdate(t); -// systemService.addLog(message, Globals.Log_Type_UPDATE, -// Globals.Log_Leavel_INFO); -// } else { -// j.setSuccess(false); -// message = "储位不存在 或已停用"; -// j.setMsg(message); -// return j; -// } -// } else { -// j.setSuccess(false); -// message = "储位已被占用"; -// j.setMsg(message); -// return j; -// } -// }else{ + + if(StringUtil.isNotEmpty(wmInQmI.getBinId())){ + if(!wmUtil.checkbin(wmInQmI.getBinId())){ + j.setSuccess(false); + message = wmInQmI.getBinId()+"储位不存在"; + return j; + } + } + MyBeanUtils.copyBeanNotNull2Bean(wmInQmI, t); t.setBaseUnit(null); wmInQmIService.saveOrUpdate(t); diff --git a/src/main/java/com/zzjee/wmutil/wmUtil.java b/src/main/java/com/zzjee/wmutil/wmUtil.java index 38ff7e69..4cd4852b 100644 --- a/src/main/java/com/zzjee/wmutil/wmUtil.java +++ b/src/main/java/com/zzjee/wmutil/wmUtil.java @@ -1,7 +1,9 @@ package com.zzjee.wmutil; +import com.zzjee.md.entity.MdBinEntity; import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.sys.entity.SysParaEntity; +import org.antlr.stringtemplate.language.Cat; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.ResourceUtil; @@ -378,6 +380,24 @@ public class wmUtil { } + + public static boolean checkbin(String binid){ + boolean flag= false; + SystemService systemService = ApplicationContextUtil.getContext().getBean(SystemService.class); + try{ + MdBinEntity mdBinEntity = systemService.findUniqueByProperty(MdBinEntity.class,"kuWeiBianMa",binid); + if (mdBinEntity!=null){ + if("N".equals(mdBinEntity.getTingYong())){ + flag = true; + } + + } + }catch (Exception e){ + + } + return flag; + } + public static String getscrp(){ if("no".equals(ResourceUtil.getConfigByName("scrqon"))){ if(StringUtil.isNotEmpty(ResourceUtil.getConfigByName("scrq"))){ diff --git a/src/main/webapp/webpage/com/zzjee/bireport/rpPeriodInOutList.jsp b/src/main/webapp/webpage/com/zzjee/bireport/rpPeriodInOutList.jsp index 40c3ea70..354afecc 100644 --- a/src/main/webapp/webpage/com/zzjee/bireport/rpPeriodInOutList.jsp +++ b/src/main/webapp/webpage/com/zzjee/bireport/rpPeriodInOutList.jsp @@ -3,7 +3,7 @@
- + @@ -20,8 +20,12 @@ + + + + <%----%> <%----%>