Commit ee6b4164 by 江和松

生产领料提交修改实时库存操作、提交后数据隐藏按钮

parent 670e2dcf
...@@ -5,6 +5,9 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,6 +5,9 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC008; import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -13,7 +16,9 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -13,7 +16,9 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages; import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -122,6 +127,17 @@ public class ServiceHGKC008 extends ServiceBase { ...@@ -122,6 +127,17 @@ public class ServiceHGKC008 extends ServiceBase {
hgkc008.fromMap(map); hgkc008.fromMap(map);
DaoUtils.update(HGKC008.UPDATE_STATUS, hgkc008); DaoUtils.update(HGKC008.UPDATE_STATUS, hgkc008);
} }
List<HGKC008A> hgkc008AList = HGKCTools.HgKc008A.getHgkc008aList(hgkc008.getId());
if(!CollectionUtils.isEmpty(hgkc008AList)){
for(HGKC008A hgkc008A : hgkc008AList){
//领料如果是正数则为出库,需要减少库存,如果是退回则要加库存
BigDecimal qty = hgkc008A.getInvQty().multiply(new BigDecimal(-1));
//增加库存
HGKCUtils.HgKc010.updateInv(hgkc008A.getCompanyCode(),hgkc008A.getWhCode(),
hgkc008A.getInvSpecId(),qty,
hgkc008A.getInvUnitWeight(),hgkc008A.getInvWeight());
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) { } catch (PlatException e) {
......
...@@ -111,6 +111,8 @@ public class ServiceHGKC008A extends ServiceBase { ...@@ -111,6 +111,8 @@ public class ServiceHGKC008A extends ServiceBase {
hgkc008a.setProjName(hgkc008.getProjName()); hgkc008a.setProjName(hgkc008.getProjName());
hgkc008a.setWhCode(hgkc008.getWhCode()); hgkc008a.setWhCode(hgkc008.getWhCode());
hgkc008a.setWhName(hgkc008.getWhName()); hgkc008a.setWhName(hgkc008.getWhName());
hgkc008a.setCompanyCode(hgkc008.getCompanyCode());
hgkc008a.setCompanyName(hgkc008.getCompanyName());
if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0){ if(hgkc008.getReceiveType().compareTo(HGConstant.ReceiveType.DEFAULT) == 0){
//如果明细里面有负数的,主表就是退库 //如果明细里面有负数的,主表就是退库
if(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0){ if(hgkc008a.getInvQty().compareTo(BigDecimal.ZERO) < 0){
......
...@@ -74,10 +74,12 @@ public class ServiceHGKC010 extends ServiceBase { ...@@ -74,10 +74,12 @@ public class ServiceHGKC010 extends ServiceBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String whCode = MapUtils.getString(queryMap, HGKC010.FIELD_WH_CODE); String whCode = MapUtils.getString(queryMap, HGKC010.FIELD_WH_CODE);
String inventType = MapUtils.getString(queryMap, HGKC010.FIELD_INVENT_TYPE); String inventType = MapUtils.getString(queryMap, HGKC010.FIELD_INVENT_TYPE);
String companyCode = MapUtils.getString(queryMap, HGKC010.FIELD_COMPANY_CODE);
Map map = new HashMap(); Map map = new HashMap();
map.put(HGKC010.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode()); map.put(HGKC010.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC010.FIELD_WH_CODE, whCode); map.put(HGKC010.FIELD_WH_CODE, whCode);
map.put(HGKC010.FIELD_INVENT_TYPE, inventType); map.put(HGKC010.FIELD_INVENT_TYPE, inventType);
map.put(HGKC010.FIELD_COMPANY_CODE, companyCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID), map,false);
return inInfo; return inInfo;
......
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic> </dynamic>
</select> </select>
......
...@@ -342,6 +342,13 @@ public class HGKCTools { ...@@ -342,6 +342,13 @@ public class HGKCTools {
} }
public static List<HGKC008A> getHgkc008aList(Long receiveId) {
Map paramMap = new HashMap();
paramMap.put("receiveId", receiveId);
List<HGKC008A> results = DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
return results;
}
} }
/** /**
......
...@@ -30,7 +30,7 @@ $(function (){ ...@@ -30,7 +30,7 @@ $(function (){
let template = ''; let template = '';
if (item.id){ if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id +',\''+item.whCode+'\')" >领料详情</a>'; + 'onclick="showDetail(' + item.id + ',\''+item.whCode+'\',\''+item.companyCode+'\',\''+item.status+'\')" >领料详情</a>';
if (status == 0) { if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',1)" >提交</a>'; + 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
...@@ -224,9 +224,9 @@ function updateStatus(id,status) { ...@@ -224,9 +224,9 @@ function updateStatus(id,status) {
/** /**
* 显示详情 * 显示详情
*/ */
function showDetail(id,whCode) { function showDetail(id,whCode,companyCode,status) {
JSColorbox.open({ JSColorbox.open({
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode, href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-status="+status,
title: "<div style='text-align: center;'>领料详情</div>", title: "<div style='text-align: center;'>领料详情</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
...@@ -6,7 +6,6 @@ $(function (){ ...@@ -6,7 +6,6 @@ $(function (){
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */ /* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, { $.extend(true, IPLATUI.Config, {
EFGrid: { EFGrid: {
...@@ -67,6 +66,7 @@ $(function (){ ...@@ -67,6 +66,7 @@ $(function (){
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whCode", options.model["whCode"]); inInfo.set("inqu_status-0-whCode", options.model["whCode"]);
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]); inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]); inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("field", options.field); inInfo.set("field", options.field);
...@@ -100,6 +100,21 @@ $(function (){ ...@@ -100,6 +100,21 @@ $(function (){
item['receiveId'] =$("#inqu_status-0-receiveId").val(); item['receiveId'] =$("#inqu_status-0-receiveId").val();
return $("#inqu_status-0-receiveId").val(); return $("#inqu_status-0-receiveId").val();
} }
},
{
field: "whCode",
template: function (item) {
item['whCode'] =$("#inqu_status-0-whCode").val();
return $("#inqu_status-0-whCode").val();
}
}
,
{
field: "companyCode",
template: function (item) {
item['companyCode'] =$("#inqu_status-0-companyCode").val();
return $("#inqu_status-0-companyCode").val();
}
} }
], ],
loadComplete: function(grid) { loadComplete: function(grid) {
...@@ -130,9 +145,9 @@ $(function (){ ...@@ -130,9 +145,9 @@ $(function (){
if (e.field == "inventType") { if (e.field == "inventType") {
//选择后,先加载此方法,再加载属性中的方法,所以存货类型加载时,先修改存货编号下拉框的查询 //选择后,先加载此方法,再加载属性中的方法,所以存货类型加载时,先修改存货编号下拉框的查询
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-whCode", options.model["whCode"]); inInfo.set("inqu_status-0-whCode",item.whCode);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]); inInfo.set("inqu_status-0-companyCode",item.companyCode);
inInfo.set("field", options.field); inInfo.set("inqu_status-0-inventType",item.inventType);
EiCommunicator.send("HGKC010", "queryInventCodeBox", inInfo, { EiCommunicator.send("HGKC010", "queryInventCodeBox", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
inventRecordBoxBlocks = ei.getBlock("invent_code_box_block_id").getMappedRows(); inventRecordBoxBlocks = ei.getBlock("invent_code_box_block_id").getMappedRows();
...@@ -220,6 +235,21 @@ $(function (){ ...@@ -220,6 +235,21 @@ $(function (){
downKeyUp(); downKeyUp();
}) })
/**
* 页面加载时执行
*/
$(window).load(function () {
var status = $("#inqu_status-0-status").val();
//如果提交了,则不能修改
if(status && status === "1"){
$('#add').hide();
$('#save-changes').hide();
$('#cancel-changes').hide();
$('#delete').hide();
}
});
let query = function () { let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
} }
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" 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-whCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-companyCode" cname="仓库编码" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-status" cname="状态" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains"> <EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -28,6 +30,7 @@ ...@@ -28,6 +30,7 @@
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/> <EF:EFColumn ename="receiveId" cname="领料单id" hidden="true"/>
<EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/> <EF:EFColumn ename="whCode" cname="仓库编码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="公司编码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
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