You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
2.2 KiB
45 lines
2.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using FactorySystemCommon;
|
|
using FactorySystemModel.EnumModel;
|
|
using FactorySystemModel.RequestModel;
|
|
using FactorySystemModel.ResponseModel;
|
|
using FactorySystemModel.SqlSugarModel;
|
|
using Newtonsoft.Json;
|
|
using SqlSugar;
|
|
|
|
namespace FactorySystemBll
|
|
{
|
|
public class HalfMaterialTaskBll
|
|
{
|
|
/// <summary>
|
|
/// 获取任务列表
|
|
/// </summary>
|
|
public List<object> GetList(TaskQuery tq, out int totalNumber)
|
|
{
|
|
totalNumber = 0;
|
|
var db = AppSettingsHelper.GetSqlSugar();
|
|
return db.Queryable<TFS_HalfMaterialTask, TFS_HalfMaterialFTeamwork, TBasicCode,TFS_Formula>((a, b, c,d) => new JoinQueryInfos(JoinType.Inner, a.FTeamID == b.FID,
|
|
JoinType.Inner, c.FType == 33 && a.FType == int.Parse(c.FValue), JoinType.Left, b.FNewTestCode == d.FTestCode))
|
|
// 事项状态
|
|
.WhereIF(tq.FState > 0 && tq.FState != 99, (a, b) => a.FState == tq.FState)
|
|
// 事项状态
|
|
.WhereIF(tq.FState == 99, (a, b) => a.FState <= 1)
|
|
// 销售号
|
|
.WhereIF(tq.FSaleCode != null, (a, b) => b.FSaleCode.Contains(tq.FSaleCode))
|
|
// 当前流程
|
|
.WhereIF(tq.FType > 0, (a, b) => a.FType == tq.FType)
|
|
// 发起时间1
|
|
.WhereIF(tq.FDateRange != null && tq.FDateRange[0] != "", (a, b) => a.FAddDate >= DateTime.Parse(tq.FDateRange[0]))
|
|
.WhereIF(tq.FDateRange != null && tq.FDateRange[1] != "", (a, b) => a.FAddDate <= DateTime.Parse(tq.FDateRange[1]))
|
|
// 责任人
|
|
.WhereIF(tq.FUserID != null, a => (',' + a.FUserID + ',').Contains(',' + tq.FUserID + ','))
|
|
// 协同
|
|
.WhereIF(tq.FTeamID > 0, a => a.FTeamID == tq.FTeamID).OrderBy((a, b, c) => a.FID, OrderByType.Desc)
|
|
.Select<object>("a.*,b.FNewTestCode,d.FVersionCode,d.FType as 'FormulaType',b.FSaleCode,b.FFormulaTestCode as FTestCode,b.FMdmCode,b.FFormulaName,b.FMaterialHalfIDs,cast(substring(c.FRemark,4,2)as int)as FViewType")
|
|
.ToPageList(tq.FPageIndex, tq.FPageSize, ref totalNumber);
|
|
}
|
|
}
|
|
}
|