冒林杰 3 years ago
parent
commit
eb2e3a59c1
  1. 7
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs
  2. 4
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs
  3. 6
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs
  4. 6
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs
  5. 4
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs
  6. 4
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj
  7. 5
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  8. 90
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs
  9. 2
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs
  10. 7
      ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs
  11. 48
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

7
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSControlModeService.cs

@ -43,14 +43,13 @@ namespace ICSSoft.DataProject
cmd.Connection = conn;
try
{
string sql = @"SELECT F_ItemCode as itemCode,F_ItemName as itemName,F_EnabledMark as enableMark FROM [dbo].[Sys_SRM_ItemsDetail] WHERE F_ItemCode='ControlMode01' OR F_ItemCode='ControlMode02'";
string sql = @"SELECT TOP 1 F_ItemCode as itemCode,F_ItemName as itemName,F_EnabledMark as enableMark FROM [dbo].[Sys_SRM_ItemsDetail] WHERE F_ItemId='14361ce1-c5e3-4e85-a253-51aa3cdde3e6'AND F_EnabledMark='1' ORDER BY F_ItemCode";
//sql = string.Format(sql, cmd);
DataTable table = DBHelper.SQlReturnData(sql, cmd);
string json = JsonConvert.SerializeObject(table);
ControlMode model = JsonConvert.DeserializeObject<ControlMode>(json);
List<ControlMode> model = JsonConvert.DeserializeObject<List<ControlMode>>(json);
cmd.Transaction.Commit();
return model;
return model[0];
}
catch (Exception ex)
{

4
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSManufactureService.cs

@ -554,7 +554,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSMOPick x ON x.MODetailID=y.MODetailID AND x.WorkPoint=y.WorkPoint AND b.TransSequence = y.Sequence + '~' + x.Sequence
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND a.ERPUpload='0' AND ISNULL(a.LogID, '')<>''
GROUP BY y.DepCode,a.ToWarehouseCode,y.MOCode,a.MUSER,a.InvCode,x.PickID,x.MODetailID,Enable
GROUP BY y.DepCode,a.ToWarehouseCode,y.MOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,x.PickID,x.MODetailID,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -787,7 +787,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSMO c ON b.TransCode=c.MOCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.DepCode,a.ToWarehouseCode,c.MOCode,a.MUSER,a.InvCode,c.MODetailID,Enable
GROUP BY c.DepCode,a.ToWarehouseCode,c.MOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.MODetailID,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')

6
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSOutsourcingService.cs

@ -873,7 +873,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSOutsourcingOrder c ON b.TransCode=c.OOCode AND b.TransSequence=c.Sequence AND f.OODetailID=c.OutDetailID AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,a.ToWarehouseCode,c.OOCode,f.ODNCode,a.MUSER,f.Sequence,a.InvCode,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.OOCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.OODetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -1003,7 +1003,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSODeliveryNotice c ON b.TransCode=c.ODNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,b.TransCode,b.TransSequence,a.ToWarehouseCode,c.ODNCode,a.MUSER,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -1134,7 +1134,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSODeliveryNotice d ON c.OODetailID=d.ODNDetailID AND d.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,d.ODNCode,a.MUSER,a.InvCode,d.ODNDetailID,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.ODNCode,d.ODNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,d.ODNDetailID,c.ODNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')

6
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSPurchaseService.cs

@ -179,7 +179,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSPurchaseOrder c ON b.TransCode=c.POCode AND b.TransSequence=c.Sequence AND f.PODetailID=c.PODetailID AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,a.ToWarehouseCode,c.POCode,f,DNCode,a.MUSER,f.Sequence,a.InvCode,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.POCode,a.MUSER,a.InvCode,lot.Amount,lot.Quantity,c.PODetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -310,7 +310,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
INNER JOIN ICSConfiguration conn ON con.WorkPoint=conn.WorkPoint AND conn.Code='Escrow001'
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,a.MUSER,a.InvCode,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,con.Enable,conn.Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -441,7 +441,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSDeliveryNotice d ON c.PODetailID=d.DNDetailID AND d.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,d.DNCode,a.MUSER,a.InvCode,d.DNDetailID,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
GROUP BY c.VenCode,a.ToWarehouseCode,c.DNCode,d.DNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,d.DNDetailID,c.DNDetailID,isnull((c.UnitPrice),0),c.Currency,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')

4
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSalesService.cs

@ -225,7 +225,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSSDN c ON b.TransCode=c.SDNCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0' AND c.Type='2'
GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,a.InvCode,c.SDNDetailID,Enable
GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.SDNDetailID,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')
@ -354,7 +354,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSSDN c ON a.TransCode=c.SDNCode AND a.TransSequence=c.Sequence AND a.WorkPoint=c.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock001' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0' AND c.Type='2'
GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,a.InvCode,c.SDNDetailID,Enable
GROUP BY c.CusCode,a.ToWarehouseCode,c.SDNCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,c.SDNDetailID,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')

4
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSoft.DataProject.csproj

@ -43,9 +43,9 @@
<Reference Include="log4net, Version=2.0.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.13\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ICSSoft.WebAPI\bin\Newtonsoft.Json.dll</HintPath>
<HintPath>..\ICSSoft.WMS.WebAPI\bin\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />

5
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -1691,7 +1691,7 @@ namespace ICSSoft.DataProject
BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>();
//入库
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID);
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language, itemInfo.LogID, itemInfo.InvCode + itemInfo.WarehouseCode);
//更新日志表源头单据信息
string sql = @"UPDATE ICSWareHouseLotInfoLog SET TransCode='{3}',TransSequence='{4}'
@ -1834,9 +1834,8 @@ namespace ICSSoft.DataProject
throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
}
//入库
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity,
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID);
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID,itemInfo.InvCode + itemInfo.WarehouseCode);
}
}

