You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.0 KiB
C#

using AUCMA.STORE.Business.Implements;
using AUCMA.STORE.Business.Interface;
using AUCMA.STORE.Common;
using AUCMA.STORE.Entity.DAO;
using AUCMA.STORE.Entity.DTO;
using AUCMA.STORE.Entity.Enums;
using AUCMA.STORE.SqlSugar.serviceImpl;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace AUCMA.STORE.UnitTest
{
[TestClass]
public class UnitTest9
{
[TestMethod]
public void TestMethod1()
{
/*BaseMaterialInfo baseMaterial = new BaseMaterialInfo();
baseMaterial.materialCode = "8208001930";
baseMaterial.locationArea = LocationArea.Location_Left;
test(baseMaterial);*/
test();
}
public async void test()
{
IBaseTaskQueueBusiness baseTaskQueueBusiness = new BaseTaskQueueBusiness();
TaskDTO task = new TaskDTO();
task.pilerTaskCode = 123456;
task.pilerCode = "1002";
// task.boxCode = "8208001992BG1231";
//task.materialCode = "8208001992";
task.storeCode = "A";
task.taskStatus = Entity.Enums.TaskStatus.Await;
task.taskType = Entity.Enums.TaskType.OutStore;
task.locationArea = Entity.Enums.LocationArea.Location_Left;
task.operationType = Entity.Enums.OperationType.Automatic;
task.pilerClaimGoodsRows = 1;
task.pilerClaimGoodsLine = 2;
task.pilerClaimGoodsTier = 3;
task.pilerUnloadRows = 2;
task.pilerUnloadLine = 2;
task.pilerUnloadTier = 2;
await baseTaskQueueBusiness.WriteTaskQueue(task);
}
public async void test(BaseMaterialInfo baseMaterialInfo)
{
List<BaseLocationInfo> result = new List<BaseLocationInfo>();
Expression<Func<BaseLocationInfo, bool>> exp = s1 => true;
exp = exp.And(s1 => s1.materialType == baseMaterialInfo.materialCode && s1.locationStatus == LocationStatus.InUse && s1.deleteFlag == Entity.Enums.DeleteFlag.No && s1.storeCode == ConfigHelper.GetConfig("storeCode"));
List<BaseLocationInfo> baseMaterialStores = await new BaseServices<BaseLocationInfo>().Query(exp);
if (baseMaterialInfo.locationArea != LocationArea.Location_NoCare)
{
baseMaterialStores = baseMaterialStores.Where(x => x.locationArea == baseMaterialInfo.locationArea).ToList();
}
/* foreach (var x in baseMaterialStores)
{
Expression<Func<BaseLocationInfo, bool>> expression = s1 => true;
expression = expression.And(s1 => s1.locationCode == x.locationCode && s1.locationStatus == LocationStatus.InUse && s1.locationArea == x.locationArea && s1.storeCode == ConfigHelper.GetConfig("storeCode"));
var info = await new BaseServices<BaseLocationInfo>().Query(expression);
info.ForEach(item => result.Add(item));
}*/
}
}
}