储位判断

master
e 2019-01-20 08:46:35 +08:00
parent d277aa65b8
commit 2f449b5ad9
4 changed files with 121 additions and 61 deletions

View File

@ -69,11 +69,17 @@ public class RpPeriodInOutEntity implements java.io.Serializable {
@Excel(name="规格") @Excel(name="规格")
private String goodsGuige; private String goodsGuige;
/**入库数量*/ /**入库数量*/
@Excel(name="期初数量")
private String goodsQc;
/**入库数量*/
@Excel(name="入库数量") @Excel(name="入库数量")
private String goodsIn; private String goodsIn;
/**出库数量*/ /**出库数量*/
@Excel(name="出库数量") @Excel(name="出库数量")
private String goodsOut; private String goodsOut;
/**入库数量*/
@Excel(name="期末数量")
private String goodsQm;
/**现库存*/ /**现库存*/
@Excel(name="现库存") @Excel(name="现库存")
private String goodsNow; private String goodsNow;
@ -352,6 +358,25 @@ public class RpPeriodInOutEntity implements java.io.Serializable {
public void setGoodsIn(String goodsIn){ public void setGoodsIn(String goodsIn){
this.goodsIn = 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 *: java.lang.String
*@return: java.lang.String *@return: java.lang.String

View File

@ -4,10 +4,7 @@ import com.zzjee.api.ResultDO;
import com.zzjee.md.entity.MdCusEntity; import com.zzjee.md.entity.MdCusEntity;
import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.md.entity.MvGoodsEntity; import com.zzjee.md.entity.MvGoodsEntity;
import com.zzjee.wm.entity.WmImNoticeHEntity; import com.zzjee.wm.entity.*;
import com.zzjee.wm.entity.WmImNoticeIEntity;
import com.zzjee.wm.entity.WmInQmIEntity;
import com.zzjee.wm.entity.WmToUpGoodsEntity;
import com.zzjee.wm.service.WmInQmIServiceI; import com.zzjee.wm.service.WmInQmIServiceI;
import java.util.ArrayList; import java.util.ArrayList;
@ -129,7 +126,26 @@ public class WmInQmIController extends BaseController {
} }
// cq.like("imNoticeId", "RK%"); // cq.like("imNoticeId", "RK%");
cq.add(); cq.add();
this.wmInQmIService.getDataGridReturn(cq, true); this.wmInQmIService.getDataGridReturn(cq, true);
List<WmInQmIEntity> resultold = dataGrid.getResults();
List<WmInQmIEntity> 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); TagUtil.datagrid(response, dataGrid);
} }
@RequestMapping(params = "datagridt") @RequestMapping(params = "datagridt")
@ -153,6 +169,24 @@ public class WmInQmIController extends BaseController {
cq.like("imNoticeId", "TH%"); cq.like("imNoticeId", "TH%");
cq.add(); cq.add();
this.wmInQmIService.getDataGridReturn(cq, true); this.wmInQmIService.getDataGridReturn(cq, true);
List<WmInQmIEntity> resultold = dataGrid.getResults();
List<WmInQmIEntity> 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); TagUtil.datagrid(response, dataGrid);
} }
/** /**
@ -232,13 +266,11 @@ public class WmInQmIController extends BaseController {
wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode()); wmToUpGoodsEntity.setCusCode(wmInQmIEntity.getCusCode());
wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName()); wmToUpGoodsEntity.setGoodsName(wmInQmIEntity.getGoodsName());
wmToUpGoodsEntity.setActTypeCode("01"); wmToUpGoodsEntity.setActTypeCode("01");
String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '" // String sql = "select md.suo_shu_ke_hu as cuscode from md_bin md where md.ku_wei_bian_ma = '"
+ wmInQmIEntity.getBinId() + "'"; // + wmInQmIEntity.getBinId() + "'";
Map<String, Object> binMap = systemService.findOneForJdbc(sql); // Map<String, Object> binMap = systemService.findOneForJdbc(sql);
if (binMap == null) { if (!wmUtil.checkbin(wmInQmIEntity.getBinId())) {
return false; return false;
} }
try { try {
@ -398,18 +430,17 @@ public class WmInQmIController extends BaseController {
return j; return j;
// TODO: handle exception // TODO: handle exception
} }
if(StringUtil.isNotEmpty(wmInQmI.getBinId())){
if(!wmUtil.checkbin(wmInQmI.getBinId())){
j.setSuccess(false);
message = wmInQmI.getBinId()+"储位不存在";
return j;
}
}
try { try {
//托盘占用判断 //托盘占用判断
if("yes".equals(ResourceUtil.getConfigByName("usetuopan"))){ 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<String, Object> tinMap = systemService.findOneForJdbc(tsql);
// if (tinMap != null) {
// j.setSuccess(false);
// message = "托盘已被占用";
// j.setMsg(message);
// return j;
// }
}else{ }else{
if (StringUtil.isEmpty(wmInQmI.getTinId())){ if (StringUtil.isEmpty(wmInQmI.getTinId())){
wmInQmI.setTinId(ResourceUtil.getConfigByName("tuopanma")); wmInQmI.setTinId(ResourceUtil.getConfigByName("tuopanma"));
@ -574,21 +605,24 @@ public class WmInQmIController extends BaseController {
request.getParameter("id")); request.getParameter("id"));
String binid = request.getParameter("binid"); 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)){ if(StringUtil.isEmpty(binid)){
message = "储位不能为空"; message = "储位不能为空";
j.setSuccess(false); j.setSuccess(false);
}else{ }else{
String sql = "select binid from wv_avabin where binid = '"
+ binid
+ "'";
Map<String, Object> binMap = systemService.findOneForJdbc(sql);
if(binMap==null||binMap.isEmpty()){
message = "储位不能用";
j.setSuccess(false);
}else{
t.setBinId(binid); t.setBinId(binid);
systemService.updateEntitie(t); systemService.updateEntitie(t);
} // }
} }
@ -613,38 +647,15 @@ public class WmInQmIController extends BaseController {
WmInQmIEntity t = wmInQmIService.get(WmInQmIEntity.class, WmInQmIEntity t = wmInQmIService.get(WmInQmIEntity.class,
wmInQmI.getId()); wmInQmI.getId());
try { try {
// if(StringUtil.isNotEmpty(wmInQmI.getBinId())){
// String sql = "select binid from wv_avabin where binid = '" if(StringUtil.isNotEmpty(wmInQmI.getBinId())){
// + wmInQmI.getBinId() if(!wmUtil.checkbin(wmInQmI.getBinId())){
// + "'"; j.setSuccess(false);
// Map<String, Object> binMap = systemService.findOneForJdbc(sql); message = wmInQmI.getBinId()+"储位不存在";
// if(wmInQmI.getBinId().equals(t.getBinId())){//没有更改则绕过盘点 return j;
// 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{
MyBeanUtils.copyBeanNotNull2Bean(wmInQmI, t); MyBeanUtils.copyBeanNotNull2Bean(wmInQmI, t);
t.setBaseUnit(null); t.setBaseUnit(null);
wmInQmIService.saveOrUpdate(t); wmInQmIService.saveOrUpdate(t);

View File

@ -1,7 +1,9 @@
package com.zzjee.wmutil; package com.zzjee.wmutil;
import com.zzjee.md.entity.MdBinEntity;
import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.sys.entity.SysParaEntity; import com.zzjee.sys.entity.SysParaEntity;
import org.antlr.stringtemplate.language.Cat;
import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.DateUtils;
import org.jeecgframework.core.util.ResourceUtil; 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(){ public static String getscrp(){
if("no".equals(ResourceUtil.getConfigByName("scrqon"))){ if("no".equals(ResourceUtil.getConfigByName("scrqon"))){
if(StringUtil.isNotEmpty(ResourceUtil.getConfigByName("scrq"))){ if(StringUtil.isNotEmpty(ResourceUtil.getConfigByName("scrq"))){

View File

@ -3,7 +3,7 @@
<t:base type="jquery,easyui,tools,DatePicker"></t:base> <t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true"> <div class="easyui-layout" fit="true">
<div region="center" style="padding:0px;border:0px"> <div region="center" style="padding:0px;border:0px">
<t:datagrid name="rpPeriodInOutList" checkbox="false" autoLoadData="false" pagination="true" fitColumns="false" title="期间出货统计" actionUrl="rpPeriodInOutController.do?datagrid" idField="id" fit="true" queryMode="group"> <t:datagrid name="rpPeriodInOutList" checkbox="false" autoLoadData="false" pagination="true" fitColumns="false" title="进销存统计表" actionUrl="rpPeriodInOutController.do?datagrid" idField="id" fit="true" queryMode="group">
<t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol> <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
@ -20,8 +20,12 @@
<t:dgCol title="商品名称" field="goodsName" query="true" queryMode="single" width="220"></t:dgCol> <t:dgCol title="商品名称" field="goodsName" query="true" queryMode="single" width="220"></t:dgCol>
<t:dgCol title="单位" field="goodsUnit" queryMode="single" width="120"></t:dgCol> <t:dgCol title="单位" field="goodsUnit" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="规格" field="goodsGuige" queryMode="single" width="120"></t:dgCol> <t:dgCol title="规格" field="goodsGuige" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="期初数量" field="goodsQc" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="入库数量" field="goodsIn" queryMode="single" width="120"></t:dgCol> <t:dgCol title="入库数量" field="goodsIn" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="出库数量" field="goodsOut" queryMode="single" width="120"></t:dgCol> <t:dgCol title="出库数量" field="goodsOut" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="期末数量" field="goodsQm" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="现库存" field="goodsNow" queryMode="single" width="120"></t:dgCol> <t:dgCol title="现库存" field="goodsNow" queryMode="single" width="120"></t:dgCol>
<%--<t:dgCol title="操作" field="opt" width="100"></t:dgCol>--%> <%--<t:dgCol title="操作" field="opt" width="100"></t:dgCol>--%>
<%--<t:dgDelOpt title="删除" url="rpPeriodInOutController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>--%> <%--<t:dgDelOpt title="删除" url="rpPeriodInOutController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>--%>