90
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

@ -50,8 +50,9 @@ namespace ICSSoft.DataProject
/// <param name="TransType"></param>
/// <param name="BusinessCode"></param>
/// <param name="cmd"></param>
/// <param name="jointLotNo"></param>
public static void WareHouseLotInfoUp(string Identification, string LocationCode, string LotNo, string Quantity, string User,
string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID)
string WorkPoint, string TransType, string BusinessCode, SqlCommand cmd, Dictionary<string, string> language, string LogID,string jointLotNo)
{
try
{
@ -107,13 +108,6 @@ namespace ICSSoft.DataProject
throw new Exception(language.GetNameByCode("WMSAPIInfo165"));
}
ControlMode mode = ICSControlModeService.GetControlModes();
//管控方式启用"料品"时
if (mode.itemCode.Equals("ControlMode02"))
{
}
///添加日志
sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity,
@ -137,6 +131,86 @@ namespace ICSSoft.DataProject
{
throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
}
ControlMode mode = ICSControlModeService.GetControlModes();
//管控方式是"料品"时
if (mode.itemCode.Equals("ControlMode02"))
{
///将物料编码作为物料条码添加库存(原条码退回,更新库存;新条码直接入库)
if (BusinessCode != TransTypeEnum.SalesReturnBack.GetDescription<DBValue>()
&& string.IsNullOrWhiteSpace(LogID))
{
sql = @"IF EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo164") + @"',16,1);
RETURN
END ";
}
sql += @" IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
BEGIN
RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1);
RETURN
END
IF EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{3}' WHERE LotNo='{0}' AND WorkPoint='{1}'
END
ELSE
BEGIN
IF EXISTS(SELECT il.InvCode FROM ICSInventoryLocation il
INNER JOIN ICSInventoryLot a ON a.InvCode=il.InvCode AND a.WorkPoint=il.WorkPoint
WHERE il.Enable='1' AND a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
IF NOT EXISTS(SELECT il.InvCode FROM ICSInventoryLocation il
INNER JOIN ICSInventoryLot a ON a.InvCode=il.InvCode AND a.WorkPoint=il.WorkPoint
WHERE il.Enable='1' AND a.LotNo='{0}' AND a.WorkPoint='{1}' AND il.LocationCode='{4}')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo180") + @"',16,1);
RETURN
END
END
INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID(),a.LotNo ,e.WarehouseCode,d.LocationCode,a.InvCode ,'{3}',SYSDATETIME(),'0',f.F_Account ,f.F_RealName ,SYSDATETIME() ,a.WorkPoint ,''
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
--INNER JOIN ICSOApplyNegDetail c ON b.TransCode=c.OApplyNegCode AND b.TransSequence=c.Sequence AND b.WorkPoint=c.WorkPoint
INNER JOIN ICSLocation d ON d.LocationCode='{4}' AND a.WorkPoint=d.WorkPoint
INNER JOIN ICSWarehouse e ON d.WHID=e.ID AND d.WorkPoint=e.WorkPoint
INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
END";
sql = string.Format(sql, jointLotNo, WorkPoint, User, Quantity, LocationCode);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo165"));
}
///添加日志
sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity,
Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID,
ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName,
MTIME,WorkPoint,EATTRIBUTE1,LogID)
SELECT NEWID(),'{3}',b.TransCode,b.TransSequence,a.LotNo ,a.InvCode ,
'','',c.WarehouseCode,c.LocationCode,'{6}',
'','0','{4}','{5}','0','',
'','','',f.F_Account ,f.F_RealName ,
SYSDATETIME() ,a.WorkPoint ,'','{7}'
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSWareHouseLotInfo c ON a.LotNo=c.LotNo AND a.WorkPoint=c.WorkPoint
INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
";
sql = string.Format(sql, jointLotNo, WorkPoint, User, Identification, TransType, BusinessCode, Quantity, LogID);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
}
}
}
catch (Exception)
{

2
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseService.cs

@ -1015,7 +1015,7 @@ namespace ICSSoft.DataProject
INNER JOIN ICSReturn b ON a.TransCode=b.ReturnCode AND a.TransSequence=b.Sequence AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSConfiguration con ON con.Code='Stock002' AND a.WorkPoint=con.WorkPoint
WHERE a.Identification='{0}' AND ERPUpload='0'
GROUP BY a.ToWarehouseCode,b.ReturnCode,a.MUSER,a.InvCode,b.ReturnDetailID,Enable
GROUP BY a.ToWarehouseCode,b.ReturnCode,a.MUSER,lot.Amount,lot.Quantity,a.InvCode,b.ReturnDetailID,Enable
,a.WorkPoint,ISNULL(ext.ProjectCode, ''),CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END,ISNULL(ext.Version, ''),ISNULL(ext.Brand, ''),
ISNULL(ext.cFree1, ''),ISNULL(ext.cFree2, ''),ISNULL(ext.cFree3, ''),ISNULL(ext.cFree4, ''),ISNULL(ext.cFree5, ''),ISNULL(ext.cFree6, ''),ISNULL(ext.cFree7, ''),ISNULL(ext.cFree8, ''),ISNULL(ext.cFree9, ''),ISNULL(ext.cFree10, '')

7
ICSSoft.WMS.WebAPI/ICSSoft.Entity/LOTStockUpCreateIModel.cs

@ -26,7 +26,7 @@ namespace ICSSoft.Entity
/// 类型
/// </summary>
public string TransType { get; set; }
public List<LOTStockUpCreateIModelList> detail { get; set; }
@ -64,5 +64,10 @@ namespace ICSSoft.Entity
/// 数量
/// </summary>
public string Quantity { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public string InvCode { get; set; }
}
}

