change - GetSpaceInfoByMaterialType增加操作类型区分入库、出库

foamRearStore
wenjy 1 year ago
parent a87b449fcd
commit 342089da27

Binary file not shown.

@ -64,6 +64,7 @@
<Compile Include="domain\ProductPlanInfo.cs" /> <Compile Include="domain\ProductPlanInfo.cs" />
<Compile Include="domain\RealTaskInfo.cs" /> <Compile Include="domain\RealTaskInfo.cs" />
<Compile Include="domain\SysUserInfo.cs" /> <Compile Include="domain\SysUserInfo.cs" />
<Compile Include="enums\OperationType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository.cs" /> <Compile Include="Repository.cs" />
<Compile Include="service\IBaseBomInfoService.cs" /> <Compile Include="service\IBaseBomInfoService.cs" />

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.enums
{
public enum OperationType
{
/// <summary>
/// 入库
/// </summary>
inStore,
/// <summary>
/// 出库
/// </summary>
outStore
}
}

@ -1 +1 @@
cd309b8333415f420709774c635be812b73b5a82 ee420817595965611deb28a84aebedb91656b671

@ -1,4 +1,5 @@
using HighWayIot.Repository.domain; using HighWayIot.Repository.domain;
using HighWayIot.Repository.enums;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -18,7 +19,7 @@ namespace HighWayIot.Repository.service
/// <param name="store"></param> /// <param name="store"></param>
/// <param name="materialType"></param> /// <param name="materialType"></param>
/// <returns></returns> /// <returns></returns>
BaseSpaceInfo GetSpaceInfoByMaterialType(string store, string materialType); BaseSpaceInfo GetSpaceInfoByMaterialType(string store, string materialType,OperationType operation);
/// <summary> /// <summary>
/// 更新货道信息 /// 更新货道信息

@ -1,6 +1,7 @@
using HighWayIot.Common; using HighWayIot.Common;
using HighWayIot.Log4net; using HighWayIot.Log4net;
using HighWayIot.Repository.domain; using HighWayIot.Repository.domain;
using HighWayIot.Repository.enums;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -24,14 +25,24 @@ namespace HighWayIot.Repository.service.Impl
/// <param name="store"></param> /// <param name="store"></param>
/// <param name="materialType"></param> /// <param name="materialType"></param>
/// <returns></returns> /// <returns></returns>
public BaseSpaceInfo GetSpaceInfoByMaterialType(string store, string materialType) public BaseSpaceInfo GetSpaceInfoByMaterialType(string store, string materialType,OperationType operation)
{ {
BaseSpaceInfo spaceInfo = null; BaseSpaceInfo spaceInfo = null;
List<BaseSpaceInfo> spaceInfos; List<BaseSpaceInfo> spaceInfos;
try try
{ {
Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true; Expression<Func<BaseSpaceInfo, bool>> exp = s1 => true;
exp = exp.And(x => x.storeCode == store && x.materialType == materialType && x.spaceStatus == 1 && x.spaceCapacity != x.spaceStock); //相同型号、启用状态、库存未满的货道信息 exp = exp.And(x => x.storeCode == store && x.materialType == materialType && x.spaceStatus == 1); //相同型号、启用状态的货道信息
if(operation == OperationType.inStore)
{
exp = exp.And(x => x.spaceCapacity != x.spaceStock); //库存未满
}
else if(operation == OperationType.outStore)
{
exp = exp.And(x => x.spaceStock > 0); //库存不为空
}
spaceInfos = _mesRepository.GetList(exp); spaceInfos = _mesRepository.GetList(exp);
if(spaceInfos.Count == 0) //没有指定该类型物料的货道信息,需获取空白货道信息进行分配 if(spaceInfos.Count == 0) //没有指定该类型物料的货道信息,需获取空白货道信息进行分配

@ -22,7 +22,7 @@ namespace HighWayIot
static void Main(string[] args) static void Main(string[] args)
{ {
logger.Info("初始化启动"); logger.Info("初始化启动");
var info = spaceInfoService.GetSpaceInfoByMaterialType("X-001", "SC232"); var info = spaceInfoService.GetSpaceInfoByMaterialType("X-001", "SC232",Repository.enums.OperationType.inStore);
} }
} }
} }

@ -14,4 +14,16 @@
日志时间2023-09-27 10:42:50,576 [1] 日志时间2023-09-27 10:42:50,576 [1]
日志级别INFO 日志级别INFO
日志内容仓库X-001物料SC232匹配的入库货道信息{"objId":2,"spaceCode":"HD_002","spaceName":"货道02","spaceCapacity":10,"spaceStock":1,"spaceStatus":1,"spaceType":1,"materialType":null,"storeCode":"X-001","isFlag":0} 日志内容仓库X-001物料SC232匹配的入库货道信息{"objId":2,"spaceCode":"HD_002","spaceName":"货道02","spaceCapacity":10,"spaceStock":1,"spaceStatus":1,"spaceType":1,"materialType":null,"storeCode":"X-001","isFlag":0}
<-------------->
日志时间2023-09-27 10:51:48,117 [1]
日志级别INFO
日志内容:初始化启动
<-------------->
日志时间2023-09-27 10:51:51,547 [1]
日志级别INFO
日志内容根据仓库X-001物料SC232获取到的货道信息[{"objId":2,"spaceCode":"HD_002","spaceName":"货道02","spaceCapacity":10,"spaceStock":1,"spaceStatus":1,"spaceType":1,"materialType":null,"storeCode":"X-001","isFlag":0}]
<-------------->
日志时间2023-09-27 10:51:51,550 [1]
日志级别INFO
日志内容仓库X-001物料SC232匹配的入库货道信息{"objId":2,"spaceCode":"HD_002","spaceName":"货道02","spaceCapacity":10,"spaceStock":1,"spaceStatus":1,"spaceType":1,"materialType":null,"storeCode":"X-001","isFlag":0}

@ -14,4 +14,12 @@
日志时间2023-09-27 10:42:50,459 [1] 日志时间2023-09-27 10:42:50,459 [1]
日志级别INFO 日志级别INFO
日志内容SELECT "OBJ_ID","SPACE_CODE","SPACE_NAME","SPACE_CAPACITY","SPACE_STOCK","SPACE_STATUS","SPACE_TYPE","MATERIAL_TYPE","STORE_CODE","IS_FLAG" FROM "BASE_SPACEINFO" WHERE (( 1 = 1 ) AND(( "MATERIAL_TYPE" IS NULL ) AND ( "SPACE_CAPACITY" <> "SPACE_STOCK" )));参数:[] 日志内容SELECT "OBJ_ID","SPACE_CODE","SPACE_NAME","SPACE_CAPACITY","SPACE_STOCK","SPACE_STATUS","SPACE_TYPE","MATERIAL_TYPE","STORE_CODE","IS_FLAG" FROM "BASE_SPACEINFO" WHERE (( 1 = 1 ) AND(( "MATERIAL_TYPE" IS NULL ) AND ( "SPACE_CAPACITY" <> "SPACE_STOCK" )));参数:[]
<-------------->
日志时间2023-09-27 10:51:49,350 [1]
日志级别INFO
日志内容SELECT "OBJ_ID","SPACE_CODE","SPACE_NAME","SPACE_CAPACITY","SPACE_STOCK","SPACE_STATUS","SPACE_TYPE","MATERIAL_TYPE","STORE_CODE","IS_FLAG" FROM "BASE_SPACEINFO" WHERE ((( 1 = 1 ) AND((( "STORE_CODE" = :storeCode1 ) AND ( "MATERIAL_TYPE" = :materialType2 )) AND ( "SPACE_STATUS" = :spaceStatus3 ))) AND ( "SPACE_CAPACITY" <> "SPACE_STOCK" ));参数:[{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":16,"Direction":0,"IsNullable":false,"ParameterName":":storeCode1","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":"X-001","TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0},{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":16,"Direction":0,"IsNullable":false,"ParameterName":":materialType2","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":"SC232","TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0},{"_Size":4000,"IsRefCursor":false,"IsClob":false,"IsNvarchar2":false,"DbType":11,"Direction":0,"IsNullable":false,"ParameterName":":spaceStatus3","Size":4000,"SourceColumn":null,"SourceColumnNullMapping":false,"UdtTypeName":null,"Value":1,"TempDate":null,"SourceVersion":0,"TypeName":null,"IsJson":false,"IsArray":false,"CustomDbType":null,"Precision":0,"Scale":0}]
<-------------->
日志时间2023-09-27 10:51:50,852 [1]
日志级别INFO
日志内容SELECT "OBJ_ID","SPACE_CODE","SPACE_NAME","SPACE_CAPACITY","SPACE_STOCK","SPACE_STATUS","SPACE_TYPE","MATERIAL_TYPE","STORE_CODE","IS_FLAG" FROM "BASE_SPACEINFO" WHERE (( 1 = 1 ) AND(( "MATERIAL_TYPE" IS NULL ) AND ( "SPACE_CAPACITY" <> "SPACE_STOCK" )));参数:[]
Loading…
Cancel
Save