diff --git a/BasicData/Tnb.BasicData.Entities/Properties/launchSettings.json b/BasicData/Tnb.BasicData.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..60bc7990
--- /dev/null
+++ b/BasicData/Tnb.BasicData.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.BasicData.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50313;http://localhost:50314"
+ }
+ }
+}
\ No newline at end of file
diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs
index ac47c8f2..1e4e57ed 100644
--- a/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs
+++ b/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs
@@ -18,5 +18,12 @@ namespace Tnb.BasicData.Interfaces
///
public Task GetHistoryList(EsopHistoryListQueryInput input);
+ ///
+ /// 根据生产bom工序id获取实体
+ ///
+ /// mbomProcessId
+ ///
+ public Task GetEntityByMbomProcessId(Dictionary dic);
+
}
}
\ No newline at end of file
diff --git a/BasicData/Tnb.BasicData.Interfaces/Properties/launchSettings.json b/BasicData/Tnb.BasicData.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..1fcc5282
--- /dev/null
+++ b/BasicData/Tnb.BasicData.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.BasicData.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50305;http://localhost:50306"
+ }
+ }
+}
\ No newline at end of file
diff --git a/BasicData/Tnb.BasicData/BasESopService.cs b/BasicData/Tnb.BasicData/BasESopService.cs
index 61b94458..00d86f39 100644
--- a/BasicData/Tnb.BasicData/BasESopService.cs
+++ b/BasicData/Tnb.BasicData/BasESopService.cs
@@ -126,6 +126,18 @@ namespace Tnb.BasicData
return PageResult.SqlSugarPageResult(list);
}
+ [HttpPost]
+ public async Task GetEntityByMbomProcessId(Dictionary dic)
+ {
+ string mbomProcessId = dic["mbomProcessId"];
+ if (!string.IsNullOrEmpty(mbomProcessId))
+ {
+ return await _repository.GetFirstAsync(x => x.mbom_process_id == mbomProcessId && x.enabled == 1);
+ }
+
+ return null;
+ }
+
[HttpPost]
public async Task UploadNewVersion(UploadNewVersionInput input)
{
diff --git a/BasicData/Tnb.BasicData/Properties/launchSettings.json b/BasicData/Tnb.BasicData/Properties/launchSettings.json
new file mode 100644
index 00000000..058fd70e
--- /dev/null
+++ b/BasicData/Tnb.BasicData/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.BasicData": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50307;http://localhost:50308"
+ }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Consts/EquipmentLife.cs b/EquipMgr/Tnb.EquipMgr.Entities/Consts/EquipmentLife.cs
index 7224dfc9..78c78153 100644
--- a/EquipMgr/Tnb.EquipMgr.Entities/Consts/EquipmentLife.cs
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Consts/EquipmentLife.cs
@@ -21,5 +21,9 @@ namespace Tnb.EquipMgr
/// 报废
///
public const string SCRAP = "4";
+ ///
+ /// 未入场
+ ///
+ public const string NOTADMITTED = "4";
}
}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeInput.cs
new file mode 100644
index 00000000..c6a3d0da
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeInput.cs
@@ -0,0 +1,10 @@
+namespace Tnb.EquipMgr.Entities.Dto
+{
+ public class EquipWorkshopChangeInput
+ {
+ public string equip_id { get; set; } = string.Empty;
+ public string new_workshop_id { get; set; } = string.Empty;
+ public string? new_installation_location { get; set; }
+ public string? remark { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeQueryOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeQueryOutput.cs
new file mode 100644
index 00000000..b1099286
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipWorkshopChangeQueryOutput.cs
@@ -0,0 +1,36 @@
+namespace Tnb.EquipMgr.Entities.Dto
+{
+ public class EquipWorkshopChangeQueryOutput
+ {
+ public string id { get; set; } = string.Empty;
+ ///
+ /// 旧车间id
+ ///
+ public string old_workshop_id { get; set; } = string.Empty;
+
+ ///
+ /// 新车间id
+ ///
+ public string new_workshop_id { get; set; } = string.Empty;
+
+ ///
+ /// 旧安装地点
+ ///
+ public string? old_installation_location { get; set; }
+
+ ///
+ /// 新安装地点
+ ///
+ public string? new_installation_location { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string? remark { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public string? create_time { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs
index 335cda29..ff6a8947 100644
--- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs
@@ -187,5 +187,15 @@ public partial class EqpEquipment : BaseEntity
/// 工位编码
///
public string? station_code { get; set; }
+
+ ///
+ /// 质保开始时间
+ ///
+ public DateTime? warranty_start_time { get; set; }
+
+ ///
+ /// 质保结束时间
+ ///
+ public DateTime? warranty_end_time { get; set; }
}
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpWorkshopChangeLog.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpWorkshopChangeLog.cs
new file mode 100644
index 00000000..85b448f1
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpWorkshopChangeLog.cs
@@ -0,0 +1,72 @@
+using JNPF.Common.Contracts;
+using JNPF.Common.Security;
+using SqlSugar;
+
+namespace Tnb.EquipMgr.Entities;
+
+///
+/// 设备使用车间变更记录
+///
+[SugarTable("eqp_workshop_change_log")]
+public partial class EqpWorkshopChangeLog : BaseEntity
+{
+ public EqpWorkshopChangeLog()
+ {
+ id = SnowflakeIdHelper.NextId();
+ }
+ ///
+ /// 设备id
+ ///
+ public string equip_id { get; set; } = string.Empty;
+
+ ///
+ /// 旧车间id
+ ///
+ public string? old_workshop_id { get; set; }
+
+ ///
+ /// 新车间id
+ ///
+ public string? new_workshop_id { get; set; }
+
+ ///
+ /// 旧安装地点
+ ///
+ public string? old_installation_location { get; set; }
+
+ ///
+ /// 新安装地点
+ ///
+ public string? new_installation_location { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string? remark { get; set; }
+
+ ///
+ /// 创建用户
+ ///
+ public string? create_id { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public DateTime? create_time { get; set; }
+
+ ///
+ /// 修改用户
+ ///
+ public string? modify_id { get; set; }
+
+ ///
+ /// 修改时间
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// 所属组织
+ ///
+ public string? org_id { get; set; }
+
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Properties/launchSettings.json b/EquipMgr/Tnb.EquipMgr.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..0685298d
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.EquipMgr.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50299;http://localhost:50300"
+ }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs
new file mode 100644
index 00000000..f4cdd287
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs
@@ -0,0 +1,23 @@
+using Tnb.EquipMgr.Entities.Dto;
+
+namespace Tnb.EquipMgr.Interfaces
+{
+ ///
+ /// 设备迁移服务
+ ///
+ public interface IEqpWorkshopChangeLogService
+ {
+ ///
+ /// 根据设备id获取迁移记录
+ ///
+ ///
+ public Task GetEquipWorkshopChangeList(EquipQueryInput input);
+
+ ///
+ /// 设备迁移
+ ///
+ ///
+ ///
+ public Task WorkshopChange(EquipWorkshopChangeInput input);
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/Properties/launchSettings.json b/EquipMgr/Tnb.EquipMgr.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..f4a42f30
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.EquipMgr.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50303;http://localhost:50304"
+ }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs b/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs
new file mode 100644
index 00000000..94074c06
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs
@@ -0,0 +1,95 @@
+using JNPF.Common.Core.Manager;
+using JNPF.Common.Enums;
+using JNPF.Common.Filter;
+using JNPF.DependencyInjection;
+using JNPF.DynamicApiController;
+using JNPF.FriendlyException;
+using JNPF.Systems.Entitys.Permission;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using SqlSugar;
+using Tnb.EquipMgr.Entities;
+using Tnb.EquipMgr.Entities.Dto;
+using Tnb.EquipMgr.Interfaces;
+
+namespace Tnb.EquipMgr
+{
+ ///
+ /// 设备技术参数
+ ///
+ [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
+ [Route("api/[area]/[controller]/[action]")]
+ public class EqpWorkshopChangeLogService : IEqpWorkshopChangeLogService, IDynamicApiController, ITransient
+ {
+ private readonly ISqlSugarRepository _repository;
+ private readonly IUserManager _userManager;
+
+ public EqpWorkshopChangeLogService(ISqlSugarRepository repository, IUserManager userManager)
+ {
+ _userManager = userManager;
+ _repository = repository;
+ }
+
+ [HttpPost]
+ public async Task GetEquipWorkshopChangeList(EquipQueryInput input)
+ {
+ var db = _repository.AsSugarClient();
+ // Dictionary? queryJson = new Dictionary();
+ // if (input!=null && !string.IsNullOrEmpty(input.queryJson))
+ // {
+ // queryJson = JsonConvert.DeserializeObject>(input?.queryJson ?? "");
+ // }
+ var result = await db.Queryable()
+ .LeftJoin((a,b)=>a.old_workshop_id==b.Id)
+ .LeftJoin((a,b,c)=>a.new_workshop_id==c.Id)
+ .WhereIF(input!=null,a=>a.equip_id==input.equip_id)
+ //.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson["name"]))
+ .Select((a,b,c) => new EquipWorkshopChangeQueryOutput
+ {
+ id = a.id,
+ old_workshop_id = b.FullName,
+ new_workshop_id = c.FullName,
+ old_installation_location = a.old_installation_location,
+ new_installation_location = a.new_installation_location,
+ remark = a.remark,
+ create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"),
+ }).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
+
+ return PageResult.SqlSugarPageResult(result);
+ }
+
+ [HttpPost]
+ public async Task WorkshopChange(EquipWorkshopChangeInput input)
+ {
+ var db = _repository.AsSugarClient();
+ DbResult result = await db.Ado.UseTranAsync(async () =>
+ {
+ EqpEquipment eqpEquipment = await db.Queryable().SingleAsync(x => x.id == input.equip_id);
+
+ EqpWorkshopChangeLog eqpWorkshopChangeLog = new EqpWorkshopChangeLog()
+ {
+ equip_id = input.equip_id,
+ old_workshop_id = eqpEquipment.use_department_id,
+ new_workshop_id = input.new_workshop_id,
+ old_installation_location = eqpEquipment.installation_location,
+ new_installation_location = input.new_installation_location,
+ remark = input.remark,
+ create_id = _userManager.UserId,
+ create_time = DateTime.Now,
+ org_id = _userManager.GetUserInfo().Result.organizeId
+ };
+
+ await _repository.InsertAsync(eqpWorkshopChangeLog);
+
+ await db.Updateable()
+ .SetColumns(x => x.use_department_id == input.new_workshop_id)
+ .SetColumns(x => x.installation_location == input.new_installation_location)
+ .Where(x => x.id == input.equip_id).ExecuteCommandAsync();
+
+ });
+
+ if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
+ return result.IsSuccess ? "迁移成功" : result.ErrorMessage;
+ }
+ }
+}
\ No newline at end of file
diff --git a/EquipMgr/Tnb.EquipMgr/Properties/launchSettings.json b/EquipMgr/Tnb.EquipMgr/Properties/launchSettings.json
new file mode 100644
index 00000000..52e54340
--- /dev/null
+++ b/EquipMgr/Tnb.EquipMgr/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.EquipMgr": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50301;http://localhost:50302"
+ }
+ }
+}
\ No newline at end of file
diff --git a/PerMgr/Tnb.PerMgr.Entities/Properties/launchSettings.json b/PerMgr/Tnb.PerMgr.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..54c1b4f2
--- /dev/null
+++ b/PerMgr/Tnb.PerMgr.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.PerMgr.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50319;http://localhost:50320"
+ }
+ }
+}
\ No newline at end of file
diff --git a/PerMgr/Tnb.PerMgr.Interfaces/Properties/launchSettings.json b/PerMgr/Tnb.PerMgr.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..4967ac13
--- /dev/null
+++ b/PerMgr/Tnb.PerMgr.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.PerMgr.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50321;http://localhost:50322"
+ }
+ }
+}
\ No newline at end of file
diff --git a/PerMgr/Tnb.PerMgr/Properties/launchSettings.json b/PerMgr/Tnb.PerMgr/Properties/launchSettings.json
new file mode 100644
index 00000000..6d85c6dd
--- /dev/null
+++ b/PerMgr/Tnb.PerMgr/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.PerMgr": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50317;http://localhost:50318"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Properties/launchSettings.json b/ProductionMgr/Tnb.ProductionMgr.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..a4a524d7
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.ProductionMgr.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50311;http://localhost:50312"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/Properties/launchSettings.json b/ProductionMgr/Tnb.ProductionMgr.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..4dc4edc8
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.ProductionMgr.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50315;http://localhost:50316"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
index 79fe64ea..8d34e4f0 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs
@@ -1070,7 +1070,8 @@ namespace Tnb.ProductionMgr
record.masterial_name = material?.name;
record.plan_start_date = taskInfo.estimated_start_date;
record.plan_end_date = taskInfo.estimated_end_date;
- record.plan_qty = taskInfo.plan_qty;
+ // record.plan_qty = taskInfo.plan_qty;
+ record.plan_qty = taskInfo.scheduled_qty;
record.eqp_code = (await db.Queryable().FirstAsync(it => it.id == taskInfo.eqp_id))?.code;
record.mo_task_type = mo?.mo_type;
record.status = taskInfo.mo_task_status;
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
index a285f4b6..7b3d309c 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs
@@ -68,7 +68,7 @@ namespace Tnb.ProductionMgr
process_id = a.process_id,
plan_start_date = a.estimated_start_date,
plan_end_date = a.estimated_end_date,
- plan_qty = c.plan_qty,
+ plan_qty = c.scheduled_qty,
// complete_qty = SqlFunc.Subqueryable().Where(it => it.mo_task_code == a.mo_task_code).Sum(it => it.reported_work_qty),
complete_qty = a.last_process_complete_qty,
mo_task_status = a.mo_task_status,
@@ -132,7 +132,7 @@ namespace Tnb.ProductionMgr
process_name = b.process_name,
plan_start_date = a.estimated_start_date,
plan_end_date = a.estimated_end_date,
- plan_qty = c.plan_qty,
+ plan_qty = c.scheduled_qty,
//complete_qty = SqlFunc.Subqueryable().Where(it => it.mo_task_code == a.mo_task_code).Sum(it => it.reported_work_qty),
complete_qty = a.reported_work_qty+a.scrap_qty,
mo_task_status = a.mo_task_status,
@@ -150,8 +150,8 @@ namespace Tnb.ProductionMgr
{
nsChild[i].parentId = parentId;
nsChild[i].process_id = $"{items[i].process_code}/{items[i].process_name}";
- nsChild[i].plan_start_date = items[i].estimated_start_date.HasValue ? items[i].estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
- nsChild[i].plan_end_date = items[i].estimated_end_date.HasValue ? items[i].estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
+ nsChild[i].plan_start_date = items[i].plan_start_date.HasValue ? items[i].plan_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
+ nsChild[i].plan_end_date = items[i].plan_end_date.HasValue ? items[i].plan_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : "";
if (nsChild[i].workline_id.IsNotEmptyOrNull())
{
diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs
index 2bb31058..1ad7ad01 100644
--- a/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs
@@ -278,6 +278,7 @@ namespace Tnb.ProductionMgr
// reported_qty = a.reported_qty,
// prd_qty = a.prd_qty,
eqp_code = d.code,
+ mbom_process_id = a.mbom_process_id,
}).FirstAsync();
return prdTask;
diff --git a/ProductionMgr/Tnb.ProductionMgr/Properties/launchSettings.json b/ProductionMgr/Tnb.ProductionMgr/Properties/launchSettings.json
new file mode 100644
index 00000000..cce9bdec
--- /dev/null
+++ b/ProductionMgr/Tnb.ProductionMgr/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.ProductionMgr": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50309;http://localhost:50310"
+ }
+ }
+}
\ No newline at end of file
diff --git a/QcMgr/Tnb.QcMgr.Entities/Properties/launchSettings.json b/QcMgr/Tnb.QcMgr.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..a45ccc61
--- /dev/null
+++ b/QcMgr/Tnb.QcMgr.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.QcMgr.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50295;http://localhost:50296"
+ }
+ }
+}
\ No newline at end of file
diff --git a/QcMgr/Tnb.QcMgr.Interfaces/Properties/launchSettings.json b/QcMgr/Tnb.QcMgr.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..5f71dd6e
--- /dev/null
+++ b/QcMgr/Tnb.QcMgr.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.QcMgr.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50297;http://localhost:50298"
+ }
+ }
+}
\ No newline at end of file
diff --git a/QcMgr/Tnb.QcMgr/Properties/launchSettings.json b/QcMgr/Tnb.QcMgr/Properties/launchSettings.json
new file mode 100644
index 00000000..e8f5d84b
--- /dev/null
+++ b/QcMgr/Tnb.QcMgr/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.QcMgr": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50291;http://localhost:50292"
+ }
+ }
+}
\ No newline at end of file
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs
index e2154202..83daa894 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs
@@ -15,6 +15,10 @@ namespace Tnb.WarehouseMgr.Entities.Consts
///
public const string WMS_INSTOCK_D_BILL_STATUS_TYPEID = "25065133038101";
///
+ /// 业务类型TypeId
+ ///
+ public const string WMS_BIZTYPE_ID = "25043955941909";
+ ///
/// 预任务生成EnCode
///
public const string WMS_PRETASK_H_ENCODE = "PreTaskGen";
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs
new file mode 100644
index 00000000..75ddcae5
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
+{
+ ///
+ /// 出库签收输入参数
+ ///
+ public class SignForDeliveryInput
+ {
+ ///
+ /// 任务ID
+ ///
+ public string disTaskId { get; set; }
+ ///
+ /// 载具ID
+ ///
+ public string carryId { get; set; }
+ ///
+ /// 服务模块
+ ///
+ public string serviceModule { get; set; }
+ }
+}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs
new file mode 100644
index 00000000..279ad345
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs
@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
+{
+ ///
+ /// 载具信息输出类
+ ///
+ public class CarryInfoOutput
+ {
+ ///
+ /// 租户ID
+ ///
+ public string? tenant_id { get; set; }
+
+ ///
+ /// 所属组织ID
+ ///
+ public string? org_id { get; set; }
+
+ ///
+ /// 载具编号
+ ///
+ public string carry_code { get; set; } = string.Empty;
+
+ ///
+ /// 载具名称
+ ///
+ public string carry_name { get; set; } = string.Empty;
+
+ ///
+ /// 状态
+ ///
+ public int status { get; set; }
+
+ ///
+ /// 载具状态
+ ///
+ public string carry_status { get; set; }
+
+ ///
+ /// 载具分类ID
+ ///
+ public string carrystd_id { get; set; } = string.Empty;
+
+ ///
+ /// 载具库位ID
+ ///
+ public string? location_id { get; set; }
+
+ ///
+ /// 载具库位编号
+ ///
+ public string? location_code { get; set; }
+
+ ///
+ /// 是否锁定
+ ///
+ public int is_lock { get; set; }
+
+ ///
+ /// 出库类型
+ ///
+ public string out_status { get; set; }
+
+ ///
+ /// 是否检验
+ ///
+ public int is_check { get; set; }
+
+ ///
+ /// 来源单据ID
+ ///
+ public string? source_id { get; set; }
+
+ ///
+ /// 来源单据代码
+ ///
+ public string? source_code { get; set; }
+
+ ///
+ /// 创建用户
+ ///
+ public string create_id { get; set; } = string.Empty;
+
+ ///
+ /// 创建时间
+ ///
+ public DateTime create_time { get; set; } = DateTime.Now;
+
+ ///
+ /// 最后修改人员ID
+ ///
+ public string? modify_id { get; set; }
+
+ ///
+ /// 最后修改时间
+ ///
+ public DateTime? modify_time { get; set; }
+
+ ///
+ /// 扩展字段
+ ///
+ public string? extras { get; set; }
+
+ ///
+ /// 时间戳(用于并发控制)
+ ///
+ public DateTime? timestamp { get; set; }
+
+ ///
+ /// 打包号
+ ///
+ public string? bale_num { get; set; }
+
+ ///
+ /// 齐套搭配方案ID
+ ///
+ public string? collocation_scheme_id { get; set; }
+
+ ///
+ /// 齐套搭配方案编号
+ ///
+ public string? collocation_scheme_code { get; set; }
+ ///
+ /// 载具明细列表
+ ///
+ public List carryDetails { get; set; }=new List();
+ ///
+ /// 载具条码列表
+ ///
+ public List carryCodes { get; set; } = new List();
+ ///
+ /// 载具无聊分拣明细
+ ///
+ public List carryMats { get; set; } = new List();
+
+ }
+}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Properties/launchSettings.json b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Properties/launchSettings.json
new file mode 100644
index 00000000..190e0f72
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.WarehouseMgr.Entities": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50287;http://localhost:50288"
+ }
+ }
+}
\ No newline at end of file
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Properties/launchSettings.json b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..e52cdd23
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.WarehouseMgr.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50293;http://localhost:50294"
+ }
+ }
+}
\ No newline at end of file
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
index d7c079df..2596f2f4 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs
@@ -18,6 +18,7 @@ using Tnb.Common.Utils;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Entities.Dto;
+using Tnb.WarehouseMgr.Entities.Dto.Outputs;
using Tnb.WarehouseMgr.Entities.Enums;
using Tnb.WarehouseMgr.Interfaces;
@@ -35,11 +36,11 @@ namespace Tnb.WarehouseMgr
private readonly IRunService _runService;
private readonly IVisualDevService _visualDevService;
public WmsCarryService(
- ISqlSugarRepository repository,
- IUserManager userManager,
- IBillRullService billRullService,
+ ISqlSugarRepository repository,
+ IUserManager userManager,
+ IBillRullService billRullService,
IRunService runService,
- IVisualDevService visualDevService )
+ IVisualDevService visualDevService)
{
_db = repository.AsSugarClient();
_userManager = userManager;
@@ -49,6 +50,23 @@ namespace Tnb.WarehouseMgr
OverideFuncs.CreateAsync = ExchangeCarry;
}
+ ///
+ /// 根据载具ID获取载具信息
+ ///
+ ///
+ ///
+ [HttpGet]
+ public async Task GetCarryInfoById([FromRoute] string carryId)
+ {
+ var carryOutPut = await _db.Queryable().Where(it => it.id == carryId).Select().FirstAsync();
+ if (carryOutPut == null) throw new AppFriendlyException("找不到载具", 500);
+ carryOutPut.carryDetails = await _db.Queryable().Where(it=>it.carry_id == carryId).ToListAsync();
+ carryOutPut.carryCodes = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
+ carryOutPut.carryMats = await _db.Queryable().Where(it => it.carry_id == carryId).ToListAsync();
+ return carryOutPut;
+ }
+
+
///
/// 更换载具
///
@@ -63,7 +81,7 @@ namespace Tnb.WarehouseMgr
///
private async Task ExchangeCarry(VisualDevModelDataCrInput input)
{
-
+
var isOk = false;
try
@@ -146,7 +164,7 @@ namespace Tnb.WarehouseMgr
carryObj.location_id = null;
carryObj.location_code = null;
carryObj.out_status = "0";
- carryObj.is_check = 0;
+ carryObj.is_check = 1;
carryObj.status = 1;
carryObj.bale_num = null;
carryObj.collocation_scheme_id = null;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
index bc14c2ee..a216fa8c 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
@@ -95,11 +95,10 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
}
var partCarryMats = carryCodesPart.Adapt>();
- partCarryMats.ForEach(x =>
+ for (int i = 0; i < partCarryMats.Count; i++)
{
- x.need_qty = (int)os.pr_qty;
- x.real_qty = codeQty;
- });
+ partCarryMats[i].need_qty = carryCodesPart[i].codeqty;
+ }
carryMats.AddRange(partCarryMats);
}
}
@@ -110,12 +109,12 @@ namespace Tnb.WarehouseMgr
.Select(x =>
{
WmsCarryMat? carryMat = x.FirstOrDefault()!;
- carryMat.real_qty = x.Sum(d => d.real_qty);
+ carryMat.need_qty = x.Sum(d => d.need_qty);
return carryMat;
})
.ToList();
await _db.Insertable(carryMats).ExecuteCommandAsync();
- var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.real_qty);
+ var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.need_qty);
var allOutIds = new List();
var sortingOutIds = new List();
foreach (var pair in dic)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
index 0f6d0547..bd13a658 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
@@ -76,11 +76,11 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException($"需要出库[{os.pr_qty}],实际库存{codeQty},数量不足", 500);
}
var partCarryMats = carryCodesPart.Adapt>();
- partCarryMats.ForEach(x =>
+ for (int i = 0; i < partCarryMats.Count; i++)
{
- x.need_qty = (int)os.pr_qty;
- x.real_qty = codeQty;
- });
+ partCarryMats[i].need_qty = carryCodesPart[i].codeqty;
+ }
+
carryMats.AddRange(partCarryMats);
}
}
@@ -91,89 +91,34 @@ namespace Tnb.WarehouseMgr
.Select(x =>
{
WmsCarryMat? carryMat = x.FirstOrDefault()!;
- carryMat.real_qty = x.Sum(d => d.real_qty);
+ carryMat.need_qty = x.Sum(d => d.need_qty);
return carryMat;
})
.ToList();
await _db.Insertable(carryMats).ExecuteCommandAsync();
- var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.real_qty);
- var allOutIds = new List();
- var sortingOutIds = new List();
- foreach (var pair in dic)
- {
- var codes = carryCodes.FindAll(x => x.carry_id == pair.Key);
- if (codes?.Count > 0)
- {
- if (pair.Value == codes.Sum(d => d.codeqty))
- {
- allOutIds.Add(pair.Key);
- }
- else
- {
- sortingOutIds.Add(pair.Key);
- }
- }
- }
- carryIds = allOutIds.Concat(sortingOutIds).ToList();
- await _db.Updateable().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => allOutIds.Contains(it.id)).ExecuteCommandAsync();
+ var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.need_qty);
+
+ carryIds = carryMats.Select(x => x.carry_id).Distinct().ToList();
+ await _db.Updateable().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString() }).Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
//天益项目不需要
//await _db.Updateable().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.分拣出).ToString() }).Where(it => sortingOutIds.Contains(it.id)).ExecuteCommandAsync();
}
- var carrys = await _db.Queryable().Where(it => carryIds.Contains(it.id)).ToListAsync();
- if (carrys?.Count > 0)
+ var carrys = await _db.Queryable().Where(it => carryIds.Contains(it.id)).ToArrayAsync();
+ if (carrys?.Length > 0)
{
List preTasks = new();
List locIds = new();
- foreach (var carry in carrys)
+ string firstLocationId = "27010980724501", secondLocationId = "27010987857941";
+ if (carrys.Length > 6)
{
- WmsPointH sPoint = await _db.Queryable().FirstAsync(it => it.location_id == carry.location_id);
- WmsPointH ePoint = null!;
-
- //ePoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
-
- if (sPoint != null && ePoint != null)
- {
- var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
- locIds.AddRange(points.Select(x => x.location_id).ToList()!);
- //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
- if (points?.Count > 0)
- {
- if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
- var curPreTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
- {
- var sPoint = it.FirstOrDefault();
- var ePoint = it.LastOrDefault();
-
- WmsPretaskH preTask = new();
- preTask.org_id = _userManager.User.OrganizeId;
- preTask.startlocation_id = sPoint?.location_id!;
- preTask.startlocation_code = sPoint?.location_code!;
- preTask.endlocation_id = ePoint?.location_id!;
- preTask.endlocation_code = ePoint?.location_code!;
- preTask.start_floor = sPoint?.floor.ToString();
- preTask.end_floor = ePoint?.floor.ToString();
- preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
- preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
- preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
- preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
- preTask.carry_id = carry.id;
- preTask.carry_code = carry.carry_code;
- preTask.area_id = sPoint?.area_id!;
- preTask.area_code = it.Key;
- preTask.require_id = "";
- preTask.require_code = "";
- preTask.create_id = _userManager.UserId;
- preTask.create_time = DateTime.Now;
- return preTask;
- }).ToList();
- //if (loc.is_sign == 0)
- //{
- // curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
- //}
- preTasks.AddRange(curPreTasks);
-
- }
- }
+ var leftCarrys = carrys[..6];
+ var rightCarrys = carrys[6..];
+ await _genPreTask(leftCarrys, locIds, firstLocationId, singleSorting.id, singleSorting.bill_code, preTasks);
+ await _genPreTask(rightCarrys, locIds, secondLocationId, singleSorting.id, singleSorting.bill_code, preTasks);
+ }
+ else
+ {
+ await _genPreTask(carrys, locIds, firstLocationId, singleSorting.id, singleSorting.bill_code, preTasks);
}
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
GenPreTaskUpInput genPreTaskAfterUpInput = new();
@@ -186,5 +131,59 @@ namespace Tnb.WarehouseMgr
}
}
+ private async Task _genPreTask(WmsCarryH[] carrys, List locIds, string eLocationId, string requireId, string requireCode, List preTasks)
+ {
+ var loc = await _db.Queryable().SingleAsync(it => it.id == eLocationId);
+ foreach (var carry in carrys)
+ {
+ WmsPointH sPoint = await _db.Queryable().FirstAsync(it => it.location_id == carry.location_id);
+ WmsPointH ePoint = await _db.Queryable().FirstAsync(it => it.location_id == eLocationId);
+
+ if (sPoint != null && ePoint != null)
+ {
+ var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
+ locIds.AddRange(points.Select(x => x.location_id).ToList()!);
+ //根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
+ if (points?.Count > 0)
+ {
+ if (points.Count <= 2) throw new AppFriendlyException("该路径不存在", 500);
+ var curPreTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
+ {
+ var sPoint = it.FirstOrDefault();
+ var ePoint = it.LastOrDefault();
+
+ WmsPretaskH preTask = new();
+ preTask.org_id = _userManager.User.OrganizeId;
+ preTask.startlocation_id = sPoint?.location_id!;
+ preTask.startlocation_code = sPoint?.location_code!;
+ preTask.endlocation_id = ePoint?.location_id!;
+ preTask.endlocation_code = ePoint?.location_code!;
+ preTask.start_floor = sPoint?.floor.ToString();
+ preTask.end_floor = ePoint?.floor.ToString();
+ preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
+ preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
+ preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID;
+ preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
+ preTask.carry_id = carry.id;
+ preTask.carry_code = carry.carry_code;
+ preTask.area_id = sPoint?.area_id!;
+ preTask.area_code = it.Key;
+ preTask.require_id = requireId;
+ preTask.require_code = requireCode;
+ preTask.create_id = _userManager.UserId;
+ preTask.create_time = DateTime.Now;
+ return preTask;
+ }).ToList();
+ if (loc.is_sign == 0)
+ {
+ curPreTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
+ }
+ preTasks.AddRange(curPreTasks);
+
+ }
+ }
+ }
+ }
+
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
index e9c2809f..9242aa8d 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs
@@ -1,15 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
+using JNPF.Common.Contracts;
using JNPF.Common.Enums;
+using JNPF.Common.Extension;
using JNPF.FriendlyException;
+using JNPF.Systems.Interfaces.System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.Operations;
using SqlSugar;
+using Tnb.BasicData.Entities;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Consts;
+using Tnb.WarehouseMgr.Entities.Dto.Inputs;
+using Tnb.WarehouseMgr.Interfaces;
namespace Tnb.WarehouseMgr
{
@@ -19,10 +26,14 @@ namespace Tnb.WarehouseMgr
public class WmsSignForDeliveryService : BaseWareHouseService
{
private readonly ISqlSugarClient _db;
-
- public WmsSignForDeliveryService(ISqlSugarRepository repository)
+ private readonly IWmsCarryService _wareCarryService;
+ private readonly IDictionaryDataService _dictionaryDataService;
+ private static Dictionary _dicBizType = new();
+ public WmsSignForDeliveryService(ISqlSugarRepository repository, IWmsCarryService wareCarryService, IDictionaryDataService dictionaryDataService)
{
_db = repository.AsSugarClient();
+ _wareCarryService = wareCarryService;
+ _dictionaryDataService = dictionaryDataService;
}
///
/// 根据载具ID获取,对应的执行任务记录
@@ -35,10 +46,40 @@ namespace Tnb.WarehouseMgr
var item = await _db.Queryable().FirstAsync(it => it.carry_id == carryId && it.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID && it.is_sign == 0);
return item;
}
+ ///
+ /// 出库签收
+ ///
+ ///
[HttpPost]
- public async Task SaveData()
+ public async Task SignForDelivery(SignForDeliveryInput input)
{
-
+ if (_dicBizType.Count < 1)
+ {
+ _dicBizType = await _dictionaryDataService.GetDictionaryByTypeId(WmsWareHouseConst.WMS_BIZTYPE_ID);
+ }
+ var carry = await _db.Queryable().SingleAsync(it => it.id == input.carryId);
+ if (carry != null)
+ {
+ var disTask = await _db.Queryable().SingleAsync(it => it.id == input.disTaskId);
+ if (disTask != null)
+ {
+ if (_dicBizType.ContainsKey(disTask.biz_type))
+ {
+ switch (_dicBizType[disTask.biz_type])
+ {
+ case "空载具出库":
+ case "寄存出库":
+ case "齐套出库":
+ case "一般出库":
+ await _wareCarryService.UpdateNullCarry(carry);
+ break;
+ }
+ }
+ }
+ var loc = await _db.Queryable().SingleAsync(it => it.id == carry.location_id);
+ loc.is_use = "0";
+ await _db.Updateable(loc).UpdateColumns(it => it.is_use).ExecuteCommandAsync();
+ }
}
}
}
diff --git a/app/Tnb.Apps.Interfaces/Properties/launchSettings.json b/app/Tnb.Apps.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..c8996f68
--- /dev/null
+++ b/app/Tnb.Apps.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Apps.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50247;http://localhost:50263"
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/Tnb.Apps/Properties/launchSettings.json b/app/Tnb.Apps/Properties/launchSettings.json
new file mode 100644
index 00000000..a07fb231
--- /dev/null
+++ b/app/Tnb.Apps/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Apps": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50240;http://localhost:50264"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.CollectiveOAuth/Properties/launchSettings.json b/common/Tnb.CollectiveOAuth/Properties/launchSettings.json
new file mode 100644
index 00000000..67b55152
--- /dev/null
+++ b/common/Tnb.CollectiveOAuth/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.CollectiveOAuth": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50269;http://localhost:50270"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.Common.Core/Properties/launchSettings.json b/common/Tnb.Common.Core/Properties/launchSettings.json
new file mode 100644
index 00000000..8467993c
--- /dev/null
+++ b/common/Tnb.Common.Core/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Common.Core": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50271;http://localhost:50273"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.Common/Properties/launchSettings.json b/common/Tnb.Common/Properties/launchSettings.json
new file mode 100644
index 00000000..38603b70
--- /dev/null
+++ b/common/Tnb.Common/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Common": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50246;http://localhost:50267"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.SqlSugar/Properties/launchSettings.json b/common/Tnb.SqlSugar/Properties/launchSettings.json
new file mode 100644
index 00000000..ce32dbb9
--- /dev/null
+++ b/common/Tnb.SqlSugar/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.SqlSugar": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50289;http://localhost:50290"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.Thirdparty/Properties/launchSettings.json b/common/Tnb.Thirdparty/Properties/launchSettings.json
new file mode 100644
index 00000000..b2a75244
--- /dev/null
+++ b/common/Tnb.Thirdparty/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Thirdparty": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50276;http://localhost:50277"
+ }
+ }
+}
\ No newline at end of file
diff --git a/common/Tnb.WebSockets/Properties/launchSettings.json b/common/Tnb.WebSockets/Properties/launchSettings.json
new file mode 100644
index 00000000..c89e7e57
--- /dev/null
+++ b/common/Tnb.WebSockets/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.WebSockets": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50272;http://localhost:50274"
+ }
+ }
+}
\ No newline at end of file
diff --git a/extend/Tnb.Extend.Entitys/Properties/launchSettings.json b/extend/Tnb.Extend.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..dca0860f
--- /dev/null
+++ b/extend/Tnb.Extend.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Extend.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50285;http://localhost:50286"
+ }
+ }
+}
\ No newline at end of file
diff --git a/extend/Tnb.Extend.Interfaces/Properties/launchSettings.json b/extend/Tnb.Extend.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..77266e9a
--- /dev/null
+++ b/extend/Tnb.Extend.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Extend.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50283;http://localhost:50284"
+ }
+ }
+}
\ No newline at end of file
diff --git a/message/Tnb.Message.Entitys/Properties/launchSettings.json b/message/Tnb.Message.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..31331cbf
--- /dev/null
+++ b/message/Tnb.Message.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Message.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50244;http://localhost:50268"
+ }
+ }
+}
\ No newline at end of file
diff --git a/message/Tnb.Message.Interfaces/Properties/launchSettings.json b/message/Tnb.Message.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..6f24c200
--- /dev/null
+++ b/message/Tnb.Message.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Message.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50239;http://localhost:50259"
+ }
+ }
+}
\ No newline at end of file
diff --git a/message/Tnb.Message/Properties/launchSettings.json b/message/Tnb.Message/Properties/launchSettings.json
new file mode 100644
index 00000000..3aff95b9
--- /dev/null
+++ b/message/Tnb.Message/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Message": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50241;http://localhost:50262"
+ }
+ }
+}
\ No newline at end of file
diff --git a/system/Tnb.OAuth/Properties/launchSettings.json b/system/Tnb.OAuth/Properties/launchSettings.json
new file mode 100644
index 00000000..c7a7206a
--- /dev/null
+++ b/system/Tnb.OAuth/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.OAuth": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50278;http://localhost:50279"
+ }
+ }
+}
\ No newline at end of file
diff --git a/system/Tnb.Systems.Entitys/Properties/launchSettings.json b/system/Tnb.Systems.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..c69f89f2
--- /dev/null
+++ b/system/Tnb.Systems.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.Systems.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50280;http://localhost:50281"
+ }
+ }
+}
\ No newline at end of file
diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Properties/launchSettings.json b/taskschedule/Tnb.TaskScheduler.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..842c1c8a
--- /dev/null
+++ b/taskschedule/Tnb.TaskScheduler.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.TaskScheduler.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50245;http://localhost:50257"
+ }
+ }
+}
\ No newline at end of file
diff --git a/taskschedule/Tnb.TaskScheduler.Interfaces/Properties/launchSettings.json b/taskschedule/Tnb.TaskScheduler.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..4d593874
--- /dev/null
+++ b/taskschedule/Tnb.TaskScheduler.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.TaskScheduler.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50251;http://localhost:50258"
+ }
+ }
+}
\ No newline at end of file
diff --git a/taskschedule/Tnb.TaskScheduler/Properties/launchSettings.json b/taskschedule/Tnb.TaskScheduler/Properties/launchSettings.json
new file mode 100644
index 00000000..523f2c0b
--- /dev/null
+++ b/taskschedule/Tnb.TaskScheduler/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.TaskScheduler": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50250;http://localhost:50255"
+ }
+ }
+}
\ No newline at end of file
diff --git a/visualdev/Tnb.VisualDev.Engine/Properties/launchSettings.json b/visualdev/Tnb.VisualDev.Engine/Properties/launchSettings.json
new file mode 100644
index 00000000..6bf841cb
--- /dev/null
+++ b/visualdev/Tnb.VisualDev.Engine/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.VisualDev.Engine": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50248;http://localhost:50254"
+ }
+ }
+}
\ No newline at end of file
diff --git a/visualdev/Tnb.VisualDev.Entitys/Properties/launchSettings.json b/visualdev/Tnb.VisualDev.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..6b871025
--- /dev/null
+++ b/visualdev/Tnb.VisualDev.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.VisualDev.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50243;http://localhost:50260"
+ }
+ }
+}
\ No newline at end of file
diff --git a/visualdev/Tnb.VisualDev.Interfaces/Properties/launchSettings.json b/visualdev/Tnb.VisualDev.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..a65fcf0f
--- /dev/null
+++ b/visualdev/Tnb.VisualDev.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.VisualDev.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50252;http://localhost:50256"
+ }
+ }
+}
\ No newline at end of file
diff --git a/visualdev/Tnb.VisualDev/Properties/launchSettings.json b/visualdev/Tnb.VisualDev/Properties/launchSettings.json
new file mode 100644
index 00000000..698c0500
--- /dev/null
+++ b/visualdev/Tnb.VisualDev/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.VisualDev": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50242;http://localhost:50266"
+ }
+ }
+}
\ No newline at end of file
diff --git a/workflow/Tnb.WorkFlow.Entitys/Properties/launchSettings.json b/workflow/Tnb.WorkFlow.Entitys/Properties/launchSettings.json
new file mode 100644
index 00000000..46607c9d
--- /dev/null
+++ b/workflow/Tnb.WorkFlow.Entitys/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.WorkFlow.Entitys": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50253;http://localhost:50261"
+ }
+ }
+}
\ No newline at end of file
diff --git a/workflow/Tnb.WorkFlow.Interfaces/Properties/launchSettings.json b/workflow/Tnb.WorkFlow.Interfaces/Properties/launchSettings.json
new file mode 100644
index 00000000..0d35553b
--- /dev/null
+++ b/workflow/Tnb.WorkFlow.Interfaces/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "profiles": {
+ "Tnb.WorkFlow.Interfaces": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "https://localhost:50249;http://localhost:50265"
+ }
+ }
+}
\ No newline at end of file