48
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

@ -376,6 +376,54 @@ namespace ICSSoft.WebAPI.Controllers
return result;
}
/*
/// <summary>
/// 测试获取管控方式
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("api/ControlMode/Get")]
public HttpResponseMessage getControlMode()
{
log.Info("获取管控方式" );
try
{
ControlMode model = new ControlMode();
//model = JsonConvert.DeserializeObject<List<LOTStockUpCreateIModel>>(JsonData.ToString());
//WMSBarCoreService action = new WMSBarCoreService();
//var resultStr = action.LOTStockCreate(model);
var resultStr = ICSControlModeService.GetControlModes();
res.Success = true;
res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
if (resultStr != null && resultStr.ToString() != "[]")
{
if (resultStr.itemCode.Equals("ControlMode01"))
{
res.Data = "启用批次";
}
else
{
res.Data = "启用物料";
}
//res.Data = resultStr.itemCode + "," + resultStr.itemName + "," + resultStr.enableMark + "," + resultStr.itemCode.Equals("ControlMode01");
}
}
catch (Exception ex)
{
log.Error("转换失败:" + ex.ToString());
res.Success = false;
res.Message = ex.Message;
}
finally
{
str = JsonConvert.SerializeObject(res);
result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
}
log.Debug("上架返回值:" + str);
return result;
}
*/
///// <summary>
///// 上架删除
///// </summary>

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