Commit b993f965 by 宋祥

1.采购合同BUG修复

parent 294bfa0c
......@@ -5,7 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG001A;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -123,6 +126,8 @@ public class ServiceHGCG002A extends ServiceBase {
Long id = fCg001A.getId();
HGCG001A dbCg001A = dbCg001AMap.get(id);
AssertUtils.isNull(dbCg001A, String.format("计划明细[%s]不存在", id));
AssertUtils.isGe(BigDecimal.ZERO, fCg001A.getPurQty(), "采购数量不能小于等于0");
AssertUtils.isGt(BigDecimal.ZERO, fCg001A.getPurWeight(), "采购总量不能小于0");
AssertUtils.isTrue(fCg001A.getTaxRate().compareTo(BigDecimal.ZERO) <= 0, "税率不能小于等于0");
AssertUtils.isTrue(fCg001A.getPrice().compareTo(BigDecimal.ZERO) <= 0, "单价不能小于等于0");
}
......@@ -130,13 +135,13 @@ public class ServiceHGCG002A extends ServiceBase {
/**
* 数据保存
* @param resultRows
* @param fCg001As
* @param dbCg001Map
* @param hgcg001Map
*/
private void confirmData(List<HGCG001A> resultRows, Map<Long, HGCG001A> dbCg001Map, Map<String, HGCG001> hgcg001Map) {
private void confirmData(List<HGCG001A> fCg001As, Map<Long, HGCG001A> dbCg001Map, Map<String, HGCG001> hgcg001Map) {
//取一条主表数据,用于拷贝合同主表信息
HGCG001A oneCg001A = resultRows.get(0);
HGCG001A oneCg001A = fCg001As.get(0);
HGCG001 oneCG001 = hgcg001Map.get(oneCg001A.getPlanNo());
HGCG002 newCg002 = new HGCG002();
BeanUtils.copyProperties(oneCG001, newCg002,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
......@@ -146,30 +151,31 @@ public class ServiceHGCG002A extends ServiceBase {
newCg002.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newCg002.setSource(HGConstant.CgSource.DEFAULT);
DaoUtils.insert(HGCG002.INSERT, newCg002);
for (HGCG001A hgcg001A : resultRows) {
for (HGCG001A fCg001A : fCg001As) {
//新增子表信息
insertDetails(hgcg001A,newCg002);
HGCG001 cg001 = hgcg001Map.get(hgcg001A.getPlanNo());
insertDetails(fCg001A, newCg002);
HGCG001 cg001 = hgcg001Map.get(fCg001A.getPlanNo());
// 更新计划状态
HGCGTools.HgCg001.updateStatus(cg001.getPlanNo(), HGConstant.CgPlanStatus.S_4);
// 更新计划状态
HGCGTools.HgCg001A.updateStatus(hgcg001A.getId(), HGConstant.CgPlanStatus.S_4);
HGCGTools.HgCg001A.updateStatus(fCg001A.getId(), HGConstant.CgPlanStatus.S_4);
}
//修改主表信息
HGCGTools.HgCg002.updateCg002Pur(newCg002);
}
private void insertDetails(HGCG001A dbCg001A, HGCG002 newCg002) {
private void insertDetails(HGCG001A fCg001A, HGCG002 newCg002) {
//获取采购计划明细
List<HGCG002B> cg002BList = new LinkedList<>();
HGCG002B cg002B = new HGCG002B();
//拷贝明细信息
BeanUtils.copyProperties(dbCg001A,cg002B,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
BeanUtils.copyProperties(fCg001A, cg002B, "id", "createdBy", "createdName", "createdTime", "updatedBy",
"updatedName", "updatedTime");
cg002B.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
cg002B.setPrimaryId(newCg002.getId());
cg002B.setPlanDetailId(dbCg001A.getId());
cg002B.setPlanDetailId(fCg001A.getId());
cg002BList.add(cg002B);
DaoUtils.insertBatch(HGCG002B.INSERT,cg002BList);
DaoUtils.insertBatch(HGCG002B.INSERT, cg002BList);
}
/**
......
......@@ -381,7 +381,7 @@ let selectPlan = function () {
href: "HGCG002A?methodName=initLoad",
title: "<div style='text-align: center;'>计划查询</div>",
width: "80%",
height: "80%",
height: "90%",
callbackName: selectPlanCallback
});
}
......
......@@ -37,7 +37,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1">
......
......@@ -23,7 +23,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="67vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
......@@ -33,15 +33,15 @@
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"
sumType="page"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"
sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFComboColumn ename="taxRate" cname="税率(%)" enable="true" width="100" align="center" required="true"
copy="true">
......
......@@ -320,7 +320,7 @@ let selectContract = function () {
href: "HGCG003A?methodName=initLoad",
title: "<div style='text-align: center;'>合同查询</div>",
width: "80%",
height: "80%",
height: "90%",
callbackName: selectContractCallback
});
}
......@@ -364,7 +364,7 @@ function showDetail(id,status,source) {
href: "HGCG003B?methodName=initLoad&inqu_status-0-primaryId=" + id+"&status="+status+"&source="+source,
title: "<div style='text-align: center;'>详情</div>",
width: "80%",
height: "80%",
height: "90%",
callbackName: windowCallback
});
}
......
......@@ -37,7 +37,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" copyToAdd="false">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" copyToAdd="false" height="63vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center">
......
......@@ -40,7 +40,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="60vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center"/>
......
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