Commit 4f823247 by 宋祥

1.生产领料报错BUG修复

parent b368bb6c
......@@ -193,7 +193,7 @@ public class ServiceHGKC008 extends ServiceBase {
//查看是否能获取到账期,获取不到就提示
HGKC008 getKc008 = HGKCTools.HgKc008.getById(hgkc008.getId());
HGCWTools.HgCw001.getAccountPeriod(getKc008.getCompanyCode(),getKc008.getReceiptDate());
DaoUtils.update(HGKC008.UPDATE_STATUS, hgkc008);
DaoUtils.update(HGKC008.UPDATE_STATUS, hgkc008.toMap());
}
List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId());
if(!CollectionUtils.isEmpty(hgkc008AList)){
......
......@@ -16,11 +16,13 @@ import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.Arrays;
......@@ -71,7 +73,6 @@ public class ServiceHGKC008A extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC008A.QUERY, new HGKC008A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -128,9 +129,8 @@ public class ServiceHGKC008A extends ServiceBase {
*/
public EiInfo save(EiInfo inInfo) {
try {
// 查询领料单
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String applyCode = MapUtils.getString(queryMap, HGKC008A.FIELD_RECEIVE_ID);
String applyCode = MapUtils.getString(queryMap, HGKC008A.FIELD_APPLY_CODE);
HGKC008 dbKc008 = HGKCTools.HgKc008.getByApplyCode(applyCode);
AssertUtils.isNull(dbKc008, String.format("领料单【%s】不存在", applyCode));
AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S0, dbKc008.getStatus(),
......@@ -141,8 +141,8 @@ public class ServiceHGKC008A extends ServiceBase {
// 数据校验
this.checkSaveData(dbKc008, fKc008As, dbKc008AMap);
this.setData(dbKc008, fKc008As);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("保存成功!");
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fKc008As.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
......@@ -166,6 +166,9 @@ public class ServiceHGKC008A extends ServiceBase {
if (Objects.nonNull(fKc008A.getId()) && fKc008A.getId() != 0) {
DaoUtils.update(HGKC008A.UPDATE, fKc008A);
} else {
fKc008A.setApplyCode(dbKc008.getApplyCode());
fKc008A.setApplyLineCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.SC_APPLY_LINE_CODE,
new String[]{dbKc008.getApplyCode()}));
DaoUtils.insert(HGKC008A.INSERT, fKc008A);
}
if (dbKc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0) {
......@@ -190,7 +193,7 @@ public class ServiceHGKC008A extends ServiceBase {
private void checkSaveData(HGKC008 dbKc008, List<HGKC008A> fKc008As, Map<String, HGKC008A> dbKc008AMap) {
for (HGKC008A fKc008A : fKc008As) {
String applyLineCode = fKc008A.getApplyLineCode();
HGKC008A dbKc008A = dbKc008AMap.get(applyLineCode);
HGKC008A dbKc008A = StringUtils.isBlank(applyLineCode) ? null : dbKc008AMap.get(applyLineCode);
this.checkData(applyLineCode, dbKc008A);
AssertUtils.isGe(BigDecimal.ZERO, fKc008A.getInvWeight(), "重量必须大于0");
if (Objects.nonNull(fKc008A.getId()) && fKc008A.getId() != 0) {
......@@ -212,7 +215,9 @@ public class ServiceHGKC008A extends ServiceBase {
* @param dbKc008A
*/
private void checkData(String applyLineCode, HGKC008A dbKc008A) {
AssertUtils.isNull(dbKc008A, String.format("领料单行【%s】不存在", applyLineCode));
if (dbKc008A == null) {
return;
}
AssertUtils.isNotEquals(CommonConstant.YesNo.NO_0, dbKc008A.getDeleteFlag(),
String.format("领料单行【%s】不是\"未删除\"状态,不允许操作", applyLineCode));
AssertUtils.isNotEquals(HgKcConst.HgKc008.Status.S0, dbKc008A.getStatus(),
......
......@@ -140,6 +140,8 @@ public class ServiceHGKC008B extends ServiceBase {
newKc008A.setInvSpec(dbKc010.getSpec());
newKc008A.setInvSpecId(dbKc010.getSpecId());
newKc008A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newKc008A.setAccountCode("");
newKc008A.setDepCode("");
DaoUtils.insert(HGKC008A.INSERT, newKc008A);
}
}
......
......@@ -31,7 +31,8 @@ $(function (){
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\'' + item.whCode + '\',\''
+ item.companyCode + '\',\'' + item.status + '\')" >领料详情</a>';
+ item.companyCode + '\',\'' + item.status + '\',\''
+ item.applyCode + '\')" >领料详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
......@@ -267,9 +268,10 @@ function updateStatus(id,status) {
/**
* 显示详情
*/
function showDetail(id, whCode, companyCode, status) {
function showDetail(id, whCode, companyCode, status, applyCode) {
let params = {
"inqu_status-0-receiveId": id,
"inqu_status-0-applyCode": applyCode,
}
JSColorbox.open({
href: "HGKC008A",
......
......@@ -128,9 +128,6 @@ $(function (){
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
//选中
......
......@@ -12,6 +12,7 @@
<EF:EFInput ename="main-0-applyCode" cname="领料单号" colWidth="3" type="hidden"/>
<EF:EFInput ename="main-0-status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-applyCode" cname="申请编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编码" colWidth="3" type="hidden"/>
......
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