Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -226,6 +226,37 @@ public static class DictConst
|
||||
/// 出库单据状态完成
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSCOMPLETED = "8";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态新增id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSADDID = "25065138925589";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态作业中id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSWORKINGID = "25065143245845";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态已呼叫id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSCALLEDID = "26169430480933";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态待配送id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSTOBEDELIVEREDID = "26169434213669";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态取消id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSCANCELID = "25065146252309";
|
||||
|
||||
/// <summary>
|
||||
/// 出库单据状态完成id
|
||||
/// </summary>
|
||||
public const string OUTSTOCKSTATUSCOMPLETEDID = "25065149810453";
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto
|
||||
{
|
||||
public class OutstockRecordListOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string mo_task_code { get; set; }
|
||||
public string mo_id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string material_id_id { get; set; }
|
||||
public string process_id { get; set; }
|
||||
public string process_id_id { get; set; }
|
||||
public string workstation_id { get; set; }
|
||||
public string workstation_id_id { get; set; }
|
||||
public string act_start_date { get; set; }
|
||||
public List<PrdKittingOutRecordListChildOutput> tablefield105 { get; set; } = new List<PrdKittingOutRecordListChildOutput>();
|
||||
public List<OutstockRecordListChildOutput> tablefield134 { get; set; } = new List<OutstockRecordListChildOutput>();
|
||||
}
|
||||
|
||||
public class OutstockRecordListChildOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string bill_code { get; set; }
|
||||
public string warehouse_id { get; set; }
|
||||
public string warehouse_id_id { get; set; }
|
||||
public string location_code { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
/// <summary>
|
||||
/// 1 齐套 2 一般/物料出库
|
||||
/// </summary>
|
||||
public string type { get; set; }
|
||||
}
|
||||
public class PrdKittingOutRecordListChildOutput : OutstockRecordListChildOutput
|
||||
{
|
||||
public string collocation_scheme_id { get; set; }
|
||||
public string collocation_scheme_id_id { get; set; }
|
||||
}
|
||||
|
||||
public class OutstockRecordListDownOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string material_id_id { get; set; }
|
||||
public string unit_id { get; set; }
|
||||
public string code_batch { get; set; }
|
||||
public string pr_qty { get; set; }
|
||||
public string box { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto
|
||||
{
|
||||
public class PrdFeedingRecordUpListOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string mo_task_code { get; set; }
|
||||
public string mo_task_status { get; set; }
|
||||
public string mo_id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string workstation_id { get; set; }
|
||||
public string workline_id { get; set; }
|
||||
public string act_start_date { get; set; }
|
||||
public List<PrdFeedingRecordUpListChildOutPut> tablefield102 { get; set; } = new List<PrdFeedingRecordUpListChildOutPut>();
|
||||
}
|
||||
|
||||
public class PrdFeedingRecordUpListChildOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string carry_code { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
}
|
||||
|
||||
public class PrdFeedingRecordUpListDownOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string unit_id { get; set; }
|
||||
public string num { get; set; }
|
||||
public string batch { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto
|
||||
{
|
||||
public class PrdMaterialReceiptRecordUpListOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string mo_task_code { get; set; }
|
||||
public string mo_task_status { get; set; }
|
||||
public string mo_id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string workstation_id { get; set; }
|
||||
public string workline_id { get; set; }
|
||||
public string act_start_date { get; set; }
|
||||
public List<PrdMaterialReceiptRecordUpListChildOutPut> tablefield103 { get; set; } = new List<PrdMaterialReceiptRecordUpListChildOutPut>();
|
||||
}
|
||||
|
||||
public class PrdMaterialReceiptRecordUpListChildOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
}
|
||||
|
||||
public class PrdMaterialReceiptRecordUpListDownOutPut
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string unit_id { get; set; }
|
||||
public string batch { get; set; }
|
||||
public string feeding_num { get; set; }
|
||||
public string num { get; set; }
|
||||
public string member_carry_code { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -84,5 +84,10 @@ public partial class PrdOutstockH : BaseEntity<string>
|
||||
/// 流程引擎Id
|
||||
/// </summary>
|
||||
public string? f_flowid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产任务单id
|
||||
/// </summary>
|
||||
public string? mo_task_id { get; set; }
|
||||
|
||||
}
|
||||
111
ProductionMgr/Tnb.ProductionMgr/PrdFeedingRecordUpServicecs.cs
Normal file
111
ProductionMgr/Tnb.ProductionMgr/PrdFeedingRecordUpServicecs.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产投料记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdFeedingRecordUpServicecs : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30373723635221";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdFeedingRecordUpServicecs(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string mo_code = queryJson.ContainsKey("mo_id") ? queryJson["mo_id"].ToString() : "";
|
||||
// string workstation_id_str = queryJson.ContainsKey("workstation_id") ? queryJson["workstation_id"].ToString() : "";
|
||||
// string workstation_id = "";
|
||||
// if (!string.IsNullOrEmpty(workstation_id_str))
|
||||
// {
|
||||
// string[] workstation_arr = JsonConvert.DeserializeObject<string[]>(workstation_id_str);
|
||||
// if (workstation_arr != null && workstation_arr.Length > 0)
|
||||
// {
|
||||
// workstation_id = workstation_arr[workstation_arr.Length - 1];
|
||||
// }
|
||||
// }
|
||||
|
||||
if (string.IsNullOrEmpty(input.sidx))
|
||||
{
|
||||
input.sidx = "a.create_time";
|
||||
input.sort = "desc";
|
||||
}
|
||||
else
|
||||
{
|
||||
input.sidx = "a." + input.sidx;
|
||||
}
|
||||
|
||||
|
||||
var result = await db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c)=>a.workstation_id==c.Id)
|
||||
.LeftJoin<PrdMo>((a,b,c,d)=>a.mo_id==d.id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e)=>e.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==e.EnCode)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c,d,e,f)=>a.workline_id==f.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_code),(a,b,c,d,e)=>d.mo_code.Contains(mo_code))
|
||||
.Where(a=>a.act_start_date!=null)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d,e,f) => new PrdFeedingRecordUpListOutPut()
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = d.mo_code,
|
||||
material_id = b.name,
|
||||
workstation_id = c.FullName,
|
||||
mo_task_status = e.FullName,
|
||||
workline_id = f.FullName,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
tablefield102 = SqlFunc.Subqueryable<PrdFeedingH>()
|
||||
.LeftJoin<UserEntity>((x,y)=>x.create_id==y.Id)
|
||||
.Where(x=>x.mo_task_id==a.id).ToList((x,y)=>new PrdFeedingRecordUpListChildOutPut()
|
||||
{
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
carry_code = x.carry_code,
|
||||
create_id = y.RealName,
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
|
||||
}),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdFeedingRecordUpListOutPut>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -306,10 +306,10 @@ namespace Tnb.ProductionMgr
|
||||
// carry_code = input.carry_code ?? "",
|
||||
// };
|
||||
//
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
// Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
// {
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
// };
|
||||
// var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN,JsonConvert.SerializeObject(mesCarrySignInput),header);
|
||||
// Log.Information(sendResult);
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料签收记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdFeedingRecordDownServicecs : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30373784928789";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdFeedingRecordDownServicecs(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string feeding_id = queryJson.ContainsKey("feeding_id") ? queryJson["feeding_id"].ToString() : "";
|
||||
if (string.IsNullOrEmpty(feeding_id))
|
||||
{
|
||||
return new
|
||||
{
|
||||
pagination = new PageResult(),
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
var result = await db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<DictionaryTypeEntity>((a,b,c)=>c.EnCode==DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d)=>a.unit_id==d.EnCode && c.Id==d.DictionaryTypeId)
|
||||
.WhereIF(!string.IsNullOrEmpty(feeding_id),a=>a.feeding_id==feeding_id)
|
||||
.Select((a, b, c,d) => new PrdFeedingRecordUpListDownOutPut
|
||||
{
|
||||
id = a.id,
|
||||
material_id = b.name,
|
||||
unit_id = d.FullName,
|
||||
batch = a.batch,
|
||||
num = a.num.ToString(),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdFeedingRecordUpListDownOutPut>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,11 +198,11 @@ namespace Tnb.ProductionMgr
|
||||
codeqty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"),
|
||||
});
|
||||
}
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -395,12 +395,12 @@ namespace Tnb.ProductionMgr
|
||||
code_batch = prdReport.mo_task_code,
|
||||
codeqty = (int)prdReport.reported_qty,
|
||||
});
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
// string domain = "http://localhost:9232";
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -507,11 +507,11 @@ namespace Tnb.ProductionMgr
|
||||
// code_batch = prdReport.mo_task_code,
|
||||
// codeqty = (int)prdReport.reported_qty,
|
||||
// });
|
||||
// // string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// // string domain = _userManager.Domain;
|
||||
// string domain = _userManager.Domain;
|
||||
// Dictionary<string, object> header = new()
|
||||
// {
|
||||
// // ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// // ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
// };
|
||||
// string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
// Log.Information(sendResult);
|
||||
@@ -667,13 +667,13 @@ namespace Tnb.ProductionMgr
|
||||
code_batch = prdReport.mo_task_code,
|
||||
codeqty = (int)prdReport.reported_qty,
|
||||
});
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
// string domain = _userManager.Domain;
|
||||
// string domain = "http://localhost:9232";
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -783,12 +783,12 @@ namespace Tnb.ProductionMgr
|
||||
code_batch = prdReport.mo_task_code,
|
||||
codeqty = (int)prdReport.reported_qty,
|
||||
});
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
string domain = _userManager.Domain;
|
||||
// string domain = "http://localhost:9232";
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -973,11 +973,11 @@ namespace Tnb.ProductionMgr
|
||||
});
|
||||
}
|
||||
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 齐套出库领料记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdKittingOutRecordDownService : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30305671171605";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdKittingOutRecordDownService(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string kitting_out_id = queryJson.ContainsKey("kitting_out_id") ? queryJson["kitting_out_id"].ToString() : "";
|
||||
string type = queryJson.ContainsKey("type") ? queryJson["type"].ToString() : "";
|
||||
|
||||
if (string.IsNullOrEmpty(kitting_out_id))
|
||||
{
|
||||
return new
|
||||
{
|
||||
pagination = new PageResult(),
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
if (type == "1")
|
||||
{
|
||||
var result = await db.Queryable<PrdKittingOutD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c)=>a.unit_id==c.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(kitting_out_id),a=>a.kitting_out_id==kitting_out_id)
|
||||
.Select((a, b, c) => new OutstockRecordListDownOutput
|
||||
{
|
||||
id = a.id,
|
||||
material_id = b.name,
|
||||
material_id_id = a.material_id,
|
||||
unit_id = c.FullName,
|
||||
code_batch = a.code_batch,
|
||||
pr_qty = a.pr_qty.ToString(),
|
||||
box = a.box.ToString(),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<OutstockRecordListDownOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = await db.Queryable<PrdOutstockD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c)=>a.unit_id==c.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(kitting_out_id),a=>a.outstock_id==kitting_out_id)
|
||||
.Select((a, b, c) => new OutstockRecordListDownOutput
|
||||
{
|
||||
id = a.id,
|
||||
material_id = b.name,
|
||||
material_id_id = a.material_id,
|
||||
unit_id = c.FullName,
|
||||
code_batch = a.code_batch,
|
||||
pr_qty = "",
|
||||
box = a.pr_qty.ToString(),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<OutstockRecordListDownOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
135
ProductionMgr/Tnb.ProductionMgr/PrdKittingOutRecordService.cs
Normal file
135
ProductionMgr/Tnb.ProductionMgr/PrdKittingOutRecordService.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 齐套出库领料记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdKittingOutRecordService : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30303202245397";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdKittingOutRecordService(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string mo_code = queryJson.ContainsKey("mo_id.mo_code") ? queryJson["mo_id.mo_code"].ToString() : "";
|
||||
string workstation_id_str = queryJson.ContainsKey("workstation_id") ? queryJson["workstation_id"].ToString() : "";
|
||||
string workstation_id = "";
|
||||
if (!string.IsNullOrEmpty(workstation_id_str))
|
||||
{
|
||||
string[] workstation_arr = JsonConvert.DeserializeObject<string[]>(workstation_id_str);
|
||||
if (workstation_arr != null && workstation_arr.Length > 0)
|
||||
{
|
||||
workstation_id = workstation_arr[workstation_arr.Length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(input.sidx))
|
||||
{
|
||||
input.sidx = "a.create_time";
|
||||
input.sort = "desc";
|
||||
}
|
||||
else
|
||||
{
|
||||
input.sidx = "a." + input.sidx;
|
||||
}
|
||||
|
||||
|
||||
var result = await db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c)=>a.workstation_id==c.Id)
|
||||
.LeftJoin<BasProcess>((a,b,c,d)=>a.process_id==d.id)
|
||||
.LeftJoin<PrdMo>((a,b,c,d,e)=>a.mo_id==e.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_code),(a,b,c,d,e)=>e.mo_code.Contains(mo_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(workstation_id),(a,b,c,d,e)=>a.workstation_id==workstation_id)
|
||||
.Where(a=>a.act_start_date!=null)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d,e) => new OutstockRecordListOutput
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = e.mo_code,
|
||||
material_id = b.name,
|
||||
material_id_id = a.material_id,
|
||||
workstation_id = c.FullName,
|
||||
workstation_id_id = a.workstation_id,
|
||||
process_id = d.process_name,
|
||||
process_id_id = a.process_id,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
tablefield105 = SqlFunc.Subqueryable<PrdKittingOutH>()
|
||||
.LeftJoin<BasWarehouse>((x,y)=>x.warehouse_id==y.id)
|
||||
.LeftJoin<UserEntity>((x,y,z)=>x.create_id==z.Id)
|
||||
.LeftJoin<WmsCollocationSchemeH>((x,y,z,cs)=>x.collocation_scheme_id==cs.id)
|
||||
.Where(x=>x.mo_task_id==a.id).ToList((x,y,z,cs)=>new PrdKittingOutRecordListChildOutput()
|
||||
{
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
bill_code = x.code,
|
||||
warehouse_id = y.whname,
|
||||
warehouse_id_id = x.warehouse_id,
|
||||
location_code = x.location_code,
|
||||
create_id = z.RealName,
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
collocation_scheme_id = cs.bill_name,
|
||||
collocation_scheme_id_id = x.collocation_scheme_id,
|
||||
type="1"
|
||||
|
||||
}),
|
||||
tablefield134 = SqlFunc.Subqueryable<PrdOutstockH>()
|
||||
.LeftJoin<BasWarehouse>((x,y)=>x.warehouse_id==y.id)
|
||||
.LeftJoin<UserEntity>((x,y,z)=>x.create_id==z.Id)
|
||||
.Where(x=>x.mo_task_id==a.id).ToList((x,y,z)=>new OutstockRecordListChildOutput()
|
||||
{
|
||||
id = x.id,
|
||||
code = x.bill_code,
|
||||
bill_code = x.bill_code,
|
||||
warehouse_id = y.whname,
|
||||
warehouse_id_id = x.warehouse_id,
|
||||
location_code = x.location_code,
|
||||
create_id = z.RealName,
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
type="2"
|
||||
}),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<OutstockRecordListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,10 +82,10 @@ namespace Tnb.ProductionMgr
|
||||
// });
|
||||
//
|
||||
// input[0].wmsKittingoutDs = JsonConvert.DeserializeObject<List<MESKittingOutStkDInput>>(JsonConvert.SerializeObject(visualDevModelDataCrInput.data["tableField115"]));
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
// Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
// {
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
// };
|
||||
// var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK,JsonConvert.SerializeObject(input),header);
|
||||
// Log.Information(sendResult);
|
||||
@@ -192,10 +192,10 @@ namespace Tnb.ProductionMgr
|
||||
};
|
||||
|
||||
input[0].wmsKittingoutDs = JsonConvert.DeserializeObject<List<MESKittingOutStkDInput>>(JsonConvert.SerializeObject(kittingOutInput.tableField115));
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -332,10 +332,10 @@ namespace Tnb.ProductionMgr
|
||||
});
|
||||
}
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料签收记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdMaterialReceiptRecordDownServicecs : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30371998404373";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdMaterialReceiptRecordDownServicecs(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string material_receipt_id = queryJson.ContainsKey("material_receipt_id") ? queryJson["material_receipt_id"].ToString() : "";
|
||||
if (string.IsNullOrEmpty(material_receipt_id))
|
||||
{
|
||||
return new
|
||||
{
|
||||
pagination = new PageResult(),
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
var result = await db.Queryable<PrdMaterialReceiptD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<DictionaryTypeEntity>((a,b,c)=>c.EnCode==DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d)=>a.unit_id==d.EnCode && c.Id==d.DictionaryTypeId)
|
||||
.WhereIF(!string.IsNullOrEmpty(material_receipt_id),a=>a.material_receipt_id==material_receipt_id)
|
||||
.Select((a, b, c,d) => new PrdMaterialReceiptRecordUpListDownOutPut
|
||||
{
|
||||
id = a.id,
|
||||
material_id = b.name,
|
||||
unit_id = d.FullName,
|
||||
batch = a.batch,
|
||||
num = a.num.ToString(),
|
||||
feeding_num = a.feeding_num.ToString(),
|
||||
member_carry_code = a.member_carry_code
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdMaterialReceiptRecordUpListDownOutPut>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.Permission;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料签收记录pc端
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
[OverideVisualDev(ModuleId)]
|
||||
public class PrdMaterialReceiptRecordUpServicecs : IDynamicApiController, ITransient, IOverideVisualDevService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdKittingOutH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IOrganizeService _organizeService;
|
||||
private const string ModuleId = "30371961209365";
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public PrdMaterialReceiptRecordUpServicecs(
|
||||
ISqlSugarRepository<PrdKittingOutH> repository,
|
||||
IOrganizeService organizeService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
_organizeService = organizeService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
private async Task<object> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string mo_code = queryJson.ContainsKey("mo_id") ? queryJson["mo_id"].ToString() : "";
|
||||
// string workstation_id_str = queryJson.ContainsKey("workstation_id") ? queryJson["workstation_id"].ToString() : "";
|
||||
// string workstation_id = "";
|
||||
// if (!string.IsNullOrEmpty(workstation_id_str))
|
||||
// {
|
||||
// string[] workstation_arr = JsonConvert.DeserializeObject<string[]>(workstation_id_str);
|
||||
// if (workstation_arr != null && workstation_arr.Length > 0)
|
||||
// {
|
||||
// workstation_id = workstation_arr[workstation_arr.Length - 1];
|
||||
// }
|
||||
// }
|
||||
|
||||
if (string.IsNullOrEmpty(input.sidx))
|
||||
{
|
||||
input.sidx = "a.create_time";
|
||||
input.sort = "desc";
|
||||
}
|
||||
else
|
||||
{
|
||||
input.sidx = "a." + input.sidx;
|
||||
}
|
||||
|
||||
|
||||
var result = await db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c)=>a.workstation_id==c.Id)
|
||||
.LeftJoin<PrdMo>((a,b,c,d)=>a.mo_id==d.id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e)=>e.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==e.EnCode)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c,d,e,f)=>a.workline_id==f.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_code),(a,b,c,d,e)=>d.mo_code.Contains(mo_code))
|
||||
.Where(a=>a.act_start_date!=null)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.Select((a, b, c, d,e,f) => new PrdMaterialReceiptRecordUpListOutPut()
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = d.mo_code,
|
||||
material_id = b.name,
|
||||
workstation_id = c.FullName,
|
||||
mo_task_status = e.FullName,
|
||||
workline_id = f.FullName,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
tablefield103 = SqlFunc.Subqueryable<PrdMaterialReceiptH>()
|
||||
.LeftJoin<UserEntity>((x,y)=>x.create_id==y.Id)
|
||||
.Where(x=>x.mo_task_id==a.id).ToList((x,y)=>new PrdMaterialReceiptRecordUpListChildOutPut()
|
||||
{
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
create_id = y.RealName,
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
|
||||
}),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdMaterialReceiptRecordUpListOutPut>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,10 +225,10 @@ namespace Tnb.ProductionMgr
|
||||
carry_code = input.carry_code ?? "",
|
||||
};
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN, JsonConvert.SerializeObject(mesCarrySignInput), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -344,11 +344,11 @@ namespace Tnb.ProductionMgr
|
||||
carry_code = input.carry_code ?? "",
|
||||
};
|
||||
|
||||
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
// string domain = _userManager.Domain;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
// ["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN, JsonConvert.SerializeObject(mesCarrySignInput), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
@@ -914,10 +914,10 @@ namespace Tnb.ProductionMgr
|
||||
public async Task<dynamic> PrdMoReverseFromMaterialInfo(PrdMoReverseFromQueryInput prdMoReverseFromQueryInput)
|
||||
{
|
||||
string barcode = prdMoReverseFromQueryInput.barcode ?? "";
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
Dictionary<string, object> postData = new()
|
||||
{
|
||||
@@ -1222,10 +1222,10 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
List<string> barCodes = await _db.Queryable<PrdReport>().Where(x => reportIds.Contains(x.id)).Select(x => x.barcode).ToListAsync();
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
Dictionary<string, object> postData = new()
|
||||
{
|
||||
|
||||
@@ -1497,6 +1497,21 @@ namespace Tnb.ProductionMgr
|
||||
// throw Oops.Bah("已完成数量不能大于任务单数量");
|
||||
// }
|
||||
|
||||
if (string.IsNullOrEmpty((input.material_box_code)))
|
||||
{
|
||||
throw Oops.Bah("载具不能为空");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty((input.location_code)))
|
||||
{
|
||||
throw Oops.Bah("入库库位不能为空");
|
||||
}
|
||||
|
||||
if (input.reported_qty<=0)
|
||||
{
|
||||
throw Oops.Bah("提报数量为正数");
|
||||
}
|
||||
|
||||
report = input.Adapt<PrdReport>();
|
||||
report.id = SnowflakeIdHelper.NextId();
|
||||
report.reported_qty = input.reported_qty;
|
||||
|
||||
@@ -95,10 +95,10 @@ namespace Tnb.ProductionMgr
|
||||
// }
|
||||
|
||||
input.outstockDs = JsonConvert.DeserializeObject<List<MESWmsOutstockDInput>>(JsonConvert.SerializeObject(visualDevModelDataCrInput.data["tablefield107"]));
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -187,10 +187,10 @@ namespace Tnb.ProductionMgr
|
||||
});
|
||||
}
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
string sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header);
|
||||
Log.Information(sendResult);
|
||||
@@ -213,6 +213,7 @@ namespace Tnb.ProductionMgr
|
||||
prdOutstockH.workstation_id = generalOutstockInput.workstation_id;
|
||||
prdOutstockH.workline = workline?.Id ?? "";
|
||||
prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD;
|
||||
prdOutstockH.mo_task_id = prdMoTask.id;
|
||||
|
||||
List<PrdOutstockD> prdOutstockDs = new();
|
||||
foreach (GeneralOutstockDInput item in generalOutstockInput.details)
|
||||
@@ -311,10 +312,10 @@ namespace Tnb.ProductionMgr
|
||||
});
|
||||
}
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
string domain = _userManager.Domain;
|
||||
Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
{
|
||||
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
|
||||
["Authorization"] = App.HttpContext!=null ? App.HttpContext.Request.Headers["Authorization"] : ""
|
||||
};
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK,JsonConvert.SerializeObject(input),header);
|
||||
Log.Information(sendResult);
|
||||
@@ -337,6 +338,7 @@ namespace Tnb.ProductionMgr
|
||||
prdOutstockH.workstation_id = materialOutstockInput.workstation_id;
|
||||
prdOutstockH.workline = workline?.Id ?? "";
|
||||
prdOutstockH.status = DictConst.OUTSTOCKSTATUSADD;
|
||||
prdOutstockH.mo_task_id = prdMoTask.id;
|
||||
|
||||
List<PrdOutstockD> prdOutstockDs = new List<PrdOutstockD>();
|
||||
foreach (var item in materialOutstockInput.details)
|
||||
|
||||
Reference in New Issue
Block a user