Commit 1b40a0c1 by wuwenlong

库存管理opt

parent c32343b3
......@@ -101,8 +101,8 @@ public class ServiceHPKC010 extends ServiceBase {
}});
if(CollectionUtils.isEmpty(list)){
//新增
if(Objects.isNull(amount)||amount.compareTo(BigDecimal.ZERO)<=0
||Objects.isNull(amount)||weight.compareTo(BigDecimal.ZERO)<=0){
if(amount.compareTo(BigDecimal.ZERO)<0
||weight.compareTo(BigDecimal.ZERO)<0){
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
}
generatorBaseInfo(newObj);
......@@ -113,7 +113,7 @@ public class ServiceHPKC010 extends ServiceBase {
oldObj.fromMap(list.get(0));
BigDecimal afterAmout = oldObj.getAmount().add(amount);
BigDecimal afterWeight = oldObj.getWeight().add(weight);
if(afterAmout.compareTo(BigDecimal.ZERO)<=0||afterWeight.compareTo(BigDecimal.ZERO)<=0){
if(afterAmout.compareTo(BigDecimal.ZERO)<0||afterWeight.compareTo(BigDecimal.ZERO)<0){
throw new PlatException("库存更新失败,出库数量与重量不能大于当前库存!");
}
oldObj.setAmount(afterAmout);
......@@ -220,11 +220,13 @@ public class ServiceHPKC010 extends ServiceBase {
if(Objects.isNull(inventRecordId)||inventRecordId==0){
throw new PlatException("存货档案ID不能为空!");
}
if(Objects.isNull(amout)||amout.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更数量不能为空!");
if(Objects.isNull(amout)||
Objects.isNull(amout)){
throw new PlatException("库存变更数量或重量不能为空!");
}
if(Objects.isNull(amout)||weight.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更重量不能为空!");
if(amout.compareTo(BigDecimal.ZERO)==0
&&weight.compareTo(BigDecimal.ZERO)==0){
throw new PlatException("库存变更数量或重量不能为0)!");
}
}
......
......@@ -16,7 +16,11 @@
<EF:EFRegion id="inqu" title="查询条件"><%-- type="query" efRegionShowClear="true" efRegionSave="true"--%>
<div class="row"> <%-- blockId="inqu_status" row="0" --%>
<EF:EFInput blockId="inqu_status" ename="projType" cname="项目类型:" row="0"/>
<EF:EFSelect ename="inqu_status-0-projType" cname="项目类型" colWidth="3" filter="contains"
template="#=valueField#-#=textField#" valueTemplate="#=valueField#-#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" ename="projName" cname="项目名称:" row="0"/>
</div>
<EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>
......@@ -25,7 +29,10 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projType" required='true' cname="项目类型"/>
<EF:EFComboColumn ename="projType" cname="项目类型" width="100" align="center" required="true"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#">
<EF:EFCodeOption codeName="hpjx.hpsc.projType"/>
</EF:EFComboColumn>
<EF:EFColumn required="true" ename="projCode" cname="项目编码"/>
<EF:EFColumn required="true" ename="projName" cname="项目名称"/>
<EF:EFColumn required="true" ename="princ1" cname="本公司项目负责人"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment