Browse Source

no message

master
Juj 1 year ago
parent
commit
b24d0e1a58
  1. 66
      WMS-BS/NFine.Application/OMAY/ICSMoCreateLotApp.cs
  2. 4
      WMS-BS/NFine.Web/Areas/OMAY/Controllers/ICSMoCreateLotController.cs
  3. 2
      WMS-BS/NFine.Web/Areas/OMAY/Views/ICSMoCreateLot/From.cshtml
  4. 7
      WMS-BS/NFine.Web/Areas/OMAY/Views/ICSMoCreateLot/ICSCreateLotByMO.cshtml

66
WMS-BS/NFine.Application/OMAY/ICSMoCreateLotApp.cs

@ -563,12 +563,15 @@ where a.EATTRIBUTE1='1' and SUBSTRING(b.ClassCode, 1, 2) not IN ('05') ";
//副产品生成条码获取物料数量信息
public DataTable GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint)
public DataTable GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint, string MoTypeValue)
{
DataTable dt = new DataTable();
object Figure = GetDecimalDigits();
List<DbParameter> parameter = new List<DbParameter>();
string sql = @"
string sql = string.Empty;
if (MoTypeValue=="0")
{
sql = @"
select
a.InvCode,b.InvName,b.ClassCode,b.InvStd,b.InvUnit, a.Quantity as Quantity,
cast( isnull(h.BL,0)*a.Quantity AS DECIMAL(18,4)) as AbsolveQty,
@ -616,9 +619,62 @@ left join Sys_SRM_ItemsDetail flag on flag.F_ItemCode='GDCS0001'
group by MODetailID )a) h on a.MODetailID=h.MODetailID
left join ICSExtension e on d.ExtensionID=e.ID and a.WorkPoint=e.WorkPoint
WHERE 1=1
and d.MOCode='" + FCPMOCode + "' and d.Sequence+'~'+a.Sequence='" + Sequence + "'";
sql += " and a.WorkPoint='" + WorkPoint + "'";
WHERE 1=1 ";
}
else
{
sql = @"
select
a.InvCode,b.InvName,b.ClassCode,b.InvStd,b.InvUnit, a.Quantity as Quantity,
cast( isnull(h.BL,0)*a.Quantity AS DECIMAL(18,4)) as AbsolveQty,
cast( isnull(h.BL,0)*a.Amount AS DECIMAL(18,4)) as AbsolveAmount,
cast( isnull(c.LOTQTY,0)+isnull(f.GDQTY,0) as DECIMAL(18,4)) as CreatedQty,
CAST( ((isnull(h.BL,0)*a.Amount) -(isnull(c.LOTQTY,0)+isnull(f.GDQTY,0))) as DECIMAL(18,4)) as thisCreateQty,
cast( a.Amount as DECIMAL(18,4)) as Amount,
isnull(b.EffectiveEnable,0) as EffectiveEnable,
cast( isnull(b.EffectiveDays,0) as DECIMAL(18,4)) as EffectiveDays
,e.ProjectCode,e.BatchCode,e.Version,e.Brand,e.cFree1,e.cFree2,e.cFree3,e.cFree4,e.cFree5,e.cFree6,e.cFree7,e.cFree8,e.cFree9,e.cFree10
from ICSMOPick a
left join ICSMO d on a.MODetailID=d.MODetailID and a.WorkPoint=d.WorkPoint and d.MOStatus<>'3'
--
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint
left join (
select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='18'
where isnull(a.EATTRIBUTE1,'')=''
group by b.TransCode,b.TransSequence
) c on d.MOCode=c.TransCode and d.Sequence+'~'+a.Sequence=c.TransSequence
--
left join (
select b.TransCode,b.TransSequence ,sum(isnull(Quantity,0)) GDQTY from ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='3'
where isnull(a.EATTRIBUTE1,'')=''
group by b.TransCode,b.TransSequence
) f on d.MOCode=f.TransCode and d.Sequence=f.TransSequence
left join
(select case when Flag>0 then ( case when PSLNUM>MLNUM then MLNUM else PSLNUM end) else PSLNUM end as BL ,MODetailID from (
select a.MODetailID,
case when isnull(sum(a.PSLYL),0)=0 then 0 else sum(a.PSLLSS)/sum(a.PSLYL)* max(isnull(F_Define1,0)/100.0) end as PSLNUM,
case when isnull(sum(a.MLYL),0)=0 then 0 else sum(a.MLLSS)/sum(a.MLYL)*max(isnull(F_Define1,0)/100.0) end as MLNUM,
sum(Flag) as Flag
from (
select a.MODetailID ,
case when SUBSTRING(b.ClassCode, 1, 2) IN ('01','04','05') then a.Quantity else 0 end PSLYL,
case when SUBSTRING(b.ClassCode, 1, 2) IN ('01','04','05') then a.IssueQuantity else 0 end PSLLSS,
case when SUBSTRING(b.ClassCode, 1, 2) IN ('03') then a.Quantity else 0 end MLYL,
case when SUBSTRING(b.ClassCode, 1, 2) IN ('03') then a.IssueQuantity else 0 end MLLSS,
case when SUBSTRING(b.ClassCode, 1, 2) IN ('03') then 1 else 0 end Flag
from dbo.ICSMOPick a
inner join dbo.ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint
where a.EATTRIBUTE1 <> '1')a
left join Sys_SRM_ItemsDetail flag on flag.F_ItemCode='GDCS0001'
group by MODetailID )a) h on a.MODetailID=h.MODetailID
left join ICSExtension e on d.ExtensionID=e.ID and a.WorkPoint=e.WorkPoint
WHERE 1=1 ";
}
sql += " and d.MOCode='" + FCPMOCode + "' and d.Sequence+'~'+a.Sequence='" + Sequence + "' and a.WorkPoint='" + WorkPoint + "'";
sql = string.Format(sql, Figure);
return Repository().FindTableBySql(sql.ToString());
}

4
WMS-BS/NFine.Web/Areas/OMAY/Controllers/ICSMoCreateLotController.cs

@ -166,9 +166,9 @@ namespace NFine.Web.Areas.OMAY.Controllers
//副产品生成条码获取物料数量信息
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint)
public ActionResult GetSubGridJsonFCPCreate(string FCPMOCode, string Sequence, string WorkPoint, string MoTypeValue)
{
DataTable ListData = App.GetSubGridJsonFCPCreate(FCPMOCode, Sequence, WorkPoint);
DataTable ListData = App.GetSubGridJsonFCPCreate(FCPMOCode, Sequence, WorkPoint, MoTypeValue);
var JsonData = new
{
rows = ListData,

2
WMS-BS/NFine.Web/Areas/OMAY/Views/ICSMoCreateLot/From.cshtml

@ -159,7 +159,7 @@
if (Type == '18') {
if (!!FCPMOCode && !!Sequence) {
$.ajax({
url: "/OMAY/ICSMoCreateLot/GetSubGridJsonFCPCreate?FCPMOCode=" + FCPMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints,
url: "/OMAY/ICSMoCreateLot/GetSubGridJsonFCPCreate?FCPMOCode=" + FCPMOCode + "&Sequence=" + Sequence + "&WorkPoint=" + WorkPoints + "&MoTypeValue=" + MoTypeValue,
dataType: "json",
async: false,
success: function (data) {

7
WMS-BS/NFine.Web/Areas/OMAY/Views/ICSMoCreateLot/ICSCreateLotByMO.cshtml

@ -143,6 +143,8 @@
cols.push(collast);
var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
cols.push(collast);
var collast = { label: '工单类型', name: 'MoType', width: 100, align: 'left' };
cols.push(collast);
var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
cols.push(collast);
var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 100, align: 'left' };
@ -167,6 +169,8 @@
cols.push(collast);
var collast = { label: '工单关联ID', name: 'MODetailID', hidden: true };
cols.push(collast);
var collast = { label: '类型值', name: 'MoTypeValue', hidden: true };
cols.push(collast);
//var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
//cols.push(collast);
@ -526,11 +530,12 @@
Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
MoTypeValue = $("#gridList").jqGrid('getRowData', ids[i]).MoTypeValue;
}
$.modalOpen({
id: "FormAddItemLot",
title: "副产品生成条码",
url: "/OMAY/ICSMoCreateLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&MODetailID=" + MODetailID + "&" + Math.random(),
url: "/OMAY/ICSMoCreateLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&MODetailID=" + MODetailID + "&MoTypeValue=" + MoTypeValue + "&" + Math.random(),
width: "550px",
height: "1000px",
callBack: function (iframeId) {

|||||||
100:0
Loading…
Cancel
Save