diff --git a/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs index 494db034..171f491c 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/CodeTemplateConst.cs @@ -9,7 +9,7 @@ namespace Tnb.BasicData /// 物料签收编码 /// public const string MATERIAL_RECEIPT_CODE = "MaterialReceipt"; - + /// /// 生产投料编码 /// @@ -24,17 +24,17 @@ namespace Tnb.BasicData /// 备件领用 /// public const string SPAREPARTSREQUISITION_CODE = "SparePartsRequisition"; - + /// /// 生产齐套领料 /// public const string PRDKITTINGOUTSTOCK_CODE = "PrdKittingOutStocK"; - + /// /// 设备维修单 /// public const string EQPREPAIR_CODE = "EqpRepair"; - - + + } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs b/BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs index 640564f5..a9ec1d59 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs @@ -6,7 +6,7 @@ namespace Tnb.BasicData /// 2024-10-27 10:10 /// public const string MM = "yyyy-MM-dd HH:mi"; - + /// /// 2024-10-27 10:10:10 /// diff --git a/BasicData/Tnb.BasicData.Entities/Consts/DictConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/DictConst.cs index 69611399..ab3fad04 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/DictConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/DictConst.cs @@ -76,7 +76,7 @@ public static class DictConst /// 工单状态-code /// public const string MoTaskStatusCode = "OrderStatus"; - + /// /// 工单状态 已下发字典Id /// @@ -137,12 +137,12 @@ public static class DictConst /// 任务单状态key /// public const string TaskStatus = "TaskStatus"; - + /// /// andon状态key /// public const string AndonStatus = "AndonStatus"; - + /// /// andon状态呼叫中 /// @@ -168,17 +168,17 @@ public static class DictConst /// 产成品入库单 /// public const string CHANCHENGPINRUKUDAN = "40"; - + /// /// 生产领料单 /// public const string SHENGCHANLINGLIAO = "23"; - + /// /// 生产补料单 /// public const string SHENGCHANBULIAO = "24"; - + #endregion diff --git a/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs index 9b46621b..1b16c47f 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/FactoryConfigConst.cs @@ -9,7 +9,7 @@ namespace Tnb.BasicData /// 报工是否允许超过工单计划数 是:1 否 :0 /// public const string IS_SURPASS = "is_surpass"; - + /// /// 报工允许超过工单计划数百分比 例:填写10就是10% /// diff --git a/BasicData/Tnb.BasicData.Entities/Consts/ModuleConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/ModuleConst.cs index 20eb49d8..3f0bbdf7 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/ModuleConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/ModuleConst.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData; +namespace Tnb.BasicData; public class ModuleConst { diff --git a/BasicData/Tnb.BasicData.Entities/Consts/WebApiConst.cs b/BasicData/Tnb.BasicData.Entities/Consts/WebApiConst.cs index e29717ed..59f584f4 100644 --- a/BasicData/Tnb.BasicData.Entities/Consts/WebApiConst.cs +++ b/BasicData/Tnb.BasicData.Entities/Consts/WebApiConst.cs @@ -5,17 +5,17 @@ namespace Tnb.BasicData #region wms //mes生产入库接口 - public const string MES_CREATE_INSTOCK = "/api/wms/wms-in-stock/mes-create-instock"; - + public const string MES_CREATE_INSTOCK = "/api/wms/wms-in-stock/mes-create-instock"; + //载具签收接口 - public const string MES_CARRY_SIGN = "/api/wms/wms-sign-for-delivery/mes-carry-sign"; - + public const string MES_CARRY_SIGN = "/api/wms/wms-sign-for-delivery/mes-carry-sign"; + //生产出库接口 - public const string MES_CREATE_OUTSTOCK = "/api/wms/wms-out-stock/mes-create-outstock"; - + public const string MES_CREATE_OUTSTOCK = "/api/wms/wms-out-stock/mes-create-outstock"; + //齐套出库接口 - public const string MES_KITTING_OUT_STK = "/api/wms/wmskitting-out/mes-kitting-out-stk"; - + public const string MES_KITTING_OUT_STK = "/api/wms/wmskitting-out/mes-kitting-out-stk"; + //物料标签查询接口 public const string MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE = "/api/wms/wms-in-stock/mes-fetch-in-out-stock-info-by-bar-code"; diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarInput.cs index c2faa9be..4cf8c782 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entities.Dto +namespace Tnb.BasicData.Entities.Dto { public class CalendarInput { @@ -12,9 +6,9 @@ namespace Tnb.BasicData.Entities.Dto public string? datetype { get; set; } public string? workhour { get; set; } public string? worktype { get; set; } - public int? calendartype { get; set;} + public int? calendartype { get; set; } - public string? content { get; set;} + public string? content { get; set; } } public class CalendarBatchInput { diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarOut.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarOut.cs index 70c527c3..da4b6bee 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarOut.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasCalendar/CalendarOut.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entities.Dto.BasCalendar +namespace Tnb.BasicData.Entities.Dto.BasCalendar { public class CalendarOut { diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasESop/EsopHistoryListQueryInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasESop/EsopHistoryListQueryInput.cs index 33d28b4d..7e03704a 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasESop/EsopHistoryListQueryInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasESop/EsopHistoryListQueryInput.cs @@ -4,7 +4,7 @@ namespace Tnb.BasicData.Entities.Dto { public string mbom_id { get; set; } = string.Empty; public string mbom_process_id { get; set; } = string.Empty; - + /// /// 当前页码:pageIndex. /// @@ -14,7 +14,7 @@ namespace Tnb.BasicData.Entities.Dto /// 每页行数. /// public virtual int pageSize { get; set; } = 50; - + public string? queryJson { get; set; } } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasESop/UploadNewVersionInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasESop/UploadNewVersionInput.cs index 7a36813c..0f9b2daf 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasESop/UploadNewVersionInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasESop/UploadNewVersionInput.cs @@ -25,9 +25,9 @@ namespace Tnb.BasicData.Entities.Dto /// 附件对象. /// public string attachment { get; set; } = string.Empty; - + public string version { get; set; } = string.Empty; - + /// /// 备注 /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeOutput.cs index 15303f02..fc446c5c 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeOutput.cs @@ -30,54 +30,54 @@ namespace Tnb.BasicData.Entities.Dto /// 是否有下级 /// public bool hasChildren { get; set; } - + /// /// Desc:投料管控 /// Default:NULL::character varying /// Nullable:True /// - public string? feeding_control {get;set;} - + public string? feeding_control { get; set; } + /// /// Desc:损耗率 /// Default:NULL::character varying /// Nullable:True /// - public string? loss_rate {get;set;} - + public string? loss_rate { get; set; } + /// /// /// 数量 /// public decimal quantity { get; set; } - + /// /// Desc:需要称量 /// Default:NULL::character varying /// Nullable:True /// - public string? require_weight {get;set;} - + public string? require_weight { get; set; } + /// /// Desc:替代物料 /// Default:NULL::character varying /// Nullable:True /// - public string? substitute_material_id {get;set;} - + public string? substitute_material_id { get; set; } + /// /// Desc:工艺路线 /// Default:NULL::character varying /// Nullable:True /// - public string? route_name {get;set;} - + public string? route_name { get; set; } + /// /// Desc:版本号 /// Default:NULL::character varying /// Nullable:True /// - public string? version {get;set;} - + public string? version { get; set; } + } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeQueryInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeQueryInput.cs index 7bfe858f..0e29e017 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeQueryInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasEbom/EbomTreeQueryInput.cs @@ -10,8 +10,8 @@ namespace Tnb.BasicData.Entities.Dto /// 物料id /// public string? materialId { get; set; } - - - + + + } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialQueryInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialQueryInput.cs index 7e5fd547..82b6ecf3 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialQueryInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialQueryInput.cs @@ -12,7 +12,7 @@ namespace Tnb.BasicData.Entities.Dto /// 物料类型 /// public string types { get; set; } = string.Empty; - + /// /// 当前页码:pageIndex. /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectOutput.cs index 4838899a..bdfdf94e 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectOutput.cs @@ -9,27 +9,27 @@ namespace Tnb.BasicData.Entities.Dto /// 物料id /// public string? id { get; set; } - + /// /// 编码 /// public string? code { get; set; } - + /// /// 名称 /// - public string? name { get; set; } - + public string? name { get; set; } + /// /// 描述 /// public string? descrip { get; set; } - + /// /// 主单位id /// public string? unit_id { get; set; } - + /// /// 主单位名称 /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectQueryInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectQueryInput.cs index 45394189..e5a3a034 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectQueryInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMaterial/MaterialSelectQueryInput.cs @@ -11,7 +11,7 @@ namespace Tnb.BasicData.Entities.Dto /// 物料编码名称查询 /// public string material_info { get; set; } = string.Empty; - + /// /// 当前页码:pageIndex. /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomDataOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomDataOutput.cs index 1698923a..6862e074 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomDataOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomDataOutput.cs @@ -1,5 +1,3 @@ -using Tnb.BasicData.Entities; - namespace Tnb.BasicData.Entities.Dto { public class MbomDataOutput @@ -8,57 +6,57 @@ namespace Tnb.BasicData.Entities.Dto /// 生产bomid /// public string? id { get; set; } - + /// /// 物料id /// public string? material_id { get; set; } - + /// /// 数量 /// public int num { get; set; } - + /// /// 单位id /// public string? unit_id { get; set; } - + /// /// 版本号 /// public string? version { get; set; } - + /// /// 有效开始时间 /// public DateTime? start_time { get; set; } - + /// /// 有效结束时间 /// public DateTime? end_time { get; set; } - + /// /// 物料清单id /// public string? ebom_id { get; set; } - + /// /// 工艺路线id /// public string? route_id { get; set; } - + /// /// 物料均再首道工序投产 /// public int? is_first { get; set; } - + /// /// 备注 /// public string? remark { get; set; } - + /// /// 工序 /// @@ -68,24 +66,24 @@ namespace Tnb.BasicData.Entities.Dto public class MbomProcessOutDto { public string id { get; set; } = string.Empty; - + /// /// Desc:生产bomid /// Default: /// Nullable:False /// public string? mbom_id { get; set; } - + /// /// 工序编号 /// public string? no { get; set; } - + /// /// 上道工序编号 /// public string? last_process_no { get; set; } - + /// /// 下道工序编号 /// @@ -111,26 +109,26 @@ namespace Tnb.BasicData.Entities.Dto /// Nullable:True /// public string? station { get; set; } - + /// /// Desc:副产出管控 0 不启用 1 启用 /// Default: /// Nullable:False /// public int byproduct_status { get; set; } - + /// /// Desc:投产方式 /// Default:NULL::character varying /// Nullable:True /// - public string? production_method {get;set;} - + public string? production_method { get; set; } + /// /// 投入物料 /// public List? inputs { get; set; } - + /// /// 产出物料 /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomSaveDataInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomSaveDataInput.cs index 4c6552a8..aa3bd507 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomSaveDataInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasMbom/MbomSaveDataInput.cs @@ -1,5 +1,3 @@ -using Tnb.BasicData.Entities; - namespace Tnb.BasicData.Entities.Dto { public class MbomSaveDataInput @@ -8,57 +6,57 @@ namespace Tnb.BasicData.Entities.Dto /// 生产bomid /// public string id { get; set; } = string.Empty; - + /// /// 物料id /// public string material_id { get; set; } = string.Empty; - + /// /// 数量 /// public int num { get; set; } - + /// /// 单位id /// public string unit_id { get; set; } = string.Empty; - + /// /// 版本号 /// public string version { get; set; } = string.Empty; - + /// /// 有效开始时间 /// public DateTime? start_time { get; set; } - + /// /// 有效结束时间 /// public DateTime? end_time { get; set; } - + /// /// 物料清单id /// public string ebom_id { get; set; } = string.Empty; - + /// /// 工艺路线id /// public string route_id { get; set; } = string.Empty; - + /// /// 物料均再首道工序投产 /// public int is_first { get; set; } - + /// /// 备注 /// public string remark { get; set; } = string.Empty; - + /// /// 工序 /// @@ -68,7 +66,7 @@ namespace Tnb.BasicData.Entities.Dto public class MbomProcessDto { public string id { get; set; } = string.Empty; - + /// /// Desc:生产bomid /// Default: @@ -82,17 +80,17 @@ namespace Tnb.BasicData.Entities.Dto /// Nullable:False /// public string? process_id { get; set; } - + /// /// 工序编号 /// public string? no { get; set; } - + /// /// 上道工序编号 /// public string? last_process_no { get; set; } - + /// /// 下道工序编号 /// @@ -111,31 +109,31 @@ namespace Tnb.BasicData.Entities.Dto /// Nullable:True /// public string? station { get; set; } - + /// /// Desc:副产出管控 0 不启用 1 启用 /// Default: /// Nullable:False /// public int byproduct_status { get; set; } - + /// /// 工艺路线子表id /// public string route_detail_id { get; set; } = string.Empty; - + /// /// Desc:投产方式 /// Default:NULL::character varying /// Nullable:True /// - public string? production_method {get;set;} - + public string? production_method { get; set; } + /// /// 投入物料 /// public List? inputs { get; set; } - + /// /// 产出物料 /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessListOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessListOutput.cs index 390f2f02..22000b8e 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessListOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entitys.Dto.BasProcess +namespace Tnb.BasicData.Entitys.Dto.BasProcess { /// /// 工序列表输出类 @@ -14,7 +8,7 @@ namespace Tnb.BasicData.Entitys.Dto.BasProcess public string id { get; set; } public string process_code { get; set; } public string process_name { get; set; } - public string process_collection { get; set;} + public string process_collection { get; set; } public string status { get; set; } public string station { get; set; } public string must_pass { get; set; } @@ -27,6 +21,6 @@ namespace Tnb.BasicData.Entitys.Dto.BasProcess public string org_id { get; set; } public string create_id { get; set; } public string modify_id { get; set; } - public DateTime? modify_time { get; set;} + public DateTime? modify_time { get; set; } } } diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessStationInput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessStationInput.cs index ea21a076..010b0d57 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessStationInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasProcess/ProcessStationInput.cs @@ -6,7 +6,7 @@ namespace Tnb.BasicData.Entities.Dto /// 工序id /// public string? process_id { get; set; } - + /// /// 工位id集合 /// diff --git a/BasicData/Tnb.BasicData.Entities/Dto/BasRoute/VaildRouteOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/BasRoute/VaildRouteOutput.cs index 040ab357..622d4515 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/BasRoute/VaildRouteOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/BasRoute/VaildRouteOutput.cs @@ -3,13 +3,13 @@ namespace Tnb.BasicData.Entities.Dto public class VaildRouteOutput { public string? id { get; set; } - + public string? code { get; set; } - + public string? name { get; set; } public string start_time { get; set; } = string.Empty; - + public string end_time { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Dto/ElementSelectDto.cs b/BasicData/Tnb.BasicData.Entities/Dto/ElementSelectDto.cs index bfeaa24d..2f6d23c5 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/ElementSelectDto.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/ElementSelectDto.cs @@ -2,8 +2,8 @@ namespace Tnb.BasicData.Entitys { public class ElementSelectDto { - public string?label { get; set; } - + public string? label { get; set; } + public string? value { get; set; } } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Entities/Dto/ProcessManage/RouteLineTreeOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/ProcessManage/RouteLineTreeOutput.cs index aab0daec..0cdeeee1 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/ProcessManage/RouteLineTreeOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/ProcessManage/RouteLineTreeOutput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; +using JNPF.Common.Security; namespace Tnb.BasicData.Entities.Dto { diff --git a/BasicData/Tnb.BasicData.Entities/Dto/SubBomListOutput.cs b/BasicData/Tnb.BasicData.Entities/Dto/SubBomListOutput.cs index 27de3443..f2f1d541 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/SubBomListOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/SubBomListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entities.Dto +namespace Tnb.BasicData.Entities.Dto { /// /// 子工单列表 @@ -34,7 +28,7 @@ namespace Tnb.BasicData.Entities.Dto /// /// 数量 /// - public string num { get; set;} + public string num { get; set; } /// /// 单位id /// @@ -64,7 +58,7 @@ namespace Tnb.BasicData.Entities.Dto /// 工序排序序号 /// public long? ordinal { get; set; } - + /// /// 生产bom工序id /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasCalendar.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasCalendar.cs index 06066055..4050fdc2 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasCalendar.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasCalendar.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs index 42fff12b..375db58b 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasLocation.cs @@ -1,7 +1,6 @@ using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; -using SqlSugar.DbConvert; namespace Tnb.BasicData.Entities; @@ -44,7 +43,7 @@ public partial class BasLocation : BaseEntity /// 是否使用 /// //[SugarColumn(ColumnDataType = "varchar(32)", SqlParameterDbType = typeof(CommonPropertyConvert))] - public string is_use { get; set; } + public string is_use { get; set; } /// /// 是否最小 diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs index b9147f91..847f2e4d 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMaterial.cs @@ -248,7 +248,7 @@ public partial class BasMaterial : BaseEntity /// 是否包含入库数 /// public int? is_contain_into_num { get; set; } - + /// /// 是否创建子工单 /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomInput.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomInput.cs index ba4adbed..6769d48a 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomInput.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomInput.cs @@ -43,7 +43,7 @@ public partial class BasMbomInput : BaseEntity /// 数量 /// public decimal num { get; set; } - + /// /// 单位id /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomOutput.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomOutput.cs index 8dfa838f..8ade2a09 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomOutput.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomOutput.cs @@ -43,7 +43,7 @@ public partial class BasMbomOutput : BaseEntity /// 产出数量(可小数分数) /// public string num { get; set; } = string.Empty; - + /// /// 单位id /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomProcess.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomProcess.cs index 8ee30b99..c2078542 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasMbomProcess.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasMbomProcess.cs @@ -53,7 +53,7 @@ public partial class BasMbomProcess : BaseEntity /// 工艺路线子表id /// public string route_detail_id { get; set; } = string.Empty; - + /// /// 是否时最后一道工序 /// @@ -63,7 +63,7 @@ public partial class BasMbomProcess : BaseEntity /// 排序 /// public int ordinal { get; set; } - + /// /// 工序编号 /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasRouteD.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasRouteD.cs index ea695f32..111fb9cf 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasRouteD.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasRouteD.cs @@ -113,7 +113,7 @@ public partial class BasRouteD : BaseEntity /// 产出比 /// public decimal? output_ratio { get; set; } - + /// /// 工序编号 /// diff --git a/BasicData/Tnb.BasicData.Entities/Entity/BasShiftWorkgroup.cs b/BasicData/Tnb.BasicData.Entities/Entity/BasShiftWorkgroup.cs index deb24b43..378b141b 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/BasShiftWorkgroup.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/BasShiftWorkgroup.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/BasicData/Tnb.BasicData.Entities/Enums/EnumCalendarType.cs b/BasicData/Tnb.BasicData.Entities/Enums/EnumCalendarType.cs index 03afed7b..f1d512fb 100644 --- a/BasicData/Tnb.BasicData.Entities/Enums/EnumCalendarType.cs +++ b/BasicData/Tnb.BasicData.Entities/Enums/EnumCalendarType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entities.Enums +namespace Tnb.BasicData.Entities.Enums { public enum EnumCalendarType { diff --git a/BasicData/Tnb.BasicData.Entities/Enums/EnumLocationType.cs b/BasicData/Tnb.BasicData.Entities/Enums/EnumLocationType.cs index 8e021211..27dc426f 100644 --- a/BasicData/Tnb.BasicData.Entities/Enums/EnumLocationType.cs +++ b/BasicData/Tnb.BasicData.Entities/Enums/EnumLocationType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entities.Enums +namespace Tnb.BasicData.Entities.Enums { /// /// 库位类型 diff --git a/BasicData/Tnb.BasicData.Entities/Mapper/Mapper.cs b/BasicData/Tnb.BasicData.Entities/Mapper/Mapper.cs index 12c508bc..3200bb9d 100644 --- a/BasicData/Tnb.BasicData.Entities/Mapper/Mapper.cs +++ b/BasicData/Tnb.BasicData.Entities/Mapper/Mapper.cs @@ -1,5 +1,4 @@ using Mapster; -using SqlSugar; using Tnb.BasicData.Entities.Dto; namespace Tnb.BasicData.Entities diff --git a/BasicData/Tnb.BasicData.Entities/Model/RouteModel.cs b/BasicData/Tnb.BasicData.Entities/Model/RouteModel.cs index 83c5553a..91c2ded3 100644 --- a/BasicData/Tnb.BasicData.Entities/Model/RouteModel.cs +++ b/BasicData/Tnb.BasicData.Entities/Model/RouteModel.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.BasicData.Entitys.Model +namespace Tnb.BasicData.Entitys.Model { - public class RouteTree + public class RouteTree { /// /// 工艺路线类型 @@ -19,7 +13,7 @@ namespace Tnb.BasicData.Entitys.Model } - public class RouteName + public class RouteName { public string Tag { get; set; } /// @@ -29,5 +23,5 @@ namespace Tnb.BasicData.Entitys.Model } - + } diff --git a/BasicData/Tnb.BasicData.Entities/Tnb.BasicData.Entities.csproj b/BasicData/Tnb.BasicData.Entities/Tnb.BasicData.Entities.csproj index bc02f09d..57e42217 100644 --- a/BasicData/Tnb.BasicData.Entities/Tnb.BasicData.Entities.csproj +++ b/BasicData/Tnb.BasicData.Entities/Tnb.BasicData.Entities.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasCalendarService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasCalendarService.cs index 4eaf8a89..8610f687 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasCalendarService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasCalendarService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.BasicData.Entities.Dto; +using Tnb.BasicData.Entities.Dto; namespace Tnb.BasicData.Interfaces { diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs index 1e4e57ed..086e6a6c 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasESopService.cs @@ -10,20 +10,20 @@ namespace Tnb.BasicData.Interfaces /// /// public Task UploadNewVersion(UploadNewVersionInput input); - + /// /// 获取历史记录 /// /// /// public Task GetHistoryList(EsopHistoryListQueryInput input); - + /// /// 根据生产bom工序id获取实体 /// /// mbomProcessId /// - public Task GetEntityByMbomProcessId(Dictionary dic); - + public Task GetEntityByMbomProcessId(Dictionary dic); + } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasLocationService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasLocationService.cs index f3ddd99c..c967411c 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasLocationService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasLocationService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.BasicData.Entities; +using Tnb.BasicData.Entities; namespace Tnb.BasicData.Interfaces { diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs index 1da4bc94..ddfc341b 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasMaterialService.cs @@ -10,8 +10,8 @@ namespace Tnb.BasicData.Interfaces /// /// public Task GetMaterialSelectInfo(MaterialSelectQueryInput queryInput); - - + + /// /// 获取可创建子工单的物料 /// @@ -25,7 +25,7 @@ namespace Tnb.BasicData.Interfaces /// /// public Task GetMaterialByType(Dictionary dic); - + /// /// 根据物料类型获取物料列表 /// diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasProcessService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasProcessService.cs index 594f103b..8664ea95 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasProcessService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasProcessService.cs @@ -1,10 +1,6 @@ -using JNPF.Common.Dtos.VisualDev; -using JNPF.VisualDev; -using Tnb.BasicData.Entities.Dto; - namespace Tnb.BasicData.Interfaces { public interface IBasProcessService - { + { } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasQrcodeService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasQrcodeService.cs index cf09636b..c7f7387d 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasQrcodeService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasQrcodeService.cs @@ -1,6 +1,6 @@ namespace Tnb.BasicData.Interfaces { - + /// /// 二维码 /// @@ -12,14 +12,14 @@ namespace Tnb.BasicData.Interfaces /// /// public Task GetQrcodeByCode(Dictionary dic); - + /// /// 根据code获取工位信息 /// /// /// public Task GetWorkStationByCode(Dictionary dic); - + /// /// 获取工位信息 /// diff --git a/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs b/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs index 0fbaa1c1..c884639d 100644 --- a/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs +++ b/BasicData/Tnb.BasicData.Interfaces/IBasRouteService.cs @@ -1,5 +1,4 @@ using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Filter; namespace Tnb.BasicData.Interfaces { @@ -16,7 +15,7 @@ namespace Tnb.BasicData.Interfaces /// /// 工艺路线id id public Task Copy(Dictionary parameters); - + /// /// 获取有效的已发布的工艺路线 /// diff --git a/BasicData/Tnb.BasicData.Interfaces/Tnb.BasicData.Interfaces.csproj b/BasicData/Tnb.BasicData.Interfaces/Tnb.BasicData.Interfaces.csproj index 40c23903..862aac48 100644 --- a/BasicData/Tnb.BasicData.Interfaces/Tnb.BasicData.Interfaces.csproj +++ b/BasicData/Tnb.BasicData.Interfaces/Tnb.BasicData.Interfaces.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/BasicData/Tnb.BasicData/BasCalendarService.cs b/BasicData/Tnb.BasicData/BasCalendarService.cs index 61d2e75c..b6a5dc14 100644 --- a/BasicData/Tnb.BasicData/BasCalendarService.cs +++ b/BasicData/Tnb.BasicData/BasCalendarService.cs @@ -1,19 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; -using JNPF.Common.Models.VisualDev; +using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.JsonSerialization; -using JNPF.Systems.Interfaces.System; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula.Functions; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.BasicData.Entities.Dto; @@ -28,7 +17,7 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] - public class BasCalendarService: IBasCalendarService, IDynamicApiController, ITransient + public class BasCalendarService : IBasCalendarService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; @@ -38,6 +27,7 @@ namespace Tnb.BasicData _repository = repository; _userManager = userManager; } + /// /// 保存工作日历 /// @@ -46,17 +36,20 @@ namespace Tnb.BasicData [HttpPost] public async Task SaveData(CalendarInput CalendarInput) { - var db = _repository.AsSugarClient(); - await db.Deleteable(p=>p.datetext== CalendarInput.datetext).ExecuteCommandAsync(); - BasCalendar BasCalendar = new BasCalendar(); - BasCalendar.datetext = CalendarInput.datetext; - BasCalendar.datetype = CalendarInput.datetype; - BasCalendar.workhour = CalendarInput.workhour; - BasCalendar.worktype = CalendarInput.worktype; - BasCalendar.create_id = _userManager.UserId; - BasCalendar.create_time = DateTime.Now; - await db.Insertable(BasCalendar).ExecuteCommandAsync(); + ISqlSugarClient db = _repository.AsSugarClient(); + _ = await db.Deleteable(p => p.datetext == CalendarInput.datetext).ExecuteCommandAsync(); + BasCalendar BasCalendar = new() + { + datetext = CalendarInput.datetext, + datetype = CalendarInput.datetype, + workhour = CalendarInput.workhour, + worktype = CalendarInput.worktype, + create_id = _userManager.UserId, + create_time = DateTime.Now + }; + _ = await db.Insertable(BasCalendar).ExecuteCommandAsync(); } + /// /// 获取工作日历 /// @@ -64,95 +57,31 @@ namespace Tnb.BasicData [HttpPost] public async Task GetWorkData(CalendarInput CalendarInput) { - List CalendarOuts = new List(); + List CalendarOuts = new(); if (CalendarInput.calendartype == (int)EnumCalendarType.分类) { - var db = _repository.AsSugarClient(); - var lists = await db.Queryable().Where(p => p.worktype == CalendarInput.content).ToListAsync(); - - foreach (var list in lists) + ISqlSugarClient db = _repository.AsSugarClient(); + List lists = await db.Queryable().Where(p => p.worktype == CalendarInput.content).ToListAsync(); + + foreach (BasCalendar list in lists) { - CalendarOut CalendarOut = new CalendarOut(); - CalendarOut.datetext = list.datetext; - CalendarOut.datetype = list.datetype; - CalendarOut.workhour = JSON.Deserialize>(list.workhour); - CalendarOut.worktype = list.worktype; + CalendarOut CalendarOut = new() + { + datetext = list.datetext, + datetype = list.datetype, + workhour = JSON.Deserialize>(list.workhour), + worktype = list.worktype + }; CalendarOuts.Add(CalendarOut); } } else if (CalendarInput.calendartype == (int)EnumCalendarType.班组) { - var db = _repository.AsSugarClient(); - var Shifts = await db.Queryable().Where(p => p.workgroup_id == CalendarInput.content).Select(p=>p.shift_id).ToListAsync(); + ISqlSugarClient db = _repository.AsSugarClient(); + List Shifts = await db.Queryable().Where(p => p.workgroup_id == CalendarInput.content).Select(p => p.shift_id).ToListAsync(); if (Shifts != null && Shifts.Count > 0) { - var BasTimePeriods = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id }) - .Where((a,b) => Shifts.Contains(a.shifttype_id!)) - .Select((a, b) => - new Shift - { - startday = b.shiftb_time, - endday = b.shifte_time, - workhour = new WorkHour { start=a.tpb_time,end=a.tpe_time }, - } - ).ToListAsync(); - - - var BasTimePeriodRests = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id }) - .Where((a, b) => Shifts.Contains(a.shift_type_id!)) - .Select((a, b) => - new Shift - { - startday = b.shiftb_time, - endday = b.shifte_time, - workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time }, - }).ToListAsync(); - foreach (var BasTimePeriod in BasTimePeriods) - { - var start = DateTime.Parse(BasTimePeriod.startday!); - var end = DateTime.Parse(BasTimePeriod.endday!); - for (DateTime date = start; date <= end; date = date.AddDays(1)) - { - if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) - CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!); - else - { - CalendarOut CalendarOut = new CalendarOut(); - CalendarOut.datetext = date.ToString("yyyy-MM-dd"); - CalendarOut.datetype = "workDay"; - CalendarOut.workhour = new List { BasTimePeriod.workhour! }; - CalendarOuts.Add(CalendarOut); - } - } - } - foreach (var BasTimePeriodRest in BasTimePeriodRests) - { - var start = DateTime.Parse(BasTimePeriodRest.startday!); - var end = DateTime.Parse(BasTimePeriodRest.endday!); - for (DateTime date = start; date <= end; date = date.AddDays(1)) - { - if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) - CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!); - else - { - CalendarOut CalendarOut = new CalendarOut(); - CalendarOut.datetext = date.ToString("yyyy-MM-dd"); - CalendarOut.datetype = "dayOff"; - CalendarOut.workhour = new List { BasTimePeriodRest.workhour! }; - CalendarOuts.Add(CalendarOut); - } - } - } - } - } - else if (CalendarInput.calendartype == (int)EnumCalendarType.个人) - { - var db = _repository.AsSugarClient(); - var groups = await db.Queryable().Where(p => p.employee_id == CalendarInput.content).Select(p => p.group_id).ToListAsync(); - var Shifts = await db.Queryable().Where(p => groups.Contains(p.workgroup_id)).Select(p => p.shift_id).ToListAsync(); - if (Shifts != null && Shifts.Count > 0) - { - var BasTimePeriods = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id }) + List BasTimePeriods = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id }) .Where((a, b) => Shifts.Contains(a.shifttype_id!)) .Select((a, b) => new Shift @@ -163,8 +92,7 @@ namespace Tnb.BasicData } ).ToListAsync(); - - var BasTimePeriodRests = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id }) + List BasTimePeriodRests = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id }) .Where((a, b) => Shifts.Contains(a.shift_type_id!)) .Select((a, b) => new Shift @@ -173,38 +101,119 @@ namespace Tnb.BasicData endday = b.shifte_time, workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time }, }).ToListAsync(); - foreach (var BasTimePeriod in BasTimePeriods) + foreach (Shift? BasTimePeriod in BasTimePeriods) { - var start = DateTime.Parse(BasTimePeriod.startday!); - var end = DateTime.Parse(BasTimePeriod.endday!); + DateTime start = DateTime.Parse(BasTimePeriod.startday!); + DateTime end = DateTime.Parse(BasTimePeriod.endday!); for (DateTime date = start; date <= end; date = date.AddDays(1)) { if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) + { CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!); + } else { - CalendarOut CalendarOut = new CalendarOut(); - CalendarOut.datetext = date.ToString("yyyy-MM-dd"); - CalendarOut.datetype = "workDay"; - CalendarOut.workhour = new List { BasTimePeriod.workhour! }; + CalendarOut CalendarOut = new() + { + datetext = date.ToString("yyyy-MM-dd"), + datetype = "workDay", + workhour = new List { BasTimePeriod.workhour! } + }; CalendarOuts.Add(CalendarOut); } } } - foreach (var BasTimePeriodRest in BasTimePeriodRests) + foreach (Shift? BasTimePeriodRest in BasTimePeriodRests) { - var start = DateTime.Parse(BasTimePeriodRest.startday!); - var end = DateTime.Parse(BasTimePeriodRest.endday!); + DateTime start = DateTime.Parse(BasTimePeriodRest.startday!); + DateTime end = DateTime.Parse(BasTimePeriodRest.endday!); for (DateTime date = start; date <= end; date = date.AddDays(1)) { if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) + { CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!); + } else { - CalendarOut CalendarOut = new CalendarOut(); - CalendarOut.datetext = date.ToString("yyyy-MM-dd"); - CalendarOut.datetype = "dayOff"; - CalendarOut.workhour = new List { BasTimePeriodRest.workhour! }; + CalendarOut CalendarOut = new() + { + datetext = date.ToString("yyyy-MM-dd"), + datetype = "dayOff", + workhour = new List { BasTimePeriodRest.workhour! } + }; + CalendarOuts.Add(CalendarOut); + } + } + } + } + } + else if (CalendarInput.calendartype == (int)EnumCalendarType.个人) + { + ISqlSugarClient db = _repository.AsSugarClient(); + List groups = await db.Queryable().Where(p => p.employee_id == CalendarInput.content).Select(p => p.group_id).ToListAsync(); + List Shifts = await db.Queryable().Where(p => groups.Contains(p.workgroup_id)).Select(p => p.shift_id).ToListAsync(); + if (Shifts != null && Shifts.Count > 0) + { + List BasTimePeriods = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shifttype_id == b.id }) + .Where((a, b) => Shifts.Contains(a.shifttype_id!)) + .Select((a, b) => + new Shift + { + startday = b.shiftb_time, + endday = b.shifte_time, + workhour = new WorkHour { start = a.tpb_time, end = a.tpe_time }, + } + ).ToListAsync(); + + List BasTimePeriodRests = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.shift_type_id == b.id }) + .Where((a, b) => Shifts.Contains(a.shift_type_id!)) + .Select((a, b) => + new Shift + { + startday = b.shiftb_time, + endday = b.shifte_time, + workhour = new WorkHour { start = a.tp_b_time, end = a.tp_e_time }, + }).ToListAsync(); + foreach (Shift? BasTimePeriod in BasTimePeriods) + { + DateTime start = DateTime.Parse(BasTimePeriod.startday!); + DateTime end = DateTime.Parse(BasTimePeriod.endday!); + for (DateTime date = start; date <= end; date = date.AddDays(1)) + { + if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) + { + CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriod.workhour!); + } + else + { + CalendarOut CalendarOut = new() + { + datetext = date.ToString("yyyy-MM-dd"), + datetype = "workDay", + workhour = new List { BasTimePeriod.workhour! } + }; + CalendarOuts.Add(CalendarOut); + } + } + } + foreach (Shift? BasTimePeriodRest in BasTimePeriodRests) + { + DateTime start = DateTime.Parse(BasTimePeriodRest.startday!); + DateTime end = DateTime.Parse(BasTimePeriodRest.endday!); + for (DateTime date = start; date <= end; date = date.AddDays(1)) + { + if (CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) + { + CalendarOuts.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First().workhour!.Add(BasTimePeriodRest.workhour!); + } + else + { + CalendarOut CalendarOut = new() + { + datetext = date.ToString("yyyy-MM-dd"), + datetype = "dayOff", + workhour = new List { BasTimePeriodRest.workhour! } + }; CalendarOuts.Add(CalendarOut); } } @@ -213,6 +222,7 @@ namespace Tnb.BasicData } return CalendarOuts; } + /// /// 批量保存工作日历 /// @@ -220,37 +230,39 @@ namespace Tnb.BasicData /// public async Task SaveBatchData(CalendarBatchInput CalendarBatchInput) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); DateTime start = DateTime.Parse(CalendarBatchInput.startenday![0]); DateTime end = DateTime.Parse(CalendarBatchInput.startenday![1]); - List BasCalendars = new List(); - var lists=await db.Queryable().Where(p=>start<=DateTime.Parse(p.datetext!)&&end>= DateTime.Parse(p.datetext!)&& p.worktype== CalendarBatchInput.worktype).ToListAsync(); - var updatelist=new List(); + List BasCalendars = new(); + List lists = await db.Queryable().Where(p => start <= DateTime.Parse(p.datetext!) && end >= DateTime.Parse(p.datetext!) && p.worktype == CalendarBatchInput.worktype).ToListAsync(); + List updatelist = new(); for (DateTime date = start; date <= end; date = date.AddDays(1)) { if (CalendarBatchInput.weekday!.Contains((int)date.DayOfWeek)) { if (lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).Any()) { - var BasCalendar = lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First(); + BasCalendar BasCalendar = lists.Where(p => p.datetext == date.ToString("yyyy-MM-dd")).First(); BasCalendar.datetype = CalendarBatchInput.datetype; - updatelist.Add(BasCalendar); + updatelist.Add(BasCalendar); } else { - BasCalendar BasCalendar = new BasCalendar(); - BasCalendar.datetext = date.ToString("yyyy-MM-dd"); - BasCalendar.datetype = CalendarBatchInput.datetype; - BasCalendar.workhour = CalendarBatchInput.workhour; - BasCalendar.worktype = CalendarBatchInput.worktype; - BasCalendar.create_id = _userManager.UserId; - BasCalendar.create_time = DateTime.Now; + BasCalendar BasCalendar = new() + { + datetext = date.ToString("yyyy-MM-dd"), + datetype = CalendarBatchInput.datetype, + workhour = CalendarBatchInput.workhour, + worktype = CalendarBatchInput.worktype, + create_id = _userManager.UserId, + create_time = DateTime.Now + }; BasCalendars.Add(BasCalendar); } } } - await db.Updateable(updatelist).ExecuteCommandAsync(); - await db.Insertable(BasCalendars).ExecuteCommandAsync(); + _ = await db.Updateable(updatelist).ExecuteCommandAsync(); + _ = await db.Insertable(BasCalendars).ExecuteCommandAsync(); } } -} +} \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/BasDefectService.cs b/BasicData/Tnb.BasicData/BasDefectService.cs index f75e0f46..6b1accb3 100644 --- a/BasicData/Tnb.BasicData/BasDefectService.cs +++ b/BasicData/Tnb.BasicData/BasDefectService.cs @@ -2,11 +2,10 @@ using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.BasicData.Entities.Dto; using Tnb.BasicData.Entities; +using Tnb.BasicData.Entities.Dto; using Tnb.BasicData.Interfaces; namespace Tnb.BasicData @@ -16,14 +15,14 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] - public class BasDefectService: IBasDefectService,IDynamicApiController, ITransient + public class BasDefectService : IBasDefectService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; - + public BasDefectService( - ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + ISqlSugarRepository repository, DataBaseManager dbManager, IDictionaryDataService dictionaryDataService) { _repository = repository; _dbManager = dbManager; @@ -34,16 +33,16 @@ namespace Tnb.BasicData public async Task GetDefectListByProcessId(Dictionary dic) { string processId = dic["processId"]; - var db = _repository.AsSugarClient(); - List defectIds = await db.Queryable().Where(x=>x.process_id==processId).Select(x=>x.defective_id).ToListAsync(); - List defectTypeIds = await db.Queryable().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync(); + ISqlSugarClient db = _repository.AsSugarClient(); + List defectIds = await db.Queryable().Where(x => x.process_id == processId).Select(x => x.defective_id).ToListAsync(); + List defectTypeIds = await db.Queryable().Where(x => defectIds.Contains(x.id) && x.enabled == 1).Select(x => x.defect_type_id).ToListAsync(); return await _repository.AsSugarClient().Queryable() .Where((a) => defectTypeIds.Contains(a.id)) .Select(a => new { defect_type_id = a.id, - defect_type_name = a.defect_type_name, - children = SqlFunc.Subqueryable().Where(x=>x.defect_type_id==a.id && defectIds.Contains(x.id)).ToList(x=>new DefectOutput() + a.defect_type_name, + children = SqlFunc.Subqueryable().Where(x => x.defect_type_id == a.id && defectIds.Contains(x.id)).ToList(x => new DefectOutput() { id = x.id, defect_code = x.defect_code, diff --git a/BasicData/Tnb.BasicData/BasESopService.cs b/BasicData/Tnb.BasicData/BasESopService.cs index b52fc9d4..ee9bc836 100644 --- a/BasicData/Tnb.BasicData/BasESopService.cs +++ b/BasicData/Tnb.BasicData/BasESopService.cs @@ -6,7 +6,6 @@ using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Microsoft.AspNetCore.Mvc; @@ -24,13 +23,13 @@ namespace Tnb.BasicData [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModelId)] - public class BasESopService : IBasESopService,IOverideVisualDevService,IDynamicApiController, ITransient + public class BasESopService : IBasESopService, IOverideVisualDevService, IDynamicApiController, ITransient { public const string ModelId = "26919620992277"; private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); - + public BasESopService( IUserManager userManager, ISqlSugarRepository repository) @@ -39,7 +38,7 @@ namespace Tnb.BasicData _userManager = userManager; OverideFuncs.GetListAsync = GetList; } - + /// /// ESOP列表 /// @@ -48,12 +47,12 @@ namespace Tnb.BasicData [HttpPost] public async Task GetList(VisualDevModelListQueryInput input) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); Dictionary? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject>(); - string? code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; - string? name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; - string? version = queryJson!=null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : ""; - var list = await db.Queryable((a, b, c, d,e) => new object[] + string? code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; + string? name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; + string? version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : ""; + SqlSugarPagedList list = await db.Queryable((a, b, c, d, e) => new object[] { JoinType.Left, a.mbom_id == b.id, JoinType.Left, a.mbom_process_id == c.id, @@ -63,8 +62,8 @@ namespace Tnb.BasicData .WhereIF(!string.IsNullOrEmpty(code), (a, b, c, d) => a.code.Contains(code!)) .WhereIF(!string.IsNullOrEmpty(name), (a, b, c, d) => a.name.Contains(name!)) .WhereIF(!string.IsNullOrEmpty(version), (a, b, c, d) => a.version.Contains(version!)) - .Where((a,b,c)=>a.enabled==1) - .Select((a, b, c, d,e) => new ESopListOutput + .Where((a, b, c) => a.enabled == 1) + .Select((a, b, c, d, e) => new ESopListOutput { id = a.id, code = a.code, @@ -72,31 +71,31 @@ namespace Tnb.BasicData mbom_id = b.version!, mbom_process_id = e.process_name!, version = a.version, - enabled = a.enabled==1 ? "是" : "否", + enabled = a.enabled == 1 ? "是" : "否", attachment = a.attachment, remark = a.remark, create_id = d.RealName, - create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"), mbom_id_id = a.mbom_id, mbom_process_id_id = a.mbom_process_id - }).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + }).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); return PageResult.SqlSugarPageResult(list); } - + [HttpPost] public async Task GetHistoryList(EsopHistoryListQueryInput input) { - var db = _repository.AsSugarClient(); - Dictionary? queryJson = new Dictionary(); - if (input!=null && !string.IsNullOrEmpty(input.queryJson)) + ISqlSugarClient db = _repository.AsSugarClient(); + Dictionary? queryJson = new(); + if (input != null && !string.IsNullOrEmpty(input.queryJson)) { queryJson = JsonConvert.DeserializeObject>(input?.queryJson ?? ""); } - string code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; - string name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; - string version = queryJson!=null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : ""; - var list = await db.Queryable((a, b, c, d,e) => new object[] + string code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; + string name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; + string version = queryJson != null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : ""; + SqlSugarPagedList list = await db.Queryable((a, b, c, d, e) => new object[] { JoinType.Left, a.mbom_id == b.id, JoinType.Left, a.mbom_process_id == c.id, @@ -106,8 +105,8 @@ namespace Tnb.BasicData .WhereIF(!string.IsNullOrEmpty(code), (a, b, c, d) => a.code.Contains(code)) .WhereIF(!string.IsNullOrEmpty(name), (a, b, c, d) => a.name.Contains(name)) .WhereIF(!string.IsNullOrEmpty(version), (a, b, c, d) => a.version.Contains(version)) - .Where((a,b,c)=>a.mbom_id==input!.mbom_id && a.mbom_process_id==input!.mbom_process_id) - .Select((a, b, c, d,e) => new ESopListOutput + .Where((a, b, c) => a.mbom_id == input!.mbom_id && a.mbom_process_id == input!.mbom_process_id) + .Select((a, b, c, d, e) => new ESopListOutput { id = a.id, code = a.code, @@ -115,27 +114,24 @@ namespace Tnb.BasicData mbom_id = b.version!, mbom_process_id = e.process_name!, version = a.version, - enabled = a.enabled==1 ? "是" : "否", + enabled = a.enabled == 1 ? "是" : "否", attachment = a.attachment, remark = a.remark, create_id = d.RealName, - create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString("yyyy-MM-dd"), mbom_id_id = a.mbom_id - }).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + }).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); return PageResult.SqlSugarPageResult(list); } [HttpPost] - public async Task GetEntityByMbomProcessId(Dictionary dic) + 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!; + return !string.IsNullOrEmpty(mbomProcessId) + ? await _repository.GetFirstAsync(x => x.mbom_process_id == mbomProcessId && x.enabled == 1) + : (dynamic)null; } [HttpPost] @@ -146,15 +142,15 @@ namespace Tnb.BasicData throw Oops.Bah("已存在该版本"); } - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); DbResult result = await db.Ado.UseTranAsync(async () => { - await _repository.UpdateAsync(x => new BasESop() + _ = await _repository.UpdateAsync(x => new BasESop() { enabled = 0, }, x => x.mbom_id == input.mbom_id && x.mbom_process_id == input.mbom_process_id); - - BasESop basESop = new BasESop() + + BasESop basESop = new() { code = input.code, name = input.name, @@ -169,13 +165,9 @@ namespace Tnb.BasicData enabled = 1, }; - await _repository.InsertAsync(basESop); - + _ = await _repository.InsertAsync(basESop); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - - return result.IsSuccess ? "上传成功" : result.ErrorMessage; - + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "上传成功" : result.ErrorMessage); } } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/BasEbomService.cs b/BasicData/Tnb.BasicData/BasEbomService.cs index 01679ee6..9cedf8a3 100644 --- a/BasicData/Tnb.BasicData/BasEbomService.cs +++ b/BasicData/Tnb.BasicData/BasEbomService.cs @@ -3,7 +3,6 @@ using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; @@ -11,7 +10,6 @@ using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.BasicData.Entities.Dto; -using Tnb.BasicData.Entitys.Dto.BasProcess; using Tnb.BasicData.Interfaces; namespace Tnb.BasicData @@ -22,23 +20,22 @@ namespace Tnb.BasicData [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModelId)] - public class BasEbomService : IBasEbomService,IOverideVisualDevService,IDynamicApiController, ITransient + public class BasEbomService : IBasEbomService, IOverideVisualDevService, IDynamicApiController, ITransient { public const string ModelId = "25487105536805"; private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); - + public BasEbomService( - ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + ISqlSugarRepository repository, DataBaseManager dbManager, IDictionaryDataService dictionaryDataService) { _repository = repository; _dbManager = dbManager; _dictionaryDataService = dictionaryDataService; OverideFuncs.GetListAsync = GetList; } - /// /// 物料清单列表 @@ -47,15 +44,15 @@ namespace Tnb.BasicData /// public async Task GetList(VisualDevModelListQueryInput input) { - var db = _repository.AsSugarClient(); - Dictionary? queryJson = (input==null || string.IsNullOrEmpty(input.queryJson)) ? null : input.queryJson.ToObject>(); + ISqlSugarClient db = _repository.AsSugarClient(); + Dictionary? queryJson = (input == null || string.IsNullOrEmpty(input.queryJson)) ? null : input.queryJson.ToObject>(); string materialInfo = queryJson?["query_info"]?.ToString() ?? ""; - var list = await db.Queryable((a, b, c) => new object[] + SqlSugarPagedList list = await db.Queryable((a, b, c) => new object[] { JoinType.Left, a.material_id == b.id, JoinType.Left, a.route_id == c.id, }) - .WhereIF(!string.IsNullOrEmpty(materialInfo),(a,b,c)=>b.code.Contains(materialInfo) || b.name.Contains(materialInfo)) + .WhereIF(!string.IsNullOrEmpty(materialInfo), (a, b, c) => b.code.Contains(materialInfo) || b.name.Contains(materialInfo)) .Select((a, b, c) => new EbomListOutput { id = a.id, @@ -67,12 +64,11 @@ namespace Tnb.BasicData version = a.version, route_id = c.name, route_id_id = c.id, + }).ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); - }).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); - - return PageResult.SqlSugarPageResult(list); + return PageResult.SqlSugarPageResult(list); } - + /// /// 获取物料清单树. /// @@ -80,9 +76,9 @@ namespace Tnb.BasicData [HttpPost] public async Task GetTree(EbomTreeQueryInput queryInput) { - var db = _repository.AsSugarClient(); - var dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit); - + ISqlSugarClient db = _repository.AsSugarClient(); + Dictionary dic = await _dictionaryDataService.GetDicByKey(DictConst.MeasurementUnit); + // var momDbLink = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.FullName == DbName.TNBMON); // if (momDbLink != null) // { @@ -91,14 +87,14 @@ namespace Tnb.BasicData if (string.IsNullOrEmpty(queryInput.materialId)) { - var data = await db.Queryable() - .LeftJoin((a,b)=>a.ebom_id==b.id) - .LeftJoin((a,b,c)=>a.material_id==c.id) - .LeftJoin((a,b,c,d)=>a.material_id==d.material_id) - .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) - .LeftJoin((a,b,c,d,e,f)=>a.substitute_material_id==f.id) - .Where((a,b,c)=>a.ebom_id==queryInput.ebomId) - .Select((a,b,c,d,e,f)=>new EbomTreeOutput + List data = await db.Queryable() + .LeftJoin((a, b) => a.ebom_id == b.id) + .LeftJoin((a, b, c) => a.material_id == c.id) + .LeftJoin((a, b, c, d) => a.material_id == d.material_id) + .LeftJoin((a, b, c, d, e) => d.route_id == e.id) + .LeftJoin((a, b, c, d, e, f) => a.substitute_material_id == f.id) + .Where((a, b, c) => a.ebom_id == queryInput.ebomId) + .Select((a, b, c, d, e, f) => new EbomTreeOutput { material_id = c.name, material_id_descrip = c.descrip, @@ -112,7 +108,7 @@ namespace Tnb.BasicData route_name = e.name, version = d.version, substitute_material_id = f.name, - hasChildren = SqlFunc.Subqueryable().Where(x=>x.material_id==a.material_id).Any(), + hasChildren = SqlFunc.Subqueryable().Where(x => x.material_id == a.material_id).Any(), }).Mapper(it => { it.material_id_unit_id = !string.IsNullOrEmpty(it.material_id_unit_id) ? dic[it.material_id_unit_id].ToString() : ""; @@ -121,14 +117,14 @@ namespace Tnb.BasicData } else { - var data = await db.Queryable() - .LeftJoin((a,b)=>a.ebom_id==b.id) - .LeftJoin((a,b,c)=>a.material_id==c.id) - .LeftJoin((a,b,c,d)=>a.material_id==d.material_id) - .LeftJoin((a,b,c,d,e)=>d.route_id==e.id) - .LeftJoin((a,b,c,d,e,f)=>a.substitute_material_id==f.id) - .Where((a,b,c)=>b.material_id==queryInput.materialId && a.ebom_id==b.id) - .Select((a,b,c,d,e,f)=>new EbomTreeOutput + List data = await db.Queryable() + .LeftJoin((a, b) => a.ebom_id == b.id) + .LeftJoin((a, b, c) => a.material_id == c.id) + .LeftJoin((a, b, c, d) => a.material_id == d.material_id) + .LeftJoin((a, b, c, d, e) => d.route_id == e.id) + .LeftJoin((a, b, c, d, e, f) => a.substitute_material_id == f.id) + .Where((a, b, c) => b.material_id == queryInput.materialId && a.ebom_id == b.id) + .Select((a, b, c, d, e, f) => new EbomTreeOutput { material_id = c.name, material_id_descrip = c.descrip, @@ -142,15 +138,13 @@ namespace Tnb.BasicData route_name = e.name, version = d.version, substitute_material_id = f.name, - hasChildren = SqlFunc.Subqueryable().Where(x=>x.material_id==a.material_id).Any(), + hasChildren = SqlFunc.Subqueryable().Where(x => x.material_id == a.material_id).Any(), }).Mapper(it => { it.material_id_unit_id = !string.IsNullOrEmpty(it.material_id_unit_id) ? dic[it.material_id_unit_id].ToString() : ""; }).ToListAsync(); return data; } - - } /// @@ -159,11 +153,11 @@ namespace Tnb.BasicData /// 物料id materialId /// [HttpPost] - public async Task> GetEbomVersionAndRouteName(Dictionary parameters) + public async Task> GetEbomVersionAndRouteName(Dictionary parameters) { string materialId = parameters["materialId"]; - var db = _repository.AsSugarClient(); - + ISqlSugarClient db = _repository.AsSugarClient(); + // var momDbLink = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.FullName == DbName.TNBMON); // if (momDbLink != null) // { @@ -171,16 +165,16 @@ namespace Tnb.BasicData // } var ebom = await db.Queryable() - .LeftJoin((a,b)=>a.route_id==b.id) - .OrderByDescending((a,b)=>a.create_time) - .Where((a,b) => a.material_id == materialId) - .Select((a,b)=>new + .LeftJoin((a, b) => a.route_id == b.id) + .OrderByDescending((a, b) => a.create_time) + .Where((a, b) => a.material_id == materialId) + .Select((a, b) => new { a.id, a.version, b.name, }).FirstAsync(); - return new Dictionary() + return new Dictionary() { ["version"] = ebom?.version ?? "", ["routeName"] = ebom?.name ?? "", diff --git a/BasicData/Tnb.BasicData/BasLocationService.cs b/BasicData/Tnb.BasicData/BasLocationService.cs index 4f9dc202..af13f6d3 100644 --- a/BasicData/Tnb.BasicData/BasLocationService.cs +++ b/BasicData/Tnb.BasicData/BasLocationService.cs @@ -1,15 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.DynamicApiController; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.BasicData.Entities.Enums; using Tnb.BasicData.Interfaces; using Tnb.WarehouseMgr.Entities.Enums; @@ -32,19 +25,27 @@ namespace Tnb.BasicData /// /// [HttpGet] - public async Task GetUnStoreLocationListByCarryId([FromRoute]string carryId) + public async Task GetUnStoreLocationListByCarryId([FromRoute] string carryId) { - - var items = await _db.Queryable().Where(it => !string.IsNullOrEmpty(it.is_type) && Convert.ToInt32(it.is_type) != (int)EnumLocationType.存储库位).ToListAsync(); + + List items = await _db.Queryable().Where(it => !string.IsNullOrEmpty(it.is_type) && Convert.ToInt32(it.is_type) != (int)EnumLocationType.存储库位).ToListAsync(); return items; } public async Task> GetLocationInfobyIds(IEnumerable locIds) { - if (locIds == null) throw new ArgumentNullException(nameof(locIds)); - if (!locIds.Any()) throw new ArithmeticException($"parameter locIds.Count is not be empty"); - var items = await _db.Queryable().Where(it => locIds.Contains(it.id)).ToListAsync(); + if (locIds == null) + { + throw new ArgumentNullException(nameof(locIds)); + } + + if (!locIds.Any()) + { + throw new ArithmeticException($"parameter locIds.Count is not be empty"); + } + + List items = await _db.Queryable().Where(it => locIds.Contains(it.id)).ToListAsync(); return items; } } diff --git a/BasicData/Tnb.BasicData/BasMaterialService.cs b/BasicData/Tnb.BasicData/BasMaterialService.cs index 7f2bceaa..fb4df1df 100644 --- a/BasicData/Tnb.BasicData/BasMaterialService.cs +++ b/BasicData/Tnb.BasicData/BasMaterialService.cs @@ -21,20 +21,20 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] - public class BasMaterialService : IBasMaterialService,IDynamicApiController, ITransient + public class BasMaterialService : IBasMaterialService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; - + public BasMaterialService( - ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + ISqlSugarRepository repository, DataBaseManager dbManager, IDictionaryDataService dictionaryDataService) { _repository = repository; _dbManager = dbManager; _dictionaryDataService = dictionaryDataService; } - + /// /// 复制物料 /// @@ -44,7 +44,7 @@ namespace Tnb.BasicData { string id = parameters["id"]; BasMaterial basMaterial = await _repository.GetByIdAsync(id); - + List materialUnits = await _repository.AsSugarClient().Queryable().Where(x => x.material_id == id).ToListAsync(); List materialIntoFactorySpecifications = await _repository.AsSugarClient().Queryable().Where(x => x.material_id == id).ToListAsync(); @@ -53,27 +53,26 @@ namespace Tnb.BasicData basMaterial.code += "_复制的请修改"; basMaterial.name += "_复制的请修改"; - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - await _repository.InsertAsync(basMaterial); + _ = await _repository.InsertAsync(basMaterial); foreach (BasMaterialUnit basMaterialUnit in materialUnits) { basMaterialUnit.id = SnowflakeIdHelper.NextId(); basMaterialUnit.material_id = newId; } - + foreach (BasMaterialIntoFactorySpecifications basMaterialIntoFactorySpecification in materialIntoFactorySpecifications) { basMaterialIntoFactorySpecification.id = SnowflakeIdHelper.NextId(); basMaterialIntoFactorySpecification.material_id = newId; } - await _repository.AsSugarClient().Insertable(materialUnits).ExecuteCommandAsync(); - await _repository.AsSugarClient().Insertable(materialIntoFactorySpecifications).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(materialUnits).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(materialIntoFactorySpecifications).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "复制成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "复制成功" : result.ErrorMessage; } /// @@ -84,14 +83,17 @@ namespace Tnb.BasicData [HttpPost] public async Task GetMaterialSelectInfo(MaterialSelectQueryInput queryInput) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); if (!string.IsNullOrEmpty(queryInput.ebom_id)) { - List ids = await GetAllChildrenMaterialId(queryInput.ebom_id,0); + List ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0); BasEbomH ebom = await db.Queryable().Where(x => x.id == queryInput.ebom_id).SingleAsync(); - if(ebom!=null && !string.IsNullOrEmpty(ebom.material_id)) + if (ebom != null && !string.IsNullOrEmpty(ebom.material_id)) + { ids.Add(ebom.material_id); - var result = await db.Queryable() + } + + SqlSugarPagedList result = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null) .LeftJoin((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode) .WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info)) @@ -107,11 +109,11 @@ namespace Tnb.BasicData }).ToPagedListAsync(queryInput.currentPage, queryInput.pageSize); return PageResult.SqlSugarPageResult(result); - + } else { - var result = await db.Queryable() + SqlSugarPagedList result = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null) .LeftJoin((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode) .WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info)) @@ -132,16 +134,16 @@ namespace Tnb.BasicData [HttpPost] public async Task GetCanCreateSubWorkOrderMaterial(MaterialSelectQueryInput queryInput) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); if (!string.IsNullOrEmpty(queryInput.ebom_id)) { - List ids = await GetAllChildrenMaterialId(queryInput.ebom_id,0); - var result = await db.Queryable() + List ids = await GetAllChildrenMaterialId(queryInput.ebom_id, 0); + SqlSugarPagedList result = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null) .LeftJoin((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode) .WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info)) .WhereIF(!string.IsNullOrEmpty(queryInput.ebom_id), (a, b, c) => ids.Contains(a.id)) - .Where((a,b,c)=>a.is_create_sub_work_order=="1") + .Where((a, b, c) => a.is_create_sub_work_order == "1") .Select((a, b, c) => new MaterialSelectOutput() { id = a.id, @@ -153,7 +155,7 @@ namespace Tnb.BasicData }).ToPagedListAsync(queryInput.currentPage, queryInput.pageSize); return PageResult.SqlSugarPageResult(result); - + } else { @@ -166,32 +168,32 @@ namespace Tnb.BasicData { string types = dic["types"]; string[] typeArr = types.Split(","); - List list = await _repository.AsSugarClient().Queryable().Where(x => x.state=="1").ToListAsync(); - List result = new List(); - foreach (var type in typeArr) + List list = await _repository.AsSugarClient().Queryable().Where(x => x.state == "1").ToListAsync(); + List result = new(); + foreach (string type in typeArr) { - result.AddRange(list.Where(x=>x.category_id.Contains(type))); + result.AddRange(list.Where(x => x.category_id.Contains(type))); } return result; } - + [HttpPost] public async Task GetMaterialByQueryJson(MaterialQueryInput input) { - var db = _repository.AsSugarClient(); - Dictionary? queryJson = new Dictionary(); - if (input!=null && !string.IsNullOrEmpty(input.queryJson)) + ISqlSugarClient db = _repository.AsSugarClient(); + Dictionary? queryJson = new(); + if (input != null && !string.IsNullOrEmpty(input.queryJson)) { queryJson = JsonConvert.DeserializeObject>(input?.queryJson ?? ""); } - List typeList = new List(); - if(!string.IsNullOrEmpty(input!.types)) + List typeList = new(); + if (!string.IsNullOrEmpty(input!.types)) { - typeList = JsonConvert.DeserializeObject>((input?.types??"")) ?? new List(); + typeList = JsonConvert.DeserializeObject>(input?.types ?? "") ?? new List(); } - var query = db.Queryable() + ISugarQueryable query = db.Queryable() .Where(x => x.state == "1") .WhereIF(queryJson != null && queryJson.ContainsKey("name"), x => x.name.Contains(queryJson!["name"])) .WhereIF(queryJson != null && queryJson.ContainsKey("code"), x => x.code.Contains(queryJson!["code"])) @@ -199,43 +201,51 @@ namespace Tnb.BasicData x => x.material_standard!.Contains(queryJson!["material_standard"])) .Select(x => x); - var list = new List>(); - foreach (var type in typeList) + List> list = new(); + foreach (string type in typeList) { - list.Add(query.Clone().Where(x=>x.category_id.Contains(type))); + list.Add(query.Clone().Where(x => x.category_id.Contains(type))); } if (list.Count <= 0) { - var result = await query.ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + SqlSugarPagedList result = await query.ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); return PageResult.SqlSugarPageResult(result); } else { - var result = await db.UnionAll(list).Select().ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + SqlSugarPagedList result = await db.UnionAll(list).Select().ToPagedListAsync(input?.currentPage ?? 1, input?.pageSize ?? 50); return PageResult.SqlSugarPageResult(result); } - + } /// /// 获取物料清单下所子集物料id /// /// - private async Task> GetAllChildrenMaterialId(string ebomId,int index) + private async Task> GetAllChildrenMaterialId(string ebomId, int index) { - if (string.IsNullOrEmpty(ebomId)) return new List(); - List ids = new List(); - if (index++ > 10) return ids; - var list = await _repository.AsSugarClient().Queryable().Where(x => x.ebom_id == ebomId) + if (string.IsNullOrEmpty(ebomId)) + { + return new List(); + } + + List ids = new(); + if (index++ > 10) + { + return ids; + } + + List list = await _repository.AsSugarClient().Queryable().Where(x => x.ebom_id == ebomId) .Select(x => x.material_id).ToListAsync(); if (list != null && list.Count > 0) { - foreach (var id in list) + foreach (string id in list) { //获取最新创建的物料清单 - var ebom = await _repository.AsSugarClient().Queryable().Where(x=>x.material_id==id).OrderByDescending(x=>x.create_time).FirstAsync(); - ids.AddRange(await GetAllChildrenMaterialId(ebom?.id ?? "",index)); + BasEbomH ebom = await _repository.AsSugarClient().Queryable().Where(x => x.material_id == id).OrderByDescending(x => x.create_time).FirstAsync(); + ids.AddRange(await GetAllChildrenMaterialId(ebom?.id ?? "", index)); } ids.AddRange(list); } diff --git a/BasicData/Tnb.BasicData/BasMbomService.cs b/BasicData/Tnb.BasicData/BasMbomService.cs index ace5e263..6736f838 100644 --- a/BasicData/Tnb.BasicData/BasMbomService.cs +++ b/BasicData/Tnb.BasicData/BasMbomService.cs @@ -1,5 +1,6 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Enums; +using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -11,10 +12,8 @@ using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.BasicData.Interfaces; using Tnb.BasicData.Entities.Dto; -using NPOI.OpenXmlFormats.Dml; -using JNPF.Common.Extension; +using Tnb.BasicData.Interfaces; namespace Tnb.BasicData { @@ -56,10 +55,10 @@ namespace Tnb.BasicData /// public async Task GetList(VisualDevModelListQueryInput input) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); Dictionary? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject>(); string materialInfo = queryJson?["query_info"]?.ToString() ?? ""; - var list = await db.Queryable((a, b, c, d) => new object[] + SqlSugarPagedList list = await db.Queryable((a, b, c, d) => new object[] { JoinType.Left, a.material_id == b.id, JoinType.Left, a.ebom_id == c.id, @@ -75,8 +74,8 @@ namespace Tnb.BasicData ebom_id = c.version, route_id = d.name, route_id_id = c.id, - start_time = a.start_time==null ? "" : a.start_time.Value.ToString("yyyy-MM-dd"), - end_time = a.end_time==null ? "" : a.end_time.Value.ToString("yyyy-MM-dd"), + start_time = a.start_time == null ? "" : a.start_time.Value.ToString("yyyy-MM-dd"), + end_time = a.end_time == null ? "" : a.end_time.Value.ToString("yyyy-MM-dd"), is_first = SqlFunc.IIF(a.is_first == 0, "否", "是"), }).ToPagedListAsync(input.currentPage, input.pageSize); @@ -90,13 +89,13 @@ namespace Tnb.BasicData /// public async Task GetInfo(string id) { - var db = _repository.AsSugarClient(); + ISqlSugarClient db = _repository.AsSugarClient(); BasMbom mbom = await _repository.GetSingleAsync(x => x.id == id); - List processes = await db.Queryable().Where(x => x.mbom_id == id).OrderBy(x=>x.ordinal).ToListAsync(); + List processes = await db.Queryable().Where(x => x.mbom_id == id).OrderBy(x => x.ordinal).ToListAsync(); List inputs = await db.Queryable().Where(x => x.mbom_id == id).ToListAsync(); List outputs = await db.Queryable().Where(x => x.mbom_id == id).ToListAsync(); - MbomDataOutput mbomDataOutput = new MbomDataOutput(); - List mbomProcessOutDtos = new List(); + MbomDataOutput mbomDataOutput = new(); + List mbomProcessOutDtos = new(); mbomDataOutput.id = mbom.id; mbomDataOutput.ebom_id = mbom.ebom_id; @@ -158,9 +157,12 @@ namespace Tnb.BasicData public async Task GetSubMoListByBomId([FromRoute] string bomId) { - if (string.IsNullOrEmpty(bomId)) throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty"); + if (string.IsNullOrEmpty(bomId)) + { + throw new ArgumentException($"parameter {nameof(bomId)} not be null or empty"); + } - var result = await _db.Queryable() + List result = await _db.Queryable() .LeftJoin((a, b) => a.id == b.mbom_id) .LeftJoin((a, b, c) => a.route_id == c.id) // .LeftJoin((a, b, c, d) => b.process_id == d.process_id && c.id == d.route_id) @@ -182,7 +184,7 @@ namespace Tnb.BasicData }) .Mapper(it => it.output_qty = it.num.ParseToInt()) .ToListAsync(); - + return result; } @@ -194,7 +196,7 @@ namespace Tnb.BasicData .Where(x => x.mbom_process_id == id) .Select(x => new { - material_id = x.material_id, + x.material_id, }).ToListAsync(); return result; @@ -231,13 +233,13 @@ namespace Tnb.BasicData material_name = b.name, start_time = a.start_time.HasValue ? a.start_time.Value.ToString(DbTimeFormat.SS) : null, end_time = a.end_time.HasValue ? a.end_time.Value.ToString(DbTimeFormat.SS) : null, - version = a.version, + a.version, route_id = c.id, route_name = c.name, }) .ToListAsync(); } - + // /// // /// 保存生产bom // /// @@ -512,7 +514,7 @@ namespace Tnb.BasicData // } // return result.IsSuccess ? "保存成功" : result.ErrorMessage; // } - + /// /// 保存生产bom /// @@ -529,7 +531,7 @@ namespace Tnb.BasicData { string mbomId = SnowflakeIdHelper.NextId(); string orgId = _userManager.GetUserInfo().Result.organizeId; - BasMbom mbom = new BasMbom() + BasMbom mbom = new() { id = mbomId, org_id = orgId, @@ -554,15 +556,15 @@ namespace Tnb.BasicData errorCode = ErrorCode.COM1004; throw Oops.Oh(ErrorCode.COM1004); } - await _repository.InsertAsync(mbom); - List processes = new List(); - List inputs = new List(); - List outputs = new List(); + _ = await _repository.InsertAsync(mbom); + List processes = new(); + List inputs = new(); + List outputs = new(); if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null) { - int index = 0; - foreach (var process in mbomSaveDataInput.processes) + int index = 0; + foreach (MbomProcessDto? process in mbomSaveDataInput.processes) { string mbomProcessId = SnowflakeIdHelper.NextId(); processes.Add(new BasMbomProcess() @@ -586,7 +588,7 @@ namespace Tnb.BasicData if (process.inputs != null) { - foreach (var input in process.inputs) + foreach (BasMbomInput input in process.inputs) { string inputId = SnowflakeIdHelper.NextId(); inputs.Add(new BasMbomInput() @@ -605,7 +607,7 @@ namespace Tnb.BasicData if (process.outputs != null) { - foreach (var output in process.outputs) + foreach (BasMbomOutput output in process.outputs) { string outputId = SnowflakeIdHelper.NextId(); outputs.Add(new BasMbomOutput() @@ -626,17 +628,17 @@ namespace Tnb.BasicData if (processes.Count > 0) { - await _repository.AsSugarClient().Insertable(processes).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(processes).ExecuteCommandAsync(); } if (inputs.Count > 0) { - await _repository.AsSugarClient().Insertable(inputs).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(inputs).ExecuteCommandAsync(); } if (outputs.Count > 0) { - await _repository.AsSugarClient().Insertable(outputs).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(outputs).ExecuteCommandAsync(); } } else//修改 @@ -651,7 +653,7 @@ namespace Tnb.BasicData string orgId = _userManager.GetUserInfo().Result.organizeId; if (mbomSaveDataInput != null) { - await _repository.UpdateAsync(x => new BasMbom() + _ = await _repository.UpdateAsync(x => new BasMbom() { // org_id = orgId, material_id = mbomSaveDataInput.material_id, @@ -670,12 +672,12 @@ namespace Tnb.BasicData }, x => x.id == mbomSaveDataInput.id); } // List processes = new List(); - List inputs = new List(); - List outputs = new List(); + List inputs = new(); + List outputs = new(); if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null) { - foreach (var process in mbomSaveDataInput.processes) + foreach (MbomProcessDto? process in mbomSaveDataInput.processes) { string mbomProcessId = process.id; // string mbomProcessId = SnowflakeIdHelper.NextId(); @@ -692,9 +694,9 @@ namespace Tnb.BasicData // route_detail_id = process.route_detail_id, // // }); - + decimal preparation_time = process?.preparation_time ?? 0; - await _repository.AsSugarClient().Updateable() + _ = await _repository.AsSugarClient().Updateable() .SetColumns(x => x.preparation_time == preparation_time) .SetColumns(x => x.station == process!.station) .SetColumns(x => x.byproduct_status == process!.byproduct_status) @@ -703,7 +705,7 @@ namespace Tnb.BasicData if (process!.inputs != null) { - foreach (var input in process.inputs) + foreach (BasMbomInput input in process.inputs) { string inputId = SnowflakeIdHelper.NextId(); inputs.Add(new BasMbomInput() @@ -722,7 +724,7 @@ namespace Tnb.BasicData if (process.outputs != null) { - foreach (var output in process.outputs) + foreach (BasMbomOutput output in process.outputs) { string outputId = SnowflakeIdHelper.NextId(); outputs.Add(new BasMbomOutput() @@ -744,9 +746,9 @@ namespace Tnb.BasicData if (mbomSaveDataInput != null && !string.IsNullOrEmpty(mbomSaveDataInput.id)) { - // await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); - await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); - await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); + // await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Deleteable().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync(); } // if (processes.Count > 0) // { @@ -755,12 +757,12 @@ namespace Tnb.BasicData if (inputs.Count > 0) { - await _repository.AsSugarClient().Insertable(inputs).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(inputs).ExecuteCommandAsync(); } if (outputs.Count > 0) { - await _repository.AsSugarClient().Insertable(outputs).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(outputs).ExecuteCommandAsync(); } } diff --git a/BasicData/Tnb.BasicData/BasProcessService.cs b/BasicData/Tnb.BasicData/BasProcessService.cs index df785b20..d36819ee 100644 --- a/BasicData/Tnb.BasicData/BasProcessService.cs +++ b/BasicData/Tnb.BasicData/BasProcessService.cs @@ -1,4 +1,3 @@ -using Aop.Api.Domain; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; @@ -7,20 +6,15 @@ using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; using SqlSugar; -using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.BasicData.Entitys.Dto.BasProcess; -using Tnb.BasicData.Interfaces; namespace Tnb.BasicData { @@ -64,21 +58,16 @@ namespace Tnb.BasicData /// private async Task GetList(VisualDevModelListQueryInput input) { - var result = new SqlSugarPagedList(); - var db = _repository.AsSugarClient(); - var organize = await db.Queryable().FirstAsync(it => it.EnCode == input.station_code && it.Category == DictConst.RegionCategoryStationCode); + SqlSugarPagedList result = new(); + ISqlSugarClient db = _repository.AsSugarClient(); + OrganizeEntity organize = await db.Queryable().FirstAsync(it => it.EnCode == input.station_code && it.Category == DictConst.RegionCategoryStationCode); if (organize != null) { - var whereExpr = Expressionable.Create(); - var curProcessIds = await db.Queryable().Where(it => it.station_id == organize.Id).Select(it => it.process_id).Distinct().ToListAsync(); - if (curProcessIds?.Count > 0) - { - whereExpr = whereExpr.And((a, b) => curProcessIds.Contains(a.id)).Or((a, b) => string.IsNullOrEmpty(b.process_id)); - } - else - { - whereExpr = whereExpr.And((a, b) => string.IsNullOrEmpty(b.process_id)); - } + Expressionable whereExpr = Expressionable.Create(); + List curProcessIds = await db.Queryable().Where(it => it.station_id == organize.Id).Select(it => it.process_id).Distinct().ToListAsync(); + whereExpr = curProcessIds?.Count > 0 + ? whereExpr.And((a, b) => curProcessIds.Contains(a.id)).Or((a, b) => string.IsNullOrEmpty(b.process_id)) + : whereExpr.And((a, b) => string.IsNullOrEmpty(b.process_id)); result = await db.Queryable().LeftJoin((a, b) => a.id == b.process_id).Where(whereExpr.ToExpression()).Select(a => new ProcessListOutput { id = a.id, @@ -118,8 +107,8 @@ namespace Tnb.BasicData string processId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? ""; - List list = new List(); - foreach (var item in (JArray)visualDevModelDataCrInput.data["station"]) + List list = new(); + foreach (JToken item in (JArray)visualDevModelDataCrInput.data["station"]) { string processStationId = SnowflakeIdHelper.NextId(); @@ -134,11 +123,10 @@ namespace Tnb.BasicData }); } - await _repository.AsSugarClient().Insertable(list).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(list).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "保存成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "保存成功" : result.ErrorMessage); } diff --git a/BasicData/Tnb.BasicData/BasPushRuleLogService.cs b/BasicData/Tnb.BasicData/BasPushRuleLogService.cs index 9f164ef4..f08ecbc5 100644 --- a/BasicData/Tnb.BasicData/BasPushRuleLogService.cs +++ b/BasicData/Tnb.BasicData/BasPushRuleLogService.cs @@ -1,7 +1,5 @@ -using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; @@ -28,7 +26,7 @@ namespace Tnb.BasicData public async Task Stop(Dictionary dic) { string id = dic["id"]; - await _repository.UpdateAsync(x => new BasPushRuleLog() + _ = await _repository.UpdateAsync(x => new BasPushRuleLog() { is_push = 0, }, x => x.biz_id == id); diff --git a/BasicData/Tnb.BasicData/BasQrcodeService.cs b/BasicData/Tnb.BasicData/BasQrcodeService.cs index c3875673..c79ac873 100644 --- a/BasicData/Tnb.BasicData/BasQrcodeService.cs +++ b/BasicData/Tnb.BasicData/BasQrcodeService.cs @@ -6,8 +6,6 @@ using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.BasicData.Entities.Dto; -using Tnb.BasicData.Entitys.Dto.BasProcess; using Tnb.BasicData.Interfaces; using Tnb.EquipMgr.Entities; using Tnb.WarehouseMgr.Entities; @@ -19,14 +17,14 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 1102)] [Route("api/[area]/[controller]/[action]")] - public class BasQrcodeService : IBasQrcodeService,IDynamicApiController, ITransient + public class BasQrcodeService : IBasQrcodeService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; - + public BasQrcodeService( - ISqlSugarRepository repository,DataBaseManager dbManager,IDictionaryDataService dictionaryDataService) + ISqlSugarRepository repository, DataBaseManager dbManager, IDictionaryDataService dictionaryDataService) { _repository = repository; _dbManager = dbManager; @@ -34,22 +32,26 @@ namespace Tnb.BasicData } [HttpPost] - public async Task GetQrcodeByCode(Dictionary dic) + public async Task GetQrcodeByCode(Dictionary dic) { string code = dic.ContainsKey("code") ? dic["code"] : ""; - if (string.IsNullOrEmpty(code)) return null; + if (string.IsNullOrEmpty(code)) + { + return null; + } + var result = await _repository.AsSugarClient().Queryable() .LeftJoin((a, b) => a.source_id == b.Id) .LeftJoin((a, b, c) => a.source_id == c.id) .LeftJoin((a, b, c, d) => a.source_id == d.id) - .LeftJoin((a,b,c,d,e)=>a.source_id==e.id) - .LeftJoin((a,b,c,d,e,f)=>a.source_id==f.id) + .LeftJoin((a, b, c, d, e) => a.source_id == e.id) + .LeftJoin((a, b, c, d, e, f) => a.source_id == f.id) .Where((a, b, c, d) => a.code == code) - .Select((a, b, c, d,e,f) => new + .Select((a, b, c, d, e, f) => new { - id = a.id, - source_id = a.source_id, - source_name = a.source_name, + a.id, + a.source_id, + a.source_name, org_code = b.EnCode, org_name = b.FullName, equip_code = a.code, @@ -57,27 +59,31 @@ namespace Tnb.BasicData tool_location_code = d.location_code, bas_location_name = e.location_name, bas_location_code = e.location_code, - carry_name = f.carry_name, - carry_code = f.carry_code, + f.carry_name, + f.carry_code, }).FirstAsync(); return result; } [HttpPost] - public async Task GetWorkStationByCode(Dictionary dic) + public async Task GetWorkStationByCode(Dictionary dic) { string code = dic.ContainsKey("code") ? dic["code"] : ""; - if (string.IsNullOrEmpty(code)) return null; + if (string.IsNullOrEmpty(code)) + { + return null; + } + var result = await _repository.AsSugarClient().Queryable() .LeftJoin((a, b) => a.source_id == b.Id) - .LeftJoin((a,b,c)=>a.source_id==c.ObjectId && c.ObjectType=="Eqp") - .LeftJoin((a,b,c,d)=>c.OrganizeId==d.Id) + .LeftJoin((a, b, c) => a.source_id == c.ObjectId && c.ObjectType == "Eqp") + .LeftJoin((a, b, c, d) => c.OrganizeId == d.Id) .Where((a, b, c) => a.code == code) - .Select((a, b, c,d) => new + .Select((a, b, c, d) => new { - id = a.id, - source_id = a.source_id, - source_name = a.source_name, + a.id, + a.source_id, + a.source_name, org_id = b.Id, org_code = b.EnCode, org_name = b.FullName, diff --git a/BasicData/Tnb.BasicData/BasRouteService.cs b/BasicData/Tnb.BasicData/BasRouteService.cs index 741f9f54..1bb37321 100644 --- a/BasicData/Tnb.BasicData/BasRouteService.cs +++ b/BasicData/Tnb.BasicData/BasRouteService.cs @@ -9,8 +9,8 @@ using JNPF.FriendlyException; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.BasicData.Interfaces; using Tnb.BasicData.Entities.Dto; +using Tnb.BasicData.Interfaces; namespace Tnb.BasicData { @@ -19,11 +19,11 @@ namespace Tnb.BasicData /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 701)] [Route("api/[area]/[controller]/[action]")] - public class BasRouteService : IBasRouteService,IDynamicApiController, ITransient + public class BasRouteService : IBasRouteService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; - - + + public BasRouteService( UserManager userManager, ISqlSugarRepository repository) @@ -40,12 +40,12 @@ namespace Tnb.BasicData { string id = parameters["id"]; - await _repository.UpdateAsync(x => new BasRouteH() + _ = await _repository.UpdateAsync(x => new BasRouteH() { status = "1", }, x => x.id == id); } - + /// /// 复制工艺路线 /// @@ -55,7 +55,7 @@ namespace Tnb.BasicData { string id = parameters["id"]; BasRouteH basRouteH = await _repository.GetByIdAsync(id); - + List basRouteDs = await _repository.AsSugarClient().Queryable().Where(x => x.route_id == id).ToListAsync(); string newId = SnowflakeIdHelper.NextId(); @@ -64,42 +64,41 @@ namespace Tnb.BasicData basRouteH.name += "_复制的请修改"; basRouteH.status = "0"; - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - await _repository.InsertAsync(basRouteH); + _ = await _repository.InsertAsync(basRouteH); foreach (BasRouteD basRouteD in basRouteDs) { basRouteD.id = SnowflakeIdHelper.NextId(); basRouteD.route_id = newId; } - await _repository.AsSugarClient().Insertable(basRouteDs).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Insertable(basRouteDs).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "复制成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : result.IsSuccess ? "复制成功" : result.ErrorMessage; } /// /// 获取有效的已发布的工艺路线 /// [HttpPost] - public async Task GetValidRouteList([FromBody]VisualDevDataFieldDataListInput pageInput) + public async Task GetValidRouteList([FromBody] VisualDevDataFieldDataListInput pageInput) { - var db = _repository.AsSugarClient(); - var result = await db.Queryable() - .Where(x => x.status == "1" - && ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value>=DateTime.Now) - || (x.start_time==null && x.end_time>=DateTime.Now) - || (x.end_time==null && x.start_time<=DateTime.Now) + ISqlSugarClient db = _repository.AsSugarClient(); + SqlSugarPagedList result = await db.Queryable() + .Where(x => x.status == "1" + && ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value >= DateTime.Now) + || (x.start_time == null && x.end_time >= DateTime.Now) + || (x.end_time == null && x.start_time <= DateTime.Now) || (x.start_time == null && x.end_time == null) - )).Select(x=>new VaildRouteOutput() + )).Select(x => new VaildRouteOutput() { id = x.id, code = x.code, name = x.name, - start_time = x.start_time==null ? "" : x.start_time.Value.ToString("yyyy-MM-dd"), - end_time = x.end_time==null ? "" : x.end_time.Value.ToString("yyyy-MM-dd"), + start_time = x.start_time == null ? "" : x.start_time.Value.ToString("yyyy-MM-dd"), + end_time = x.end_time == null ? "" : x.end_time.Value.ToString("yyyy-MM-dd"), }).ToPagedListAsync(pageInput.currentPage, pageInput.pageSize); return PageResult.SqlSugarPageResult(result); } diff --git a/BasicData/Tnb.BasicData/Tnb.BasicData.csproj b/BasicData/Tnb.BasicData/Tnb.BasicData.csproj index 9de471f3..349cdb7c 100644 --- a/BasicData/Tnb.BasicData/Tnb.BasicData.csproj +++ b/BasicData/Tnb.BasicData/Tnb.BasicData.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldPlanMaintainStatus.cs b/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldPlanMaintainStatus.cs index f013c856..6334795a 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldPlanMaintainStatus.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldPlanMaintainStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Consts +namespace Tnb.EquipMgr.Entities.Consts { public class MoldPlanMaintainStatus { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldUseStatus.cs b/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldUseStatus.cs index a27c20bf..3ab5e008 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldUseStatus.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Consts/MoldUseStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Consts +namespace Tnb.EquipMgr.Entities.Consts { public class MoldUseStatus { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs b/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs index d774afae..bf2e824d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Consts/SpotInsRecordExecutionStatus.cs @@ -9,12 +9,12 @@ namespace Tnb.EquipMgr /// 待执行 /// public const string TOBEEXECUTED = "1"; - + /// /// 待复核 /// public const string TOBECHECK = "2"; - + /// /// 已完成 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/BaseMoldMaintainInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/BaseMoldMaintainInput.cs index 8ec274d1..7a0be017 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/BaseMoldMaintainInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/BaseMoldMaintainInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class BaseMoldMaintainInput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemOutput.cs index c0e04187..7ef4853c 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class CheckItemOutput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemQueryinput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemQueryinput.cs index 4f286ad7..caedb658 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemQueryinput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/CheckItemQueryinput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 根据模具ID、计划ID获取,保养组及项目信息 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ClosedownEndListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ClosedownEndListOutput.cs index 7d9bd6a9..6bb1d0b5 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ClosedownEndListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ClosedownEndListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class ClosedownEndListOutput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpMaintainRecordListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpMaintainRecordListOutput.cs index 807b00eb..91e980a7 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpMaintainRecordListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpMaintainRecordListOutput.cs @@ -14,11 +14,11 @@ namespace Tnb.EquipMgr.Entities.Dto public string execute_time { get; set; } public string repeat_user_id { get; set; } public string repeat_user_id_id { get; set; } - public string execute_user_id{ get; set; } + public string execute_user_id { get; set; } public string execute_user_id_id { get; set; } public string repeat_time { get; set; } - public string last_execute_time { get; set; } - + public string last_execute_time { get; set; } + public DateTime? date_repeat_time { get; set; } public DateTime? date_create_time { get; set; } public DateTime? date_execute_time { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpSpotInsRecordListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpSpotInsRecordListOutput.cs index 97af0a07..b4b48d22 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpSpotInsRecordListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EqpSpotInsRecordListOutput.cs @@ -12,10 +12,10 @@ namespace Tnb.EquipMgr.Entities.Dto public string spot_record_date_time { get; set; } public string repeat_user_id { get; set; } public string repeat_user_id_id { get; set; } - public string spot_record_user_id{ get; set; } + public string spot_record_user_id { get; set; } public string spot_record_user_id_id { get; set; } public string repeat_time { get; set; } - + public DateTime? date_repeat_time { get; set; } public DateTime? date_create_time { get; set; } public DateTime? date_spot_record_date_time { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipDaqQueryOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipDaqQueryOutput.cs index 9f61c3c5..1f466b7d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipDaqQueryOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipDaqQueryOutput.cs @@ -5,7 +5,7 @@ namespace Tnb.EquipMgr.Entities.Dto public string? id { get; set; } public string? data_source { get; set; } public string create_id { get; set; } = string.Empty; - public string? create_time { get; set; } + public string? create_time { get; set; } public string? data_type { get; set; } public string? enabled { get; set; } public string? equip_id { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipFileQueryOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipFileQueryOutput.cs index 894388aa..01f09767 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipFileQueryOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipFileQueryOutput.cs @@ -6,7 +6,7 @@ namespace Tnb.EquipMgr.Entities.Dto public string? attachment { get; set; } public string? create_id { get; set; } public string? create_id_id { get; set; } - public string? create_time { get; set; } + public string? create_time { get; set; } public string? equip_id { get; set; } public string? equip_id_id { get; set; } public string? file_name { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipQueryInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipQueryInput.cs index c067c21d..623edaa7 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipQueryInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipQueryInput.cs @@ -3,7 +3,7 @@ namespace Tnb.EquipMgr.Entities.Dto public class EquipQueryInput { public string equip_id { get; set; } = string.Empty; - + /// /// 当前页码:pageIndex. /// @@ -13,7 +13,7 @@ namespace Tnb.EquipMgr.Entities.Dto /// 每页行数. /// public virtual int pageSize { get; set; } = 50; - + public string? queryJson { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipRepairRefuseInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipRepairRefuseInput.cs index 798b7056..63ace2f3 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipRepairRefuseInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipRepairRefuseInput.cs @@ -4,6 +4,6 @@ namespace Tnb.EquipMgr.Entities.Dto { public string id { get; set; } = string.Empty; public string reason { get; set; } = string.Empty; - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsInput.cs index 8d7ae4a6..d4687248 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsInput.cs @@ -3,7 +3,7 @@ namespace Tnb.EquipMgr.Entities.Dto public class EquipSparePartsInput { public string equip_id { get; set; } = string.Empty; - + public List? spare_parts_ids { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsQueryOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsQueryOutput.cs index 460cf8e4..33f096ac 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsQueryOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipSparePartsQueryOutput.cs @@ -8,6 +8,6 @@ namespace Tnb.EquipMgr.Entities.Dto public string? code { get; set; } public string? name { get; set; } public string? specification { get; set; } - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipmentListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipmentListOutput.cs index 570e8faa..66e73fdf 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipmentListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/EquipmentListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 设备列表输出类 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainInfoQueryinput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainInfoQueryinput.cs index 55b6bc50..0e9eb63e 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainInfoQueryinput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainInfoQueryinput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class MaintainInfoQueryinput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanCrInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanCrInput.cs index da654111..7650aacb 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanCrInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanCrInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 生成保养计划输入参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanMoldLstOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanMoldLstOutput.cs index 78acb766..173e8168 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanMoldLstOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainPlanMoldLstOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NPOI.HSSF.Record.Chart; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 保养计划模具列表输出参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatInput.cs index a923ef71..ff09b958 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatInput.cs @@ -5,9 +5,9 @@ namespace Tnb.EquipMgr.Entities.Dto public string id { get; set; } = string.Empty; public string repeat_result { get; set; } = string.Empty; - + public string? repeat_remark { get; set; } - - public List>? details { get; set; } + + public List>? details { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatOutput.cs index c8a415c0..ac814c67 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRecordRepeatOutput.cs @@ -3,7 +3,7 @@ namespace Tnb.EquipMgr.Entities.Dto public class MaintainRecordRepeatOutput { public EqpMaintainRecordH? model { get; set; } - + public List? details { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRuleMoldListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRuleMoldListOutput.cs index 4d5917c6..59639353 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRuleMoldListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainRuleMoldListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 保养规则关联模具列表输出参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainStatusUpInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainStatusUpInput.cs index 4fdf5b08..4bcddb12 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainStatusUpInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaintainStatusUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 修改维修单任务状态输入参数 @@ -18,6 +12,6 @@ namespace Tnb.EquipMgr.Entities.Dto /// /// 维修单状态 DWX(待维修)、WXZ(维修中)、YWC(已维修) /// - public string status { get; set; } + public string status { get; set; } } } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaterialListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaterialListOutput.cs index bf1d1328..62cdf0a7 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaterialListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MaterialListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 物料列表输出类 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs index 72a9bc91..399f9172 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class RelevanceMoldListOutput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainDelInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainDelInput.cs index 4bedda98..856c68ba 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainDelInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainDelInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养删除参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainGroupItemRelationInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainGroupItemRelationInput.cs index 0618d131..42b7b8e2 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainGroupItemRelationInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainGroupItemRelationInput.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 关联保养组与模具输入参数 /// - public class MoldMaintainGroupItemRelationInput :BaseMoldMaintainInput + public class MoldMaintainGroupItemRelationInput : BaseMoldMaintainInput { } } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs index 8820e89a..ada61572 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养项输入参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemListOutput.cs index c45b8ad4..c17e70fa 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养项列表输出 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainPlanRunQueryOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainPlanRunQueryOutput.cs index 5a80c60a..2c23acef 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainPlanRunQueryOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainPlanRunQueryOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养计划执行查询输出参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainRunUpInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainRunUpInput.cs index d66bd684..e9a2cf48 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainRunUpInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainRunUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养执行输入参数 @@ -34,7 +28,7 @@ namespace Tnb.EquipMgr.Entities.Dto public string starttime { get; set; } } - public class MaintainItemInfo + public class MaintainItemInfo { public string item_group_id { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainUpInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainUpInput.cs index 01b9fb77..16b50dd8 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainUpInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class MoldMaintainUpInput { @@ -15,6 +9,6 @@ namespace Tnb.EquipMgr.Entities.Dto /// /// 维修状态 /// - public string status{ get; set; } + public string status { get; set; } } } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldRuleSelectorListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldRuleSelectorListOutput.cs index 0ac562ab..690a8cd4 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldRuleSelectorListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldRuleSelectorListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具规则选择列表输出类 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs index 054a8d4f..30431bcc 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadMainListOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class PadMainListOutput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs index daf60528..eae3b27d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListInput.cs @@ -5,11 +5,11 @@ namespace Tnb.EquipMgr.Entities.Dto public class PadRepairListInput : PageInputBase { public string status { get; set; } - + public string equip_info { get; set; } - + public DateTime? start_time { get; set; } public DateTime? end_time { get; set; } - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs index ef577df0..228f6286 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PadRepairListOutput.cs @@ -3,9 +3,9 @@ namespace Tnb.EquipMgr.Entities.Dto public class PadRepairListOutput { public string id { get; set; } - + public string code { get; set; } - + public string name { get; set; } public string equip_id { get; set; } public string equip_id_id { get; set; } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs index dfeffb72..68a3a35a 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaMaintainInput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Filter; +using JNPF.Common.Filter; namespace Tnb.EquipMgr.Entities.Dto { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaRepairApplyListOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaRepairApplyListOutput.cs index c2455cec..5436846c 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaRepairApplyListOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/PdaRepairApplyListOutput.cs @@ -13,9 +13,9 @@ namespace Tnb.EquipMgr.Entities.Dto public string status { get; set; } public string repairer_id { get; set; } public string? repairer_id_id { get; set; } - + public string apply_user_id { get; set; } public string apply_user_id_id { get; set; } - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldFromPlanInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldFromPlanInput.cs index 59a4b291..180b2efe 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldFromPlanInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldFromPlanInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具保养计划制定-计划关联模具输入参数 diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs index 74cc333c..273199cb 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { /// /// 模具规则定义,关键模具输入参数 @@ -27,7 +21,7 @@ namespace Tnb.EquipMgr.Entities.Dto } - public class RowIdItem + public class RowIdItem { /// /// 模具id diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyOutRegisterInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyOutRegisterInput.cs index 628e9f43..7196bae9 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyOutRegisterInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyOutRegisterInput.cs @@ -3,22 +3,22 @@ namespace Tnb.EquipMgr.Entities.Dto public class RepairApplyOutRegisterInput { public string? id { get; set; } - + /// /// 实际维修供应商id /// public string? real_supplier_id { get; set; } - + /// /// 附件 /// public string? attachment { get; set; } - + /// /// 费用 /// public decimal? cost { get; set; } - + /// /// 修复时间 /// @@ -28,12 +28,12 @@ namespace Tnb.EquipMgr.Entities.Dto /// 维修耗时 /// public decimal? repair_take_time { get; set; } - + /// /// 维修备注 /// public string? repair_remark { get; set; } - + /// /// 报修申请id /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyRegisterInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyRegisterInput.cs index 38cabadf..43954af6 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyRegisterInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairApplyRegisterInput.cs @@ -3,27 +3,27 @@ namespace Tnb.EquipMgr.Entities.Dto public class RepairApplyRegisterInput { public string? id { get; set; } - + /// /// 故障ID /// public string? fault_id { get; set; } - + /// /// 是否完成 /// public string? is_complete { get; set; } - + /// /// 完成时间 /// public DateTime? complete_time { get; set; } - + /// /// 维修耗时 /// public int? repair_take_time { get; set; } - + /// /// 是否停机 /// @@ -33,17 +33,17 @@ namespace Tnb.EquipMgr.Entities.Dto /// 停机时长 /// public int? halt_take_time { get; set; } - + /// /// 维修描述 /// public string? repair_description { get; set; } - + /// /// 维修图片 /// public string? repair_img { get; set; } - + /// /// 是否外修 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairDelayInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairDelayInput.cs index 439a2bef..0db194c2 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairDelayInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairDelayInput.cs @@ -3,15 +3,15 @@ namespace Tnb.EquipMgr.Entities.Dto public class RepairDelayInput { public string? repair_apply_id { get; set; } - + public string? equip_id { get; set; } - + public string? repair_request_sender_id { get; set; } - + public string? repair_sender_id { get; set; } - + public DateTime expected_time { get; set; } - + public string? delay_reason { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairOutApplyInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairOutApplyInput.cs index ae5c6e37..e6cd8e02 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairOutApplyInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/RepairOutApplyInput.cs @@ -10,6 +10,6 @@ namespace Tnb.EquipMgr.Entities.Dto public string? construction_period_requirement { get; set; } public string? out_apply_reason { get; set; } public string? remark { get; set; } - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordExecuteInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordExecuteInput.cs index 6823a5dd..78844b0d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordExecuteInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordExecuteInput.cs @@ -3,13 +3,13 @@ namespace Tnb.EquipMgr.Entities.Dto public class SpotInsRecordExecuteInput { public string? id { get; set; } - + public string? attachment { get; set; } - + public string? result { get; set; } - + public string? result_remark { get; set; } - - public List>? details { get; set; } + + public List>? details { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatInput.cs index 2b45861b..35cc5b6d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatInput.cs @@ -3,9 +3,9 @@ namespace Tnb.EquipMgr.Entities.Dto public class SpotInsRecordRepeatInput { public string? id { get; set; } - + public string? repeat_result { get; set; } - + public string? repeat_remark { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatOutput.cs index 37db7bc2..a2af14b9 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsRecordRepeatOutput.cs @@ -3,7 +3,7 @@ namespace Tnb.EquipMgr.Entities.Dto public class SpotInsRecordRepeatOutput { public EqpSpotInsRecordH? model { get; set; } - + public List? details { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsTemPublishInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsTemPublishInput.cs index 3e27dd1b..ecb39a49 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsTemPublishInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/SpotInsTemPublishInput.cs @@ -3,7 +3,7 @@ namespace Tnb.EquipMgr.Entities.Dto public class SpotInsTemPublishInput { public string? id { get; set; } - + public string[]? equipIds { get; set; } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs index cae96d36..40f971e4 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities +namespace Tnb.EquipMgr.Entities { public class ToolInput { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolMoldInput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolMoldInput.cs index 64a6e2f7..2f137c97 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolMoldInput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/ToolMoldInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Dto +namespace Tnb.EquipMgr.Entities.Dto { public class ToolMoldInput { @@ -16,5 +10,5 @@ namespace Tnb.EquipMgr.Entities.Dto public string[] molds { get; set; } } - + } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Dto/WorklineAndEquipTreeOutput.cs b/EquipMgr/Tnb.EquipMgr.Entities/Dto/WorklineAndEquipTreeOutput.cs index dcfee410..6423ef14 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Dto/WorklineAndEquipTreeOutput.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Dto/WorklineAndEquipTreeOutput.cs @@ -7,7 +7,7 @@ namespace Tnb.EquipMgr.Entities.Dto /// /// public string id { get; set; } - + /// /// 标题 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs index 70b020ae..1a5d0b6c 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpEquipment.cs @@ -187,12 +187,12 @@ public partial class EqpEquipment : BaseEntity /// 工位编码 /// public string? station_code { get; set; } - + /// /// 质保开始时间 /// public DateTime? warranty_start_time { get; set; } - + /// /// 质保结束时间 /// @@ -207,17 +207,17 @@ public partial class EqpEquipment : BaseEntity /// 二维码 /// public string? qrcode { get; set; } - + /// /// 挤出件类型 /// public string? tube { get; set; } - + /// /// 入库库位id /// public string? as_location_id { get; set; } - + /// /// 第三方平台设备编号 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs index 3724956c..41edadb4 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs @@ -128,7 +128,7 @@ public partial class EqpMaintainTemEquipH : BaseEntity /// 责任岗位id /// public string send_post_info_user_id { get; set; } = string.Empty; - + /// /// 所属组织 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs index 971809e6..4fd84f75 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs @@ -123,7 +123,7 @@ public partial class EqpMaintainTemH : BaseEntity /// 责任岗位id /// public string send_post_info_user_id { get; set; } = string.Empty; - + /// /// 所属组织 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairAnalysisRecord.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairAnalysisRecord.cs index 49e56317..f3df2c56 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairAnalysisRecord.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairAnalysisRecord.cs @@ -1,5 +1,4 @@ using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.EquipMgr.Entities; @@ -12,7 +11,7 @@ public partial class EqpRepairAnalysisRecord : BaseEntity { public EqpRepairAnalysisRecord() { - + } /// /// TODO diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.cs index 727ee5a9..36e4ba59 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairApply.cs @@ -148,12 +148,12 @@ public partial class EqpRepairApply : BaseEntity /// 附件 /// public string? attachment { get; set; } - + /// /// 维修图片 /// public string? repair_img { get; set; } - + /// /// 生产任务单id /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairCompletionRecord.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairCompletionRecord.cs index 5b195fcd..3df8957e 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairCompletionRecord.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairCompletionRecord.cs @@ -1,5 +1,4 @@ using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.EquipMgr.Entities; @@ -12,7 +11,7 @@ public partial class EqpRepairCompletionRecord : BaseEntity { public EqpRepairCompletionRecord() { - + } /// /// TODO diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairDelay.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairDelay.cs index e62cce1a..728e69e1 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairDelay.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairDelay.cs @@ -1,6 +1,3 @@ -using System; -using System.Linq; -using System.Text; using JNPF.Common.Security; using SqlSugar; diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairOutApply.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairOutApply.cs index adc2cfe6..cbdd6502 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairOutApply.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpRepairOutApply.cs @@ -113,23 +113,23 @@ public partial class EqpRepairOutApply : BaseEntity /// 所属组织 /// public string? org_id { get; set; } - + /// /// 附件 /// public string? attachment { get; set; } - + /// /// 实际维修供应商 /// public string? real_supplier_id { get; set; } - + /// /// 流程id /// [SugarColumn(ColumnName = "f_flowid")] public string? flow_id { get; set; } - + /// /// 流程任务id /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpEquipCheckRecord.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpEquipCheckRecord.cs index a72ad608..3cbf3c65 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpEquipCheckRecord.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpEquipCheckRecord.cs @@ -118,7 +118,7 @@ public partial class EqpSpEquipCheckRecord : BaseEntity /// 流程引擎Id /// public string? f_flowid { get; set; } - + /// /// 所属组织 /// diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs index 076469c0..6654de79 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpSpotInsRecordD.cs @@ -108,5 +108,5 @@ public partial class EqpSpotInsRecordD : BaseEntity /// 是否通过 /// public string? is_pass { get; set; } - + } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs index f34d8433..d525f962 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using System.Text; -using SqlSugar; +using SqlSugar; namespace Tnb.EquipMgr.Entities { diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckItem.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckItem.cs index 1797a714..2ac4a713 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckItem.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckItem.cs @@ -1,5 +1,4 @@ using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; using Yitter.IdGenerator; diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckPeriod.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckPeriod.cs index 1898e13b..07794d7d 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckPeriod.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolModelCheckPeriod.cs @@ -1,5 +1,4 @@ using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.EquipMgr.Entities; diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMoldMaintainPlan.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMoldMaintainPlan.cs index af26dbc9..65929f93 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMoldMaintainPlan.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMoldMaintainPlan.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.part.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.part.cs index d6d167ba..540e98a2 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.part.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.EquipMgr.Entities; @@ -7,7 +5,7 @@ namespace Tnb.EquipMgr.Entities; /// /// 模具信息表 /// -public partial class ToolMolds +public partial class ToolMolds { /// /// 库房编码 @@ -17,6 +15,6 @@ public partial class ToolMolds /// /// 库位编码 /// - [SugarColumn(IsIgnore =true)] + [SugarColumn(IsIgnore = true)] public string location_code { get; set; } } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Enums/MaintainStatus.cs b/EquipMgr/Tnb.EquipMgr.Entities/Enums/MaintainStatus.cs index d17d7d50..0f658171 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Enums/MaintainStatus.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Enums/MaintainStatus.cs @@ -1,24 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Entities.Enums +namespace Tnb.EquipMgr.Entities.Enums { public enum MaintainStatus { /// /// 待维修 /// - DWX=1, + DWX = 1, /// /// 维修中 /// - WXZ=2, + WXZ = 2, /// /// 已完成 /// - YWC=4, + YWC = 4, } } diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs b/EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs index 475faac8..580e82d5 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs @@ -1,6 +1,5 @@ using Mapster; using Tnb.EquipMgr.Entities.Dto; -using Tnb.EquipMgr.Entities; namespace Tnb.EquipMgr.Entities.Mapper { @@ -14,7 +13,7 @@ namespace Tnb.EquipMgr.Entities.Mapper .Map(dest => dest.mold_id, src => src.id); config.ForType() .Map(dest => dest.mold_id, src => src.id); - //.Map(dest=>dest.mold_name,src=>src.mold_name); + //.Map(dest=>dest.mold_name,src=>src.mold_name); } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Tnb.EquipMgr.Entities.csproj b/EquipMgr/Tnb.EquipMgr.Entities/Tnb.EquipMgr.Entities.csproj index edabb960..bd191439 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Tnb.EquipMgr.Entities.csproj +++ b/EquipMgr/Tnb.EquipMgr.Entities/Tnb.EquipMgr.Entities.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipFileService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipFileService.cs index 3d47193f..96645005 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipFileService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipFileService.cs @@ -1,4 +1,3 @@ -using Microsoft.AspNetCore.Http; using Tnb.EquipMgr.Entities.Dto; namespace Tnb.EquipMgr.Interfaces diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipSparePartsService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipSparePartsService.cs index 38a1bcb0..922fd3bd 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipSparePartsService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpEquipSparePartsService.cs @@ -10,7 +10,7 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task AddEquipSpareParts(EquipSparePartsInput input); - + /// /// 根据设备id获取备品备件 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainRecordService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainRecordService.cs index 3ca7ee5a..abe34335 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainRecordService.cs @@ -1,4 +1,3 @@ -using JNPF.Common.Dtos.VisualDev; using Tnb.EquipMgr.Entities.Dto; namespace Tnb.EquipMgr.Interfaces @@ -18,14 +17,14 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task GetMaintainRecordRepeatInfo(Dictionary dic); - + /// /// 复核备保养计划 /// /// /// public Task RepeatMaintain(MaintainRecordRepeatInput input); - + /// /// 根据设备id获取设备保养记录 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemEquipService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemEquipService.cs index 1b6496a5..fdfaf79d 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemEquipService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemEquipService.cs @@ -2,7 +2,7 @@ namespace Tnb.EquipMgr.Interfaces { public interface IEqpMaintainTemEquipService { - + /// /// 停止计划 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairApplyService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairApplyService.cs index 00a88135..a5665019 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairApplyService.cs @@ -5,43 +5,43 @@ namespace Tnb.EquipMgr.Interfaces { public interface IEqpRepairApplyService { - + /// /// 维修作废 /// /// - public Task Repeal(Dictionary dic); - + public Task Repeal(Dictionary dic); + /// /// 维修关闭 /// /// - public Task Close(Dictionary dic); - + public Task Close(Dictionary dic); + /// /// 维修指派 /// /// - public Task Assign(Dictionary dic); - + public Task Assign(Dictionary dic); + /// /// 维修接收 /// /// - public Task Receive(Dictionary dic); - + public Task Receive(Dictionary dic); + /// /// 维修拒绝 /// /// - public Task Refuse(Dictionary dic); - + public Task Refuse(Dictionary dic); + /// /// 维修信息 /// /// - public Task GetInfo(Dictionary dic); - + public Task GetInfo(Dictionary dic); + /// /// 维修登记 /// @@ -53,13 +53,13 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task GetRepairApplyDetail(Dictionary dic); - + /// /// 根据设备id获取维修记录 /// /// public Task GetRepairRecordList(EquipQueryInput input); - + /// /// 看板端设备报修维修列表接口 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairDelayService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairDelayService.cs index 2864d32d..ab9f3e20 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairDelayService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairDelayService.cs @@ -9,6 +9,6 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task Delay(RepairDelayInput input); - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairOutApplyService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairOutApplyService.cs index 5e3b57dd..777ce6e5 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairOutApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpRepairOutApplyService.cs @@ -5,24 +5,24 @@ namespace Tnb.EquipMgr.Interfaces { public interface IEqpRepairOutApplyService { - + /// /// 获取外修申请信息 /// /// - public Task GetInfo(Dictionary dic); - + public Task GetInfo(Dictionary dic); + /// /// 外修申请 /// /// public Task OutApply(RepairOutApplyInput input); - + /// /// 外修登记 /// /// public Task Register(RepairApplyOutRegisterInput input); - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSpEquipCheckRecordService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSpEquipCheckRecordService.cs index 2028c41f..694e98b1 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSpEquipCheckRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSpEquipCheckRecordService.cs @@ -1,5 +1,5 @@ using Tnb.EquipMgr.Entities; - + namespace Tnb.EquipMgr.Interfaces { public interface IEqpSpEquipCheckRecordService diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSparePartsRequisitionHService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSparePartsRequisitionHService.cs index 85b1bb7a..36893a0e 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSparePartsRequisitionHService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpSparePartsRequisitionHService.cs @@ -5,6 +5,6 @@ namespace Tnb.EquipMgr.Interfaces /// public interface IEqpSparePartsRequisitionHService { - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs index f4cdd287..fcef53ff 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEqpWorkshopChangeLogService.cs @@ -12,7 +12,7 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task GetEquipWorkshopChangeList(EquipQueryInput input); - + /// /// 设备迁移 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsRecordService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsRecordService.cs index 43c849fc..1ebbfd60 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquSpotInsRecordService.cs @@ -1,4 +1,3 @@ -using JNPF.Common.Dtos.VisualDev; using Tnb.EquipMgr.Entities.Dto; namespace Tnb.EquipMgr.Interfaces @@ -18,14 +17,14 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task GetSpotInsRecordRepeatInfo(Dictionary dic); - + /// /// 复核点巡检 /// /// /// public Task RepeatSpotIns(SpotInsRecordRepeatInput input); - + /// /// 根据设备id获取点巡检记录 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IEquipmentService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquipmentService.cs index 803272f5..7584ef96 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IEquipmentService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IEquipmentService.cs @@ -10,7 +10,7 @@ namespace Tnb.EquipMgr.Interfaces /// /// public Task GetEntityById(Dictionary dic); - + /// /// 根据设备类型获取设备列表 /// @@ -22,8 +22,8 @@ namespace Tnb.EquipMgr.Interfaces /// 获取产线和注塑挤出设备树 /// /// - public Task GetWorklineAndEquipTree(Dictionary dic); - + public Task GetWorklineAndEquipTree(Dictionary dic); + /// /// 根据二维码查设备 /// diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldHouseService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldHouseService.cs index 221f05ea..971f3efd 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldHouseService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldHouseService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { /// /// 目录库房服务接口 diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldLocationService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldLocationService.cs index d788daca..2459072e 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldLocationService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldLocationService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { /// /// 模具库位服务接口 diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainGroupService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainGroupService.cs index e3a9aa6d..3272eb39 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainGroupService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainGroupService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { /// /// 模具保养项目组接口 diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanRunService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanRunService.cs index 0c482f04..cc3ce025 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanRunService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanRunService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { public interface IToolMoldMaintainPlanRunService { diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanService.cs index 808506b2..22c84880 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainPlanService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { public interface IToolMoldMaintainPlanService { diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainRuleService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainRuleService.cs index a066341d..74440623 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainRuleService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainRuleService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr.Interfaces +namespace Tnb.EquipMgr.Interfaces { /// /// 设备保养规则定义 diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainTaskService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainTaskService.cs index fa2181d5..814e3897 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainTaskService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaintainTaskService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.EquipMgr.Entities; +using Tnb.EquipMgr.Entities; namespace Tnb.EquipMgr.Interfaces { diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaterialService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaterialService.cs index be6af180..8240edbc 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaterialService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldMaterialService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Tnb.EquipMgr.Entities.Dto; +using Tnb.EquipMgr.Entities.Dto; namespace Tnb.EquipMgr.Interfaces { diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldRequisitionService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldRequisitionService.cs index 15fbd54c..5a8eea4d 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldRequisitionService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldRequisitionService.cs @@ -5,6 +5,6 @@ namespace Tnb.EquipMgr.Interfaces /// public interface IToolMoldRequisitionService { - + } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldsService.cs b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldsService.cs index e1e1f8d9..238af7fc 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldsService.cs +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/IToolMoldsService.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities.Dto; namespace Tnb.EquipMgr.Interfaces { diff --git a/EquipMgr/Tnb.EquipMgr.Interfaces/Tnb.EquipMgr.Interfaces.csproj b/EquipMgr/Tnb.EquipMgr.Interfaces/Tnb.EquipMgr.Interfaces.csproj index 83209e17..ab92314f 100644 --- a/EquipMgr/Tnb.EquipMgr.Interfaces/Tnb.EquipMgr.Interfaces.csproj +++ b/EquipMgr/Tnb.EquipMgr.Interfaces/Tnb.EquipMgr.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/EquipMgr/Tnb.EquipMgr/App/AppEqpRepairApplyService.cs b/EquipMgr/Tnb.EquipMgr/App/AppEqpRepairApplyService.cs index 2c188cd1..531d2e4d 100644 --- a/EquipMgr/Tnb.EquipMgr/App/AppEqpRepairApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr/App/AppEqpRepairApplyService.cs @@ -1,10 +1,7 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; using JNPF.Common.Filter; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.VisualDev; @@ -16,7 +13,6 @@ using SqlSugar; using Tnb.BasicData; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; -using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr { @@ -26,7 +22,7 @@ namespace Tnb.EquipMgr [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleId)] - public class AppEqpRepairApplyService : IOverideVisualDevService,IDynamicApiController, ITransient + public class AppEqpRepairApplyService : IOverideVisualDevService, IDynamicApiController, ITransient { private const string ModuleId = "28621611210261"; private readonly ISqlSugarRepository _repository; @@ -46,43 +42,43 @@ namespace Tnb.EquipMgr _visualDevService = visualDevService; OverideFuncs.GetListAsync = GetList; } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); Dictionary queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); - string code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; - string name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; + string code = queryJson != null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : ""; + string name = queryJson != null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : ""; string userId = _userManager.UserId; var result = await db.Queryable() .LeftJoin((a, b) => a.equip_id == b.id) .LeftJoin((a, b, c) => a.apply_user_id == c.Id) - .LeftJoin((a,b,c,d)=>d.EnCode==DictConst.RepairStatus) - .LeftJoin((a,b,c,d,e)=>a.status==e.EnCode && d.Id==e.DictionaryTypeId) + .LeftJoin((a, b, c, d) => d.EnCode == DictConst.RepairStatus) + .LeftJoin((a, b, c, d, e) => a.status == e.EnCode && d.Id == e.DictionaryTypeId) .WhereIF(!string.IsNullOrEmpty("code"), (a, b, c) => a.code.Contains(code)) .WhereIF(!string.IsNullOrEmpty("name"), (a, b, c) => a.name.Contains(name)) .Where((a, b, c) => a.repairer_id == userId) - .Where((a, b, c) => a.status == "2" || a.status=="3") - .Select((a, b, c,d,e) => new PdaRepairApplyListOutput + .Where((a, b, c) => a.status == "2" || a.status == "3") + .Select((a, b, c, d, e) => new PdaRepairApplyListOutput { id = a.id, code = a.code, name = a.name, - equip_id = b.code+"/"+b.name, + equip_id = b.code + "/" + b.name, equip_id_id = a.equip_id, - expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"), - is_ugent = a.is_ugent==null ? "" : a.is_ugent==0 ? "否" : "是", + expect_complete_time = a.expect_complete_time == null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"), + is_ugent = a.is_ugent == null ? "" : a.is_ugent == 0 ? "否" : "是", description = a.description, status = e.FullName, - apply_user_id = SqlFunc.IsNull(c.RealName,"异常停机"), + apply_user_id = SqlFunc.IsNull(c.RealName, "异常停机"), apply_user_id_id = a.create_id, // repairer_id = c.RealName, // repairer_id_id = a.repairer_id, - }).ToPagedListAsync(input.currentPage,input.pageSize); + }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - + /// /// 根据id获取维修相关信息 @@ -90,7 +86,7 @@ namespace Tnb.EquipMgr /// /// [HttpPost] - public async Task GetRepairInfoById(Dictionary dic) + public async Task GetRepairInfoById(Dictionary dic) { string id = dic.ContainsKey("id") ? dic["id"] : ""; if (string.IsNullOrEmpty(id)) return null; @@ -106,7 +102,7 @@ namespace Tnb.EquipMgr equip_id = a.equip_id, equip_code = b.code, equip_name = b.name, - expect_complete_time = a.expect_complete_time==null?"":a.expect_complete_time.Value.ToString("yyyy-MM-dd"), + expect_complete_time = a.expect_complete_time == null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd"), is_ugent = a.is_ugent, description = a.description, status = a.status, diff --git a/EquipMgr/Tnb.EquipMgr/BaseMoldMaintainService.cs b/EquipMgr/Tnb.EquipMgr/BaseMoldMaintainService.cs index ce2313b9..4d51e102 100644 --- a/EquipMgr/Tnb.EquipMgr/BaseMoldMaintainService.cs +++ b/EquipMgr/Tnb.EquipMgr/BaseMoldMaintainService.cs @@ -1,18 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; +using System.Linq.Expressions; +using JNPF.Common.Contracts; using JNPF.Common.Enums; -using JNPF.Common.Security; +using JNPF.Common.Extension; using JNPF.FriendlyException; +using Mapster; using SqlSugar; using Tnb.EquipMgr.Entities.Dto; -using Tnb.EquipMgr.Entities; -using Mapster; -using JNPF.Common.Contracts; -using JNPF.Common.Extension; namespace Tnb.EquipMgr { @@ -75,7 +68,7 @@ namespace Tnb.EquipMgr var itemIds = await _db.Queryable().Where(masterFilterExp).Select(masterSelector).ToListAsync(); if (itemIds?.Count > 0) { - var items = await _db.Queryable().Where(it=>itemIds.Contains(it.id)).ToListAsync(); + var items = await _db.Queryable().Where(it => itemIds.Contains(it.id)).ToListAsync(); list = items.Adapt>(); } return list; diff --git a/EquipMgr/Tnb.EquipMgr/EqpDaqService.cs b/EquipMgr/Tnb.EquipMgr/EqpDaqService.cs index 39e605a2..dc8be317 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpDaqService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpDaqService.cs @@ -6,10 +6,10 @@ using JNPF.Systems.Entitys.Permission; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; +using Tnb.BasicData; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Tnb.BasicData; namespace Tnb.EquipMgr { @@ -34,29 +34,29 @@ namespace Tnb.EquipMgr { var db = _repository.AsSugarClient(); Dictionary? queryJson = new Dictionary(); - if (input!=null && !string.IsNullOrEmpty(input.queryJson)) + if (input != null && !string.IsNullOrEmpty(input.queryJson)) { queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a,b)=>a.create_id==b.Id) - .WhereIF(input!=null,a=>a.equip_id==input!.equip_id) - .WhereIF(queryJson!=null && queryJson.ContainsKey("data_source"),a=>a.data_source==queryJson!["data_source"]) - .WhereIF(queryJson!=null && queryJson.ContainsKey("label_name"),a=>a.label_name.Contains(queryJson!["label_name"])) - .WhereIF(queryJson!=null && queryJson.ContainsKey("label_point"),a=>a.label_point.Contains(queryJson!["label_point"])) - .Select((a,b) => new EquipDaqQueryOutput + .LeftJoin((a, b) => a.create_id == b.Id) + .WhereIF(input != null, a => a.equip_id == input!.equip_id) + .WhereIF(queryJson != null && queryJson.ContainsKey("data_source"), a => a.data_source == queryJson!["data_source"]) + .WhereIF(queryJson != null && queryJson.ContainsKey("label_name"), a => a.label_name.Contains(queryJson!["label_name"])) + .WhereIF(queryJson != null && queryJson.ContainsKey("label_point"), a => a.label_point.Contains(queryJson!["label_point"])) + .Select((a, b) => new EquipDaqQueryOutput { id = a.id, data_source = a.data_source, create_id = b.RealName, - create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), + create_time = a.create_time == null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), data_type = a.data_type, - enabled = a.enabled==1 ? "是" : "否", + enabled = a.enabled == 1 ? "是" : "否", equip_id = a.equip_id, label_name = a.label_name, label_point = a.label_point, remark = a.remark - }).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + }).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); return PageResult.SqlSugarPageResult(result); } diff --git a/EquipMgr/Tnb.EquipMgr/EqpEquipFileService.cs b/EquipMgr/Tnb.EquipMgr/EqpEquipFileService.cs index 97f48c1a..33e7a176 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpEquipFileService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpEquipFileService.cs @@ -1,5 +1,4 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Filter; using JNPF.Common.Models; @@ -9,12 +8,6 @@ using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Common; using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Interfaces.Common; -using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; @@ -45,13 +38,13 @@ namespace Tnb.EquipMgr } [HttpPost] - public async Task Upload([FromForm]string equip_id,[FromForm] ChunkModel input) + public async Task Upload([FromForm] string equip_id, [FromForm] ChunkModel input) { string msg = ""; try { var attachment = await _fileService.Uploader("annexpic", input); - + EqpEquipFile eqpEquipFile = new EqpEquipFile() { file_name = input.file.FileName, @@ -85,21 +78,21 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a, b) => a.create_id == b.Id) - .LeftJoin((a, b,c) => a.modify_id == c.Id) - .LeftJoin((a, b,c,d) => a.equip_id == d.id) - .Where((a,b,c,d)=>a.equip_id==input.equip_id) - .WhereIF(queryJson!=null && queryJson.ContainsKey("file_name"),(a,b,c,d)=>a.file_name.Contains(queryJson!["file_name"])) - .Select((a, b, c,d) => new EquipFileQueryOutput + .LeftJoin((a, b) => a.create_id == b.Id) + .LeftJoin((a, b, c) => a.modify_id == c.Id) + .LeftJoin((a, b, c, d) => a.equip_id == d.id) + .Where((a, b, c, d) => a.equip_id == input.equip_id) + .WhereIF(queryJson != null && queryJson.ContainsKey("file_name"), (a, b, c, d) => a.file_name.Contains(queryJson!["file_name"])) + .Select((a, b, c, d) => new EquipFileQueryOutput { id = a.id, attachment = a.attachment, create_id = b.RealName, create_id_id = a.create_id, - create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"), - equip_id=d.name, - equip_id_id= a.equip_id, - file_name=a.file_name, + create_time = a.create_time == null ? null : a.create_time.Value.ToString("yyyy-MM-dd"), + equip_id = d.name, + equip_id_id = a.equip_id, + file_name = a.file_name, }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); diff --git a/EquipMgr/Tnb.EquipMgr/EqpEquipScrapService.cs b/EquipMgr/Tnb.EquipMgr/EqpEquipScrapService.cs index 6df470f2..b06ff48e 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpEquipScrapService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpEquipScrapService.cs @@ -1,18 +1,12 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; 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 @@ -51,10 +45,10 @@ namespace Tnb.EquipMgr await db.Updateable().SetColumns(x => x.life == EquipmentLife.SCRAP) .Where(x => x.id == eqpEquipScrap.equip_id).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + 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/EqpEquipSparePartsService.cs b/EquipMgr/Tnb.EquipMgr/EqpEquipSparePartsService.cs index 351b7f60..6c751f92 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpEquipSparePartsService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpEquipSparePartsService.cs @@ -3,7 +3,6 @@ using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; @@ -67,13 +66,13 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a,b)=>a.spare_parts_id==b.id) + .LeftJoin((a, b) => a.spare_parts_id == b.id) .LeftJoin((a, b, c) => c.EnCode == Tnb.BasicData.DictConst.SparePartsType && c.DeleteMark == null) - .LeftJoin((a, b,c,d) => d.DictionaryTypeId == c.Id && b.type_id == d.EnCode) - .Where((a,b,c,d)=>a.equip_id==input.equip_id) - .WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>b.code.Contains(queryJson!["code"])) - .WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>b.name.Contains(queryJson!["name"])) - .Select((a, b, c,d) => new EquipSparePartsQueryOutput + .LeftJoin((a, b, c, d) => d.DictionaryTypeId == c.Id && b.type_id == d.EnCode) + .Where((a, b, c, d) => a.equip_id == input.equip_id) + .WhereIF(queryJson != null && queryJson.ContainsKey("code"), (a, b, c, d) => b.code.Contains(queryJson!["code"])) + .WhereIF(queryJson != null && queryJson.ContainsKey("name"), (a, b, c, d) => b.name.Contains(queryJson!["name"])) + .Select((a, b, c, d) => new EquipSparePartsQueryOutput { id = a.id, type_code = d.EnCode, diff --git a/EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs b/EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs index fc9f254a..d0b07c26 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs @@ -1,12 +1,11 @@ using JNPF.Common.Enums; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.EquipMgr.Interfaces; using Tnb.EquipMgr.Entities; +using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr { @@ -15,7 +14,7 @@ namespace Tnb.EquipMgr /// [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] - public class EqpMaintainTemEquipService : IEqpMaintainTemEquipService, IDynamicApiController, ITransient + public class EqpMaintainTemEquipService : IEqpMaintainTemEquipService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; @@ -29,7 +28,7 @@ namespace Tnb.EquipMgr public async Task Stop(Dictionary parameters) { string id = parameters["id"]; - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.UpdateAsync(x => new EqpMaintainTemEquipH() { @@ -40,13 +39,13 @@ namespace Tnb.EquipMgr .Select(x => x.id).ToListAsync(); await _repository.AsSugarClient().Deleteable() .Where(x => x.maintain_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED).ExecuteCommandAsync(); - + await _repository.AsSugarClient().Deleteable() .Where(x => ids.Contains(x.maintain_record_id)).ExecuteCommandAsync(); }); - - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs b/EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs index 9fd92c46..aecb9304 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs @@ -29,7 +29,7 @@ namespace Tnb.EquipMgr _repository = repository; _userManager = userManager; } - + /// /// 根据模板id发布到设备 /// @@ -37,10 +37,10 @@ namespace Tnb.EquipMgr public async Task Publish(SpotInsTemPublishInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { EqpMaintainTemH eqpMaintainTemH = await _repository.GetSingleAsync(x => x.id == input.id); - List eqpMaintainTemDs = await db.Queryable().Where(x=>x.maintain_tem_id==input.id).ToListAsync(); + List eqpMaintainTemDs = await db.Queryable().Where(x => x.maintain_tem_id == input.id).ToListAsync(); if (input.equipIds != null && input.equipIds.Length > 0) { @@ -54,7 +54,7 @@ namespace Tnb.EquipMgr { id = id, code = code, - name = eqpMaintainTemH.name+equipId, + name = eqpMaintainTemH.name + equipId, plan_cycle = eqpMaintainTemH.plan_cycle, plan_cycle_unit = eqpMaintainTemH.plan_cycle_unit, plan_run_notice = eqpMaintainTemH.plan_run_notice, @@ -92,26 +92,26 @@ namespace Tnb.EquipMgr } EqpMaintainTemEquipH oldMaintainTemEquipH = await db.Queryable().Where(x => x.maintain_tem_id == input.id && x.equip_id == equipId).FirstAsync(); - await db.Deleteable().Where(x => x.maintain_tem_id == input.id && x.equip_id==equipId).ExecuteCommandAsync(); - if(oldMaintainTemEquipH!=null) - await db.Deleteable().Where(x => x.maintain_tem_equip_id==oldMaintainTemEquipH.id).ExecuteCommandAsync(); + await db.Deleteable().Where(x => x.maintain_tem_id == input.id && x.equip_id == equipId).ExecuteCommandAsync(); + if (oldMaintainTemEquipH != null) + await db.Deleteable().Where(x => x.maintain_tem_equip_id == oldMaintainTemEquipH.id).ExecuteCommandAsync(); } if (insertEqpMaintainTemEquipHs != null && insertEqpMaintainTemEquipHs.Count > 0) { await db.Insertable(insertEqpMaintainTemEquipHs).ExecuteCommandAsync(); } - + if (insertEqpMaintainTemEquipDs != null && insertEqpMaintainTemEquipDs.Count > 0) { await db.Insertable(insertEqpMaintainTemEquipDs).ExecuteCommandAsync(); } - + } }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "发布成功" : result.ErrorMessage; } } diff --git a/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs b/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs index e4a04049..f1093657 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpRepairApplyService.cs @@ -1,8 +1,6 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; using JNPF.Common.Filter; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; @@ -10,9 +8,7 @@ using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; @@ -37,7 +33,7 @@ namespace Tnb.EquipMgr private readonly IRunService _runService; private readonly IBillRullService _billRuleService; private readonly IUserManager _userManager; - + public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public EqpRepairApplyService(ISqlSugarRepository repository, @@ -53,45 +49,50 @@ namespace Tnb.EquipMgr _billRuleService = billRullService; OverideFuncs.CreateAsync = Create; } - + private async Task Create(VisualDevModelDataCrInput input) { if (!input.data.ContainsKey("create_time")) { - input.data.Add("create_time",DateTime.Now); - }else if ( string.IsNullOrEmpty((string)input.data["create_time"])) + input.data.Add("create_time", DateTime.Now); + } + else if (string.IsNullOrEmpty((string)input.data["create_time"])) { input.data["create_time"] = DateTime.Now; } - + if (!input.data.ContainsKey("create_id")) { - input.data.Add("create_id",_userManager.UserId); - }else if ( string.IsNullOrEmpty((string)input.data["create_id"])) + input.data.Add("create_id", _userManager.UserId); + } + else if (string.IsNullOrEmpty((string)input.data["create_id"])) { input.data["create_id"] = _userManager.UserId; } - + if (!input.data.ContainsKey("apply_user_id")) { - input.data.Add("apply_user_id",_userManager.UserId); - }else if ( string.IsNullOrEmpty((string)input.data["apply_user_id"])) + input.data.Add("apply_user_id", _userManager.UserId); + } + else if (string.IsNullOrEmpty((string)input.data["apply_user_id"])) { input.data["apply_user_id"] = _userManager.UserId; } - + if (!input.data.ContainsKey("org_id")) { - input.data.Add("org_id",_userManager.GetUserInfo().Result.organizeId); - }else if ( string.IsNullOrEmpty((string)input.data["org_id"])) + input.data.Add("org_id", _userManager.GetUserInfo().Result.organizeId); + } + else if (string.IsNullOrEmpty((string)input.data["org_id"])) { input.data["org_id"] = _userManager.GetUserInfo().Result.organizeId; } - + if (!input.data.ContainsKey("code")) { - input.data.Add("code",await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE)); - }else if (string.IsNullOrEmpty((string)input.data["code"])) + input.data.Add("code", await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE)); + } + else if (string.IsNullOrEmpty((string)input.data["code"])) { input.data["code"] = await _billRuleService.GetBillNumber(CodeTemplateConst.EQPREPAIR_CODE); } @@ -100,7 +101,7 @@ namespace Tnb.EquipMgr eqpRepairApply.code = (string)input.data["code"]; eqpRepairApply.name = (string)input.data["name"]; eqpRepairApply.equip_id = (string)input.data["equip_id"]; - eqpRepairApply.expect_complete_time = input.data["expect_complete_time"]!=null && input.data["expect_complete_time"].ToString()!="" ? Convert.ToDateTime(input.data["expect_complete_time"]) : null; + eqpRepairApply.expect_complete_time = input.data["expect_complete_time"] != null && input.data["expect_complete_time"].ToString() != "" ? Convert.ToDateTime(input.data["expect_complete_time"]) : null; eqpRepairApply.is_ugent = (int?)(long)input.data["is_ugent"]; eqpRepairApply.attachment = input.data.ContainsKey("attachment") ? (string)input.data["attachment"] : null; eqpRepairApply.apply_user_id = (string)input.data["apply_user_id"]; @@ -111,7 +112,7 @@ namespace Tnb.EquipMgr eqpRepairApply.description = (string)input.data["description"]; eqpRepairApply.status = RepairApplyStatus.TOBEEXECUTED; await _repository.InsertAsync(eqpRepairApply); - + // VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); // await _runService.Create(templateEntity, input); return await Task.FromResult(true); @@ -144,7 +145,7 @@ namespace Tnb.EquipMgr { string id = dic["id"]; string repairerId = dic["repairerId"]; - EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x=>x.id==id); + EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id); if (eqpRepairApply.status == RepairApplyStatus.TOBEEXECUTED || eqpRepairApply.status == RepairApplyStatus.REFUSE) { @@ -159,14 +160,14 @@ namespace Tnb.EquipMgr { throw Oops.Bah("状态错误"); } - + } [HttpPost] public async Task Receive(Dictionary dic) { string id = dic["id"]; - EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x=>x.id==id); + EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id); if (eqpRepairApply.status == RepairApplyStatus.TOBERECEIVED) { if (_userManager.UserId == eqpRepairApply.repairer_id) @@ -196,7 +197,7 @@ namespace Tnb.EquipMgr var db = _repository.AsSugarClient(); DbResult result = await db.Ado.UseTranAsync(async () => { - EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x=>x.id==id); + EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id); if (eqpRepairApply.status == RepairApplyStatus.TOBERECEIVED) { if (_userManager.UserId == eqpRepairApply.repairer_id) @@ -224,9 +225,9 @@ namespace Tnb.EquipMgr { throw Oops.Bah("状态错误"); } - + }); - if(!result.IsSuccess) throw Oops.Oh(result.ErrorMessage); + if (!result.IsSuccess) throw Oops.Oh(result.ErrorMessage); return "拒绝成功"; } @@ -236,17 +237,17 @@ namespace Tnb.EquipMgr string id = dic["id"]; return await _repository.GetSingleAsync(x => x.id == id); } - + [HttpPost] public async Task Register(RepairApplyRegisterInput input) { - - EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x=>x.id==input.id); + + EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == input.id); if (eqpRepairApply.status == RepairApplyStatus.RECEIVED) { if (_userManager.UserId == eqpRepairApply.repairer_id) { - string status = input.is_out_apply==1 ? RepairApplyStatus.TOBEOUTAPPLY : RepairApplyStatus.COMPLETED; + string status = input.is_out_apply == 1 ? RepairApplyStatus.TOBEOUTAPPLY : RepairApplyStatus.COMPLETED; await _repository.UpdateAsync(x => new EqpRepairApply() { fault_id = input.fault_id, @@ -272,7 +273,7 @@ namespace Tnb.EquipMgr throw Oops.Bah("状态错误"); } - + } [HttpPost] @@ -281,7 +282,7 @@ namespace Tnb.EquipMgr string id = dic["id"]; EqpRepairApply eqpRepairApply = await _repository.GetSingleAsync(x => x.id == id); - EqpRepairOutApply eqpRepairOutApply = await _repository.AsSugarClient().Queryable().FirstAsync(x=>x.repair_apply_id==id); + EqpRepairOutApply eqpRepairOutApply = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.repair_apply_id == id); return new RepairApplyDetailOutput() { @@ -300,21 +301,21 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a,b)=>a.apply_user_id==b.Id) - .LeftJoin((a,b,c)=>a.repairer_id==c.Id) - .Where(a=>a.equip_id==input.equip_id) - .OrderByDescending(a=>a.create_time) - .Select((a,b,c) => new EquipRepairRecordQueryOutput + .LeftJoin((a, b) => a.apply_user_id == b.Id) + .LeftJoin((a, b, c) => a.repairer_id == c.Id) + .Where(a => a.equip_id == input.equip_id) + .OrderByDescending(a => a.create_time) + .Select((a, b, c) => new EquipRepairRecordQueryOutput { id = a.id, equip_id = a.equip_id, code = a.code, name = a.name, - apply_user_id =b.RealName, - is_ugent = a.is_ugent==1 ? "是" : "否", + apply_user_id = b.RealName, + is_ugent = a.is_ugent == 1 ? "是" : "否", description = a.description, repair_description = a.repair_description, - complete_time = a.complete_time==null ? null : a.complete_time.Value.ToString(DbTimeFormat.MM), + complete_time = a.complete_time == null ? null : a.complete_time.Value.ToString(DbTimeFormat.MM), repairer_id = c.RealName }).ToPagedListAsync(input.currentPage, input.pageSize); @@ -332,11 +333,11 @@ namespace Tnb.EquipMgr { switch (input.status) { - case "1" : + case "1": statusList.Add(RepairApplyStatus.TOBEEXECUTED); statusList.Add(RepairApplyStatus.REFUSE); break; - case "2" : + case "2": statusList.Add(RepairApplyStatus.TOBERECEIVED); statusList.Add(RepairApplyStatus.RECEIVED); statusList.Add(RepairApplyStatus.OUTAPPLYAPPROVE); @@ -344,14 +345,14 @@ namespace Tnb.EquipMgr statusList.Add(RepairApplyStatus.APPROVENOTPASS); statusList.Add(RepairApplyStatus.TOBEOUTAPPLY); break; - case "3" : + case "3": statusList.Add(RepairApplyStatus.COMPLETED); statusList.Add(RepairApplyStatus.CLOSE); statusList.Add(RepairApplyStatus.REPEAL); break; } } - + if (string.IsNullOrEmpty(input.sidx)) { input.sidx = "a.create_time"; @@ -361,40 +362,40 @@ namespace Tnb.EquipMgr { input.sidx = "a." + input.sidx; } - + var db = _repository.AsSugarClient(); var result = await db.Queryable() - .LeftJoin((a,b)=>a.apply_user_id==b.Id) - .LeftJoin((a,b,c)=>a.repairer_id==c.Id) - .LeftJoin((a,b,c,d)=>a.equip_id==d.id) - .LeftJoin((a,b,c,d,e)=>e.EnCode==DictConst.RepairStatus) - .LeftJoin((a,b,c,d,e,f)=>e.Id==f.DictionaryTypeId && a.status==f.EnCode) - .WhereIF(!string.IsNullOrEmpty(input.equip_info),(a,b,c,d)=>d.code.Contains(input.equip_info) || d.name.Contains(input.equip_info)) - .WhereIF(!string.IsNullOrEmpty(input.status),(a,b,c,d)=>statusList.Contains(a.status)) - .WhereIF(input.status=="3" && start_time!=null,a=>a.complete_time!=null && a.complete_time>=start_time) - .WhereIF(input.status=="3" && end_time!=null,a=>a.complete_time!=null && a.complete_time<=end_time) + .LeftJoin((a, b) => a.apply_user_id == b.Id) + .LeftJoin((a, b, c) => a.repairer_id == c.Id) + .LeftJoin((a, b, c, d) => a.equip_id == d.id) + .LeftJoin((a, b, c, d, e) => e.EnCode == DictConst.RepairStatus) + .LeftJoin((a, b, c, d, e, f) => e.Id == f.DictionaryTypeId && a.status == f.EnCode) + .WhereIF(!string.IsNullOrEmpty(input.equip_info), (a, b, c, d) => d.code.Contains(input.equip_info) || d.name.Contains(input.equip_info)) + .WhereIF(!string.IsNullOrEmpty(input.status), (a, b, c, d) => statusList.Contains(a.status)) + .WhereIF(input.status == "3" && start_time != null, a => a.complete_time != null && a.complete_time >= start_time) + .WhereIF(input.status == "3" && end_time != null, a => a.complete_time != null && a.complete_time <= end_time) .OrderBy($"{input.sidx} {input.sort}") - .Select((a,b,c,d,e,f) => new PadRepairListOutput + .Select((a, b, c, d, e, f) => new PadRepairListOutput { id = a.id, - equip_id = d.code+"/"+d.name, + equip_id = d.code + "/" + d.name, equip_id_id = a.equip_id, code = a.code, name = a.name, - apply_user_id =b.RealName, - apply_user_id_id =b.Id, - is_ugent = a.is_ugent==1 ? "是" : "否", + apply_user_id = b.RealName, + apply_user_id_id = b.Id, + is_ugent = a.is_ugent == 1 ? "是" : "否", description = a.description, - create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), - complete_time = a.complete_time==null ? "" : a.complete_time.Value.ToString(DbTimeFormat.SS), - expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString(DbTimeFormat.SS), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + complete_time = a.complete_time == null ? "" : a.complete_time.Value.ToString(DbTimeFormat.SS), + expect_complete_time = a.expect_complete_time == null ? "" : a.expect_complete_time.Value.ToString(DbTimeFormat.SS), repairer_id = c.RealName, repairer_id_id = c.Id, remark = a.remark, status = f.FullName }).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); - - return PageResult.SqlSugarPageResult(result); + + return PageResult.SqlSugarPageResult(result); } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr/EqpRepairDelayService.cs b/EquipMgr/Tnb.EquipMgr/EqpRepairDelayService.cs index d83763cb..58a7e909 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpRepairDelayService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpRepairDelayService.cs @@ -36,7 +36,7 @@ namespace Tnb.EquipMgr [HttpPost] public async Task Delay(RepairDelayInput input) { - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable().SingleAsync(x => x.id == input.repair_apply_id); EqpRepairDelay repairDelay = new EqpRepairDelay() @@ -59,7 +59,7 @@ namespace Tnb.EquipMgr .Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "延期成功" : result.ErrorMessage; } diff --git a/EquipMgr/Tnb.EquipMgr/EqpRepairOutApplyService.cs b/EquipMgr/Tnb.EquipMgr/EqpRepairOutApplyService.cs index a4fd2432..ced5c394 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpRepairOutApplyService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpRepairOutApplyService.cs @@ -5,7 +5,6 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.WorkFlow.Interfaces.Service; using JNPF.WorkFlow.Service; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; @@ -45,19 +44,19 @@ namespace Tnb.EquipMgr { string id = dic["id"]; EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable().SingleAsync(x => x.id == id); - return await _repository.GetSingleAsync(x => x.repair_apply_id==eqpRepairApply.id); + return await _repository.GetSingleAsync(x => x.repair_apply_id == eqpRepairApply.id); } [HttpPost] public async Task OutApply(RepairOutApplyInput input) { - EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable().SingleAsync(x=>x.id==input.repair_apply_id); + EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable().SingleAsync(x => x.id == input.repair_apply_id); if (eqpRepairApply.status == RepairApplyStatus.TOBEOUTAPPLY || eqpRepairApply.status == RepairApplyStatus.APPROVENOTPASS) { var db = _repository.AsSugarClient(); string id = string.IsNullOrEmpty(input.id) ? SnowflakeIdHelper.NextId() : input.id; - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { if (string.IsNullOrEmpty(input.id)) { @@ -94,14 +93,14 @@ namespace Tnb.EquipMgr } await db.Updateable() - .SetColumns(x=>x.status == RepairApplyStatus.OUTAPPLYAPPROVE) - .Where(x=>x.id==input.repair_apply_id).ExecuteCommandAsync(); + .SetColumns(x => x.status == RepairApplyStatus.OUTAPPLYAPPROVE) + .Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); if (result.IsSuccess) { @@ -125,20 +124,20 @@ namespace Tnb.EquipMgr {"remark",input.remark}, {"approve_status",RepairOutApplyStatus.TOBEAPPROVE}, } - + }); } else { - var entity = await _repository.GetSingleAsync(x=>x.id==input.id); + var entity = await _repository.GetSingleAsync(x => x.id == input.id); if (entity != null) { - - await _flowTaskService.Update("",new FlowTaskSubmitModel() + + await _flowTaskService.Update("", new FlowTaskSubmitModel() { flowId = flowId, parentId = "0", - id = entity?.flow_task_id??"", + id = entity?.flow_task_id ?? "", formData = new JObject() { {"id",id}, @@ -153,7 +152,7 @@ namespace Tnb.EquipMgr {"remark",input.remark}, {"approve_status",RepairOutApplyStatus.TOBEAPPROVE}, } - + }); } } @@ -164,13 +163,13 @@ namespace Tnb.EquipMgr { throw Oops.Bah("状态错误"); } - + } [HttpPost] public async Task Register(RepairApplyOutRegisterInput input) { - + var db = _repository.AsSugarClient(); DbResult result = await db.Ado.UseTranAsync(async () => { @@ -187,7 +186,7 @@ namespace Tnb.EquipMgr await db.Updateable().SetColumns(x => x.status == RepairApplyStatus.COMPLETED) .Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync(); }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "登记成功" : result.ErrorMessage; } diff --git a/EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs b/EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs index ffa74714..a07d90ed 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpRepairRefuseService.cs @@ -4,7 +4,6 @@ using JNPF.DynamicApiController; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr diff --git a/EquipMgr/Tnb.EquipMgr/EqpSpEquipCheckRecordService.cs b/EquipMgr/Tnb.EquipMgr/EqpSpEquipCheckRecordService.cs index ab5eac67..8cd6c648 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpSpEquipCheckRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpSpEquipCheckRecordService.cs @@ -1,5 +1,4 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -7,7 +6,6 @@ using JNPF.FriendlyException; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr @@ -42,7 +40,8 @@ namespace Tnb.EquipMgr if (entity.warn_unit == "1")//月 { entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value); - }else if (entity.warn_unit == "2")//天 + } + else if (entity.warn_unit == "2")//天 { entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value); } diff --git a/EquipMgr/Tnb.EquipMgr/EqpSparePartsRequisitionHService.cs b/EquipMgr/Tnb.EquipMgr/EqpSparePartsRequisitionHService.cs index 66a40260..bcda549b 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpSparePartsRequisitionHService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpSparePartsRequisitionHService.cs @@ -1,19 +1,15 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; -using Microsoft.ClearScript.Util.Web; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr @@ -24,7 +20,7 @@ namespace Tnb.EquipMgr [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleId)] - public class EqpSparePartsRequisitionHService : IEqpSparePartsRequisitionHService, IOverideVisualDevService,IDynamicApiController, ITransient + public class EqpSparePartsRequisitionHService : IEqpSparePartsRequisitionHService, IOverideVisualDevService, IDynamicApiController, ITransient { private const string ModuleId = "27338205223957"; private readonly ISqlSugarRepository _repository; @@ -32,7 +28,7 @@ namespace Tnb.EquipMgr private readonly IRunService _runService; private readonly IUserManager _userManager; private readonly IBillRullService _billRuleService; - + public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public EqpSparePartsRequisitionHService(ISqlSugarRepository repository, @@ -43,12 +39,12 @@ namespace Tnb.EquipMgr { _repository = repository; _visualDevService = visualDevService; - _runService = runService; + _runService = runService; _userManager = userManager; _billRuleService = billRuleService; OverideFuncs.CreateAsync = Create; } - + private async Task Create(VisualDevModelDataCrInput input) { var db = _repository.AsSugarClient(); @@ -73,15 +69,15 @@ namespace Tnb.EquipMgr if (input.data.TryGetValue("tablefield120", out var value)) { - var details = value.ToObject>>(); + var details = value.ToObject>>(); List eqpSparePartsList = new List(); - List eqpSparePartsRequisitionDs = new List(){}; + List eqpSparePartsRequisitionDs = new List() { }; foreach (var detail in details) { string instockDetailId = detail.ContainsKey("instock_detail_id") ? detail["instock_detail_id"] : ""; string sparePartsId = detail.ContainsKey("spare_parts_id") ? detail["spare_parts_id"] : ""; int quantity = Convert.ToInt32(detail.ContainsKey("quantity") ? detail["quantity"] : ""); - + eqpSparePartsRequisitionDs.Add(new EqpSparePartsRequisitionD { instock_detail_id = instockDetailId, @@ -90,7 +86,7 @@ namespace Tnb.EquipMgr equip_id = eqpSparePartsRequisitionH.equip_id, spare_parts_requisition_id = eqpSparePartsRequisitionH.id, }); - + if (await db.Queryable() .AnyAsync(x => x.id == instockDetailId && (x.quantity - x.use_quantity - quantity) >= 0)) { @@ -111,7 +107,7 @@ namespace Tnb.EquipMgr { throw new Exception("库存不够"); } - + } if (eqpSparePartsRequisitionDs.Count > 0) @@ -124,7 +120,7 @@ namespace Tnb.EquipMgr await db.Insertable(eqpSparePartsList).ExecuteCommandAsync(); } } - + }); if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); diff --git a/EquipMgr/Tnb.EquipMgr/EqpSpotInsTemService.cs b/EquipMgr/Tnb.EquipMgr/EqpSpotInsTemService.cs index f3036cb7..50fa264a 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpSpotInsTemService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpSpotInsTemService.cs @@ -4,12 +4,11 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.EquipMgr.Interfaces; using Tnb.EquipMgr.Entities.Dto; +using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr { @@ -38,10 +37,10 @@ namespace Tnb.EquipMgr public async Task Publish(SpotInsTemPublishInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { EqpSpotInsTemH eqpSpotInsTemH = await _repository.GetSingleAsync(x => x.id == input.id); - List eqpSpotInsTemDs = await db.Queryable().Where(x=>x.spot_ins_tem_id==input.id).ToListAsync(); + List eqpSpotInsTemDs = await db.Queryable().Where(x => x.spot_ins_tem_id == input.id).ToListAsync(); if (input.equipIds != null && input.equipIds.Length > 0) { @@ -55,7 +54,7 @@ namespace Tnb.EquipMgr { id = id, code = code, - name = eqpSpotInsTemH.name+equipId, + name = eqpSpotInsTemH.name + equipId, plan_cycle = eqpSpotInsTemH.plan_cycle, plan_cycle_unit = eqpSpotInsTemH.plan_cycle_unit, plan_run_notice = eqpSpotInsTemH.plan_run_notice, @@ -93,26 +92,26 @@ namespace Tnb.EquipMgr } EqpSpotInsTemEquipH oldSpotInsTemEquipH = await db.Queryable().Where(x => x.spot_ins_tem_id == input.id && x.equip_id == equipId).FirstAsync(); - await db.Deleteable().Where(x => x.spot_ins_tem_id == input.id && x.equip_id==equipId).ExecuteCommandAsync(); - if(oldSpotInsTemEquipH!=null) - await db.Deleteable().Where(x => x.spot_ins_tem_equip_id==oldSpotInsTemEquipH.id).ExecuteCommandAsync(); + await db.Deleteable().Where(x => x.spot_ins_tem_id == input.id && x.equip_id == equipId).ExecuteCommandAsync(); + if (oldSpotInsTemEquipH != null) + await db.Deleteable().Where(x => x.spot_ins_tem_equip_id == oldSpotInsTemEquipH.id).ExecuteCommandAsync(); } if (insertEqpSpotInsTemEquipHs != null && insertEqpSpotInsTemEquipHs.Count > 0) { await db.Insertable(insertEqpSpotInsTemEquipHs).ExecuteCommandAsync(); } - + if (insertEqpSpotInsTemEquipDs != null && insertEqpSpotInsTemEquipDs.Count > 0) { await db.Insertable(insertEqpSpotInsTemEquipDs).ExecuteCommandAsync(); } - + } }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "发布成功" : result.ErrorMessage; } } diff --git a/EquipMgr/Tnb.EquipMgr/EqpSubEquipService.cs b/EquipMgr/Tnb.EquipMgr/EqpSubEquipService.cs index 276ab5a1..7c278cd1 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpSubEquipService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpSubEquipService.cs @@ -39,23 +39,23 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a, b) => a.create_id == b.Id) - .LeftJoin((a, b,c) => a.modify_id == c.Id) - .LeftJoin((a, b,c,d) => a.equip_id == d.id) - .Where((a,b,c,d)=>a.equip_id==input.equip_id) - .WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>a.code.Contains(queryJson!["code"])) - .WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>a.name.Contains(queryJson!["name"])) - .Select((a, b, c,d) => new SubEquipQueryOutput + .LeftJoin((a, b) => a.create_id == b.Id) + .LeftJoin((a, b, c) => a.modify_id == c.Id) + .LeftJoin((a, b, c, d) => a.equip_id == d.id) + .Where((a, b, c, d) => a.equip_id == input.equip_id) + .WhereIF(queryJson != null && queryJson.ContainsKey("code"), (a, b, c, d) => a.code.Contains(queryJson!["code"])) + .WhereIF(queryJson != null && queryJson.ContainsKey("name"), (a, b, c, d) => a.name.Contains(queryJson!["name"])) + .Select((a, b, c, d) => new SubEquipQueryOutput { id = a.id, create_id = b.RealName, create_id_id = a.create_id, - create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"), - equip_id=d.name, - equip_id_id= a.equip_id, + create_time = a.create_time == null ? null : a.create_time.Value.ToString("yyyy-MM-dd"), + equip_id = d.name, + equip_id_id = a.equip_id, code = a.code, modify_id = c.RealName, - modify_time = a.modify_time==null ? null : a.modify_time.Value.ToString("yyyy-MM-dd"), + modify_time = a.modify_time == null ? null : a.modify_time.Value.ToString("yyyy-MM-dd"), name = a.name, org_id = a.org_id, specification = a.specification, diff --git a/EquipMgr/Tnb.EquipMgr/EqpTechnologyParameterService.cs b/EquipMgr/Tnb.EquipMgr/EqpTechnologyParameterService.cs index 22035383..115999e8 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpTechnologyParameterService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpTechnologyParameterService.cs @@ -32,20 +32,20 @@ namespace Tnb.EquipMgr { var db = _repository.AsSugarClient(); Dictionary? queryJson = new Dictionary(); - if (input!=null && !string.IsNullOrEmpty(input.queryJson)) + if (input != null && !string.IsNullOrEmpty(input.queryJson)) { queryJson = JsonConvert.DeserializeObject>(input?.queryJson ?? ""); } var result = await db.Queryable() - .WhereIF(input!=null,a=>a.equip_id==input!.equip_id) - .WhereIF(queryJson!=null && queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson!["name"])) + .WhereIF(input != null, a => a.equip_id == input!.equip_id) + .WhereIF(queryJson != null && queryJson.ContainsKey("name"), a => a.name.Contains(queryJson!["name"])) .Select(a => new EquipTechnologyParameterQueryOutput { id = a.id, name = a.name, definition = a.definition, remark = a.remark - }).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50)); + }).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); return PageResult.SqlSugarPageResult(result); } diff --git a/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs b/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs index 75ac0af0..750197da 100644 --- a/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs +++ b/EquipMgr/Tnb.EquipMgr/EqpWorkshopChangeLogService.cs @@ -6,7 +6,6 @@ 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; @@ -40,11 +39,11 @@ namespace Tnb.EquipMgr // 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) + .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 + .Select((a, b, c) => new EquipWorkshopChangeQueryOutput { id = a.id, old_workshop_id = b.FullName, @@ -52,8 +51,8 @@ namespace Tnb.EquipMgr 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)); + 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); } @@ -62,7 +61,7 @@ namespace Tnb.EquipMgr public async Task WorkshopChange(EquipWorkshopChangeInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { EqpEquipment eqpEquipment = await db.Queryable().SingleAsync(x => x.id == input.equip_id); @@ -88,7 +87,7 @@ namespace Tnb.EquipMgr }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "迁移成功" : result.ErrorMessage; } } diff --git a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs index b5ed35e9..dd80af65 100644 --- a/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquMaintainRecordService.cs @@ -1,5 +1,4 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Filter; using JNPF.Common.Security; @@ -9,7 +8,6 @@ using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; @@ -49,44 +47,45 @@ namespace Tnb.EquipMgr OverideFuncs.GetListAsync = GetList; // OverideFuncs.UpdateAsync = ExecuteSpotIns; } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); - Dictionary? queryJson = (input==null || string.IsNullOrEmpty(input.queryJson)) ? new Dictionary() : input.queryJson.ToObject>(); + Dictionary? queryJson = (input == null || string.IsNullOrEmpty(input.queryJson)) ? new Dictionary() : input.queryJson.ToObject>(); string equioInfo = queryJson.ContainsKey("query_info") ? (queryJson["query_info"].ToString() ?? "") : ""; string status = queryJson.ContainsKey("status") ? (queryJson["status"].ToString() ?? "") : ""; - DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; - DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; - + DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; + DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; + if (string.IsNullOrEmpty(input.sidx)) { input.sidx = "a.create_time"; input.sort = "desc"; - }else + } + else { input.sidx = "a." + input.sidx; } - - var list = await db.Queryable((a, b, c,d) => new object[] + + var list = await db.Queryable((a, b, c, d) => new object[] { JoinType.Left, a.equip_id == b.id, JoinType.Left, a.execute_user_id == c.Id, JoinType.Left, a.repeat_user_id == d.Id, }) - .WhereIF(!string.IsNullOrEmpty(status),(a,b,c)=>a.status==status) - .WhereIF(!string.IsNullOrEmpty(equioInfo),(a,b,c)=>b.code.Contains(equioInfo)|| b.name.Contains(equioInfo)) - .WhereIF(status=="3" && start_time!=null,a=>a.execute_time>=start_time) - .WhereIF(status=="3" && end_time!=null,a=>a.execute_time<=end_time) + .WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status) + .WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo)) + .WhereIF(status == "3" && start_time != null, a => a.execute_time >= start_time) + .WhereIF(status == "3" && end_time != null, a => a.execute_time <= end_time) .OrderBy($"{input.sidx} {input.sort}") - .Select((a, b, c,d) => new EqpMaintainRecordListOutput + .Select((a, b, c, d) => new EqpMaintainRecordListOutput { id = a.id, - equip_id = b.code+"/"+b.name, + equip_id = b.code + "/" + b.name, equip_id_id = a.equip_id, status = a.status, - result = a.result=="1" ? "合格" : "不合格", - repeat_result = a.repeat_result=="1" ? "合格" : "不合格", + result = a.result == "1" ? "合格" : "不合格", + repeat_result = a.repeat_result == "1" ? "合格" : "不合格", date_create_time = a.create_time, date_execute_time = a.execute_time, date_repeat_time = a.repeat_time, @@ -96,19 +95,19 @@ namespace Tnb.EquipMgr repeat_user_id_id = a.repeat_user_id, result_remark = a.result_remark, repeat_remark = a.repeat_remark, - date_last_execute_time = SqlFunc.Subqueryable().Where(x=>a.equip_id==x.equip_id && a.execute_time!=null).OrderByDesc(x=>x.execute_time).Select(x=>x.execute_time) + date_last_execute_time = SqlFunc.Subqueryable().Where(x => a.equip_id == x.equip_id && a.execute_time != null).OrderByDesc(x => x.execute_time).Select(x => x.execute_time) }) .Mapper(a => { - a.status = a.status=="1" ? "待执行" : a.status=="2" ? "待复核" : "已完成"; + a.status = a.status == "1" ? "待执行" : a.status == "2" ? "待复核" : "已完成"; a.create_time = a.date_create_time == null ? "" : a.date_create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); a.execute_time = a.date_execute_time == null ? "" : a.date_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); a.last_execute_time = a.date_last_execute_time == null ? "" : a.date_last_execute_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); }) .ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); - - return PageResult.SqlSugarPageResult(list); + + return PageResult.SqlSugarPageResult(list); } /// @@ -118,9 +117,9 @@ namespace Tnb.EquipMgr [HttpPost] public async Task ExecuteMaintain(SpotInsRecordExecuteInput input) { - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - EqpMaintainRecordH eqpSpotInsRecordH = _repository.GetSingle(x=>x.id==input.id); + EqpMaintainRecordH eqpSpotInsRecordH = _repository.GetSingle(x => x.id == input.id); string status = ""; if (eqpSpotInsRecordH.is_repeat == "1") { @@ -130,32 +129,32 @@ namespace Tnb.EquipMgr { status = SpotInsRecordExecutionStatus.COMPLETED; } - await _repository.UpdateAsync(x => new EqpMaintainRecordH() - { - result = input.result, - attachment = input.attachment, - result_remark = input.result_remark, - status = status, - execute_time = DateTime.Now, - execute_user_id = _userManager.UserId - }, x => x.id == input.id); + await _repository.UpdateAsync(x => new EqpMaintainRecordH() + { + result = input.result, + attachment = input.attachment, + result_remark = input.result_remark, + status = status, + execute_time = DateTime.Now, + execute_user_id = _userManager.UserId + }, x => x.id == input.id); + + if (input != null && input.details != null) + { + foreach (var item in input.details) + { + await _repository.AsSugarClient().Updateable() + .SetColumns(x => x.result == item["result"]) + .SetColumnsIF(item.ContainsKey("maintain_descrip"), x => x.maintain_descrip == item["maintain_descrip"]) + .Where(x => x.id == item["id"]) + .ExecuteCommandAsync(); + } + } - if (input != null && input.details != null) - { - foreach (var item in input.details) - { - await _repository.AsSugarClient().Updateable() - .SetColumns(x=>x.result==item["result"]) - .SetColumnsIF(item.ContainsKey("maintain_descrip"),x=>x.maintain_descrip==item["maintain_descrip"]) - .Where(x=>x.id==item["id"]) - .ExecuteCommandAsync(); - } - } - }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "执行成功" : result.ErrorMessage; } @@ -176,13 +175,14 @@ namespace Tnb.EquipMgr .Where((a, b) => a.EnCode == DictConst.EqpMaintainType) .Select((a, b) => new { - b.EnCode, b.FullName + b.EnCode, + b.FullName }) .MergeTable() .ToDictionaryAsync(it => it.EnCode, it => it.FullName); eqpSpotInsRecordDs.ForEach(x => { - x.maintain_type = typeDic.ContainsKey(x.maintain_type) ? typeDic[x.maintain_type]+"" : x.maintain_type; + x.maintain_type = typeDic.ContainsKey(x.maintain_type) ? typeDic[x.maintain_type] + "" : x.maintain_type; }); MaintainRecordRepeatOutput output = new MaintainRecordRepeatOutput() { @@ -213,7 +213,7 @@ namespace Tnb.EquipMgr foreach (var item in input.details) { await db.Updateable() - .SetColumnsIF(item.ContainsKey("repeat_descrip"),x => x.repeat_descrip == item["repeat_descrip"]) + .SetColumnsIF(item.ContainsKey("repeat_descrip"), x => x.repeat_descrip == item["repeat_descrip"]) .SetColumns(x => x.repeat_result == item["repeat_result"]) .Where(x => x.id == item["id"]).ExecuteCommandAsync(); } @@ -231,8 +231,8 @@ namespace Tnb.EquipMgr }, x => x.id == input.id); } }); - - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "复核成功" : result.ErrorMessage; } @@ -246,44 +246,44 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a,b)=>a.equip_id==b.id) - .LeftJoin((a,b,c)=>a.execute_user_id==c.Id) - .LeftJoin((a,b,c,d)=>a.repeat_user_id==d.Id) - .Where(a=>a.equip_id==input.equip_id) - .Select((a,b,c,d) => new EquipMaintainRecordQueryOutput + .LeftJoin((a, b) => a.equip_id == b.id) + .LeftJoin((a, b, c) => a.execute_user_id == c.Id) + .LeftJoin((a, b, c, d) => a.repeat_user_id == d.Id) + .Where(a => a.equip_id == input.equip_id) + .Select((a, b, c, d) => new EquipMaintainRecordQueryOutput { id = a.id, attachment = a.attachment, - create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), + create_time = a.create_time == null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), equip_id = b.code, equip_id_id = a.equip_id, repeat_remark = a.repeat_remark, - repeat_result = a.repeat_result=="1"?"合格":"不合格", - repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM), + repeat_result = a.repeat_result == "1" ? "合格" : "不合格", + repeat_time = a.repeat_time == null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM), repeat_user_id = d.RealName, - result = a.result=="1"?"合格":"不合格", + result = a.result == "1" ? "合格" : "不合格", result_remark = a.result_remark, maintain_tem_equip_id = a.maintain_tem_equip_id, - execute_time = a.execute_time==null ? null : a.execute_time.Value.ToString(DbTimeFormat.MM), + execute_time = a.execute_time == null ? null : a.execute_time.Value.ToString(DbTimeFormat.MM), execute_user_id = c.RealName, status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("") }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - + /// /// 根据id获取保养相关信息 /// /// [HttpPost] - public async Task GetEqpMaintainRecordInfoById(Dictionary dic) + public async Task GetEqpMaintainRecordInfoById(Dictionary dic) { string id = dic.ContainsKey("id") ? dic["id"] : ""; if (string.IsNullOrEmpty(id)) return null; var db = _repository.AsSugarClient(); return await db.Queryable() - .LeftJoin((a, b) => a.equip_id==b.id) + .LeftJoin((a, b) => a.equip_id == b.id) .Where((a, b) => a.id == id) .Select((a, b) => new { @@ -291,7 +291,7 @@ namespace Tnb.EquipMgr equip_id = a.equip_id, equip_code = b.code, equip_name = b.name, - create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), result_remark = a.result_remark, result = a.result, status = a.status, diff --git a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs index ec2b381f..3b0ffce9 100644 --- a/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquSpotInsRecordService.cs @@ -1,5 +1,4 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Filter; using JNPF.Common.Security; @@ -8,18 +7,15 @@ using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; -using Tnb.BasicData.Entities; -using Tnb.BasicData.Entities.Dto; +using Tnb.BasicData; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Tnb.BasicData; namespace Tnb.EquipMgr { @@ -54,11 +50,11 @@ namespace Tnb.EquipMgr private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); - Dictionary? queryJson = (input==null || string.IsNullOrEmpty(input.queryJson)) ? new Dictionary() : input.queryJson.ToObject>(); + Dictionary? queryJson = (input == null || string.IsNullOrEmpty(input.queryJson)) ? new Dictionary() : input.queryJson.ToObject>(); string equioInfo = queryJson.ContainsKey("query_info") ? (queryJson["query_info"].ToString() ?? "") : ""; string status = queryJson.ContainsKey("status") ? (queryJson["status"].ToString() ?? "") : ""; - DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; - DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; + DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; + DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; string now = DateTime.Now.ToString("yyyy-MM-dd"); if (string.IsNullOrEmpty(input.sidx)) { @@ -69,27 +65,27 @@ namespace Tnb.EquipMgr { input.sidx = "a." + input.sidx; } - - var list = await db.Queryable((a, b, c,d) => new object[] + + var list = await db.Queryable((a, b, c, d) => new object[] { JoinType.Left, a.equip_id == b.id, JoinType.Left, a.spot_record_user_id == c.Id, JoinType.Left, a.repeat_user_id == d.Id, }) - .WhereIF(!string.IsNullOrEmpty(status),(a,b,c)=>a.status==status) - .WhereIF(!string.IsNullOrEmpty(equioInfo),(a,b,c)=>b.code.Contains(equioInfo)|| b.name.Contains(equioInfo)) - .WhereIF(status=="3" && start_time!=null,a=>a.spot_record_date_time>=start_time) - .WhereIF(status=="3" && end_time!=null,a=>a.spot_record_date_time<=end_time) - .Where(a=>a.create_time.Value.ToString("yyyy-MM-dd")==now) + .WhereIF(!string.IsNullOrEmpty(status), (a, b, c) => a.status == status) + .WhereIF(!string.IsNullOrEmpty(equioInfo), (a, b, c) => b.code.Contains(equioInfo) || b.name.Contains(equioInfo)) + .WhereIF(status == "3" && start_time != null, a => a.spot_record_date_time >= start_time) + .WhereIF(status == "3" && end_time != null, a => a.spot_record_date_time <= end_time) + .Where(a => a.create_time.Value.ToString("yyyy-MM-dd") == now) .OrderBy($"{input.sidx} {input.sort}") - .Select((a, b, c,d) => new EqpSpotInsRecordListOutput + .Select((a, b, c, d) => new EqpSpotInsRecordListOutput { id = a.id, - equip_id = b.code+"/"+b.name, + equip_id = b.code + "/" + b.name, equip_id_id = a.equip_id, status = a.status, - result = a.result=="1" ? "合格" : "不合格", - repeat_result = a.repeat_result=="1" ? "合格" : "不合格", + result = a.result == "1" ? "合格" : "不合格", + repeat_result = a.repeat_result == "1" ? "合格" : "不合格", date_create_time = a.create_time, date_spot_record_date_time = a.spot_record_date_time, date_repeat_time = a.repeat_time, @@ -100,14 +96,14 @@ namespace Tnb.EquipMgr }) .Mapper(a => { - a.status = a.status=="1" ? "待执行" : a.status=="2" ? "待复核" : "已完成"; + a.status = a.status == "1" ? "待执行" : a.status == "2" ? "待复核" : "已完成"; a.create_time = a.date_create_time == null ? "" : a.date_create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); a.spot_record_date_time = a.date_spot_record_date_time == null ? "" : a.date_spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); a.repeat_time = a.date_repeat_time == null ? "" : a.date_repeat_time.Value.ToString("yyyy-MM-dd HH:mm:ss"); }) .ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50)); - - return PageResult.SqlSugarPageResult(list); + + return PageResult.SqlSugarPageResult(list); } /// @@ -117,10 +113,10 @@ namespace Tnb.EquipMgr [HttpPost] public async Task ExecuteSpotIns(SpotInsRecordExecuteInput input) { - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - EqpSpotInsRecordH eqpSpotInsRecordH = _repository.GetSingle(x=>x.id==input.id); - + EqpSpotInsRecordH eqpSpotInsRecordH = _repository.GetSingle(x => x.id == input.id); + string status = ""; if (eqpSpotInsRecordH.is_repeat == "1") { @@ -130,32 +126,32 @@ namespace Tnb.EquipMgr { status = SpotInsRecordExecutionStatus.COMPLETED; } - await _repository.UpdateAsync(x => new EqpSpotInsRecordH() - { - result = input.result, - attachment = input.attachment, - result_remark = input.result_remark, - status = status, - spot_record_date_time = DateTime.Now, - spot_record_user_id = _userManager.UserId - }, x => x.id == input.id); + await _repository.UpdateAsync(x => new EqpSpotInsRecordH() + { + result = input.result, + attachment = input.attachment, + result_remark = input.result_remark, + status = status, + spot_record_date_time = DateTime.Now, + spot_record_user_id = _userManager.UserId + }, x => x.id == input.id); + + if (input != null && input.details != null) + { + foreach (var item in input.details) + { + await _repository.AsSugarClient().Updateable(). + SetColumns(x => x.result == item["result"]) + .SetColumnsIF(item["judge_type"] == "1", x => x.real_value == Convert.ToDouble(item["real_value"])) + .Where(x => x.id == item["id"]) + .ExecuteCommandAsync(); + } + } - if(input!=null && input.details!=null) - { - foreach (var item in input.details) - { - await _repository.AsSugarClient().Updateable(). - SetColumns(x=>x.result==item["result"]) - .SetColumnsIF(item["judge_type"]=="1",x=>x.real_value==Convert.ToDouble(item["real_value"])) - .Where(x=>x.id==item["id"]) - .ExecuteCommandAsync(); - } - } - }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "执行成功" : result.ErrorMessage; } @@ -211,41 +207,41 @@ namespace Tnb.EquipMgr queryJson = JsonConvert.DeserializeObject>(input.queryJson); } var result = await db.Queryable() - .LeftJoin((a,b)=>a.repeat_user_id==b.Id) - .Where(a=>a.equip_id==input.equip_id) - .Select((a,b) => new EquipSpotInsRecordQueryOutput + .LeftJoin((a, b) => a.repeat_user_id == b.Id) + .Where(a => a.equip_id == input.equip_id) + .Select((a, b) => new EquipSpotInsRecordQueryOutput { id = a.id, attachment = a.attachment, - create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), + create_time = a.create_time == null ? null : a.create_time.Value.ToString(DbTimeFormat.MM), equip_id = a.equip_id, repeat_remark = a.repeat_remark, - repeat_result = a.repeat_result=="1"?"合格":"不合格", - repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM), + repeat_result = a.repeat_result == "1" ? "合格" : "不合格", + repeat_time = a.repeat_time == null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM), repeat_user_id = b.RealName, - result = a.result=="1"?"合格":"不合格", + result = a.result == "1" ? "合格" : "不合格", result_remark = a.result_remark, spot_ins_tem_equip_id = a.spot_ins_tem_equip_id, - spot_record_date_time = a.spot_record_date_time==null ? null :a.spot_record_date_time.Value.ToString(DbTimeFormat.MM), + spot_record_date_time = a.spot_record_date_time == null ? null : a.spot_record_date_time.Value.ToString(DbTimeFormat.MM), spot_record_user_id = a.spot_record_user_id, status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("") }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - + /// /// 根据id获取点巡检相关信息 /// /// [HttpPost] - public async Task GetEqpSpotInsRecordInfoById(Dictionary dic) + public async Task GetEqpSpotInsRecordInfoById(Dictionary dic) { string id = dic.ContainsKey("id") ? dic["id"] : ""; if (string.IsNullOrEmpty(id)) return null; var db = _repository.AsSugarClient(); return await db.Queryable() - .LeftJoin((a, b) => a.equip_id==b.id) + .LeftJoin((a, b) => a.equip_id == b.id) .Where((a, b) => a.id == id) .Select((a, b) => new { @@ -253,7 +249,7 @@ namespace Tnb.EquipMgr equip_id = a.equip_id, equip_code = b.code, equip_name = b.name, - create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), result_remark = a.result_remark, result = a.result, status = a.status, diff --git a/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs b/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs index b4ff4caa..edc3b02b 100644 --- a/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquSpotInsTemEquipService.cs @@ -1,12 +1,11 @@ using JNPF.Common.Enums; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.EquipMgr.Interfaces; using Tnb.EquipMgr.Entities; +using Tnb.EquipMgr.Interfaces; namespace Tnb.EquipMgr { @@ -15,7 +14,7 @@ namespace Tnb.EquipMgr /// [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] - public class EquSpotInsTemEquipService : IEquSpotInsTemEquipService, IDynamicApiController, ITransient + public class EquSpotInsTemEquipService : IEquSpotInsTemEquipService, IDynamicApiController, ITransient { private readonly ISqlSugarRepository _repository; @@ -28,7 +27,7 @@ namespace Tnb.EquipMgr public async Task Stop(Dictionary parameters) { string id = parameters["id"]; - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.UpdateAsync(x => new EqpSpotInsTemEquipH() { @@ -39,13 +38,13 @@ namespace Tnb.EquipMgr .Select(x => x.id).ToListAsync(); await _repository.AsSugarClient().Deleteable() .Where(x => x.spot_ins_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED).ExecuteCommandAsync(); - + await _repository.AsSugarClient().Deleteable() .Where(x => ids.Contains(x.spot_ins_record_id)).ExecuteCommandAsync(); }); - - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); } } } \ No newline at end of file diff --git a/EquipMgr/Tnb.EquipMgr/EquipmentService.cs b/EquipMgr/Tnb.EquipMgr/EquipmentService.cs index 3ca12c85..c8392d9c 100644 --- a/EquipMgr/Tnb.EquipMgr/EquipmentService.cs +++ b/EquipMgr/Tnb.EquipMgr/EquipmentService.cs @@ -1,28 +1,21 @@ -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Filter; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.FriendlyException; -using JNPF.Logging; using JNPF.Systems.Entitys.Permission; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; -using Senparc.NeuChar.ApiHandlers; using SqlSugar; using Tnb.BasicData; +using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Tnb.BasicData.Entities; namespace Tnb.EquipMgr { @@ -75,7 +68,7 @@ namespace Tnb.EquipMgr id = it.id, eqp_code = it.code, eqp_name = it.name, - eqp_type_code = SqlFunc.Subqueryable().Where(x=>x.id == it.equip_type_id).Select(x=>x.code), + eqp_type_code = SqlFunc.Subqueryable().Where(x => x.id == it.equip_type_id).Select(x => x.code), //accept_status = it.accept_status, //supplier_code = it.supplier_code, install_date = it.install_date, @@ -86,7 +79,7 @@ namespace Tnb.EquipMgr .ToPagedListAsync(input.currentPage, input.pageSize); return pagedList; } - + private async Task Create(VisualDevModelDataCrInput visualDevModelDataCrInput) { string qrcode = visualDevModelDataCrInput.data.ContainsKey("qrcode") ? visualDevModelDataCrInput.data["qrcode"]?.ToString() : ""; @@ -98,7 +91,7 @@ namespace Tnb.EquipMgr { VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); await _runService.Create(templateEntity, visualDevModelDataCrInput); - + string equipId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? ""; if (!string.IsNullOrEmpty(qrcode)) @@ -117,18 +110,18 @@ namespace Tnb.EquipMgr } return await Task.FromResult(true); } - - private async Task Update(string id,VisualDevModelDataUpInput visualDevModelDataUpInput) + + private async Task Update(string id, VisualDevModelDataUpInput visualDevModelDataUpInput) { string qrcode = visualDevModelDataUpInput.data.ContainsKey("qrcode") ? visualDevModelDataUpInput.data["qrcode"]?.ToString() : ""; - if (!string.IsNullOrEmpty(qrcode) && await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == visualDevModelDataUpInput.data["qrcode"] && x.source_id!=id)) + if (!string.IsNullOrEmpty(qrcode) && await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == visualDevModelDataUpInput.data["qrcode"] && x.source_id != id)) { throw Oops.Bah("二维码总表中已存在该二维码"); } else { VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); - await _runService.Update(id,templateEntity, visualDevModelDataUpInput); + await _runService.Update(id, templateEntity, visualDevModelDataUpInput); if (!string.IsNullOrEmpty(qrcode)) { @@ -157,7 +150,7 @@ namespace Tnb.EquipMgr } [HttpPost] - public async Task GetEntityById(Dictionary dic) + public async Task GetEntityById(Dictionary dic) { string id = dic["id"]; return await _repository.GetSingleAsync(x => x.id == id); @@ -173,24 +166,24 @@ namespace Tnb.EquipMgr } [HttpPost] - public async Task GetWorklineAndEquipTree(Dictionary dic) + public async Task GetWorklineAndEquipTree(Dictionary dic) { string equipTypes = dic.ContainsKey("equipTypes") ? dic["equipTypes"] : ""; var db = _repository.AsSugarClient(); var queryable1 = db.Queryable() - .Where((a) => a.DeleteMark == null && a.Category==DictConst.RegionCategoryWorkshopCode) + .Where((a) => a.DeleteMark == null && a.Category == DictConst.RegionCategoryWorkshopCode) .Select((a) => new WorklineAndEquipTreeOutput() { id = a.Id, - title = a.EnCode+"/"+a.FullName, + title = a.EnCode + "/" + a.FullName, parentId = "0", - hasChildren = SqlFunc.Subqueryable().Where(b=>b.ParentId==a.Id && b.DeleteMark==null && b.Category==DictConst.RegionCategoryWorklineCode).Any(), - num = SqlFunc.Subqueryable().Where(b=>b.ParentId==a.Id && b.DeleteMark==null && b.Category==DictConst.RegionCategoryWorklineCode).Count(), + hasChildren = SqlFunc.Subqueryable().Where(b => b.ParentId == a.Id && b.DeleteMark == null && b.Category == DictConst.RegionCategoryWorklineCode).Any(), + num = SqlFunc.Subqueryable().Where(b => b.ParentId == a.Id && b.DeleteMark == null && b.Category == DictConst.RegionCategoryWorklineCode).Count(), isLeaf = false, - children = SqlFunc.Subqueryable().Where(b=>b.ParentId==a.Id && b.DeleteMark==null && b.Category==DictConst.RegionCategoryWorklineCode).ToList(b=>new WorklineAndEquipTreeOutput() + children = SqlFunc.Subqueryable().Where(b => b.ParentId == a.Id && b.DeleteMark == null && b.Category == DictConst.RegionCategoryWorklineCode).ToList(b => new WorklineAndEquipTreeOutput() { id = b.Id, - title = b.EnCode+"/"+b.FullName, + title = b.EnCode + "/" + b.FullName, parentId = b.ParentId, hasChildren = false, num = 0, @@ -209,31 +202,31 @@ namespace Tnb.EquipMgr id = a.id, title = a.name, parentId = "0", - hasChildren = SqlFunc.Subqueryable().Where(b=>b.equip_type_id==a.id).Any(), - num = SqlFunc.Subqueryable().Where(b=>b.equip_type_id==a.id).Count(), + hasChildren = SqlFunc.Subqueryable().Where(b => b.equip_type_id == a.id).Any(), + num = SqlFunc.Subqueryable().Where(b => b.equip_type_id == a.id).Count(), isLeaf = false, - children = SqlFunc.Subqueryable().Where(b=>b.equip_type_id==a.id).ToList(b=>new WorklineAndEquipTreeOutput() + children = SqlFunc.Subqueryable().Where(b => b.equip_type_id == a.id).ToList(b => new WorklineAndEquipTreeOutput() { id = b.id, - title = b.code+"/"+b.name, + title = b.code + "/" + b.name, parentId = b.equip_type_id, hasChildren = false, num = 0, isLeaf = true, }) }).ToListAsync(); - + } // var list = await db.UnionAll(queryable1, queryable2).ToListAsync(); var list1 = await queryable1.ToListAsync(); list1.AddRange(list2); - return new AuthResponse(200, "", new Dictionary() + return new AuthResponse(200, "", new Dictionary() { ["list"] = list1, }); } - + [HttpPost] public async Task GetEntityByQrcode(Dictionary dic) { diff --git a/EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs b/EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs index 9fdee9cf..41082ee5 100644 --- a/EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs +++ b/EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.EquipMgr +namespace Tnb.EquipMgr { public class MoldMaintainBaseService { diff --git a/EquipMgr/Tnb.EquipMgr/Tnb.EquipMgr.csproj b/EquipMgr/Tnb.EquipMgr/Tnb.EquipMgr.csproj index bc0feb94..b5cf8e54 100644 --- a/EquipMgr/Tnb.EquipMgr/Tnb.EquipMgr.csproj +++ b/EquipMgr/Tnb.EquipMgr/Tnb.EquipMgr.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldHouseService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldHouseService.cs index f4c33e23..ccdbb9ca 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldHouseService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldHouseService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.ClayObject.Extensions; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.DynamicApiController; using Microsoft.AspNetCore.Mvc; using SqlSugar; diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldLocationService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldLocationService.cs index 465f1a23..8c68f022 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldLocationService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldLocationService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -26,7 +20,7 @@ namespace Tnb.EquipMgr [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleId)] - public class ToolMoldLocationService : IToolMoldLocationService,IOverideVisualDevService, IDynamicApiController, ITransient + public class ToolMoldLocationService : IToolMoldLocationService, IOverideVisualDevService, IDynamicApiController, ITransient { public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); private const string ModuleId = "27207685649173"; @@ -50,7 +44,7 @@ namespace Tnb.EquipMgr { return await _db.Queryable().ToDictionaryAsync(x => x.id, x => x.location_code); } - + private async Task Create(VisualDevModelDataCrInput visualDevModelDataCrInput) { string qrcode = visualDevModelDataCrInput.data.ContainsKey("qrcode") ? visualDevModelDataCrInput.data["qrcode"].ToString() : ""; @@ -62,7 +56,7 @@ namespace Tnb.EquipMgr { VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); await _runService.Create(templateEntity, visualDevModelDataCrInput); - + string id = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? ""; if (!string.IsNullOrEmpty(qrcode)) @@ -81,18 +75,18 @@ namespace Tnb.EquipMgr } return await Task.FromResult(true); } - - private async Task Update(string id,VisualDevModelDataUpInput visualDevModelDataUpInput) + + private async Task Update(string id, VisualDevModelDataUpInput visualDevModelDataUpInput) { string qrcode = visualDevModelDataUpInput.data.ContainsKey("qrcode") ? visualDevModelDataUpInput.data["qrcode"].ToString() : ""; - if (!string.IsNullOrEmpty(qrcode) && await _db.Queryable().AnyAsync(x => x.code == visualDevModelDataUpInput.data["qrcode"] && x.source_id!=id)) + if (!string.IsNullOrEmpty(qrcode) && await _db.Queryable().AnyAsync(x => x.code == visualDevModelDataUpInput.data["qrcode"] && x.source_id != id)) { throw Oops.Bah("二维码总表中已存在该二维码"); } else { VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); - await _runService.Update(id,templateEntity, visualDevModelDataUpInput); + await _runService.Update(id, templateEntity, visualDevModelDataUpInput); if (!string.IsNullOrEmpty(qrcode)) { diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs index efb856da..dfe67409 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs @@ -1,26 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; -using JNPF.Common.Security; +using System.Linq.Expressions; +using JNPF.Common.Contracts; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.FriendlyException; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using JNPF.Common.Contracts; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Senparc.Weixin.MP.AdvancedAPIs.GroupMessage; -using Aop.Api.Domain; namespace Tnb.EquipMgr { diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainPlanService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainPlanService.cs index 016c0aca..5f137ba9 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainPlanService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainPlanService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -14,7 +8,6 @@ using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; using Microsoft.AspNetCore.Mvc; -using Spire.Pdf.Widget; using SqlSugar; using Tnb.BasicData; using Tnb.EquipMgr.Entities; diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs index 1df9f805..a1be51ba 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs @@ -1,14 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Reactive; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Security; @@ -21,15 +11,10 @@ using JNPF.TaskScheduler; using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis.CSharp.Syntax; using SqlSugar; using Tnb.BasicData; -using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; @@ -44,7 +29,7 @@ namespace Tnb.EquipMgr [OverideVisualDev(ModuleId)] public class ToolMoldMaintainRuleService : IOverideVisualDevService, IToolMoldMaintainRuleService, IDynamicApiController, ITransient { - + private const string ModuleId = "26164864904981"; private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; @@ -74,13 +59,13 @@ namespace Tnb.EquipMgr toolMoldMaintainRule.cycle = cycle; toolMoldMaintainRule.startandend_date = startTime.ToString("yyyy-MM-dd HH:mm:ss"); toolMoldMaintainRule.create_id = _userManager.UserId; - toolMoldMaintainRule.create_time=DateTime.Now; + toolMoldMaintainRule.create_time = DateTime.Now; await _db.Insertable(toolMoldMaintainRule).ExecuteCommandAsync(); if (toolMoldMaintainRule.mode == "27118635748885") { string id = toolMoldMaintainRule.id; var comtentModel = new ContentModel(); - comtentModel.cron = "0 0 9 "+ startTime.Day + "/"+ toolMoldMaintainRule.cycle + " * ?"; + comtentModel.cron = "0 0 9 " + startTime.Day + "/" + toolMoldMaintainRule.cycle + " * ?"; comtentModel.interfaceId = ""; comtentModel.interfaceName = ""; comtentModel.parameter = new List(); diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs index 0bb50b4c..f7de66d7 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRunService.cs @@ -1,18 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Numerics; -using System.Reactive.Joins; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using Aspose.Words; -using DingTalk.Api.Request; +using System.Dynamic; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; -using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -21,9 +9,7 @@ using JNPF.Logging; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; using SqlSugar; using StackExchange.Profiling.Internal; using Tnb.BasicData; @@ -65,13 +51,13 @@ namespace Tnb.EquipMgr var planMoldRelations = await _db.Queryable() .LeftJoin((a, b) => a.maintain_plan_id == b.id)//ToolMoldMaintainPlan .LeftJoin((a, b, c) => a.mold_id == c.id) - .LeftJoin((a, b, c,d) => d.plan_code == b.plan_code&&d.mold_code==c.mold_code) + .LeftJoin((a, b, c, d) => d.plan_code == b.plan_code && d.mold_code == c.mold_code) .Where(a => a.maintain_plan_id == planId) - .Select((a, b, c,d) => new + .Select((a, b, c, d) => new { mold_id = a.mold_id, plan_start_time = d.plan_start_time, - designer=d.designer + designer = d.designer }) .ToListAsync(); var moldids = planMoldRelations.Select(x => x.mold_id).ToList(); @@ -117,7 +103,7 @@ namespace Tnb.EquipMgr var dic = await _db.Queryable().Where(p => p.DictionaryTypeId == "26149299883285").ToListAsync(); var users = await _db.Queryable().ToListAsync(); var records = _db.Queryable().ToList(); - var runrecords = _db.Queryable().ToList(); + var runrecords = _db.Queryable().ToList(); foreach (var plan in plans) { var planMoldRelations = await _db.Queryable() @@ -154,14 +140,14 @@ namespace Tnb.EquipMgr info.maintain_qty = mold.maintain_qty; info.plan_start_time = plan.plan_start_date == null ? "" : ((DateTime)plan.plan_start_date!).ToString("yyyy-MM-dd"); info.createtime = plan.create_time == null ? "" : ((DateTime)plan.create_time).ToString("yyyy-MM-dd"); - info.status = records.Where(p=>p.mold_id== mold.id&&p.plan_id== plan.id).Any()? "已完成" : "待保养";//plan.status == "UnMaintain" ? "待保养" : "已完成"; + info.status = records.Where(p => p.mold_id == mold.id && p.plan_id == plan.id).Any() ? "已完成" : "待保养";//plan.status == "UnMaintain" ? "待保养" : "已完成"; info.createuser = string.IsNullOrEmpty(plan.create_id) ? "" : users.Where(p => p.Id == plan.create_id).First().RealName; info.plan_id = plan.id; info.starttime = ""; if (runrecords.Where(p => p.mold_code == mold.mold_code && p.plan_code == plan.plan_code).Any()) { var run = runrecords.Where(p => p.mold_code == mold.mold_code && p.plan_code == plan.plan_code).First(); - info.starttime = run.plan_start_time!=null? ((DateTime)run.plan_start_time).ToString("yyyy-MM-dd") : ""; + info.starttime = run.plan_start_time != null ? ((DateTime)run.plan_start_time).ToString("yyyy-MM-dd") : ""; } var moldEqpRelation = ToolMoldsEquipments.Where(it => it.mold_id == mold.id).FirstOrDefault(); if (moldEqpRelation != null) @@ -203,13 +189,13 @@ namespace Tnb.EquipMgr input.sidx = "b." + input.sidx; } var records = await _db.Queryable().Select(p => p.plan_id + p.mold_id).ToListAsync(); - var result= await _db.Queryable() + var result = await _db.Queryable() .LeftJoin((a, b) => a.maintain_plan_id == b.id) .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => b.plan_code == d.plan_code && c.mold_code == d.mold_code) .LeftJoin((a, b, c, d, e) => e.plan_id == b.id && e.mold_id == c.id) .LeftJoin((a, b, c, d, e, f) => b.create_id == f.Id) - .LeftJoin((a, b, c, d, e, f,g) => c.mold_status == g.Id) + .LeftJoin((a, b, c, d, e, f, g) => c.mold_status == g.Id) .Where((a, b, c, d, e, f) => b.create_time != null) .WhereIF(!string.IsNullOrEmpty(input.maintain_info), (a, b, c, d, e, f, g) => c.mold_code!.Contains(input.maintain_info) || c.mold_name!.Contains(input.maintain_info)) .WhereIF(start_time != null, (a, b, c, d, e, f, g) => b.create_time != null && b.create_time >= start_time) @@ -222,7 +208,7 @@ namespace Tnb.EquipMgr mold_id = c.id, mold_code = c.mold_code!, mold_name = c.mold_name!, - mold_status=g.FullName!, + mold_status = g.FullName!, status = input.status, createuser = f.RealName, createtime = b.create_time == null ? "" : b.create_time.Value.ToString(DbTimeFormat.SS), @@ -276,7 +262,7 @@ namespace Tnb.EquipMgr }) .ToListAsync(); //新增功能 - var ToolMoldMaintainPlanRelation= _db.Queryable().Where((a) => a.maintain_plan_id == input.plan_id && a.mold_id == input.mold_id&& !string.IsNullOrEmpty(a.group_id)).First(); + var ToolMoldMaintainPlanRelation = _db.Queryable().Where((a) => a.maintain_plan_id == input.plan_id && a.mold_id == input.mold_id && !string.IsNullOrEmpty(a.group_id)).First(); if (ToolMoldMaintainPlanRelation != null) items = items.Where(a => a.item_group_id == ToolMoldMaintainPlanRelation.group_id).ToList(); var checkItems = await _db.Queryable().Where(it => it.plan_id == input.plan_id && it.mold_id == input.mold_id).Select(it => new @@ -315,10 +301,10 @@ namespace Tnb.EquipMgr public async Task MaintainStart(MoldMaintainRunUpInput input) { if (input == null) throw new ArgumentNullException("input"); - var flag= _db.Queryable() + var flag = _db.Queryable() .LeftJoin((a, b) => a.plan_code == b.plan_code) - .LeftJoin((a,b,c)=>a.mold_code==c.mold_code) - .Where((a,b,c)=>b.id== input.plan_id&&c.id==input.mold_id).Any(); + .LeftJoin((a, b, c) => a.mold_code == c.mold_code) + .Where((a, b, c) => b.id == input.plan_id && c.id == input.mold_id).Any(); if (flag) { return; @@ -348,13 +334,13 @@ namespace Tnb.EquipMgr record.designer_time = DateTime.Now; record.mold_code = mold.mold_code; record.mold_name = mold.mold_name; - record.plan_start_time = string.IsNullOrEmpty(input.starttime) ? DateTime.Now :DateTime.Parse(input.starttime); + record.plan_start_time = string.IsNullOrEmpty(input.starttime) ? DateTime.Now : DateTime.Parse(input.starttime); var row = await _db.Insertable(record).ExecuteCommandAsync(); if (row < 1) throw Oops.Oh(ErrorCode.COM1001); var groupids = _db.Queryable().Where(a => !string.IsNullOrEmpty(a.group_id) && a.mold_id == input.mold_id && a.maintain_plan_id == input.plan_id).ToList().Select(p => p.group_id); - + /* var maintainInfos = await _db.Queryable() .LeftJoin((a, b) => a.item_group_id == b.id) @@ -500,7 +486,7 @@ namespace Tnb.EquipMgr }).ToListAsync(); var dicCheckItems = checkItems.GroupBy(g => $"{g.plan_id}{g.mold_id}{g.item_group_id}{g.item_id}").ToDictionary(x => x.Key, x => x.FirstOrDefault()); var maintainedItems = items.Where(it => dicCheckItems.ContainsKey($"{it.plan_id}{it.mold_id}{it.item_group_id}{it.item_id}") && dicCheckItems[$"{it.plan_id}{it.mold_id}{it.item_group_id}{it.item_id}"] != null).ToList(); - if ((items?.Count > 0 && maintainedItems?.Count > 0 )|| (maintainedItems == null || maintainedItems.Count < 1)) + if ((items?.Count > 0 && maintainedItems?.Count > 0) || (maintainedItems == null || maintainedItems.Count < 1)) { if (maintainedItems.Count < items.Count || (maintainedItems == null || maintainedItems.Count < 1)) { diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainTaskService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainTaskService.cs index ad70afc4..a1a20167 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainTaskService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaintainTaskService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; +using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -15,9 +8,7 @@ using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging.Abstractions; using SqlSugar; -using Tnb.BasicData; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Entities.Enums; @@ -69,11 +60,11 @@ namespace Tnb.EquipMgr var pair = row[nameof(ToolMoldMaintainTask.mold_id)]; if (pair.IsNotEmptyOrNull()) { - if(_dicMold.TryGetValue(pair.ToString(),out var multi)) + if (_dicMold.TryGetValue(pair.ToString(), out var multi)) { row[nameof(ToolMoldMaintainTask.mold_id)] = $"{multi.code}/{multi.name}"; } - + } } } diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldMaterialService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldMaterialService.cs index 5020a9ee..c74f2413 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldMaterialService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldMaterialService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -33,13 +27,12 @@ namespace Tnb.EquipMgr /// /// 根据模具id获取物料集合 /// - /// /// [HttpPost] public async Task> GetMaterialLists(ToolMoldInput ToolMoldInput) { - var db = _repository.AsSugarClient(); - var list = await db.Queryable((a, b) => new object[] + ISqlSugarClient db = _repository.AsSugarClient(); + List list = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.id == b.material_id, }) @@ -49,7 +42,7 @@ namespace Tnb.EquipMgr id = a.id, code = a.code, name = a.name, - material_group=b.material_group, + material_group = b.material_group, real_cavity_qty = b.real_cavity_qty.HasValue ? b.real_cavity_qty.Value : 0 }).ToListAsync(); return list; @@ -57,105 +50,93 @@ namespace Tnb.EquipMgr /// /// 增加模具物料绑定 /// - /// - /// - /// + /// /// [HttpPost] public async Task SaveData(ToolMoldInput ToolMoldInput) { DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - var ToolMoldsProduct= await _repository.AsSugarClient().Queryable().Where(p=>p.mold_id== ToolMoldInput.mold&&p.material_id== ToolMoldInput.materialid).FirstAsync(); + ToolMoldsMaterial ToolMoldsProduct = await _repository.AsSugarClient().Queryable().Where(p => p.mold_id == ToolMoldInput.mold && p.material_id == ToolMoldInput.materialid).FirstAsync(); if (ToolMoldsProduct == null) { - var entity = new ToolMoldsMaterial(); - entity.id = SnowflakeIdHelper.NextId(); - entity.mold_id = ToolMoldInput.mold; - entity.material_id = ToolMoldInput.materialid; - entity.real_cavity_qty = ToolMoldInput.real_cavity_qty; - entity.create_time = DateTime.Now; - entity.create_id = _userManager.UserId; - await _repository.AsSugarClient().Insertable(entity).ExecuteCommandAsync(); + ToolMoldsMaterial entity = new() + { + id = SnowflakeIdHelper.NextId(), + mold_id = ToolMoldInput.mold, + material_id = ToolMoldInput.materialid, + real_cavity_qty = ToolMoldInput.real_cavity_qty, + create_time = DateTime.Now, + create_id = _userManager.UserId + }; + _ = await _repository.AsSugarClient().Insertable(entity).ExecuteCommandAsync(); } - else { - ToolMoldsProduct.real_cavity_qty= ToolMoldInput.real_cavity_qty; - await _repository.AsSugarClient().Updateable(ToolMoldsProduct).ExecuteCommandAsync(); + else + { + ToolMoldsProduct.real_cavity_qty = ToolMoldInput.real_cavity_qty; + _ = await _repository.AsSugarClient().Updateable(ToolMoldsProduct).ExecuteCommandAsync(); } - - + + }); - if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "保存成功" : result.ErrorMessage; - - + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "保存成功" : result.ErrorMessage); } /// /// 批量删除模具物料绑定 /// - /// - /// /// [HttpPost] public async Task DetachMoldData(ToolMoldInput ToolMoldInput) { DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - var arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); - await _repository.AsSugarClient().Deleteable(arr).ExecuteCommandAsync(); + List arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); + _ = await _repository.AsSugarClient().Deleteable(arr).ExecuteCommandAsync(); }); - if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "操作成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "操作成功" : result.ErrorMessage); } /// /// 物料同组 /// - /// - /// /// [HttpPost] public async Task SaveMaterialGroup(ToolMoldInput ToolMoldInput) { DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - var arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); - var sign = SnowflakeIdHelper.NextId(); + List arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); + string sign = SnowflakeIdHelper.NextId(); arr.ForEach(p => { p.material_group = sign; }); - await _repository.AsSugarClient().Updateable(arr).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Updateable(arr).ExecuteCommandAsync(); }); - if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "操作成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "操作成功" : result.ErrorMessage); } /// /// 取消物料同组 /// - /// - /// /// - public async Task CancelMaterialGroup(ToolMoldInput ToolMoldInput) + public async Task CancelMaterialGroup(ToolMoldInput ToolMoldInput) { DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - var arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); + List arr = _repository.AsSugarClient().Queryable().Where(x => x.mold_id == ToolMoldInput.mold && ToolMoldInput.materialids.Contains(x.material_id)).ToList(); arr.ForEach(p => { p.material_group = string.Empty; }); - await _repository.AsSugarClient().Updateable(arr).ExecuteCommandAsync(); + _ = await _repository.AsSugarClient().Updateable(arr).ExecuteCommandAsync(); }); - if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "操作成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "操作成功" : result.ErrorMessage); } /// /// 根据物料id获取模具集合 /// - /// /// [HttpPost] public async Task> GetMoldLists(ToolMoldInput ToolMoldInput) { - var db = _repository.AsSugarClient(); - var list = await db.Queryable((a, b) => new object[] + ISqlSugarClient db = _repository.AsSugarClient(); + List list = await db.Queryable((a, b) => new object[] { JoinType.Inner, a.id == b.mold_id, }) @@ -173,19 +154,17 @@ namespace Tnb.EquipMgr /// /// 批量删除物料模具绑定 /// - /// - /// + /// /// [HttpPost] public async Task DetachMaterialData(ToolMoldInput ToolMoldInput) { DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { - var arr = _repository.AsSugarClient().Queryable().Where(x => ToolMoldInput.molds.Contains(x.mold_id) && x.material_id == ToolMoldInput.materialid).ToList(); - await _repository.AsSugarClient().Deleteable(arr).ExecuteCommandAsync(); + List arr = _repository.AsSugarClient().Queryable().Where(x => ToolMoldInput.molds.Contains(x.mold_id) && x.material_id == ToolMoldInput.materialid).ToList(); + _ = await _repository.AsSugarClient().Deleteable(arr).ExecuteCommandAsync(); }); - if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); - return result.IsSuccess ? "操作成功" : result.ErrorMessage; + return !result.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result.IsSuccess ? "操作成功" : result.ErrorMessage); } } } diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs index e7cbfec5..a129d430 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldRequisitionService.cs @@ -1,7 +1,6 @@ using System.Dynamic; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; -using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -15,7 +14,6 @@ using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; @@ -57,42 +55,42 @@ namespace Tnb.EquipMgr string? requisitionCode = ""; DateTime[] requisitionTimeArr = null; DateTime[] estimatedReturnArr = null; - if (input!=null && !string.IsNullOrEmpty(input.queryJson)) + if (input != null && !string.IsNullOrEmpty(input.queryJson)) { queryJson = JsonConvert.DeserializeObject>(input?.queryJson ?? ""); } - + if (queryJson!.TryGetValue("requisition_code", out var value)) { requisitionCode = value.ToString(); } if (queryJson!.TryGetValue("requisition_time", out var value1)) { - requisitionTimeArr = value1.ToObject().Select(x=>DateTimeOffset.FromUnixTimeSeconds(x/1000).ToLocalTime().DateTime).ToArray(); + requisitionTimeArr = value1.ToObject().Select(x => DateTimeOffset.FromUnixTimeSeconds(x / 1000).ToLocalTime().DateTime).ToArray(); } if (queryJson!.TryGetValue("estimated_return_time", out var value2)) { - estimatedReturnArr = value2.ToObject().Select(x=>DateTimeOffset.FromUnixTimeSeconds(x/1000).ToLocalTime().DateTime).ToArray(); + estimatedReturnArr = value2.ToObject().Select(x => DateTimeOffset.FromUnixTimeSeconds(x / 1000).ToLocalTime().DateTime).ToArray(); } var result = await _db.Queryable() .LeftJoin((a, b) => a.mo_task_id == b.id) .LeftJoin((a, b, c) => a.equip_id == c.id) .LeftJoin((a, b, c, d) => a.recipient_id == d.Id) - .LeftJoin((a,b,c,d,e)=>a.mold_id==e.id) + .LeftJoin((a, b, c, d, e) => a.mold_id == e.id) .WhereIF(!string.IsNullOrEmpty(requisitionCode), (a, b, c, d) => a.code.Contains(requisitionCode)) - .WhereIF(requisitionTimeArr!=null, (a, b, c, d) => a.requisition_time>=requisitionTimeArr[0] && a.requisition_time<=requisitionTimeArr[1]) - .WhereIF(estimatedReturnArr!=null, (a, b, c, d) => a.estimated_return_time>=estimatedReturnArr[0] && a.estimated_return_time<=estimatedReturnArr[1]) - .Select((a, b, c, d,e) => new ToolMoldRequisitionListOutput + .WhereIF(requisitionTimeArr != null, (a, b, c, d) => a.requisition_time >= requisitionTimeArr[0] && a.requisition_time <= requisitionTimeArr[1]) + .WhereIF(estimatedReturnArr != null, (a, b, c, d) => a.estimated_return_time >= estimatedReturnArr[0] && a.estimated_return_time <= estimatedReturnArr[1]) + .Select((a, b, c, d, e) => new ToolMoldRequisitionListOutput { id = a.id, code = a.code, mold_id = e.mold_code, mo_task_id = b.mo_task_code, - equip_id = c.code+"/"+c.name, + equip_id = c.code + "/" + c.name, recipient_id = d.RealName, - estimated_return_time = a.estimated_return_time==null ? "" : a.estimated_return_time.Value.ToString("yyyy-MM-dd"), - requisition_time = a.requisition_time==null ? "" : a.requisition_time.Value.ToString("yyyy-MM-dd"), + estimated_return_time = a.estimated_return_time == null ? "" : a.estimated_return_time.Value.ToString("yyyy-MM-dd"), + requisition_time = a.requisition_time == null ? "" : a.requisition_time.Value.ToString("yyyy-MM-dd"), remark = a.remark }).ToPagedListAsync(input.currentPage, input.pageSize); @@ -127,8 +125,8 @@ namespace Tnb.EquipMgr List result = new(); var BasLocations = await _db.Queryable().ToListAsync(); var ToolMolds = await _db.Queryable() - .WhereIF(!string.IsNullOrEmpty(toolinput.keyword),p=>p.mold_code!.Contains(toolinput.keyword!)|| p.mold_name!.Contains(toolinput.keyword!)) - .WhereIF(!string.IsNullOrEmpty(toolinput.status), p => p.mold_status== dic.Where(p=>p.Value== toolinput.status).First().Key) + .WhereIF(!string.IsNullOrEmpty(toolinput.keyword), p => p.mold_code!.Contains(toolinput.keyword!) || p.mold_name!.Contains(toolinput.keyword!)) + .WhereIF(!string.IsNullOrEmpty(toolinput.status), p => p.mold_status == dic.Where(p => p.Value == toolinput.status).First().Key) .ToListAsync(); if (string.IsNullOrEmpty(toolinput.sort)) { @@ -138,12 +136,12 @@ namespace Tnb.EquipMgr foreach (var tool in ToolMolds) { dynamic info = new ExpandoObject(); - info.id=tool.id; - info.mold_code=tool.mold_code; + info.id = tool.id; + info.mold_code = tool.mold_code; info.mold_name = tool.mold_name; - info.mold_status= dic.Where(p=>p.Key==tool.mold_status).Any()? dic.Where(p => p.Key == tool.mold_status).First().Value:""; - info.warehosue_id=tool.warehosue_id; - info.location_id= BasLocations.Where(p => p.id == tool.location_id).Any() ? BasLocations.Where(p => p.id == tool.location_id).First().location_code : ""; + info.mold_status = dic.Where(p => p.Key == tool.mold_status).Any() ? dic.Where(p => p.Key == tool.mold_status).First().Value : ""; + info.warehosue_id = tool.warehosue_id; + info.location_id = BasLocations.Where(p => p.id == tool.location_id).Any() ? BasLocations.Where(p => p.id == tool.location_id).First().location_code : ""; result.Add(info); } return result; diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldReturnService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldReturnService.cs index 79e9a012..cbf274e4 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldReturnService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldReturnService.cs @@ -9,9 +9,7 @@ using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Tnb.ProductionMgr.Entities; namespace Tnb.EquipMgr { @@ -21,7 +19,7 @@ namespace Tnb.EquipMgr [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleId)] - public class ToolMoldReturnService : IOverideVisualDevService, IToolMoldReturnService,IDynamicApiController, ITransient + public class ToolMoldReturnService : IOverideVisualDevService, IToolMoldReturnService, IDynamicApiController, ITransient { private const string ModuleId = "27275901607701"; private readonly ISqlSugarClient _db; @@ -40,7 +38,7 @@ namespace Tnb.EquipMgr _visualDevService = visualDevService; OverideFuncs.CreateAsync = Create; } - + private async Task Create(VisualDevModelDataCrInput input) { DbResult result = await _db.Ado.UseTranAsync(async () => @@ -60,7 +58,7 @@ namespace Tnb.EquipMgr { await _db.Updateable() .SetColumns(x => x.mold_status == Tnb.BasicData.DictConst.ZKTypeId) - .SetColumnsIF(!string.IsNullOrEmpty(locationId),x=>x.location_id==locationId) + .SetColumnsIF(!string.IsNullOrEmpty(locationId), x => x.location_id == locationId) .Where(X => X.id == moldId).ExecuteCommandAsync(); } }); diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs index 6b010062..871b8345 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs @@ -1,15 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; -using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -17,15 +8,12 @@ using JNPF.FriendlyException; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula.Functions; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; -using Tnb.ProductionMgr.Entities.Dto; namespace Tnb.EquipMgr { /// diff --git a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs index 9b35fff1..96538916 100644 --- a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs +++ b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamOutput.cs @@ -3,9 +3,9 @@ namespace Tnb.PerMgr.Entities.Dto public class ProcessParamOutput { public string? name { get; set; } - + public decimal upper_value { get; set; } - + public decimal lower_value { get; set; } } } \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeChildrenOutput.cs b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeChildrenOutput.cs index d437adc9..6d8cc3f9 100644 --- a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeChildrenOutput.cs +++ b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeChildrenOutput.cs @@ -14,7 +14,7 @@ namespace Tnb.PerMgr.Entities.Dto public decimal? value { get; set; } public decimal upper_value { get; set; } public decimal lower_value { get; set; } - + public string? daq_id { get; set; } } } \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsD.cs b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsD.cs index d49222ac..0dd10a74 100644 --- a/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsD.cs +++ b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsD.cs @@ -18,7 +18,7 @@ public partial class PerProcessStandardsD : BaseEntity /// 工艺标准主表id /// public string process_standards_id { get; set; } = string.Empty; - + /// /// 工艺参数类型id /// @@ -43,7 +43,7 @@ public partial class PerProcessStandardsD : BaseEntity /// 下限 /// public decimal? lower_value { get; set; } - + /// /// 数据采集id /// diff --git a/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsH.cs b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsH.cs index 2c3cf474..7a33f8f7 100644 --- a/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsH.cs +++ b/PerMgr/Tnb.PerMgr.Entities/Entity/PerProcessStandardsH.cs @@ -103,7 +103,7 @@ public partial class PerProcessStandardsH : BaseEntity /// 流程引擎Id /// public string? f_flowid { get; set; } - + /// /// 成型周期 /// diff --git a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs index a4d98d0b..355c68c0 100644 --- a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs +++ b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamService.cs @@ -1,4 +1,3 @@ -using Microsoft.AspNetCore.Mvc; using Tnb.PerMgr.Entities.Dto; namespace Tnb.PerMgr.Interfaces @@ -10,7 +9,7 @@ namespace Tnb.PerMgr.Interfaces /// /// /// - public Task GetProcessParamInfo(Dictionary dic); + public Task GetProcessParamInfo(Dictionary dic); } } \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamTypeService.cs b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamTypeService.cs index 1b334363..ae5cc894 100644 --- a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamTypeService.cs +++ b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessParamTypeService.cs @@ -16,8 +16,8 @@ namespace Tnb.PerMgr.Interfaces /// /// public Task SaveData(List input); - - + + /// /// 根据id获取修改信息 /// diff --git a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessStandardsService.cs b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessStandardsService.cs index c3208c25..3076cc57 100644 --- a/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessStandardsService.cs +++ b/PerMgr/Tnb.PerMgr.Interfaces/IPerProcessStandardsService.cs @@ -10,12 +10,12 @@ namespace Tnb.PerMgr.Interfaces /// /// public Task ExportTemplate(); - - + + /// /// 导入 /// /// - public Task> Import(string id,ChunkModel input); + public Task> Import(string id, ChunkModel input); } } \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr/PerProcessParamService.cs b/PerMgr/Tnb.PerMgr/PerProcessParamService.cs index c0959d67..ab3f4b73 100644 --- a/PerMgr/Tnb.PerMgr/PerProcessParamService.cs +++ b/PerMgr/Tnb.PerMgr/PerProcessParamService.cs @@ -1,12 +1,7 @@ using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.FriendlyException; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using NPOI.SS.UserModel; -using NPOI.SS.Util; -using NPOI.XSSF.UserModel; using SqlSugar; using Tnb.PerMgr.Entities; using Tnb.PerMgr.Entities.Dto; @@ -23,13 +18,13 @@ namespace Tnb.PerMgr { private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; - + public PerProcessParamService(ISqlSugarRepository repository, IUserManager userManager) { _userManager = userManager; _repository = repository; } - + [HttpPost] public async Task GetProcessParamInfo(Dictionary dic) { diff --git a/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs b/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs index 92d612f2..39b798ad 100644 --- a/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs +++ b/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs @@ -22,7 +22,7 @@ namespace Tnb.PerMgr { private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; - + public PerProcessParamTypeService(ISqlSugarRepository repository, IUserManager userManager) { _userManager = userManager; @@ -40,27 +40,27 @@ namespace Tnb.PerMgr //List perProcessParamTypes = await _repository.GetListAsync(x => x.equip_type_id == equipTypeId); var result = await db.Queryable() .Where(x => x.equip_type_id == equipTypeId) - .OrderBy(x=>x.ordinal) + .OrderBy(x => x.ordinal) .Select(x => new { tab_id = x.id, tab_name = x.name, - daq_list = SqlFunc.Subqueryable().Where(a=>a.equip_id==equipId).ToList(a=>new ProcessParamTypeDaqListOutput + daq_list = SqlFunc.Subqueryable().Where(a => a.equip_id == equipId).ToList(a => new ProcessParamTypeDaqListOutput { id = a.id, label_name = a.label_name, }), children = SqlFunc.Subqueryable() - .LeftJoin((y,z)=>y.tolerance_category_id==z.id) - .Where(y=>y.process_param_type_id==x.id) - .OrderBy((y,z)=>y.ordinal) - .ToList((y,z)=>new ProcessParamTypeChildrenOutput - { - process_param_id = y.id, - name = y.name, - upper_value = z.upper_value, - lower_value = z.lower_value - }), + .LeftJoin((y, z) => y.tolerance_category_id == z.id) + .Where(y => y.process_param_type_id == x.id) + .OrderBy((y, z) => y.ordinal) + .ToList((y, z) => new ProcessParamTypeChildrenOutput + { + process_param_id = y.id, + name = y.name, + upper_value = z.upper_value, + lower_value = z.lower_value + }), }).ToListAsync(); @@ -105,10 +105,10 @@ namespace Tnb.PerMgr }; await db.Insertable(record).ExecuteCommandAsync(); } - + } - - if (item==null || string.IsNullOrEmpty(item.id)) + + if (item == null || string.IsNullOrEmpty(item.id)) { PerProcessStandardsD insertObj = new PerProcessStandardsD() { @@ -116,20 +116,20 @@ namespace Tnb.PerMgr process_param_id = item?.process_param_id ?? "", process_standards_id = item?.process_standards_id ?? "", process_param_type_id = item?.process_param_type_id ?? "", - daq_id = item?.daq_id??"", + daq_id = item?.daq_id ?? "", }; - + insertIds.Add(insertObj.id); await db.Insertable(insertObj).ExecuteCommandAsync(); } else { await db.Updateable() - .SetColumns(x=>x.value==item.value) - .SetColumns(x=>x.daq_id==item.daq_id) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.value == item.value) + .SetColumns(x => x.daq_id == item.daq_id) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } - + } List notDeleteIds = input.Select(x => x.id).ToList(); @@ -138,9 +138,9 @@ namespace Tnb.PerMgr } - + }); - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "保存成功" : result.ErrorMessage; } @@ -156,31 +156,31 @@ namespace Tnb.PerMgr var result = await db.Queryable() .Where(a => a.equip_type_id == equipTypeId) - .OrderBy(a=>a.ordinal) + .OrderBy(a => a.ordinal) .Select(a => new { tab_id = a.id, tab_name = a.name, - daq_list = SqlFunc.Subqueryable().Where(e=>e.equip_id==perProcessStandardsH.equip_id).ToList(e=>new ProcessParamTypeDaqListOutput + daq_list = SqlFunc.Subqueryable().Where(e => e.equip_id == perProcessStandardsH.equip_id).ToList(e => new ProcessParamTypeDaqListOutput { id = e.id, label_name = e.label_name, }), children = SqlFunc.Subqueryable() - .LeftJoin((b,c)=>b.process_param_id==c.id) - .LeftJoin((b,c,d)=>c.tolerance_category_id==d.id) - .Where((b,c,d)=>c.process_param_type_id==a.id && b.process_standards_id==id) - .OrderBy((b,c,d)=>c.ordinal) - .ToList((b,c,d)=>new ProcessParamTypeChildrenOutput - { - id = b.id, - process_param_id = c.id, - name = c.name, - value = b.value, - upper_value = d.upper_value, - lower_value = d.lower_value, - daq_id = b.daq_id - }), + .LeftJoin((b, c) => b.process_param_id == c.id) + .LeftJoin((b, c, d) => c.tolerance_category_id == d.id) + .Where((b, c, d) => c.process_param_type_id == a.id && b.process_standards_id == id) + .OrderBy((b, c, d) => c.ordinal) + .ToList((b, c, d) => new ProcessParamTypeChildrenOutput + { + id = b.id, + process_param_id = c.id, + name = c.name, + value = b.value, + upper_value = d.upper_value, + lower_value = d.lower_value, + daq_id = b.daq_id + }), }).ToListAsync(); diff --git a/PerMgr/Tnb.PerMgr/PerProcessStandardsService.cs b/PerMgr/Tnb.PerMgr/PerProcessStandardsService.cs index 29220237..4ba4afdc 100644 --- a/PerMgr/Tnb.PerMgr/PerProcessStandardsService.cs +++ b/PerMgr/Tnb.PerMgr/PerProcessStandardsService.cs @@ -1,18 +1,12 @@ -using System.Data; -using JNPF; using JNPF.Common.Configuration; using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager.Files; -using JNPF.Common.Enums; -using JNPF.Common.Helper; using JNPF.Common.Models; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Common; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; @@ -20,7 +14,6 @@ using NPOI.SS.Util; using NPOI.XSSF.UserModel; using SqlSugar; using Tnb.PerMgr.Entities; -using Tnb.PerMgr.Entities.Dto; using Tnb.PerMgr.Interfaces; namespace Tnb.PerMgr @@ -36,8 +29,8 @@ namespace Tnb.PerMgr private readonly IUserManager _userManager; private readonly FileManager _fileManager; private readonly FileService _fileService; - - public PerProcessStandardsService(ISqlSugarRepository repository, + + public PerProcessStandardsService(ISqlSugarRepository repository, FileService fileService, FileManager fileManager, IUserManager userManager) @@ -47,7 +40,7 @@ namespace Tnb.PerMgr _fileManager = fileManager; _fileService = fileService; } - + [AllowAnonymous] [HttpGet] public async Task ExportTemplate() @@ -55,13 +48,13 @@ namespace Tnb.PerMgr try { var db = _repository.AsSugarClient(); - string[] perProcessParamTypes = await db.Queryable().OrderBy(x => x.ordinal).Select(x=>x.name).ToArrayAsync(); - string[] perProcessParams = await db.Queryable().OrderBy(x => x.ordinal).Select(x=>x.name).ToArrayAsync(); - - + string[] perProcessParamTypes = await db.Queryable().OrderBy(x => x.ordinal).Select(x => x.name).ToArrayAsync(); + string[] perProcessParams = await db.Queryable().OrderBy(x => x.ordinal).Select(x => x.name).ToArrayAsync(); + + XSSFWorkbook workbook = new XSSFWorkbook(); NPOI.SS.UserModel.ISheet sheet = workbook.CreateSheet("BOM详情"); - + IRow row1 = sheet.CreateRow(0); string[] titles = new[] { "工艺参数类型", "工艺参数", "设定值" }; @@ -69,11 +62,11 @@ namespace Tnb.PerMgr { ICell cell1 = row1.CreateCell(i); cell1.SetCellValue(titles[i]); - sheet.SetColumnWidth(i,15 * 256); + sheet.SetColumnWidth(i, 15 * 256); } // int rowIndex = 1; - + // var column = sheet.GetColumn(0); // 设置下拉项 var validationHelper = sheet.GetDataValidationHelper(); @@ -81,15 +74,15 @@ namespace Tnb.PerMgr var region = new CellRangeAddressList(1, 1000, 0, 0); var validation = validationHelper.CreateValidation(constraint, region); sheet.AddValidationData(validation); - + var constraint2 = validationHelper.CreateExplicitListConstraint(perProcessParams); var region2 = new CellRangeAddressList(1, 1000, 1, 1); var validation2 = validationHelper.CreateValidation(constraint2, region2); sheet.AddValidationData(validation2); - + MemoryStream ms = new MemoryStream(); - + workbook.Write(ms); MemoryStream ms2 = new MemoryStream(ms.ToArray()); ms2.Position = 0; @@ -101,11 +94,11 @@ namespace Tnb.PerMgr Console.WriteLine(e); throw Oops.Bah("导出失败"); } - + } [HttpPost] - public async Task> Import([FromForm]string id, [FromForm]ChunkModel input) + public async Task> Import([FromForm] string id, [FromForm] ChunkModel input) { int rowIndex = 1; bool flag = false; @@ -114,16 +107,16 @@ namespace Tnb.PerMgr { using (Stream stream = input.file.OpenReadStream()) { - + // 2007版本 if (input.fileName.IndexOf(".xlsx") > 0) workbook = new XSSFWorkbook(stream); else if (input.fileName.IndexOf(".xls") > 0) workbook = new HSSFWorkbook(stream); - + ISheet? sheet = workbook?.GetSheetAt(0); - - if(workbook==null || sheet==null) + + if (workbook == null || sheet == null) throw Oops.Bah("无导入数据"); if (sheet?.LastRowNum <= 1) @@ -133,12 +126,12 @@ namespace Tnb.PerMgr List perProcessParamTypes = await db.Queryable().ToListAsync(); List perProcessParams = await db.Queryable().ToListAsync(); int errorColumnIndex = 5; - + ICellStyle style = workbook.CreateCellStyle(); - IFont font = workbook.CreateFont(); + IFont font = workbook.CreateFont(); font.Color = IndexedColors.Red.Index; // 将字体颜色设置为红色 style.SetFont(font); - + List list = new List() { }; for (rowIndex = 1; rowIndex <= sheet?.LastRowNum; rowIndex++) { @@ -170,14 +163,14 @@ namespace Tnb.PerMgr else { ICell errorCell = row.GetCell(errorColumnIndex) ?? row.CreateCell(errorColumnIndex); - errorCell.SetCellValue(errorCell.StringCellValue+",无该工艺参数"); + errorCell.SetCellValue(errorCell.StringCellValue + ",无该工艺参数"); errorCell.CellStyle = style; flag = true; } if (!TrySetNumberCellValue(cell2, ref item)) { ICell errorCell = row.GetCell(errorColumnIndex) ?? row.CreateCell(errorColumnIndex); - errorCell.SetCellValue(errorCell.StringCellValue+",设定值不是数字"); + errorCell.SetCellValue(errorCell.StringCellValue + ",设定值不是数字"); errorCell.CellStyle = style; flag = true; } @@ -186,7 +179,7 @@ namespace Tnb.PerMgr list.Add(item); } - + if (row.GetCell(errorColumnIndex) != null) { row.GetCell(errorColumnIndex).SetCellValue(row.GetCell(errorColumnIndex).StringCellValue.Substring(1)); @@ -199,18 +192,18 @@ namespace Tnb.PerMgr .FirstAsync(x => x.process_param_id == item.process_param_id && x.process_param_type_id == item.process_param_type_id && x.process_standards_id == id); - if (oldData!=null) + if (oldData != null) { if (oldData.value != item.value) { - + PerProcessStandardsH perProcessStandardsH = await _repository.AsSugarClient().Queryable().SingleAsync(x => x.id == oldData.process_standards_id); PerProcessParam processParam = await _repository.AsSugarClient().Queryable().SingleAsync(x => x.id == oldData.process_param_id); - + await _repository.AsSugarClient().Updateable() - .SetColumns(x=>x.value==item.value) - .Where(x=>x.id==oldData.id).ExecuteCommandAsync(); - + .SetColumns(x => x.value == item.value) + .Where(x => x.id == oldData.id).ExecuteCommandAsync(); + PerProcessParamEditRecord record = new PerProcessParamEditRecord { process_param_id = item.process_param_id, @@ -234,14 +227,14 @@ namespace Tnb.PerMgr if (flag) { MemoryStream ms = new MemoryStream(); - + workbook?.Write(ms); string fileName = $"工艺标准导入报错{DateTime.Now.Ticks}.xlsx"; using (MemoryStream ms2 = new MemoryStream(ms.ToArray())) { ms2.Position = 0; await _fileManager.UploadFileByType(ms2, FileVariable.TemporaryFilePath, fileName); - + } return new Dictionary() { @@ -258,21 +251,21 @@ namespace Tnb.PerMgr ["msg"] = "导入成功", }; } - + } } catch (Exception e) - { + { Console.WriteLine(e.Message); JNPF.Logging.Log.Error("工艺标准导入失败", e); throw Oops.Bah("导入失败"); } - - + + } - private bool TrySetNumberCellValue(ICell cell,ref PerProcessStandardsD item) + private bool TrySetNumberCellValue(ICell cell, ref PerProcessStandardsD item) { try { diff --git a/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj b/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj index e09a63c1..f61d2bcb 100644 --- a/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj +++ b/PerMgr/Tnb.PerMgr/Tnb.PerMgr.csproj @@ -1,6 +1,6 @@ - - + + net6.0 enable enable diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs index cd925157..9b424570 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/DictionaryConstants.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Consts +namespace Tnb.ProductionMgr.Entities.Consts { /// /// 工单状态 @@ -19,8 +13,8 @@ namespace Tnb.ProductionMgr.Entities.Consts /// 待排产 /// public const string WaitProductId = "25019244276501"; - + } - + } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/ModuleConst.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/ModuleConst.cs index 409f2184..3ab16a70 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/ModuleConst.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Consts/ModuleConst.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr; +namespace Tnb.ProductionMgr; public class ModuleConst { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/DictionaryTreeOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/DictionaryTreeOutput.cs index a5aaca03..cc9d4e1c 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/DictionaryTreeOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/DictionaryTreeOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { public class DictionaryTreeOutput { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AddAndonInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AddAndonInput.cs index b4fc2c9d..cbaa2a7b 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AddAndonInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AddAndonInput.cs @@ -3,9 +3,9 @@ namespace Tnb.ProductionMgr.Entities.Dto public class AddAndonInput { public string andon_type_id { get; set; } - + public string andon_info_id { get; set; } - + public string andon_breakdown_id { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListInput.cs index 929989e5..fcd563ea 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListInput.cs @@ -3,9 +3,9 @@ namespace Tnb.ProductionMgr.Entities.Dto public class AndonPadListInput { public string andon_type_id { get; set; } - + public string status { get; set; } - + /// /// 页码. /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs index 0566d0ed..c522a234 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonPadListOutput.cs @@ -2,15 +2,15 @@ namespace Tnb.ProductionMgr.Entities.Dto { public class AndonPadListOutput { - public string id { get; set; } - public string andon_info_name { get; set; } - public string promoter_name { get; set; } - public string repair_name { get; set; } - public string? promoter_time { get; set; } - public string? response_time { get; set; } - public string? start_repair_time { get; set; } - public string? end_repair_time { get; set; } - public string? confirm_time { get; set; } - public string status { get; set; } + public string id { get; set; } + public string andon_info_name { get; set; } + public string promoter_name { get; set; } + public string repair_name { get; set; } + public string? promoter_time { get; set; } + public string? response_time { get; set; } + public string? start_repair_time { get; set; } + public string? end_repair_time { get; set; } + public string? confirm_time { get; set; } + public string status { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonRecordInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonRecordInput.cs index c9100230..a108f835 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonRecordInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonRecordInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { public class AndonRecordInput { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CloseDownStartInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CloseDownStartInput.cs index 52975ea2..e7743275 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CloseDownStartInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CloseDownStartInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 停机开始输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryOutput.cs index 3f1a6658..51fb9b33 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { public class ClosedownHistoryOutput { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryQuery.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryQuery.cs index 86087362..53719464 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryQuery.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ClosedownHistoryQuery.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Filter; +using JNPF.Common.Filter; namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CountEstimatedEndTimeInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CountEstimatedEndTimeInput.cs index 4f74f496..a7e8c411 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CountEstimatedEndTimeInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/CountEstimatedEndTimeInput.cs @@ -6,17 +6,17 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public class CountEstimatedEndTimeInput { public DateTime estimated_start_date { get; set; } - + public int scheduled_qty { get; set; } - + public string? equip_id { get; set; } - + public string? molds_id { get; set; } - + public string? material_id { get; set; } - + public string? mbom_id { get; set; } - + /// /// 1 注塑挤出排产 2 组装包装排产 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/EquipmentListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/EquipmentListOutput.cs index 124992f5..e9f73f0f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/EquipmentListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/EquipmentListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 设备列表输出参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/FeedingRecordTreeOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/FeedingRecordTreeOutput.cs index f8cae0d2..d2175b07 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/FeedingRecordTreeOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/FeedingRecordTreeOutput.cs @@ -11,16 +11,16 @@ namespace Tnb.ProductionMgr.Entities.Dto { public string id { get; set; } public string code { get; set; } - + public string mo_task_id { get; set; } public List children { get; set; } = new List(); } - + public class FeedingRecordMaterialChildren { public string material_code { get; set; } - + public string material_name { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GanntSaveInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GanntSaveInput.cs index 393c24fd..0d8fbe37 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GanntSaveInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GanntSaveInput.cs @@ -6,13 +6,13 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string row_id { get; set; } public GanntTime time { get; set; } } - + public class GanntTime { public DateTime? start { get; set; } public DateTime? end { get; set; } } - + public class GanntTimeTips { public string mo_task_code { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GenSubMoCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GenSubMoCrInput.cs index 049cf59f..eb2f2dcf 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GenSubMoCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GenSubMoCrInput.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { public class GenSubMoCrInput { public string bom_id { get; set; } - + /// /// 父工单id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GeneralOutstockInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GeneralOutstockInput.cs index 79368c6f..c97a1e60 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GeneralOutstockInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/GeneralOutstockInput.cs @@ -6,11 +6,11 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 目标库位编号 /// public string location_code { get; set; } = string.Empty; - + /// 所属工位 /// public string? workstation_id { get; set; } - + /// /// 任务单 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/IcmoUpInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/IcmoUpInput.cs index b6648b96..a2e868a6 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/IcmoUpInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/IcmoUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产任务单更新输入参数 @@ -35,5 +29,5 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 生产任务单数量 /// //public int scheduled_qty { get; set; } - } + } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutInput.cs index bbbfda0b..41264525 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutInput.cs @@ -7,82 +7,82 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 出库仓库ID /// public string warehouse_id { get; set; } = string.Empty; - + /// /// 目标库位编号 /// public string location_code { get; set; } = string.Empty; - + /// /// 产品ID /// public string material_id { get; set; } = string.Empty; - + /// /// 产品编号 /// public string? material_code { get; set; } - + /// /// 齐套搭配方案ID /// public string collocation_scheme_id { get; set; } = string.Empty; - + /// /// 齐套搭配方案编号 /// public string? collocation_scheme_code { get; set; } - + /// /// 顺序号 /// public string? seq { get; set; } - + /// /// 创建用户 /// public string? create_id { get; set; } - + /// /// 创建时间 /// public DateTime? create_time { get; set; } - + /// /// 所属组织 /// public string? org_id { get; set; } - + /// /// 流程任务Id /// public string? f_flowtaskid { get; set; } - + /// /// 流程引擎Id /// public string? f_flowid { get; set; } - + /// /// 单据号 /// public string code { get; set; } = string.Empty; - + /// /// 所属工位 /// public string? workstation_id { get; set; } - + /// /// 所属产线 /// public string? workline_id { get; set; } - + /// /// 任务单 /// public string? mo_task_id { get; set; } - - public List> tableField115 { get; set; } + + public List> tableField115 { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutNewInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutNewInput.cs index bf98ca2b..58783612 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutNewInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/KittingOutNewInput.cs @@ -2,26 +2,26 @@ namespace Tnb.ProductionMgr.Entities.Dto { public class KittingOutNewInput { - + /// /// 目标库位编号 /// public string location_code { get; set; } = string.Empty; - - + + /// /// 齐套搭配方案ID /// public string collocation_scheme_id { get; set; } = string.Empty; - + /// 所属工位 /// public string? workstation_id { get; set; } - + /// /// 任务单 /// public string? mo_task_id { get; set; } - + } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs index c8f0b087..4f09160e 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialPreparationPlanOutput.cs @@ -21,7 +21,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string workstation_id { get; set; } public List children { get; set; } = new List(); } - + public class MaterialPreparationPlanDDOutput { public string material_id { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs index 94e5d2ed..a89af914 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs @@ -3,52 +3,52 @@ namespace Tnb.ProductionMgr.Entities.Dto public class MaterialReceiptInput { public string? id { get; set; } - + /// /// 签收单号 /// public string code { get; set; } = string.Empty; - + /// /// 工位id /// public string station_id { get; set; } = string.Empty; - + /// /// 任务单id /// public string? mo_task_id { get; set; } - + /// /// 工序id /// public string? process_id { get; set; } - + /// /// 设备id /// public string? equip_id { get; set; } - + /// /// 车间id /// public string? workshop_id { get; set; } - + /// /// 载具id /// public string? carry_id { get; set; } - + /// /// 产线id /// public string? workline_id { get; set; } - + /// /// 二维码信息 /// public string? carry_code { get; set; } - + /// /// 备注 /// @@ -58,7 +58,7 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 生产bom工序id /// public string? mbom_process_id { get; set; } - - public List>? details { get; set; } + + public List>? details { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptNewInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptNewInput.cs index 452fc14a..909e107f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptNewInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptNewInput.cs @@ -6,22 +6,22 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 工位id /// public string station_id { get; set; } = string.Empty; - + /// /// 任务单id /// public string? mo_task_id { get; set; } - + /// /// 设备id /// public string? equip_id { get; set; } - + /// /// 二维码信息 /// public string? carry_code { get; set; } - - public List>? details { get; set; } + + public List>? details { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoCrInput.cs index 6521a6e3..7d318873 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoCrInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产工单下发输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs index 34be5b6d..913a85d8 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MoldListOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 模具列表输出参数 @@ -36,6 +29,6 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 可用台数 /// public int available_stations { get; set; } - public string mold_id { get; set;} + public string mold_id { get; set; } } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs index f332da09..ddf21a33 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PADPackageTaskPageOutput.cs @@ -3,12 +3,12 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public class PADPackageTaskPageOutput { public string id { get; set; } - + /// /// 工单号号 /// public string? mo_code { get; set; } - + /// /// 生产任务编号 /// @@ -23,15 +23,15 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 物料Id /// public string material_id { get; set; } - + public string material_code { get; set; } public string material_name { get; set; } - + /// /// 产线id /// public string? workline_id { get; set; } - + public string? workline_name { get; set; } /// @@ -43,7 +43,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 任务单状态 /// public string? mo_task_status { get; set; } - + /// @@ -65,7 +65,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 排产类型:1、注塑、挤出2、组装、包装 /// public int? schedule_type { get; set; } - + public int? reported_work_qty { get; set; } /// @@ -81,14 +81,14 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 父任务Id /// public string? parent_id { get; set; } - + /// /// 工序id /// public string process_id { get; set; } - + public string process_name { get; set; } - + public string mbom_process_id { get; set; } public string equip_id { get; set; } public string equip_code { get; set; } @@ -97,7 +97,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string mold_code { get; set; } public string mold_name { get; set; } public DateTime? create_time { get; set; } - + /// /// 成型周期 /// @@ -107,17 +107,17 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 模穴数 /// public int? mold_cavity { get; set; } - + /// /// 标准工时 /// public string? standard_time { get; set; } - + /// /// 实际开工日期 /// public string? act_start_date { get; set; } - + /// /// 预计结束时间 /// @@ -134,22 +134,22 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 最小包装 /// public decimal? minpacking { get; set; } - + /// /// 主单位数量 /// public string? main_num { get; set; } - + /// /// 副单位数量(kg) /// public string? deputy_num { get; set; } - + /// /// 第三方平台设备编号 /// public string? third_equip_code { get; set; } - + /// /// 称重点位名称 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackPrdTaskUpInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackPrdTaskUpInput.cs index f766406b..6e3d7765 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackPrdTaskUpInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackPrdTaskUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 组装、包装,生产任务修改输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackReportTreeOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackReportTreeOutput.cs index 0cd3de9f..64f79cdf 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackReportTreeOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackReportTreeOutput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; +using JNPF.Common.Security; namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSchedlingCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSchedlingCrInput.cs index fe5d7e06..25fbf278 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSchedlingCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSchedlingCrInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 组装、包装排产输入参数 @@ -27,7 +21,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 物料Id /// public string material_id { get; set; } - + /// /// 排产数量 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackScheldToBeIssueListInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackScheldToBeIssueListInput.cs index f5d8e7aa..a195b384 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackScheldToBeIssueListInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackScheldToBeIssueListInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 组装、包装待下发列表输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs index 12e0029e..c12a37b2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackSechelToBeIssueListOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.DirectoryServices.Protocols; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 组装、包装生产任务待下发输出参数列表 @@ -80,7 +73,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 预计结束时间 /// public string? estimated_end_date { get; set; } - + /// /// 工序名称 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackingSchedulingListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackingSchedulingListOutput.cs index 581be5f6..8b38037e 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackingSchedulingListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PackingSchedulingListOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 组装、包装排产列表输出类 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockInput.cs index 6ad6e514..2dea4e06 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdInstockInput.cs @@ -7,7 +7,7 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 单据类型 /// public string bill_type { get; set; } = string.Empty; - + /// /// 载具编号 @@ -18,22 +18,22 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 起始库位编号 /// public string location_code { get; set; } = string.Empty; - + /// /// 检验(0-未检 1-已检) /// public int is_check { get; set; } - + public string? station_id { get; set; } public string? workline_id { get; set; } public string? workshop_id { get; set; } - - + + /// /// 子表明细 /// - public List> details { get; set; } - + public List> details { get; set; } + } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromOneListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromOneListOutput.cs index dd579252..b76cd738 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromOneListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromOneListOutput.cs @@ -9,28 +9,28 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 工单id /// public string id { get; set; } - + public string mo_code { get; set; } - + public string material_id { get; set; } - + public string material_code { get; set; } - + public string material_name { get; set; } - + public string? material_standard { get; set; } - + public string? act_start_date { get; set; } - + public string? act_end_date { get; set; } - + /// /// 类型 1注塑挤出 2 组装包装 /// public int type { get; set; } - + } - + /// /// 工单追溯二级列表输出类 /// @@ -40,33 +40,33 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 任务单id /// public string id { get; set; } - + public string mo_task_code { get; set; } - + public string material_id { get; set; } - + public string material_code { get; set; } - + public string material_name { get; set; } - + public string? material_standard { get; set; } - + public string? act_start_date { get; set; } - + public string? act_end_date { get; set; } - + public string? workline_name { get; set; } - + public string? workshop_name { get; set; } - + public string? mbom_version { get; set; } - + public string station_name { get; set; } - + public string equip_code { get; set; } - + } - + /// /// 工单追溯三级列表输出类 /// @@ -76,25 +76,25 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 任务单id /// public string id { get; set; } - + public string mo_task_code { get; set; } - + public string material_id { get; set; } - + public string material_code { get; set; } - + public string material_name { get; set; } - + public string? workline_id { get; set; } - + public string? batch { get; set; } - + public string process_id { get; set; } public string process_name { get; set; } - + public string station_name { get; set; } } - + /// /// 工单追溯人输出类 /// @@ -106,16 +106,16 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage // public string id { get; set; } // // public string workgroup_name { get; set; } - + public string employee_name { get; set; } public string work_time { get; set; } - + public DateTime? start_time { get; set; } public DateTime? end_time { get; set; } - - + + } - + /// /// 工单追溯机输出类 /// @@ -123,9 +123,9 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { public string equip_code { get; set; } public string mold_code { get; set; } - + } - + /// /// 工单追溯料输出类 /// @@ -138,8 +138,8 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string instock_time { get; set; } public string feeding_time { get; set; } public string check_conclusion { get; set; } - - + + } public class PrdMoReverseFromMaterialoutput @@ -163,7 +163,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 批次 /// - public string code_batch { get; set;} + public string code_batch { get; set; } /// /// 采购单号 /// @@ -223,7 +223,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string supplier_name { get; set; } public string unit_name { get; set; } } - + /// /// 物料反向追溯投料信息输出父类 /// @@ -236,9 +236,9 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string material_name { get; set; } public string material_standard { get; set; } public List children { get; set; } = new List(); - + } - + /// /// 物料反向追溯投料信息输出字类 /// @@ -255,9 +255,9 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string feeding_name { get; set; } public string station_name { get; set; } public string process_name { get; set; } - + } - + public class PrdMoReverseFromOutput { /// @@ -278,7 +278,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 批次 /// - public string code_batch { get; set;} + public string code_batch { get; set; } /// /// 单位ID /// @@ -332,5 +332,5 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// public string delivery_time { get; set; } } - + } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromQueryInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromQueryInput.cs index d284f723..d9188cd6 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromQueryInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoFromQueryInput.cs @@ -11,11 +11,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 每页行数. /// public int pageSize { get; set; } = 50; - + public string? mo_code { get; set; } - + public string? mo_task_code { get; set; } - + public string? barcode { get; set; } } @@ -25,25 +25,25 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string mo_task_code { get; set; } public string barcode { get; set; } } - + public class PrdMoFromThreeQueryInput { public string mo_task_id { get; set; } public string mo_task_code { get; set; } public string barcode { get; set; } - } - + } + public class PrdMoFromTabQueryInput { public string mo_task_id { get; set; } public string barcode { get; set; } - } - + } + public class PrdMoReverseFromQueryInput { public string barcode { get; set; } } - + public class PrdMoReverseFromOutInfoQueryInput { public string feeding_detail_id { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs index 82f7295c..0f733963 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListOuput.cs @@ -3,9 +3,9 @@ namespace Tnb.ProductionMgr.Entities.Dto public class PrdMoListOuput { public string id { get; set; } - + public string mo_type { get; set; } - + public string mo_source { get; set; } public string mo_code { get; set; } public string plan_start_date { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListTreeOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListTreeOutput.cs index bb1c96ca..5e2f9f03 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListTreeOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoListTreeOutput.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; - namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { - public class PrdMoListTreeOutput + public class PrdMoListTreeOutput { //public Dictionary row { get; set; } @@ -136,7 +129,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 父工单id /// public string parent_id { get; set; } = string.Empty; - + /// /// 获取节点id. /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskDefectOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskDefectOutput.cs index e345f950..f8c8cc00 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskDefectOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskDefectOutput.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using DbModels; -using Tnb.ProductionMgr.Entities; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 提报记录统计明细 @@ -27,7 +19,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string? batch { get; set; } public string? create_time { get; set; } - + public string? create_name { get; set; } /// /// 报废数量 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskFromEqpIdInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskFromEqpIdInput.cs index 207b3cc7..eddca47b 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskFromEqpIdInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskFromEqpIdInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 根据设备id 获取生产任务列表,输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs index c648d5f0..7a935ce2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskIssueListOutput.cs @@ -5,8 +5,8 @@ namespace Tnb.ProductionMgr.Entities.Dto public string id { get; set; } public string mo_task_code { get; set; } public string material_id { get; set; } - public string mold_id { get; set; } - public string eqp_id { get; set; } + public string mold_id { get; set; } + public string eqp_id { get; set; } public string mo_task_status { get; set; } public int? plan_qty { get; set; } public int? scheduled_qty { get; set; } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs index e3e66deb..f6e660e3 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMoTaskOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.DirectoryServices.Protocols; -using System.Linq; -using System.Security.Principal; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; +using JNPF.Common.Security; namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { @@ -76,7 +69,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 预计完工时间 /// - public string estimated_end_date { get; set; }= string.Empty; + public string estimated_end_date { get; set; } = string.Empty; /// /// 工序编码 /// @@ -84,8 +77,8 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// /// 工序名称 /// - public string process_name { get; set;} - + public string process_name { get; set; } + public string create_time { get; set; } } public class PrdMoTaskTreeOutput : TreeModel @@ -97,7 +90,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public string? material_id { get; set; } public string? mold_id { get; set; } public string? eqp_id { get; set; } - + /// /// 物料 /// @@ -122,7 +115,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// 预计结束时间 /// public string? estimated_end_date { get; set; } - + /// /// 创建时间 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMotreeOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMotreeOutput.cs index 141c0095..8a5af562 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMotreeOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdMotreeOutput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; +using JNPF.Common.Security; namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdPackReportQueryInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdPackReportQueryInput.cs index 736f3fe4..bfb504c6 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdPackReportQueryInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdPackReportQueryInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Filter; -using Microsoft.AspNetCore.Mvc.RazorPages; +using JNPF.Common.Filter; namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs index 1009a132..f1e0e6e0 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 生产提报输入参数 @@ -98,12 +92,12 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// Nullable:True /// public int icmo_qty { get; set; } - + /// /// 工位 /// public string? station { get; set; } - + /// /// 料箱二维码 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportOutput.cs index 779e1b82..56f87519 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { public class PrdReportOutput { @@ -47,6 +41,6 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// public string material_property { get; set; } - + } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperInput.cs index 8b3386e3..efce8c83 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产操作记录查询参数 @@ -30,7 +24,7 @@ namespace Tnb.ProductionMgr.Entities.Dto /// /// 计划生产开始日期 /// - public DateTime? plan_start_date{ get; set; } + public DateTime? plan_start_date { get; set; } /// /// 计划生产结束日期 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperOutput.cs index 365d18c9..188a4ef9 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskOperOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产操作记录输出类 @@ -16,7 +9,7 @@ namespace Tnb.ProductionMgr.Entities.Dto ///任务单操作状态 /// public string statusName { get; set; } - + /// /// 排产类型:1、注塑、挤出2、组装、包装 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskReleaseUpInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskReleaseUpInput.cs index 37d943f1..7c02ae35 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskReleaseUpInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskReleaseUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产任务单下发输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs index a7d4f906..c0c5085d 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdTaskSortOutput.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产任务重新排序输出参数 /// - public class PrdTaskSortOutput + public class PrdTaskSortOutput { /// /// 序号 @@ -24,7 +17,7 @@ namespace Tnb.ProductionMgr.Entities.Dto /// 生产任务状态 /// 生产任务状态 /// - public string status { get; set;} + public string status { get; set; } /// /// 是否同组标识 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ProductionSchedulingCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ProductionSchedulingCrInput.cs index 9d9ba5ae..b5a0b541 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ProductionSchedulingCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ProductionSchedulingCrInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 生产工单排产输入参数 @@ -15,7 +9,7 @@ namespace Tnb.ProductionMgr.Entities.Dto /// /// public string id { get; set; } - + /// /// Desc:排产类型 1、注塑/挤出工单 2、组装/包装工单 /// Default: @@ -43,14 +37,14 @@ namespace Tnb.ProductionMgr.Entities.Dto /// Nullable:True /// public DateTime? estimated_start_date { get; set; } - + /// /// Desc:预计结束时间 /// Default: /// Nullable:True /// public DateTime? estimated_end_date { get; set; } - + // /// // /// Desc:预计开始时间 // /// Default: @@ -126,5 +120,5 @@ namespace Tnb.ProductionMgr.Entities.Dto /// public string bom_id { get; set; } } - + } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs index b060203a..09f3aeb3 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/ReportRecordListOutput.cs @@ -10,10 +10,10 @@ namespace Tnb.ProductionMgr.Entities.Dto public string? mo_task_id_id { get; set; } = string.Empty; public string? mo_task_type { get; set; } = string.Empty; public string? plan_end_date { get; set; } = string.Empty; - public int? plan_qty { get; set; } + public int? plan_qty { get; set; } public int? completed_qty { get; set; } public string? plan_start_date { get; set; } = string.Empty; - public int? reported_work_qty { get; set; } + public int? reported_work_qty { get; set; } public string? status { get; set; } = string.Empty; public List? tablefield107 { get; set; } = new List(); @@ -27,7 +27,7 @@ namespace Tnb.ProductionMgr.Entities.Dto public string? create_id { get; set; } = string.Empty; public string? create_id_id { get; set; } = string.Empty; public string? create_time { get; set; } = string.Empty; - + public string? batch { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SelfTestScrappedInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SelfTestScrappedInput.cs index 08ff439a..aaf1fafd 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SelfTestScrappedInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SelfTestScrappedInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 自检报废输入类 @@ -57,7 +51,7 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage public List items { get; set; } } - public class defectItem + public class defectItem { /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SwapMoldUpInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SwapMoldUpInput.cs index b33ac539..3a36cc83 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SwapMoldUpInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/SwapMoldUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 模具更换输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TaskOperRecordOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TaskOperRecordOutput.cs index 2b091c6f..d16d37b7 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TaskOperRecordOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TaskOperRecordOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { public class TaskOperRecordOutput { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TransferPlatformUpInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TransferPlatformUpInput.cs index 8d6226bd..7f7473b3 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TransferPlatformUpInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/TransferPlatformUpInput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Principal; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto +namespace Tnb.ProductionMgr.Entities.Dto { /// /// 转移机台输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/UnPackSchedlingInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/UnPackSchedlingInput.cs index ba31a885..3f7c1679 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/UnPackSchedlingInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/UnPackSchedlingInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage { /// /// 拆解组装包装排产输入参数 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonBreakDown.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonBreakDown.cs index 38142fc2..3e7e9619 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonBreakDown.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonBreakDown.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonInfo.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonInfo.cs index 99adab74..29ad83bb 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonInfo.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonInfo.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; @@ -17,16 +12,16 @@ namespace Tnb.ProductionMgr.Entities.Entity id = SnowflakeIdHelper.NextId(); } public string? region_name { get; set; } - + public string? name { get; set; } - + public string? push_rule_id { get; set; } /// /// 故障类别 /// public string? andon_type { get; set; } - + /// /// 故障 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonRecords.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonRecords.cs index c813fadc..54eb2dd2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonRecords.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonRecords.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; @@ -38,14 +33,14 @@ namespace Tnb.ProductionMgr.Entities public string? remark { get; set; } public string? andon_type_id { get; set; } public string? andon_info_id { get; set; } - public string? repair_id { get; set; } - + public string? repair_id { get; set; } + public DateTime? response_time { get; set; } public DateTime? start_repair_time { get; set; } public DateTime? end_repair_time { get; set; } public DateTime? confirm_time { get; set; } - + public string status { get; set; } - + } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonTypecs.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonTypecs.cs index 0507aec2..d7a540d1 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonTypecs.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AndonTypecs.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; @@ -20,7 +15,7 @@ namespace Tnb.ProductionMgr.Entities /// 名称 /// public string? name { get; set; } - + public string? remark { get; set; } public string? create_id { get; set; } @@ -31,6 +26,6 @@ namespace Tnb.ProductionMgr.Entities /// 所属组织 /// public string? org_id { get; set; } - + } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskLogListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskLogListOutput.cs index 52ad5685..4fd2680a 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskLogListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskLogListOutput.cs @@ -15,7 +15,7 @@ namespace Tnb.ProductionMgr.Entities.Entity public string eqp_id { get; set; } public string eqp_id_id { get; set; } public string equip_code { get; set; } - + public string process_id { get; set; } public string process_id_id { get; set; } public string process_code { get; set; } @@ -23,9 +23,9 @@ namespace Tnb.ProductionMgr.Entities.Entity public int? scheduled_qty { get; set; } public int? reported_work_qty { get; set; } public int? scrap_qty { get; set; } - + public string plan_start_date { get; set; } - + public string plan_end_date { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs index e5bd8bee..2e8bcb34 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/AppPrdMoTaskOneListOutput.cs @@ -15,7 +15,7 @@ namespace Tnb.ProductionMgr.Entities public string eqp_id { get; set; } public string eqp_id_id { get; set; } public string equip_code { get; set; } - + public string process_id { get; set; } public string process_id_id { get; set; } public string process_code { get; set; } @@ -23,9 +23,9 @@ namespace Tnb.ProductionMgr.Entities public int? scheduled_qty { get; set; } public int? reported_work_qty { get; set; } public int? scrap_qty { get; set; } - + public string plan_start_date { get; set; } - + public string plan_end_date { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs index eac56daa..13edc502 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/CheckMoldInput.cs @@ -3,7 +3,7 @@ namespace Tnb.ProductionMgr.Entities.Entity public class CheckMoldInput { public string mo_task_id { get; set; } - + public string mold_qrcode { get; set; } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/MoldsEntity.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/MoldsEntity.cs index beec7c50..917af756 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/MoldsEntity.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/MoldsEntity.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using JNPF.Common.Contracts; using SqlSugar; -using JNPF.Common.Contracts; namespace Tnb.ProductionMgr.Entities { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs index 58f50b8d..41e311b2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdFeedingD.cs @@ -53,7 +53,7 @@ public partial class PrdFeedingD : BaseEntity /// 物料签收单子表id /// public string? material_receipt_detail_id { get; set; } - + /// /// 创建用户 /// @@ -63,7 +63,7 @@ public partial class PrdFeedingD : BaseEntity /// 创建时间 /// public DateTime? create_time { get; set; } - + /// /// 状态 0 未消耗 1 部分消耗 2 消耗完 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs index dcbe0c55..7c04e3a2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockD.cs @@ -53,7 +53,7 @@ public partial class PrdInstockD : BaseEntity /// 生产提报id /// public string report_id { get; set; } = string.Empty; - + /// /// 生产任务单号 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs index 2802f17e..720f5d24 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdInstockH.cs @@ -38,7 +38,7 @@ public partial class PrdInstockH : BaseEntity /// 起始库位编号 /// public string location_code { get; set; } = string.Empty; - + /// /// 工位id /// @@ -54,7 +54,7 @@ public partial class PrdInstockH : BaseEntity /// public string? workshop_id { get; set; } - + /// /// 检验(0-未检 1-已检) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs index d2d2c3ff..27cadcf2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs @@ -38,7 +38,7 @@ public partial class PrdMaterialReceiptD : BaseEntity /// 单位id /// public string? unit_id { get; set; } - + /// /// 条码编号 /// @@ -48,7 +48,7 @@ public partial class PrdMaterialReceiptD : BaseEntity /// 载具id /// public string carry_id { get; set; } = string.Empty; - + /// /// 子载具id /// @@ -69,7 +69,7 @@ public partial class PrdMaterialReceiptD : BaseEntity /// 已投料数量 /// public decimal feeding_num { get; set; } - + /// /// 供应商 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs index 94958bc2..56783a0a 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs @@ -14,12 +14,12 @@ public partial class PrdMaterialReceiptH : BaseEntity { id = SnowflakeIdHelper.NextId(); } - + /// /// 签收单号 /// public string code { get; set; } = string.Empty; - + /// /// 工位id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs index 97ec51d8..0d445a16 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMo.cs @@ -53,7 +53,7 @@ public partial class PrdMo : BaseEntity /// 已完工数量 /// public int? complete_qty { get; set; } - + /// /// 已报工数量 /// @@ -227,12 +227,12 @@ public partial class PrdMo : BaseEntity /// 父工单id /// public string parent_id { get; set; } - + /// /// 物料单位 /// public string? unit_id { get; set; } - + /// /// 工单来源 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs index be888dc5..cdeb3123 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.cs @@ -78,7 +78,7 @@ public partial class PrdMoTask : BaseEntity /// 已完工数量 /// public int? complete_qty { get; set; } - + /// /// 已报工数量 /// @@ -177,22 +177,22 @@ public partial class PrdMoTask : BaseEntity /// 工序id /// public string process_id { get; set; } - + /// /// 生产bom工序id /// public string? mbom_process_id { get; set; } - + /// /// 最后一道工序完成数量 /// public int? last_process_complete_qty { get; set; } - + /// /// 物料单位 /// public string? unit_id { get; set; } - + /// /// 物料清单id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.part.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.part.cs index 44fc1766..d09742a6 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.part.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTask.part.cs @@ -1,7 +1,3 @@ -using System; -using System.Linq; -using System.Text; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.ProductionMgr.Entities diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskLog.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskLog.cs index f10ade62..eadcd903 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskLog.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMoTaskLog.cs @@ -73,7 +73,7 @@ public partial class PrdMoTaskLog : BaseEntity /// 任务单编号 /// public string? mo_task_code { get; set; } - + /// /// 工位编号 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdOnwipTool.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdOnwipTool.cs index bd3d4f33..0e75f49b 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdOnwipTool.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdOnwipTool.cs @@ -1,5 +1,4 @@ using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.ProductionMgr.Entities; @@ -12,7 +11,7 @@ public partial class PrdOnwipTool : BaseEntity { public PrdOnwipTool() { - + } /// /// TODO diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index e24a66f2..f19f3a84 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -78,18 +78,18 @@ public partial class PrdReport : BaseEntity /// 生产任务量 /// public int? icmo_qty { get; set; } - + /// /// 批次 /// public string? batch { get; set; } - + /// /// 条码 /// public string? barcode { get; set; } - + /// /// 设备id /// @@ -109,7 +109,7 @@ public partial class PrdReport : BaseEntity /// 状态 0 未入库 1 已入库 /// public int status { get; set; } - + /// /// 物料id /// @@ -119,12 +119,12 @@ public partial class PrdReport : BaseEntity /// 物料单位 /// public string? unit_id { get; set; } - + /// /// 工序id /// public string? process_id { get; set; } - + /// /// 料箱编号 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdScrapped.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdScrapped.cs index c7896ac7..b6459a04 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdScrapped.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdScrapped.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using System.Text; -using SqlSugar; +using SqlSugar; namespace DbModels { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTask.cs index d3c75d4b..eeb48bf7 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTask.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTask.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using System.Text; -using SqlSugar; +using SqlSugar; namespace Tnb.ProductionMgr.Entities { @@ -138,7 +135,7 @@ namespace Tnb.ProductionMgr.Entities /// /// 工单数(生产任务数) /// - public int mo_qty{ get; set; } + public int mo_qty { get; set; } /// /// Desc:模具Id /// Default:NULL::character varying diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTaskLog.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTaskLog.cs index f9785a42..c5d13b56 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTaskLog.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdTaskLog.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using System.Text; -using SqlSugar; +using SqlSugar; namespace Tnb.ProductionMgr.Entities { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs index 16320af9..b54d99be 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/Eagvmode.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Entities.Enums +namespace Tnb.ProductionMgr.Entities.Enums { public enum Eagvmode { - 无请求=0, - 空框请求=1, - 满框请求=2, - 空满框请求=3, - 收到请求=4 + 无请求 = 0, + 空框请求 = 1, + 满框请求 = 2, + 空满框请求 = 3, + 收到请求 = 4 } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/MoBehavior.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/MoBehavior.cs index 7c58d8d1..1171f2f8 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/MoBehavior.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Enums/MoBehavior.cs @@ -1,21 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Spire.License; - -namespace Tnb.ProductionMgr.Entities.Enums +namespace Tnb.ProductionMgr.Entities.Enums { public enum MoBehavior { /// /// 下发 /// - Release=1, + Release = 1, /// /// 强制结单 /// - Closed=2, + Closed = 2, } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Mapper/Mapper.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Mapper/Mapper.cs index e178d8ac..173f50fd 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Mapper/Mapper.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Mapper/Mapper.cs @@ -1,6 +1,4 @@ using Mapster; -using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.Entities.Mapper { diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Tnb.ProductionMgr.Entities.csproj b/ProductionMgr/Tnb.ProductionMgr.Entities/Tnb.ProductionMgr.Entities.csproj index ce732dd2..4adc18f3 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Tnb.ProductionMgr.Entities.csproj +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Tnb.ProductionMgr.Entities.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonRecordService.cs index 340f595f..ef4dcd26 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonRecordService.cs @@ -20,29 +20,29 @@ namespace Tnb.ProductionMgr.Interfaces /// /// public Task AddAndon(AddAndonInput input); - + /// /// 响应andon /// /// - public Task ResponseAndon(Dictionary dic); - + public Task ResponseAndon(Dictionary dic); + /// /// 开始处理andon /// /// - public Task StartAndon(Dictionary dic); - + public Task StartAndon(Dictionary dic); + /// /// 结束处理andon /// /// - public Task EndAndon(Dictionary dic); - + public Task EndAndon(Dictionary dic); + /// /// 确认andon /// /// - public Task ConfirmAndon(Dictionary dic); + public Task ConfirmAndon(Dictionary dic); } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs index c7b815cc..892db2e3 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; +using Tnb.ProductionMgr.Entities.Dto.PrdManage; namespace Tnb.ProductionMgr.Interfaces { diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdCancelCloseDownService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdCancelCloseDownService.cs index 3821ca14..86831f3d 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdCancelCloseDownService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdCancelCloseDownService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { /// /// 异常停机服务接口 diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs index 7f9ea3db..9b0d03da 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdFeedingService.cs @@ -14,7 +14,7 @@ namespace Tnb.ProductionMgr.Interfaces /// /// public Task SaveData(MaterialReceiptInput input); - + /// /// 保存数据 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdInstockService.cs index 9f0cb544..9fdbb4e9 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdInstockService.cs @@ -15,21 +15,21 @@ namespace Tnb.ProductionMgr.Interfaces /// /// public Task SaveData(PrdInstockInput input); - + /// /// 入库申请同步 /// /// source_id /// public Task SyncInstock(Dictionary dic); - + /// /// 注塑满箱到位后入库申请 /// /// /// public Task InstockTypeOne(InstockInput inut); - + /// /// 短管挤出入库申请 /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdKittingOutService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdKittingOutService.cs index b86a0354..a9e6babd 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdKittingOutService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdKittingOutService.cs @@ -5,6 +5,6 @@ namespace Tnb.ProductionMgr.Interfaces /// public interface IPrdKittingOutService { - + } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskIssueService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskIssueService.cs index 2f1bfc5e..1abe6165 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskIssueService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskIssueService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { /// /// 生产任务单下发接口 diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskService.cs index ba1668ad..e20aeba7 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoTaskService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; +using Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.Interfaces { diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdPackReportService.cs index c901ed4b..c2b906de 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdPackReportService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { /// /// 组装、包装 生产提报接口 diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdTaskManageService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdTaskManageService.cs index 8d5fbe98..285165ed 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdTaskManageService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdTaskManageService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { public interface IPrdTaskManageService { diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IProductionReportRecordService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IProductionReportRecordService.cs index b02102ed..40c507a9 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IProductionReportRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IProductionReportRecordService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { public interface IProductionReportRecordService { diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IRedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IRedisDataService.cs index 35ff9417..cd144734 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IRedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IRedisDataService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { public interface IRedisDataService { diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs index a32b2420..cf222cf5 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs @@ -1,6 +1,4 @@ -using Tnb.ProductionMgr.Entities.Dto; - -namespace Tnb.ProductionMgr.Interfaces +namespace Tnb.ProductionMgr.Interfaces { /// /// 工单生成 diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/Tnb.ProductionMgr.Interfaces.csproj b/ProductionMgr/Tnb.ProductionMgr.Interfaces/Tnb.ProductionMgr.Interfaces.csproj index 9b137e20..34f5f41f 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/Tnb.ProductionMgr.Interfaces.csproj +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/Tnb.ProductionMgr.Interfaces.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskLogService.cs b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskLogService.cs index 14186d66..3ed4c7df 100644 --- a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskLogService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskLogService.cs @@ -1,4 +1,3 @@ -using COSXML.Model.Tag; using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.DependencyInjection; @@ -10,10 +9,10 @@ using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.ProductionMgr.Entities; +using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; -using Tnb.BasicData; +using Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.APP { @@ -53,7 +52,7 @@ namespace Tnb.ProductionMgr.APP _dictionaryDataService = dictionaryDataService; _billRuleService = billRullService; } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -66,18 +65,18 @@ namespace Tnb.ProductionMgr.APP .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => a.eqp_id == d.id) .LeftJoin((a, b, c, d, e) => e.EnCode == a.mo_task_status && e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId) - .LeftJoin((a,b,c,d,e,f)=>a.process_id==f.id) + .LeftJoin((a, b, c, d, e, f) => a.process_id == f.id) .WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d, e) => a.mo_task_code.Contains(mo_task_code)) .WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e) => b.code.Contains(material_code) || b.name.Contains(material_code)) .WhereIF(!string.IsNullOrEmpty(equip_code), (a, b, c, d, e) => d.code.Contains(equip_code) || d.name.Contains(equip_code)) .OrderByDescending(a => a.create_time) - .Select((a, b, c, d, e,f) => new AppPrdMoTaskOneListOutput + .Select((a, b, c, d, e, f) => new AppPrdMoTaskOneListOutput { id = a.id, mo_task_code = a.mo_task_code, mo_task_status = e.FullName, material_id_id = a.material_id, - material_id = b.code+"/"+b.name, + material_id = b.code + "/" + b.name, material_code = b.code, material_name = b.name, mold_id_id = a.mold_id, @@ -93,8 +92,8 @@ namespace Tnb.ProductionMgr.APP scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, scrap_qty = a.scrap_qty, - plan_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), + plan_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } @@ -109,9 +108,9 @@ namespace Tnb.ProductionMgr.APP { string mo_task_id = dic.ContainsKey("mo_task_id") ? dic["mo_task_id"] : ""; if (string.IsNullOrEmpty(mo_task_id)) return Array.Empty(); - Dictionary statsDic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId); - return await _db.Queryable().Where(x=>x.mo_task_id==mo_task_id) - .OrderBy(x=>x.create_time) + Dictionary statsDic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId); + return await _db.Queryable().Where(x => x.mo_task_id == mo_task_id) + .OrderBy(x => x.create_time) .Mapper(x => { if (statsDic.ContainsKey(x.status)) diff --git a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskOneService.cs b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskOneService.cs index 82f0bedd..e11e33e9 100644 --- a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskOneService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskOneService.cs @@ -1,4 +1,3 @@ -using COSXML.Model.Tag; using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.DependencyInjection; @@ -10,10 +9,10 @@ using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.ProductionMgr.Entities; +using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; -using Tnb.BasicData; +using Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.APP { @@ -50,7 +49,7 @@ namespace Tnb.ProductionMgr.APP OverideFuncs.GetListAsync = GetList; _billRuleService = billRullService; } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -67,7 +66,7 @@ namespace Tnb.ProductionMgr.APP .WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e) => b.code.Contains(material_code) || b.name.Contains(material_code)) .WhereIF(!string.IsNullOrEmpty(equip_code), (a, b, c, d, e) => d.code.Contains(equip_code) || d.name.Contains(equip_code)) .Where(a => a.schedule_type == 1) - .Where(a => (a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode || a.mo_task_status==DictConst.MoStatusExceptionCode || a.mo_task_status==DictConst.MoStatusPauseCode || a.mo_task_status==DictConst.ComplatedEnCode)) + .Where(a => (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode || a.mo_task_status == DictConst.MoStatusExceptionCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode)) .OrderByDescending(a => a.create_time) .Select((a, b, c, d, e) => new AppPrdMoTaskOneListOutput { @@ -75,7 +74,7 @@ namespace Tnb.ProductionMgr.APP mo_task_code = a.mo_task_code, mo_task_status = e.FullName, material_id_id = a.material_id, - material_id = b.code+"/"+b.name, + material_id = b.code + "/" + b.name, material_code = b.code, material_name = b.name, mold_id_id = a.mold_id, @@ -87,8 +86,8 @@ namespace Tnb.ProductionMgr.APP scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, scrap_qty = a.scrap_qty, - plan_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), + plan_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } diff --git a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskTwoService.cs b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskTwoService.cs index 9499db64..8af2de3a 100644 --- a/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskTwoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/APP/AppPrdMoTaskTwoService.cs @@ -1,4 +1,3 @@ -using COSXML.Model.Tag; using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.DependencyInjection; @@ -10,10 +9,10 @@ using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.ProductionMgr.Entities; +using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; -using Tnb.BasicData; +using Tnb.ProductionMgr.Entities; namespace Tnb.ProductionMgr.APP { @@ -50,7 +49,7 @@ namespace Tnb.ProductionMgr.APP OverideFuncs.GetListAsync = GetList; _billRuleService = billRullService; } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -63,20 +62,20 @@ namespace Tnb.ProductionMgr.APP .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => a.eqp_id == d.id) .LeftJoin((a, b, c, d, e) => e.EnCode == a.mo_task_status && e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId) - .LeftJoin((a,b,c,d,e,f)=>a.process_id==f.id) + .LeftJoin((a, b, c, d, e, f) => a.process_id == f.id) .WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d, e) => a.mo_task_code.Contains(mo_task_code)) .WhereIF(!string.IsNullOrEmpty(material_code), (a, b, c, d, e) => b.code.Contains(material_code) || b.name.Contains(material_code)) .WhereIF(!string.IsNullOrEmpty(equip_code), (a, b, c, d, e) => d.code.Contains(equip_code) || d.name.Contains(equip_code)) .Where(a => a.schedule_type == 2) - .Where(a => (a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode || a.mo_task_status==DictConst.MoStatusExceptionCode || a.mo_task_status==DictConst.MoStatusPauseCode || a.mo_task_status==DictConst.ComplatedEnCode)) + .Where(a => (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode || a.mo_task_status == DictConst.MoStatusExceptionCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode)) .OrderByDescending(a => a.create_time) - .Select((a, b, c, d, e,f) => new AppPrdMoTaskOneListOutput + .Select((a, b, c, d, e, f) => new AppPrdMoTaskOneListOutput { id = a.id, mo_task_code = a.mo_task_code, mo_task_status = e.FullName, material_id_id = a.material_id, - material_id = b.code+"/"+b.name, + material_id = b.code + "/" + b.name, material_code = b.code, material_name = b.name, mold_id_id = a.mold_id, @@ -92,8 +91,8 @@ namespace Tnb.ProductionMgr.APP scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, scrap_qty = a.scrap_qty, - plan_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), + plan_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs index 975b302a..6214667e 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs @@ -9,6 +9,7 @@ using JNPF.FriendlyException; using JNPF.Message.Entitys.Entity; using JNPF.Message.Service; using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Entitys.System; using JNPF.TaskScheduler; using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; @@ -16,30 +17,27 @@ using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; +using Tnb.BasicData; +using Tnb.BasicData.Entities; +using Tnb.BasicData.Interfaces; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Entity; using Tnb.ProductionMgr.Interfaces; -using Tnb.BasicData.Entities; -using JNPF.Systems.Entitys.System; -using JNPF.Message.Entitys.Entity; -using Tnb.BasicData; -using Tnb.BasicData.Interfaces; using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity; namespace Tnb.ProductionMgr { [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] - public class AndonRecordService: IAndonRecordService, IDynamicApiController, ITransient + public class AndonRecordService : IAndonRecordService, IDynamicApiController, ITransient { private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; private SendMessageService _sendMessageService; private readonly IBasPushRuleLogService _basPushRuleLogService; private readonly TimeTaskService _timeTaskService; - + public AndonRecordService(ISqlSugarRepository repository, SendMessageService sendMessageService, TimeTaskService timeTaskService, @@ -60,11 +58,11 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b) => a.andon_info_id == b.id) .LeftJoin((a, b, c) => a.repair_id == c.Id) .LeftJoin((a, b, c, d) => a.create_id == d.Id) - .LeftJoin((a,b,c,d,e)=>e.EnCode==DictConst.AndonStatus) - .LeftJoin((a,b,c,d,e,f)=>a.status==f.EnCode && e.Id==f.DictionaryTypeId) + .LeftJoin((a, b, c, d, e) => e.EnCode == DictConst.AndonStatus) + .LeftJoin((a, b, c, d, e, f) => a.status == f.EnCode && e.Id == f.DictionaryTypeId) .Where((a, b, c, d) => a.andon_type_id == input.andon_type_id) - .WhereIF(!string.IsNullOrEmpty(input.status),(a, b, c, d)=>a.status==input.status) - .Select((a, b, c, d,e,f) => new AndonPadListOutput + .WhereIF(!string.IsNullOrEmpty(input.status), (a, b, c, d) => a.status == input.status) + .Select((a, b, c, d, e, f) => new AndonPadListOutput { id = a.id, andon_info_name = b.name, @@ -87,30 +85,30 @@ namespace Tnb.ProductionMgr { AndonInfo andonInfo = await _db.Queryable().SingleAsync(x => x.id == input.andon_info_id); AndonRecords andonRecords = input.Adapt(); - DbResult result = await _db.Ado.UseTranAsync(async () => + DbResult result = await _db.Ado.UseTranAsync(async () => { - + andonRecords.create_time = DateTime.Now; andonRecords.create_id = _userManager.UserId; andonRecords.status = DictConst.AndonStatusHJZ; - + List toUsers = new List(); if (!string.IsNullOrEmpty(andonInfo.personnel)) { toUsers.AddRange(JsonConvert.DeserializeObject>(andonInfo.personnel)); } - + if (!string.IsNullOrEmpty(andonInfo.position)) { - + toUsers.AddRange(_db.Queryable().Where(x => andonInfo.position.Contains(x.Id)).Select(s => s.UserId).ToList()); } - + if (!string.IsNullOrEmpty(andonInfo.role)) { - + toUsers.AddRange(_db.Queryable().Where(x => andonInfo.role.Contains(x.Id)).Select(s => s.UserId).ToList()); } @@ -132,76 +130,76 @@ namespace Tnb.ProductionMgr await _db.Insertable(andonRecords).ExecuteCommandAsync(); }); - + if (result.IsSuccess) + { + BasPushRuleH basPushRuleH = await _db.Queryable().SingleAsync(x => x.id == andonInfo.push_rule_id); + BasPushRuleD basPushRuleD = await _db.Queryable().FirstAsync(x => x.push_rule_id == andonInfo.push_rule_id && x.ordinal == 1); + if (basPushRuleH?.enabled == 1) { - BasPushRuleH basPushRuleH = await _db.Queryable().SingleAsync(x=>x.id==andonInfo.push_rule_id); - BasPushRuleD basPushRuleD = await _db.Queryable().FirstAsync(x => x.push_rule_id == andonInfo.push_rule_id && x.ordinal == 1); - if (basPushRuleH?.enabled == 1) + string sendConfigId = basPushRuleD?.send_config_id ?? ""; + List sendModels = await GetSendParamJson(sendConfigId); + + if (sendModels != null && sendModels.Count > 0) { - string sendConfigId = basPushRuleD?.send_config_id ?? ""; - List sendModels = await GetSendParamJson(sendConfigId); - - if (sendModels != null && sendModels.Count > 0) + DateTime executeTime = DateTime.Now.AddMinutes(basPushRuleD.interval); + // string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ? {executeTime.Year}"; + string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ?"; + + var comtentModel = new ContentModel(); + // comtentModel.cron = (2 * 60).ToString(); + comtentModel.cron = cron; + comtentModel.interfaceId = ""; + comtentModel.interfaceName = ""; + comtentModel.parameter = new List(); + comtentModel.localHostTaskId = "PushMsgTimeWorker/PushMsg"; + comtentModel.startTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + // comtentModel.endTime = DateTimeOffset.Now.AddSeconds(3).ToUnixTimeMilliseconds().ToString(); + comtentModel.TenantId = _userManager?.TenantId; + comtentModel.TenantDbName = _userManager?.TenantDbName; + comtentModel.ConnectionConfig = _userManager?.ConnectionConfig; + comtentModel.Token = _userManager?.ToKen; + + // foreach (var item in sendModels) + // { + // } + // + TimeTaskCrInput timeTaskCrInput = new TimeTaskCrInput() { - DateTime executeTime = DateTime.Now.AddMinutes(basPushRuleD.interval); - // string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ? {executeTime.Year}"; - string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ?"; - - var comtentModel = new ContentModel(); - // comtentModel.cron = (2 * 60).ToString(); - comtentModel.cron = cron; - comtentModel.interfaceId = ""; - comtentModel.interfaceName = ""; - comtentModel.parameter = new List(); - comtentModel.localHostTaskId = "PushMsgTimeWorker/PushMsg"; - comtentModel.startTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); - // comtentModel.endTime = DateTimeOffset.Now.AddSeconds(3).ToUnixTimeMilliseconds().ToString(); - comtentModel.TenantId = _userManager?.TenantId; - comtentModel.TenantDbName = _userManager?.TenantDbName; - comtentModel.ConnectionConfig = _userManager?.ConnectionConfig; - comtentModel.Token = _userManager?.ToKen; - - // foreach (var item in sendModels) - // { - // } - // - TimeTaskCrInput timeTaskCrInput = new TimeTaskCrInput() - { - enCode = DateTime.Now.ToString("yyyyMMddHHmmss"), - fullName = "andon推送消息" + DateTime.Now.ToString("yyyyMMddHHmmss"), - executeType = "3", - executeContent = comtentModel.ToJsonString(), - description = JsonConvert.SerializeObject(sendModels[0].paramJson), - sortCode = 9999, - enabledMark = 1, - }; + enCode = DateTime.Now.ToString("yyyyMMddHHmmss"), + fullName = "andon推送消息" + DateTime.Now.ToString("yyyyMMddHHmmss"), + executeType = "3", + executeContent = comtentModel.ToJsonString(), + description = JsonConvert.SerializeObject(sendModels[0].paramJson), + sortCode = 9999, + enabledMark = 1, + }; - await _timeTaskService.Create(timeTaskCrInput,false); + await _timeTaskService.Create(timeTaskCrInput, false); - TimeTaskEntity timeTaskEntity = await _db.Queryable().Where(x => x.EnCode == timeTaskCrInput.enCode).FirstAsync(); - - BasPushRuleLog basPushRuleLog = new BasPushRuleLog() - { - push_rule_id = andonInfo.push_rule_id, - timetask_id = timeTaskEntity?.Id, - biz_id = andonRecords.id, - ordinal = 1, - is_push = 1, - }; + TimeTaskEntity timeTaskEntity = await _db.Queryable().Where(x => x.EnCode == timeTaskCrInput.enCode).FirstAsync(); - await _db.Insertable(basPushRuleLog).ExecuteCommandAsync(); - } + BasPushRuleLog basPushRuleLog = new BasPushRuleLog() + { + push_rule_id = andonInfo.push_rule_id, + timetask_id = timeTaskEntity?.Id, + biz_id = andonRecords.id, + ordinal = 1, + is_push = 1, + }; + + await _db.Insertable(basPushRuleLog).ExecuteCommandAsync(); } - } - - if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + } + + if (!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result.IsSuccess ? "发起成功" : result.ErrorMessage; } [HttpPost] - public async Task ResponseAndon(Dictionary dic) + public async Task ResponseAndon(Dictionary dic) { string id = dic.ContainsKey("id") ? dic["id"] : ""; AndonRecords andonRecords = await _db.Queryable().SingleAsync(x => x.id == id); @@ -216,13 +214,13 @@ namespace Tnb.ProductionMgr { if (andonRecords.status != DictConst.AndonStatusHJZ) { - throw Oops.Bah($"状态错误"); + throw Oops.Bah($"状态错误"); } else { await _db.Updateable() .SetColumns(x => x.repair_id == _userManager.UserId) - .SetColumns(x=>x.response_time==DateTime.Now) + .SetColumns(x => x.response_time == DateTime.Now) .ExecuteCommandAsync(); Dictionary postData = new Dictionary() { @@ -231,13 +229,13 @@ namespace Tnb.ProductionMgr await _basPushRuleLogService.Stop(postData); return true; } - - + + } } else { - throw Oops.Bah($"无该andon记录"); + throw Oops.Bah($"无该andon记录"); } } @@ -250,21 +248,21 @@ namespace Tnb.ProductionMgr { if (andonRecords.status != DictConst.AndonStatusYXY) { - throw Oops.Bah($"状态错误"); + throw Oops.Bah($"状态错误"); } else { await _db.Updateable() - .SetColumns(x=>x.start_repair_time==DateTime.Now) - .Where(x=>x.id==id) + .SetColumns(x => x.start_repair_time == DateTime.Now) + .Where(x => x.id == id) .ExecuteCommandAsync(); return true; } - + } else { - throw Oops.Bah($"无该andon记录"); + throw Oops.Bah($"无该andon记录"); } } @@ -277,24 +275,24 @@ namespace Tnb.ProductionMgr { if (andonRecords.status != DictConst.AndonStatusCLZ) { - throw Oops.Bah($"状态错误"); + throw Oops.Bah($"状态错误"); } else { await _db.Updateable() - .SetColumns(x=>x.end_repair_time==DateTime.Now) - .Where(x=>x.id==id) + .SetColumns(x => x.end_repair_time == DateTime.Now) + .Where(x => x.id == id) .ExecuteCommandAsync(); return true; } - + } else { - throw Oops.Bah($"无该andon记录"); + throw Oops.Bah($"无该andon记录"); } } - + [HttpPost] public async Task ConfirmAndon(Dictionary dic) { @@ -304,21 +302,21 @@ namespace Tnb.ProductionMgr { if (andonRecords.status != DictConst.AndonStatusYWC) { - throw Oops.Bah($"状态错误"); + throw Oops.Bah($"状态错误"); } else { await _db.Updateable() - .SetColumns(x=>x.confirm_time==DateTime.Now) - .Where(x=>x.id==id) + .SetColumns(x => x.confirm_time == DateTime.Now) + .Where(x => x.id == id) .ExecuteCommandAsync(); return true; } - + } else { - throw Oops.Bah($"无该andon记录"); + throw Oops.Bah($"无该andon记录"); } } diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonService.cs index e8ca5a9e..f583a39e 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonService.cs @@ -1,25 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Numerics; -using System.Reactive.Joins; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; +using System.Dynamic; using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Message.Service; -using JNPF.Systems.Interfaces.System; -using JNPF.TaskScheduler; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.EquipMgr.Interfaces; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Entities.Entity; @@ -33,7 +19,7 @@ namespace Tnb.ProductionMgr { private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; - public AndonService(ISqlSugarRepository repository,IUserManager userManager) + public AndonService(ISqlSugarRepository repository, IUserManager userManager) { _userManager = userManager; _db = repository.AsSugarClient(); @@ -99,11 +85,11 @@ namespace Tnb.ProductionMgr { label = andonType.name, value = andonType.id, - children = andonInfos.Where(x=>x.andon_type==andonType.id).Select(x=>new AndonCascaderOptionsOuput() + children = andonInfos.Where(x => x.andon_type == andonType.id).Select(x => new AndonCascaderOptionsOuput() { label = x.name, value = x.id, - children = andonBreakDowns.Where(y=>x.breakdown_id.Contains(y.id)).Select(y=>new AndonCascaderOptionsOuput() + children = andonBreakDowns.Where(y => x.breakdown_id.Contains(y.id)).Select(y => new AndonCascaderOptionsOuput() { label = y.name, value = y.id @@ -119,8 +105,8 @@ namespace Tnb.ProductionMgr defaultValue = breakdownIdArr[0]; } - result.Add("options",options); - result.Add("defaultValue",defaultValue); + result.Add("options", options); + result.Add("defaultValue", defaultValue); return result; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonTypeService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonTypeService.cs index 51ed758a..8ab70c4e 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonTypeService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonTypeService.cs @@ -1,17 +1,10 @@ using JNPF.Common.Core.Manager; -using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Systems.Entitys.Permission; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData; -using Tnb.BasicData.Entities; -using Tnb.EquipMgr.Interfaces; using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; -using Tnb.ProductionMgr.Entities.Entity; using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr @@ -22,7 +15,7 @@ namespace Tnb.ProductionMgr { private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; - public AndonTypeService(ISqlSugarRepository repository,IUserManager userManager) + public AndonTypeService(ISqlSugarRepository repository, IUserManager userManager) { _userManager = userManager; _db = repository.AsSugarClient(); @@ -37,7 +30,7 @@ namespace Tnb.ProductionMgr { andon_type_id = a.id, andon_type_name = a.name, - record_count = SqlFunc.Subqueryable().Where(x=>x.andon_type_id==a.id && x.status==DictConst.AndonStatusHJZ).Count(), + record_count = SqlFunc.Subqueryable().Where(x => x.andon_type_id == a.id && x.status == DictConst.AndonStatusHJZ).Count(), }).ToListAsync(); return result; } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdCancelCloseDownService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdCancelCloseDownService.cs index d2d3806c..cbbe0e7b 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdCancelCloseDownService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdCancelCloseDownService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; +using System.Dynamic; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.Message; using JNPF.Common.Enums; @@ -15,6 +9,7 @@ using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Message.Entitys.Entity; +using JNPF.Message.Service; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; @@ -26,15 +21,14 @@ using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData; +using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Interfaces; -using Tnb.BasicData.Entities; using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity; -using JNPF.Message.Service; namespace Tnb.ProductionMgr { @@ -54,7 +48,7 @@ namespace Tnb.ProductionMgr private readonly IBillRullService _billRullService; private readonly TimeTaskService _timeTaskService; private SendMessageService _sendMessageService; - + private static Dictionary _dicWorkStationAndShopRelacion = new Dictionary(); private static Dictionary _dicWorkShop = new Dictionary(); @@ -218,14 +212,14 @@ namespace Tnb.ProductionMgr BasPushRuleD basPushRuleD = await _db.Queryable().FirstAsync(x => x.push_rule_id == PUSHRULEID && x.ordinal == 1); try { - - DbResult result = await _db.Ado.UseTranAsync(async () => + + DbResult result = await _db.Ado.UseTranAsync(async () => { var moTaskList = await _prdMoTaskService.GetListByEqpId(input.eqp_id); if (moTaskList?.Count > 1) throw new AppFriendlyException($"设备{input.eqp_id},目前有两条进行中的生产任务", 500); if (moTaskList?.Count > 0) { - + cancelCloseDown.id = SnowflakeIdHelper.NextId(); cancelCloseDown.eqp_id = input.eqp_id; cancelCloseDown.create_id = _userManager.UserId; @@ -233,7 +227,7 @@ namespace Tnb.ProductionMgr cancelCloseDown.closedown_start_time = DateTime.Now; await _db.Insertable(cancelCloseDown).ExecuteCommandAsync(); - + var record = cancelCloseDown.Adapt(); record.eqp_code = eqp?.code; record.eqp_name = eqp?.name; @@ -281,12 +275,12 @@ namespace Tnb.ProductionMgr { List list = await _sendMessageService.SendTest(basPushRuleD.send_config_id); List toUsers = JsonConvert.DeserializeObject>(eqp.responsibler_id); - + foreach (var item in list) { foreach (var param in item.paramJson) { - if (param.field=="equip_code") + if (param.field == "equip_code") { param.value = eqp.code; } @@ -299,25 +293,25 @@ namespace Tnb.ProductionMgr await _sendMessageService.SendMessage(item, new Dictionary()); } } - + } else throw Oops.Oh(ErrorCode.COM1001); }); if (result.IsSuccess) { - BasPushRuleH basPushRuleH = await _db.Queryable().SingleAsync(x=>x.id==PUSHRULEID); + BasPushRuleH basPushRuleH = await _db.Queryable().SingleAsync(x => x.id == PUSHRULEID); if (basPushRuleH?.enabled == 1) { string sendConfigId = basPushRuleD?.send_config_id ?? ""; List sendModels = await GetSendParamJson(sendConfigId); - + if (sendModels != null && sendModels.Count > 0) { DateTime executeTime = DateTime.Now.AddMinutes(basPushRuleD.interval); // string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ? {executeTime.Year}"; string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ?"; - + var comtentModel = new ContentModel(); // comtentModel.cron = (2 * 60).ToString(); comtentModel.cron = cron; @@ -331,7 +325,7 @@ namespace Tnb.ProductionMgr comtentModel.TenantDbName = _userManager?.TenantDbName; comtentModel.ConnectionConfig = _userManager?.ConnectionConfig; comtentModel.Token = _userManager?.ToKen; - + foreach (var item in sendModels) { foreach (var param in item.paramJson) @@ -342,7 +336,7 @@ namespace Tnb.ProductionMgr } } } - + TimeTaskCrInput timeTaskCrInput = new TimeTaskCrInput() { enCode = DateTime.Now.ToString("yyyyMMddHHmmss"), @@ -354,10 +348,10 @@ namespace Tnb.ProductionMgr enabledMark = 1, }; - await _timeTaskService.Create(timeTaskCrInput,false); + await _timeTaskService.Create(timeTaskCrInput, false); TimeTaskEntity timeTaskEntity = await _db.Queryable().Where(x => x.EnCode == timeTaskCrInput.enCode).FirstAsync(); - + BasPushRuleLog basPushRuleLog = new BasPushRuleLog() { push_rule_id = PUSHRULEID, @@ -370,9 +364,9 @@ namespace Tnb.ProductionMgr await _db.Insertable(basPushRuleLog).ExecuteCommandAsync(); } } - + } - + } catch (Exception ex) { @@ -380,7 +374,7 @@ namespace Tnb.ProductionMgr // await _db.Ado.RollbackTranAsync(); throw; } - + } /// /// 停机结束 @@ -420,7 +414,7 @@ namespace Tnb.ProductionMgr throw; } } - + private async Task> GetSendParamJson(string id) { var list = await _db.Queryable((a, b) => new JoinQueryInfos(JoinType.Left, a.TemplateId == b.Id)) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs index 61872a53..285e7e76 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdFeedingService.cs @@ -1,29 +1,18 @@ -using JNPF; using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extras.CollectiveOAuth.Models; -using JNPF.Extras.CollectiveOAuth.Utils; using JNPF.FriendlyException; -using JNPF.Logging; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev.Entitys; using Microsoft.AspNetCore.Mvc; -using Microsoft.ClearScript.Util.Web; -using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; +using Tnb.EquipMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Interfaces; -using Tnb.ProductionMgr.Entities.Consts; -using Tnb.WarehouseMgr; using Tnb.WarehouseMgr.Entities; -using Tnb.BasicData; -using Tnb.EquipMgr.Entities; namespace Tnb.ProductionMgr { @@ -39,7 +28,7 @@ namespace Tnb.ProductionMgr private readonly IPrdMoTaskService _prdMoTaskService; private readonly IBillRullService _billRullService; // private readonly WmsSignForDeliveryService _wmsSignForDeliveryService; - + public PrdFeedingService( @@ -57,7 +46,7 @@ namespace Tnb.ProductionMgr _billRullService = billRullService; } - + [HttpPost] public async Task SaveData(MaterialReceiptInput input) { @@ -67,7 +56,7 @@ namespace Tnb.ProductionMgr var moTask = await db.Queryable().FirstAsync(x => x.id == input.mo_task_id); var inputMaterials = await db.Queryable() .Where(x => x.mbom_id == moTask.bom_id && x.mbom_process_id == input.mbom_process_id) - .Select(x=>x.material_id) + .Select(x => x.material_id) .ToListAsync(); string code = await _billRullService.GetBillNumber(Tnb.BasicData.CodeTemplateConst.FEEDING_CODE); @@ -94,7 +83,7 @@ namespace Tnb.ProductionMgr { foreach (var item in input.details) { - if(!inputMaterials.Contains(item["material_id"])) + if (!inputMaterials.Contains(item["material_id"])) throw new Exception("该物料不是生产bom投入物料,不能签收"); var detail = await db.Queryable() @@ -115,10 +104,11 @@ namespace Tnb.ProductionMgr if (detail != null) { - if(detail.feeding_num + num > detail.num) + if (detail.feeding_num + num > detail.num) { throw new Exception("投料数量不能大于签收数量"); - }else if (detail.feeding_num + num == detail.num) + } + else if (detail.feeding_num + num == detail.num) { await db.Updateable() .SetColumns(x => x.feeding_num == x.feeding_num + num) @@ -164,7 +154,7 @@ namespace Tnb.ProductionMgr taskLog.mo_task_code = moTask.mo_task_code; taskLog.station_code = station?.EnCode; taskLog.process_code = process.code; - + await db.Insertable(prdFeedingH).ExecuteCommandAsync(); await db.Insertable(list).ExecuteCommandAsync(); await db.Insertable(taskLog).ExecuteCommandAsync(); @@ -181,8 +171,8 @@ namespace Tnb.ProductionMgr // carry_code = input.carry_code ?? "", // }); } - - if(!result.IsSuccess) throw Oops.Oh(result.ErrorMessage); + + if (!result.IsSuccess) throw Oops.Oh(result.ErrorMessage); return result.IsSuccess ? "投料成功" : result.ErrorMessage; } @@ -204,13 +194,13 @@ namespace Tnb.ProductionMgr } var carry = await db.Queryable().SingleAsync(x => x.carry_code == input.carry_code); var workline = await db.Queryable().SingleAsync(x => x.Id == worklineId); - var workshop = await db.Queryable().SingleAsync(x=>x.Id==workline.ParentId); + var workshop = await db.Queryable().SingleAsync(x => x.Id == workline.ParentId); var inputMaterials = await db.Queryable() .Where(x => x.mbom_id == moTask.bom_id && x.mbom_process_id == moTask.mbom_process_id) - .Select(x=>x.material_id) + .Select(x => x.material_id) .ToListAsync(); - + string code = await _billRullService.GetBillNumber(Tnb.BasicData.CodeTemplateConst.FEEDING_CODE); prdFeedingH = new PrdFeedingH() { @@ -229,12 +219,12 @@ namespace Tnb.ProductionMgr create_time = DateTime.Now, org_id = _userManager.GetUserInfo().Result.organizeId }; - + if (input.details != null && input.details.Count > 0) { foreach (var item in input.details) { - if(!inputMaterials.Contains(item["material_id"])) + if (!inputMaterials.Contains(item["material_id"])) throw new Exception("该物料不是生产bom投入物料,不能签收"); var detail = await db.Queryable() @@ -255,10 +245,11 @@ namespace Tnb.ProductionMgr if (detail != null) { - if(detail.feeding_num + num > detail.num) + if (detail.feeding_num + num > detail.num) { throw new Exception("投料数量不能大于签收数量"); - }else if (detail.feeding_num + num == detail.num) + } + else if (detail.feeding_num + num == detail.num) { await db.Updateable() .SetColumns(x => x.feeding_num == x.feeding_num + num) @@ -285,7 +276,7 @@ namespace Tnb.ProductionMgr throw new Exception("没有签收物料"); } - + await db.Insertable(prdFeedingH).ExecuteCommandAsync(); await db.Insertable(list).ExecuteCommandAsync(); @@ -330,12 +321,12 @@ namespace Tnb.ProductionMgr // // } } - - if(!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); + + if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "签收成功" : result.ErrorMessage; } - - + + /// /// 生产投料 /// @@ -366,13 +357,13 @@ namespace Tnb.ProductionMgr } var carry = await db.Queryable().SingleAsync(x => x.carry_code == input.carry_code); var workline = await db.Queryable().SingleAsync(x => x.Id == worklineId); - var workshop = await db.Queryable().SingleAsync(x=>x.Id==workline.ParentId); + var workshop = await db.Queryable().SingleAsync(x => x.Id == workline.ParentId); var inputMaterials = await db.Queryable() .Where(x => x.mbom_id == moTask.bom_id && x.mbom_process_id == moTask.mbom_process_id) - .Select(x=>x.material_id) + .Select(x => x.material_id) .ToListAsync(); - + string code = await _billRullService.GetBillNumber(Tnb.BasicData.CodeTemplateConst.FEEDING_CODE); prdFeedingH = new PrdFeedingH() { @@ -391,12 +382,12 @@ namespace Tnb.ProductionMgr create_time = DateTime.Now, org_id = _userManager.GetUserInfo().Result.organizeId }; - + if (input.details != null && input.details.Count > 0) { foreach (var item in input.details) { - if(!inputMaterials.Contains(item["material_id"])) + if (!inputMaterials.Contains(item["material_id"])) throw new Exception("该物料不是生产bom投入物料,不能签收"); var detail = await db.Queryable() @@ -417,10 +408,11 @@ namespace Tnb.ProductionMgr if (detail != null) { - if(detail.feeding_num + num > detail.num) + if (detail.feeding_num + num > detail.num) { throw new Exception("投料数量不能大于签收数量"); - }else if (detail.feeding_num + num == detail.num) + } + else if (detail.feeding_num + num == detail.num) { await db.Updateable() .SetColumns(x => x.feeding_num == x.feeding_num + num) @@ -447,14 +439,14 @@ namespace Tnb.ProductionMgr throw new Exception("没有签收物料"); } - + await db.Insertable(prdFeedingH).ExecuteCommandAsync(); await db.Insertable(list).ExecuteCommandAsync(); }); - - if(!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); + + if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "签收成功" : result.ErrorMessage; } @@ -463,11 +455,11 @@ namespace Tnb.ProductionMgr { var db = _repository.AsSugarClient(); var result = await db.Queryable() - .Where(a => a.schedule_type == 2 && a.parent_id!=null) + .Where(a => a.schedule_type == 2 && a.parent_id != null) .Select(a => new FeedingRecordTreeOutput() { mo_task_code = a.mo_task_code, - children = SqlFunc.Subqueryable().Where(b=>a.id==b.mo_task_id).ToList(b=>new FeedingRecordChildren() + children = SqlFunc.Subqueryable().Where(b => a.id == b.mo_task_id).ToList(b => new FeedingRecordChildren() { id = b.id, code = b.code, @@ -491,7 +483,7 @@ namespace Tnb.ProductionMgr { item.children = db.Queryable() .LeftJoin((c, d) => c.material_id == d.id) - .Where((c, d) => item.id == c.feeding_id).Select((c,d) => new FeedingRecordMaterialChildren() + .Where((c, d) => item.id == c.feeding_id).Select((c, d) => new FeedingRecordMaterialChildren() { material_code = d.code, material_name = d.name, diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index 0ae748de..7a168a59 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -1,37 +1,31 @@ using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; +using JNPF.Common.Filter; +using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; using JNPF.FriendlyException; using JNPF.Logging; -using JNPF.RemoteRequest; -using JNPF.Systems.Interfaces.System; -using Mapster; -using Microsoft.AspNetCore.Http; +using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Interfaces.Permission; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; +using SqlSugar.Extensions; +using Tnb.BasicData; using Tnb.BasicData.Entities; +using Tnb.EquipMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Interfaces; -using Tnb.WarehouseMgr; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; -using Tnb.BasicData; -using JNPF.VisualDev; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using Tnb.EquipMgr.Entities; using Tnb.ProductionMgr.Entities.Dto.PrdManage; -using JNPF.Common.Filter; -using JNPF.Common.Security; -using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Interfaces.Permission; -using Microsoft.AspNetCore.Authorization; -using SQLitePCL; -using SqlSugar.Extensions; +using Tnb.ProductionMgr.Interfaces; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.ProductionMgr { @@ -41,7 +35,7 @@ namespace Tnb.ProductionMgr [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] [OverideVisualDev(ModuleId)] - public class PrdInstockService : IPrdInstockService, IDynamicApiController, ITransient, IOverideVisualDevService + public class PrdInstockService : IPrdInstockService, IDynamicApiController, ITransient, IOverideVisualDevService { private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; @@ -86,7 +80,7 @@ namespace Tnb.ProductionMgr create_time = a.create_time.ToString() }).ToListAsync(); var treeList = list.ToTree(); - treeList= treeList.Skip((input.currentPage-1)* input.pageSize).Take(input.pageSize).ToList(); + treeList = treeList.Skip((input.currentPage - 1) * input.pageSize).Take(input.pageSize).ToList(); SqlSugarPagedList pagedList = new() { list = treeList, @@ -113,13 +107,13 @@ namespace Tnb.ProductionMgr { throw Oops.Bah("请先选择工位"); } - + DbResult result = await db.Ado.UseTranAsync(async () => { OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorkshopCode); - - + + prdInstockH = new PrdInstockH() { bill_type = input.bill_type, @@ -148,7 +142,7 @@ namespace Tnb.ProductionMgr // code_batch = item.ContainsKey("batch") ? item["batch"] : "", // barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "", barcode = item.ContainsKey("barcode") ? item["barcode"] : "", - code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "", + code_batch = item.ContainsKey("barcode") ? item["barcode"] + "0001" : "", quantity = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"), }); } @@ -186,10 +180,10 @@ namespace Tnb.ProductionMgr material_id = item.ContainsKey("material_id") ? item["material_id"] : "", material_code = item.ContainsKey("material_code") ? item["material_code"] : "", unit_id = item.ContainsKey("unit_id") ? item["unit_id"] : "", - code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "", + code_batch = item.ContainsKey("barcode") ? item["barcode"] + "0001" : "", pr_qty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"), }); - + mesCreateInstockInput.instockcodes.Add(new MESWmsInstockCodeInput() { material_id = item.ContainsKey("material_id") ? item["material_id"] : "", @@ -198,7 +192,7 @@ namespace Tnb.ProductionMgr // code_batch = item.ContainsKey("batch") ? item["batch"] : "", // barcode = item.ContainsKey("batch") ? item["batch"]+"0001" : "", barcode = item.ContainsKey("barcode") ? item["barcode"] : "", - code_batch = item.ContainsKey("barcode") ? item["barcode"]+"0001" : "", + code_batch = item.ContainsKey("barcode") ? item["barcode"] + "0001" : "", codeqty = Convert.ToInt32(item.ContainsKey("quantity") ? item["quantity"] : "0"), }); } @@ -207,7 +201,7 @@ namespace Tnb.ProductionMgr { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK,JsonConvert.SerializeObject(mesCreateInstockInput),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); if (authResponse.code != 200 || !authResponse.data.ObjToBool()) @@ -219,17 +213,17 @@ namespace Tnb.ProductionMgr result2 = await db.Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdInstockH); - + if (prdInstockDs.Count > 0) { await db.Insertable(prdInstockDs).ExecuteCommandAsync(); } }); - + } } - - if(!result2.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + if (!result2.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result2.IsSuccess ? "保存成功" : result2.ErrorMessage; } @@ -277,24 +271,24 @@ namespace Tnb.ProductionMgr if (!string.IsNullOrEmpty(equip_code)) throw Oops.Bah("请传机台号"); var db = _repository.AsSugarClient(); EqpEquipment equipment = await db.Queryable().Where(x => x.code == equip_code).FirstAsync(); - if(equipment==null ) throw Oops.Bah("未找到机台"); - if(string.IsNullOrEmpty(equipment.as_location_id)) throw Oops.Bah("未找到入库库位"); - BasLocation basLocation = await db.Queryable().SingleAsync(x=>x.id==equipment.as_location_id); - if(basLocation==null) throw Oops.Bah("未找到入库库位"); + if (equipment == null) throw Oops.Bah("未找到机台"); + if (string.IsNullOrEmpty(equipment.as_location_id)) throw Oops.Bah("未找到入库库位"); + BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); + if (basLocation == null) throw Oops.Bah("未找到入库库位"); PrdReport prdReport = await db.Queryable() .Where(x => x.equip_id == equipment.id && x.status == 0).OrderByDescending(x => x.create_time) .FirstAsync(); - if(prdReport==null) throw Oops.Bah("未找到提报记录"); + if (prdReport == null) throw Oops.Bah("未找到提报记录"); PrdInstockH prdInstockH = null; List prdInstockDs = new List() { }; DbResult result2 = new DbResult(); - BasMaterial basMaterial = await db.Queryable().SingleAsync(x=>x.id==prdReport.material_id); + BasMaterial basMaterial = await db.Queryable().SingleAsync(x => x.id == prdReport.material_id); DbResult result = await db.Ado.UseTranAsync(async () => { OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode); - + prdInstockH = new PrdInstockH() { bill_type = DictConst.CHANCHENGPINRUKUDAN, @@ -319,11 +313,11 @@ namespace Tnb.ProductionMgr material_code = basMaterial.code, unit_id = prdReport.unit_id, barcode = prdReport.barcode, - code_batch = prdReport.barcode+"0001", + code_batch = prdReport.barcode + "0001", quantity = (int)prdReport.reported_qty, }); }); - + if (result.IsSuccess) { MESCreateInstockInput mesCreateInstockInput = new MESCreateInstockInput(); @@ -349,14 +343,14 @@ namespace Tnb.ProductionMgr code_batch = prdReport.barcode, pr_qty = (int)prdReport.reported_qty, }); - + mesCreateInstockInput.instockcodes.Add(new MESWmsInstockCodeInput() { material_id = prdReport.material_id, material_code = basMaterial.code, unit_id = prdReport.unit_id, barcode = prdReport.barcode, - code_batch = prdReport.barcode+"0001", + code_batch = prdReport.barcode + "0001", codeqty = (int)prdReport.reported_qty, }); string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; @@ -364,7 +358,7 @@ namespace Tnb.ProductionMgr { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK,JsonConvert.SerializeObject(mesCreateInstockInput),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); if (authResponse.code != 200 || !authResponse.data.ObjToBool()) @@ -376,17 +370,17 @@ namespace Tnb.ProductionMgr result2 = await db.Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdInstockH); - + if (prdInstockDs.Count > 0) { await db.Insertable(prdInstockDs).ExecuteCommandAsync(); } }); - + } } - - if(!result2.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); + + if (!result2.IsSuccess) throw Oops.Oh(ErrorCode.COM1008); return result2.IsSuccess ? "申请成功" : result2.ErrorMessage; } @@ -400,12 +394,12 @@ namespace Tnb.ProductionMgr PrdInstockH prdInstockH = null; List prdInstockDs = new List() { }; DbResult result2 = new DbResult(); - BasMaterial basMaterial = await db.Queryable().SingleAsync(x=>x.id==prdReport.material_id); + BasMaterial basMaterial = await db.Queryable().SingleAsync(x => x.id == prdReport.material_id); DbResult result = await db.Ado.UseTranAsync(async () => { OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(prdReport.station, DictConst.RegionCategoryWorkshopCode); - + prdInstockH = new PrdInstockH() { bill_type = DictConst.CHANCHENGPINRUKUDAN, @@ -430,11 +424,11 @@ namespace Tnb.ProductionMgr material_code = basMaterial.code, unit_id = prdReport.unit_id, barcode = prdReport.barcode, - code_batch = prdReport.barcode+"0001", + code_batch = prdReport.barcode + "0001", quantity = (int)prdReport.reported_qty, }); }); - + if (result.IsSuccess) { MESCreateInstockInput mesCreateInstockInput = new MESCreateInstockInput(); @@ -460,14 +454,14 @@ namespace Tnb.ProductionMgr code_batch = prdReport.barcode, pr_qty = (int)prdReport.reported_qty, }); - + mesCreateInstockInput.instockcodes.Add(new MESWmsInstockCodeInput() { material_id = prdReport.material_id, material_code = basMaterial.code, unit_id = prdReport.unit_id, barcode = prdReport.barcode, - code_batch = prdReport.barcode+"0001", + code_batch = prdReport.barcode + "0001", codeqty = (int)prdReport.reported_qty, }); string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; @@ -475,7 +469,7 @@ namespace Tnb.ProductionMgr { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK,JsonConvert.SerializeObject(mesCreateInstockInput),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_INSTOCK, JsonConvert.SerializeObject(mesCreateInstockInput), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); if (authResponse.code != 200 || !authResponse.data.ObjToBool()) @@ -487,13 +481,13 @@ namespace Tnb.ProductionMgr result2 = await db.Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdInstockH); - + if (prdInstockDs.Count > 0) { await db.Insertable(prdInstockDs).ExecuteCommandAsync(); } }); - + } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdKittingOutService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdKittingOutService.cs index fd81e5b3..caa07277 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdKittingOutService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdKittingOutService.cs @@ -1,6 +1,5 @@ using JNPF; using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Extras.CollectiveOAuth.Models; @@ -12,19 +11,17 @@ using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.Permission; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; using SqlSugar; using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Interfaces; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.ProductionMgr.Entities.Dto; +using Tnb.ProductionMgr.Interfaces; using Tnb.WarehouseMgr.Entities; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.ProductionMgr { @@ -44,8 +41,8 @@ namespace Tnb.ProductionMgr private readonly IOrganizeService _organizeService; private readonly IBillRullService _billRullService; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); - - public PrdKittingOutService(ISqlSugarRepository repository, IRunService runService, + + public PrdKittingOutService(ISqlSugarRepository repository, IRunService runService, IBillRullService billRullService, IUserManager userManager, IOrganizeService organizeService, @@ -59,7 +56,7 @@ namespace Tnb.ProductionMgr _billRullService = billRullService; // OverideFuncs.CreateAsync = Create; } - + // private async Task Create(VisualDevModelDataCrInput visualDevModelDataCrInput) // { // PrdKittingOutH prdKittingOutH = new PrdKittingOutH(); @@ -157,7 +154,7 @@ namespace Tnb.ProductionMgr // } // // } - + /// /// 齐套出库申请 /// @@ -165,7 +162,7 @@ namespace Tnb.ProductionMgr /// /// [HttpPost] - public async Task KittingOut(KittingOutInput kittingOutInput) + public async Task KittingOut(KittingOutInput kittingOutInput) { PrdKittingOutH prdKittingOutH = new PrdKittingOutH(); try @@ -173,7 +170,7 @@ namespace Tnb.ProductionMgr var db = _repository.AsSugarClient(); OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(kittingOutInput.workstation_id, DictConst.RegionCategoryWorklineCode); kittingOutInput.workline_id = workline?.Id ?? ""; - + List input = new List(); input.Add(new MESKittingOutStkInput() { @@ -189,14 +186,14 @@ namespace Tnb.ProductionMgr create_id = _userManager.UserId, wmsKittingoutDs = new List(), }); - + input[0].wmsKittingoutDs = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(kittingOutInput.tableField115)); string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK,JsonConvert.SerializeObject(input),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -235,11 +232,11 @@ namespace Tnb.ProductionMgr kitting_out_id = prdKittingOutH.id, }); } - + // VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); // await _runService.Create(templateEntity, visualDevModelDataCrInput); - - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdKittingOutH); if (prdKittingOutDs.Count > 0) @@ -261,10 +258,10 @@ namespace Tnb.ProductionMgr Log.Error(e.Message); throw Oops.Bah(e.Message); } - + } - - + + /// /// 齐套出库申请 /// @@ -272,32 +269,32 @@ namespace Tnb.ProductionMgr /// /// [HttpPost] - public async Task KittingOutNew(KittingOutNewInput kittingOutInput) + public async Task KittingOutNew(KittingOutNewInput kittingOutInput) { PrdKittingOutH prdKittingOutH = new PrdKittingOutH(); string warehouse_id = "26103348825381";//二楼缓存仓 try { var db = _repository.AsSugarClient(); - PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x=>x.id==kittingOutInput.mo_task_id); - BasMaterial basMaterial = await db.Queryable().SingleAsync(x=>x.id==prdMoTask.material_id); - WmsCollocationSchemeH wmsCollocationSchemeH = await db.Queryable().SingleAsync(x=>x.id==kittingOutInput.collocation_scheme_id); - List wmsCollocationSchemeDs = await db.Queryable().Where(x=>x.bill_id==kittingOutInput.collocation_scheme_id).ToListAsync(); + PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x => x.id == kittingOutInput.mo_task_id); + BasMaterial basMaterial = await db.Queryable().SingleAsync(x => x.id == prdMoTask.material_id); + WmsCollocationSchemeH wmsCollocationSchemeH = await db.Queryable().SingleAsync(x => x.id == kittingOutInput.collocation_scheme_id); + List wmsCollocationSchemeDs = await db.Queryable().Where(x => x.bill_id == kittingOutInput.collocation_scheme_id).ToListAsync(); List materialIds = wmsCollocationSchemeDs.Select(x => x.material_id).ToList(); - List basMaterials = await db.Queryable().Where(x=>materialIds.Contains(x.id)).ToListAsync(); - Dictionary unitIdDic = await db.Queryable() + List basMaterials = await db.Queryable().Where(x => materialIds.Contains(x.id)).ToListAsync(); + Dictionary unitIdDic = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit) .LeftJoin((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode) - .Where((a,b,c)=>materialIds.Contains(a.id)) - .Select((a, b, c) => new + .Where((a, b, c) => materialIds.Contains(a.id)) + .Select((a, b, c) => new { key = a.id, - value = c.Id + value = c.Id }) .ToDictionaryAsync(x => x.key, x => x.value); Dictionary unitCodeDic = basMaterials.ToDictionary(x => x.id, x => x.unit_id); OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(kittingOutInput.workstation_id, DictConst.RegionCategoryWorklineCode); - + List input = new List(); input.Add(new MESKittingOutStkInput() { @@ -313,7 +310,7 @@ namespace Tnb.ProductionMgr create_id = _userManager.UserId, wmsKittingoutDs = new List(), }); - + foreach (var item in wmsCollocationSchemeDs) { input[0].wmsKittingoutDs.Add(new MESKittingOutStkDInput() @@ -327,13 +324,13 @@ namespace Tnb.ProductionMgr box = item.box, }); } - + string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK,JsonConvert.SerializeObject(input),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_KITTING_OUT_STK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -372,11 +369,11 @@ namespace Tnb.ProductionMgr kitting_out_id = prdKittingOutH.id, }); } - + // VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); // await _runService.Create(templateEntity, visualDevModelDataCrInput); - - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdKittingOutH); if (prdKittingOutDs.Count > 0) @@ -398,7 +395,7 @@ namespace Tnb.ProductionMgr Log.Error(e.Message); throw Oops.Bah(e.Message); } - + } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index ed200e3d..ace01ef4 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -1,7 +1,5 @@ using JNPF; using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Extras.CollectiveOAuth.Models; @@ -14,20 +12,14 @@ using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; +using Tnb.BasicData; using Tnb.BasicData.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; using Tnb.ProductionMgr.Interfaces; -using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities.Consts; -using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Interfaces; -using Tnb.ProductionMgr.Entities.Consts; using Tnb.WarehouseMgr; using Tnb.WarehouseMgr.Entities; -using Tnb.BasicData; +using Tnb.WarehouseMgr.Entities.Dto; namespace Tnb.ProductionMgr { @@ -57,7 +49,7 @@ namespace Tnb.ProductionMgr _billRullService = billRullService; } - + [HttpPost] public async Task GetInfoByQrCode(string qrCode) { @@ -120,7 +112,7 @@ namespace Tnb.ProductionMgr carry_name = b.carry_name, children = SqlFunc.Subqueryable() .LeftJoin((c, d) => c.material_id == d.id) - .Where((c, d) => a.id == c.material_receipt_id && c.is_all_feeding==0).ToList((c, d) => new CarryCodeDetailOutput() + .Where((c, d) => a.id == c.material_receipt_id && c.is_all_feeding == 0).ToList((c, d) => new CarryCodeDetailOutput() { unit_id = d.unit_id, // barcode = c.barcode, @@ -148,14 +140,14 @@ namespace Tnb.ProductionMgr var moTask = await db.Queryable().FirstAsync(x => x.id == input.mo_task_id); var inputMaterials = await db.Queryable() .Where(x => x.mbom_id == moTask.bom_id) - .WhereIF(!string.IsNullOrEmpty(input.mbom_process_id),x=>x.mbom_process_id==input.mbom_process_id) - .Select(x=>x.material_id) + .WhereIF(!string.IsNullOrEmpty(input.mbom_process_id), x => x.mbom_process_id == input.mbom_process_id) + .Select(x => x.material_id) .ToListAsync(); string code = await _billRullService.GetBillNumber(Tnb.BasicData.CodeTemplateConst.MATERIAL_RECEIPT_CODE); OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorklineCode); OrganizeEntity workshop = await _organizeService.GetAnyParentByWorkstationId(input.station_id, DictConst.RegionCategoryWorkshopCode); - + prdMaterialReceiptH = new PrdMaterialReceiptH() { code = code, @@ -178,9 +170,9 @@ namespace Tnb.ProductionMgr { foreach (var item in input.details) { - if(!inputMaterials.Contains(item["material_id"])) + if (!inputMaterials.Contains(item["material_id"])) throw new Exception("该物料不是生产bom投入物料,不能签收"); - + list.Add(new PrdMaterialReceiptD { material_receipt_id = prdMaterialReceiptH.id, @@ -205,13 +197,13 @@ namespace Tnb.ProductionMgr throw new Exception("没有签收物料"); } - + // await db.Insertable(prdMaterialReceiptH).ExecuteCommandAsync(); // await db.Insertable(list).ExecuteCommandAsync(); }); - - + + if (result.IsSuccess) { //签收后调用载具签收接口 @@ -228,13 +220,13 @@ namespace Tnb.ProductionMgr create_id = _userManager.UserId, carry_code = input.carry_code ?? "", }; - + string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN,JsonConvert.SerializeObject(mesCarrySignInput),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN, JsonConvert.SerializeObject(mesCarrySignInput), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); if (authResponse.code != 200) @@ -248,11 +240,11 @@ namespace Tnb.ProductionMgr await db.Insertable(prdMaterialReceiptH).ExecuteCommandAsync(); await db.Insertable(list).ExecuteCommandAsync(); }); - + } } - if(!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); - if(!result2.IsSuccess) throw Oops.Bah(result2.ErrorMessage); + if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); + if (!result2.IsSuccess) throw Oops.Bah(result2.ErrorMessage); return "签收成功"; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index 823e74c8..7869fe92 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -5,7 +5,6 @@ using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; using JNPF.FriendlyException; using JNPF.Logging; @@ -106,7 +105,7 @@ namespace Tnb.ProductionMgr // } // return data!; // } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -119,22 +118,22 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c) => c.EnCode == DictConst.MeasurementUnit) .LeftJoin((a, b, c, d) => c.Id == d.DictionaryTypeId && a.unit_id == d.Id) .LeftJoin((a, b, c, d, e) => a.mo_status == e.Id) - .LeftJoin((a, b, c, d, e,f) => a.mo_type==f.Id) + .LeftJoin((a, b, c, d, e, f) => a.mo_type == f.Id) .WhereIF(!string.IsNullOrEmpty(moCode), (a, b, c, d, e) => a.mo_code.Contains(moCode)) .WhereIF(!string.IsNullOrEmpty(combineMoCode), (a, b, c, d, e) => a.combine_mo_code.Contains(combineMoCode)) .WhereIF(!string.IsNullOrEmpty(moStatus), (a, b, c, d, e) => a.mo_status == moStatus) - .Where(a=>SqlFunc.IsNullOrEmpty(a.parent_id)) - .OrderByDescending(a=>a.create_time) - .Select((a, b, c, d, e,f) => new PrdMoListOuput + .Where(a => SqlFunc.IsNullOrEmpty(a.parent_id)) + .OrderByDescending(a => a.create_time) + .Select((a, b, c, d, e, f) => new PrdMoListOuput { id = a.id, mo_type = f.FullName, - mo_source = a.mo_source=="1" ? "ERP同步" : "新建/导入", + mo_source = a.mo_source == "1" ? "ERP同步" : "新建/导入", mo_code = a.mo_code, - plan_start_date = a.plan_start_date==null ? "" : a.plan_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), - material_id = b.code+"/"+b.name, + plan_start_date = a.plan_start_date == null ? "" : a.plan_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"), + material_id = b.code + "/" + b.name, material_id_id = b.id, plan_qty = a.plan_qty, unit_id = d.FullName, @@ -145,17 +144,17 @@ namespace Tnb.ProductionMgr .LeftJoin((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit) .LeftJoin((aa, bb, cc, dd) => cc.Id == dd.DictionaryTypeId && aa.unit_id == dd.Id) .LeftJoin((aa, bb, cc, dd, ee) => aa.mo_status == ee.Id) - .LeftJoin((aa, bb, cc, dd, ee,ff) => aa.mo_type==ff.Id) - .Where(aa=>aa.parent_id==a.id) - .ToList((aa,bb,cc,dd,ee,ff)=>new PrdMoListOuput + .LeftJoin((aa, bb, cc, dd, ee, ff) => aa.mo_type == ff.Id) + .Where(aa => aa.parent_id == a.id) + .ToList((aa, bb, cc, dd, ee, ff) => new PrdMoListOuput { id = aa.id, mo_type = ff.FullName, - mo_source = aa.mo_source=="1" ? "ERP同步" : "新建/导入", + mo_source = aa.mo_source == "1" ? "ERP同步" : "新建/导入", mo_code = aa.mo_code, - plan_start_date = aa.plan_start_date==null ? "" : aa.plan_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = aa.plan_end_date==null ? "" : aa.plan_end_date.Value.ToString("yyyy-MM-dd"), - material_id = bb.code+"/"+bb.name, + plan_start_date = aa.plan_start_date == null ? "" : aa.plan_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = aa.plan_end_date == null ? "" : aa.plan_end_date.Value.ToString("yyyy-MM-dd"), + material_id = bb.code + "/" + bb.name, material_id_id = bb.id, plan_qty = aa.plan_qty, unit_id = dd.FullName, @@ -296,7 +295,7 @@ namespace Tnb.ProductionMgr // } // return multi; // } - + /// /// 关联同组工单 /// @@ -308,9 +307,9 @@ namespace Tnb.ProductionMgr (bool executeRes, string errMsg) multi = (true, ""); var list = await _repository.AsSugarClient().Queryable() .LeftJoin((a, b) => a.material_id == b.material_id) - .LeftJoin((a,b,c)=>b.mold_id==c.id) - .Where((a, b,c) => input.WorkOrderIds.Contains(a.id)) - .Select((a, b,c) => new + .LeftJoin((a, b, c) => b.mold_id == c.id) + .Where((a, b, c) => input.WorkOrderIds.Contains(a.id)) + .Select((a, b, c) => new { planDate = a.plan_start_date, mold_code = c.mold_code, @@ -386,24 +385,24 @@ namespace Tnb.ProductionMgr scheduled_qty = a.scheduled_qty, tobe_scheduled_qty = a.plan_qty - a.scheduled_qty, reported_work_qty = a.reported_work_qty, - complete_rate = a.reported_work_qty==null?0:SqlFunc.ToDecimal(a.reported_work_qty*100)/SqlFunc.ToDecimal(a.plan_qty), + complete_rate = a.reported_work_qty == null ? 0 : SqlFunc.ToDecimal(a.reported_work_qty * 100) / SqlFunc.ToDecimal(a.plan_qty), children = SqlFunc.Subqueryable() - .LeftJoin((x,y)=>x.mo_task_status==y.EnCode && y.DictionaryTypeId==DictConst.PrdTaskStatusTypeId) - .Where(x=>x.mo_id==a.id && SqlFunc.IsNullOrEmpty(x.parent_id)) - .OrderByDesc((x,y)=>x.create_time) - .ToList((x,y)=>new PrdMoStatisticsDetailOutput() - { - id = x.id, - mo_task_code = x.mo_task_code, - mo_task_status = y.FullName, - estimated_start_date = x.estimated_start_date==null ? "" : x.estimated_start_date.Value.ToString(DbTimeFormat.SS), - estimated_end_date = x.estimated_end_date==null ? "" : x.estimated_end_date.Value.ToString(DbTimeFormat.SS), - scheduled_qty = x.scheduled_qty, - reported_work_qty = x.reported_work_qty, - scrap_qty = x.scrap_qty, - }), + .LeftJoin((x, y) => x.mo_task_status == y.EnCode && y.DictionaryTypeId == DictConst.PrdTaskStatusTypeId) + .Where(x => x.mo_id == a.id && SqlFunc.IsNullOrEmpty(x.parent_id)) + .OrderByDesc((x, y) => x.create_time) + .ToList((x, y) => new PrdMoStatisticsDetailOutput() + { + id = x.id, + mo_task_code = x.mo_task_code, + mo_task_status = y.FullName, + estimated_start_date = x.estimated_start_date == null ? "" : x.estimated_start_date.Value.ToString(DbTimeFormat.SS), + estimated_end_date = x.estimated_end_date == null ? "" : x.estimated_end_date.Value.ToString(DbTimeFormat.SS), + scheduled_qty = x.scheduled_qty, + reported_work_qty = x.reported_work_qty, + scrap_qty = x.scrap_qty, + }), }) - .MergeTable().OrderByDescending(a=>a.complete_rate) + .MergeTable().OrderByDescending(a => a.complete_rate) .ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); @@ -432,8 +431,8 @@ namespace Tnb.ProductionMgr if (!string.IsNullOrEmpty(input.barcode)) { ids2 = await _db.Queryable() - .LeftJoin((a,b)=>a.mo_task_id==b.id) - .Where((a,b) => a.barcode.Contains(input.barcode)).Select((a,b) => b.mo_id).ToListAsync(); + .LeftJoin((a, b) => a.mo_task_id == b.id) + .Where((a, b) => a.barcode.Contains(input.barcode)).Select((a, b) => b.mo_id).ToListAsync(); ids = ids2; } @@ -441,27 +440,27 @@ namespace Tnb.ProductionMgr { ids = ids1.Intersect(ids2).ToList(); } - + var result = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .WhereIF(!string.IsNullOrEmpty(input.mo_code),(a,b)=>a.mo_code.Contains(input.mo_code)) - .WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.id)) + .WhereIF(!string.IsNullOrEmpty(input.mo_code), (a, b) => a.mo_code.Contains(input.mo_code)) + .WhereIF(ids != null && ids.Count > 0, (a, b) => ids.Contains(a.id)) .Select((a, b) => new PrdMoFromOneListOutput { id = a.id, mo_code = a.mo_code, material_id = a.material_id, - type = (a.mo_type==DictConst.PrdMoTypeZS || a.mo_type==DictConst.PrdMoTypeJC ) ? 1 : 2, + type = (a.mo_type == DictConst.PrdMoTypeZS || a.mo_type == DictConst.PrdMoTypeJC) ? 1 : 2, material_code = b.code, material_name = b.name, material_standard = b.material_standard, - act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), - act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS) + act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), + act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS) }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - + /// /// 工单追溯二级列表 /// @@ -476,22 +475,22 @@ namespace Tnb.ProductionMgr List ids = new List(); if (!string.IsNullOrEmpty(barcode)) { - ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync(); + ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync(); } - + PrdMo prdMo = await _repository.GetSingleAsync(x => x.id == mo_id); if (prdMo.mo_type is DictConst.PrdMoTypeZS or DictConst.PrdMoTypeJC) { return await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .LeftJoin((a,b,c)=>a.eqp_id==c.ObjectId && c.ObjectType=="Eqp") - .LeftJoin((a,b,c,d)=>c.OrganizeId==d.Id) - .LeftJoin((a,b,c,d,e)=>d.OrganizeIdTree.Contains(e.Id) && e.Category==DictConst.RegionCategoryWorkshopCode) - .LeftJoin((a,b,c,d,e,f)=>a.eqp_id==f.id) - .WhereIF(!string.IsNullOrEmpty(mo_id),(a,b,c,d)=>a.mo_id==mo_id) - .WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c,d)=>a.mo_task_code==mo_task_code) - .WhereIF(ids!=null && ids.Count>0,(a,b,c,d)=>ids.Contains(a.id)) - .Select((a, b, c, d,e,f) => + .LeftJoin((a, b, c) => a.eqp_id == c.ObjectId && c.ObjectType == "Eqp") + .LeftJoin((a, b, c, d) => c.OrganizeId == d.Id) + .LeftJoin((a, b, c, d, e) => d.OrganizeIdTree.Contains(e.Id) && e.Category == DictConst.RegionCategoryWorkshopCode) + .LeftJoin((a, b, c, d, e, f) => a.eqp_id == f.id) + .WhereIF(!string.IsNullOrEmpty(mo_id), (a, b, c, d) => a.mo_id == mo_id) + .WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d) => a.mo_task_code == mo_task_code) + .WhereIF(ids != null && ids.Count > 0, (a, b, c, d) => ids.Contains(a.id)) + .Select((a, b, c, d, e, f) => new PrdMoFromTwoListOutput { id = a.id, @@ -513,9 +512,9 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.workline_id == c.Id) .LeftJoin((a, b, c, d) => a.bom_id == d.id) - .WhereIF(!string.IsNullOrEmpty(mo_id),(a,b,c,d)=>a.mo_id==mo_id) - .WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c,d)=>a.mo_task_code.Contains(mo_task_code)) - .WhereIF(ids!=null && ids.Count>0,(a,b,c,d)=>ids.Contains(a.id)) + .WhereIF(!string.IsNullOrEmpty(mo_id), (a, b, c, d) => a.mo_id == mo_id) + .WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d) => a.mo_task_code.Contains(mo_task_code)) + .WhereIF(ids != null && ids.Count > 0, (a, b, c, d) => ids.Contains(a.id)) .Select((a, b, c, d) => new PrdMoFromTwoListOutput { @@ -531,9 +530,9 @@ namespace Tnb.ProductionMgr mbom_version = d.version }).ToListAsync(); } - + } - + /// /// 工单追溯三级级列表 /// @@ -548,19 +547,19 @@ namespace Tnb.ProductionMgr List ids = new List(); if (!string.IsNullOrEmpty(barcode)) { - ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync(); + ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync(); } - + PrdMoTask prdMoTask = await _db.Queryable().SingleAsync(x => x.id == mo_task_id); - List processStations = await _db.Queryable().Where(x=>x.process_id==prdMoTask.process_id).ToListAsync(); + List processStations = await _db.Queryable().Where(x => x.process_id == prdMoTask.process_id).ToListAsync(); List orgIds = processStations.Select(x => x.id).ToList(); - List orgs = await _db.Queryable().Where(x=>x.Category==DictConst.RegionCategoryStationCode && x.DeleteMark==null).ToListAsync(); + List orgs = await _db.Queryable().Where(x => x.Category == DictConst.RegionCategoryStationCode && x.DeleteMark == null).ToListAsync(); return await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .LeftJoin((a,b,c)=>a.process_id==c.id) - .WhereIF(!string.IsNullOrEmpty(mo_task_id),(a,b,c)=>a.id==mo_task_id) - .WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c)=>a.mo_task_code.Contains(mo_task_code)) - .WhereIF(ids!=null && ids.Count>0,(a,b,c)=>ids.Contains(a.id)) + .LeftJoin((a, b, c) => a.process_id == c.id) + .WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b, c) => a.id == mo_task_id) + .WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c) => a.mo_task_code.Contains(mo_task_code)) + .WhereIF(ids != null && ids.Count > 0, (a, b, c) => ids.Contains(a.id)) .Select((a, b, c) => new PrdMoFromThreeListOutput { @@ -574,16 +573,16 @@ namespace Tnb.ProductionMgr process_name = c.process_name, }).Mapper(x => { - List orgId1 = orgs.Where(y => y.OrganizeIdTree.Contains(x.workline_id)).Select(y=>y.Id).ToList(); + List orgId1 = orgs.Where(y => y.OrganizeIdTree.Contains(x.workline_id)).Select(y => y.Id).ToList(); string station_id = orgIds.Intersect(orgId1)?.FirstOrDefault(); if (!string.IsNullOrEmpty(station_id)) { x.station_name = orgs.FirstOrDefault(y => y.Id == station_id)?.FullName; } }).ToListAsync(); - + } - + /// /// 工单追溯人列表 /// @@ -597,15 +596,15 @@ namespace Tnb.ProductionMgr List ids = new List(); if (!string.IsNullOrEmpty(barcode)) { - ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync(); + ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync(); } return await _db.Queryable() .LeftJoin((a, b) => a.create_id == b.Id) .WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b) => a.mo_task_id == mo_task_id) // .WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.mo_task_id)) - .WhereIF(!string.IsNullOrEmpty(barcode),(a,b)=>a.barcode.Contains(barcode)) - .GroupBy((a,b)=>new {a.create_id,employee_name = b.RealName}) + .WhereIF(!string.IsNullOrEmpty(barcode), (a, b) => a.barcode.Contains(barcode)) + .GroupBy((a, b) => new { a.create_id, employee_name = b.RealName }) .Select((a, b) => new PrdMoFromManListOutput() { // id = a.id, @@ -618,7 +617,7 @@ namespace Tnb.ProductionMgr }) .ToListAsync(); } - + /// /// 工单追溯机列表 /// @@ -632,21 +631,21 @@ namespace Tnb.ProductionMgr List ids = new List(); if (!string.IsNullOrEmpty(barcode)) { - ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync(); + ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync(); } return await _db.Queryable() .LeftJoin((a, b) => a.eqp_id == b.id) - .LeftJoin((a,b,c)=>a.mold_id==c.id) + .LeftJoin((a, b, c) => a.mold_id == c.id) .WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b) => a.id == mo_task_id) - .WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.id)) - .Select((a, b,c) => new PrdMoFromEquipListOutput() + .WhereIF(ids != null && ids.Count > 0, (a, b) => ids.Contains(a.id)) + .Select((a, b, c) => new PrdMoFromEquipListOutput() { equip_code = b.code, mold_code = b.code, }).ToListAsync(); } - + /// /// 工单追溯料列表 /// @@ -660,7 +659,7 @@ namespace Tnb.ProductionMgr List ids = new List(); if (!string.IsNullOrEmpty(barcode)) { - ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync(); + ids = await _db.Queryable().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync(); } PrdMoTask prdMoTask = await _db.Queryable().SingleAsync(x => x.id == mo_task_id); PrdMo prdMo = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.mo_id); @@ -675,10 +674,10 @@ namespace Tnb.ProductionMgr if (prdMoTask.schedule_type == 1) { return await _db.Queryable() - .LeftJoin((a,b)=>a.id==b.ebom_id) - .LeftJoin((a,b,c)=>b.material_id==c.id) - .Where((a,b,c)=>a.id==prdMoTask.ebom_id) - .Select((a,b,c)=>new PrdMoFromMaterialListOutput() + .LeftJoin((a, b) => a.id == b.ebom_id) + .LeftJoin((a, b, c) => b.material_id == c.id) + .Where((a, b, c) => a.id == prdMoTask.ebom_id) + .Select((a, b, c) => new PrdMoFromMaterialListOutput() { material_code = c.code, material_name = c.name, @@ -687,9 +686,9 @@ namespace Tnb.ProductionMgr else { return await _db.Queryable() - .LeftJoin((a,b)=>a.material_id==b.id) - .Where((a,b)=>a.mbom_id==prdMoTask.bom_id) - .Select((a,b)=>new PrdMoFromMaterialListOutput() + .LeftJoin((a, b) => a.material_id == b.id) + .Where((a, b) => a.mbom_id == prdMoTask.bom_id) + .Select((a, b) => new PrdMoFromMaterialListOutput() { material_code = b.code, material_name = b.name, @@ -699,7 +698,7 @@ namespace Tnb.ProductionMgr else { PrdReport prdReport = await _db.Queryable().Where(x => x.barcode == barcode).FirstAsync(); - List prdReports = await _db.Queryable().Where(x=>x.create_time<=prdReport.create_time && x.barcode!=barcode && x.mo_task_id==mo_task_id).ToListAsync(); + List prdReports = await _db.Queryable().Where(x => x.create_time <= prdReport.create_time && x.barcode != barcode && x.mo_task_id == mo_task_id).ToListAsync(); int? beforeReportNum = prdReports.Sum(x => x.reported_qty); List prdFeedingIds = new List(); if (prdMoTask.schedule_type == 1) @@ -713,7 +712,7 @@ namespace Tnb.ProductionMgr List prdFeedingDs = await _db.Queryable() .LeftJoin((a, b) => a.feeding_id == b.id) .Where((a, b) => a.material_id == item.material_id && b.mo_task_id == mo_task_id) - .OrderBy((a,b)=>b.create_time) + .OrderBy((a, b) => b.create_time) .Select((a, b) => a).ToListAsync(); decimal sum1 = 0; decimal sum2 = 0; @@ -737,7 +736,7 @@ namespace Tnb.ProductionMgr } } } - + return await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.material_receipt_detail_id == c.id) @@ -754,40 +753,40 @@ namespace Tnb.ProductionMgr instock_time = c.instock_time.ToString(DbTimeFormat.SS), feeding_time = e.create_time == null ? "" : e.create_time.Value.ToString(DbTimeFormat.SS), }).ToListAsync(); - + } else { - List basMbomInputs = await _db.Queryable().Where(x=>x.mbom_process_id==prdMoTask.mbom_process_id).ToListAsync(); + List basMbomInputs = await _db.Queryable().Where(x => x.mbom_process_id == prdMoTask.mbom_process_id).ToListAsync(); BasMbom basMbom = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.bom_id); BasMbomProcess basMbomProcess = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.mbom_process_id); List lastPrdReportIds = new List(); foreach (var item in basMbomInputs) { - BasMbomOutput basMbomOutput = await _db.Queryable().Where(x=>x.mbom_process_id==basMbomProcess.id && x.material_id==prdMoTask.material_id).FirstAsync(); - if (basMbomOutput == null) break; + BasMbomOutput basMbomOutput = await _db.Queryable().Where(x => x.mbom_process_id == basMbomProcess.id && x.material_id == prdMoTask.material_id).FirstAsync(); + if (basMbomOutput == null) break; decimal? num1 = beforeReportNum / Convert.ToDecimal(basMbomOutput.num) * item.num; List prdFeedingDs = await _db.Queryable() .LeftJoin((a, b) => a.feeding_id == b.id) .Where((a, b) => a.material_id == item.material_id && b.mo_task_id == mo_task_id) - .OrderBy((a,b)=>b.create_time) + .OrderBy((a, b) => b.create_time) .Select((a, b) => a).ToListAsync(); - + if (prdFeedingDs == null || prdFeedingDs.Count <= 0) { if (string.IsNullOrEmpty(basMbomProcess.last_process_no)) continue; - - List lastBasMbomProcesses = await _db.Queryable().Where(x=>x.no==basMbomProcess.last_process_no && x.mbom_id==prdMoTask.bom_id).ToListAsync(); + + List lastBasMbomProcesses = await _db.Queryable().Where(x => x.no == basMbomProcess.last_process_no && x.mbom_id == prdMoTask.bom_id).ToListAsync(); foreach (var lastBasMbomProcess in lastBasMbomProcesses) { List lastPrdReports = await _db.Queryable() - .Where(x=>x.mbom_process_id==lastBasMbomProcess.id && x.material_id==item.material_id) - .OrderBy(x=>x.create_time) + .Where(x => x.mbom_process_id == lastBasMbomProcess.id && x.material_id == item.material_id) + .OrderBy(x => x.create_time) .ToListAsync(); if (lastPrdReports == null || lastPrdReports.Count <= 0) continue; - - PrdMoTask lastPrdMoTask = await _db.Queryable().FirstAsync(x=>x.mo_id==prdMo.id && x.mbom_process_id==lastBasMbomProcess.id); - + + PrdMoTask lastPrdMoTask = await _db.Queryable().FirstAsync(x => x.mo_id == prdMo.id && x.mbom_process_id == lastBasMbomProcess.id); + decimal sum1 = 0; decimal sum2 = 0; foreach (var lastPrdReport in lastPrdReports) @@ -809,9 +808,9 @@ namespace Tnb.ProductionMgr } } } - + } - + } else @@ -839,7 +838,7 @@ namespace Tnb.ProductionMgr } } } - + var queryable1 = _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.material_receipt_detail_id == c.id) @@ -877,14 +876,14 @@ namespace Tnb.ProductionMgr { return await queryable1.ToListAsync(); } - + } } - + } #endregion - + #region 反向工单追溯相关 /// @@ -908,7 +907,7 @@ namespace Tnb.ProductionMgr ["currentPage"] = 1, ["pageSize"] = int.MaxValue, }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE,JsonConvert.SerializeObject(postData),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE, JsonConvert.SerializeObject(postData), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -918,15 +917,15 @@ namespace Tnb.ProductionMgr } else { - PageResult output = JsonConvert.DeserializeObject>(authResponse.data.ToString(),new Tnb.Common.Utils.DateTimeJsonConverter()); + PageResult output = JsonConvert.DeserializeObject>(authResponse.data.ToString(), new Tnb.Common.Utils.DateTimeJsonConverter()); if (output.list != null && output.list.Count > 0) { - BasMaterial basMaterial = await _db.Queryable().SingleAsync(x=>x.id==output.list[0].material_id); - BasSupplier basSupplier = await _db.Queryable().SingleAsync(x=>x.id==output.list[0].supplier_id); + BasMaterial basMaterial = await _db.Queryable().SingleAsync(x => x.id == output.list[0].material_id); + BasSupplier basSupplier = await _db.Queryable().SingleAsync(x => x.id == output.list[0].supplier_id); DictionaryDataEntity unit = await _db.Queryable() - .LeftJoin((a,b)=>a.Id==b.DictionaryTypeId) - .Where((a,b)=>a.EnCode==DictConst.MeasurementUnit && b.EnCode==output.list[0].unit_id) - .Select((a,b)=>b) + .LeftJoin((a, b) => a.Id == b.DictionaryTypeId) + .Where((a, b) => a.EnCode == DictConst.MeasurementUnit && b.EnCode == output.list[0].unit_id) + .Select((a, b) => b) .FirstAsync(); output.list[0].feeding_num = await _db.Queryable() .LeftJoin((a, b) => a.id == b.material_receipt_detail_id) @@ -935,15 +934,15 @@ namespace Tnb.ProductionMgr output.list[0].material_standard = basMaterial.material_standard; output.list[0].supplier_name = basSupplier?.supplier_name ?? ""; output.list[0].unit_name = unit?.FullName ?? ""; - + return output.list[0]; - } + } } return Array.Empty(); } - + /// /// 物料反向追溯投料信息 /// @@ -995,7 +994,7 @@ namespace Tnb.ProductionMgr return result; // return PageResult.SqlSugarPageResult(result); } - + /// /// 物料反向追溯产出信息 /// @@ -1006,12 +1005,12 @@ namespace Tnb.ProductionMgr { string feeding_detail_id = prdMoReverseFromOutInfoQueryInput.feeding_detail_id ?? ""; PrdFeedingD prdFeedingD = await _db.Queryable().FirstAsync(x => x.id == feeding_detail_id); - if(prdFeedingD.use_num<=0) return Array.Empty(); + if (prdFeedingD.use_num <= 0) return Array.Empty(); PrdFeedingH prdFeedingH = await _db.Queryable().FirstAsync(x => x.id == prdFeedingD.feeding_id); PrdMoTask prdMoTask = await _db.Queryable().FirstAsync(x => x.id == prdFeedingH.mo_task_id); List prdFeedingDs = await _db.Queryable() .LeftJoin((a, b) => a.feeding_id == b.id) - .Where((a, b) => a.material_id == prdFeedingD.material_id && b.mo_task_id == prdFeedingH.mo_task_id && b.create_time<=prdFeedingH.create_time && a.id!=prdFeedingD.id) + .Where((a, b) => a.material_id == prdFeedingD.material_id && b.mo_task_id == prdFeedingH.mo_task_id && b.create_time <= prdFeedingH.create_time && a.id != prdFeedingD.id) .Select((a, b) => a).ToListAsync(); decimal beforeIn = prdFeedingDs.Sum(x => x.num); List reportIds = new List(); @@ -1022,7 +1021,7 @@ namespace Tnb.ProductionMgr BasEbomD basEbomD = basEbomDs.Where(x => x.material_id == prdFeedingD.material_id).FirstOrDefault(); if (basEbomD != null) { - List prdReports = await _db.Queryable().Where(x => x.mo_task_id == prdMoTask.id).OrderBy(x=>x.create_time).ToListAsync(); + List prdReports = await _db.Queryable().Where(x => x.mo_task_id == prdMoTask.id).OrderBy(x => x.create_time).ToListAsync(); if (prdReports != null && prdReports.Count > 0) { bool flag = true; @@ -1048,7 +1047,7 @@ namespace Tnb.ProductionMgr reportIds.Add(prdReport.id); break; } - + flag = false; continue; @@ -1058,7 +1057,8 @@ namespace Tnb.ProductionMgr { residueNeed -= needNum; reportIds.Add(prdReport.id); - }else + } + else { reportIds.Add(prdReport.id); break; @@ -1075,30 +1075,30 @@ namespace Tnb.ProductionMgr { return Array.Empty(); } - - } + + } else { List prdReports = await _db.Queryable() .LeftJoin((a, b) => a.mbom_process_id == b.id) .LeftJoin((a, b, c) => a.id == c.mo_task_id) .Where((a, b, c) => a.mo_id == prdMoTask.mo_id && b.next_process_no == null) - .OrderBy((a,b,c)=>c.create_time) + .OrderBy((a, b, c) => c.create_time) .Select((a, b, c) => c).ToListAsync(); if (prdReports != null && prdReports.Count > 0) { - List mbomProcesssIds = new List(){prdMoTask.mbom_process_id}; - BasMbomProcess startMbomProcess = await _db.Queryable().Where(x=>x.id==prdMoTask.mbom_process_id).FirstAsync(); - List allMbomProcesses = await _db.Queryable().Where(x=>x.mbom_id==prdMoTask.bom_id).ToListAsync(); + List mbomProcesssIds = new List() { prdMoTask.mbom_process_id }; + BasMbomProcess startMbomProcess = await _db.Queryable().Where(x => x.id == prdMoTask.mbom_process_id).FirstAsync(); + List allMbomProcesses = await _db.Queryable().Where(x => x.mbom_id == prdMoTask.bom_id).ToListAsync(); string startNo = startMbomProcess.next_process_no; if (!string.IsNullOrEmpty(startNo)) { while (true) { - BasMbomProcess nextMbomProcess = allMbomProcesses.FirstOrDefault(x=>x.no==startNo); + BasMbomProcess nextMbomProcess = allMbomProcesses.FirstOrDefault(x => x.no == startNo); - if (nextMbomProcess==null || nextMbomProcess.no==null) + if (nextMbomProcess == null || nextMbomProcess.no == null) { break; } @@ -1120,23 +1120,23 @@ namespace Tnb.ProductionMgr List outputList = await _db.Queryable() .LeftJoin((a, b) => a.id == b.mbom_process_id) .Where((a, b) => mbomProcesssIds.Contains(a.id)) - .Select((a,b)=>b).ToListAsync(); - + .Select((a, b) => b).ToListAsync(); + List inputList = await _db.Queryable() .LeftJoin((a, b) => a.id == b.mbom_process_id) .Where((a, b) => mbomProcesssIds.Contains(a.id)) - .Select((a,b)=>b).ToListAsync(); + .Select((a, b) => b).ToListAsync(); decimal? needNum = 1;//一个最终物料需要本任务单投入物料的数量 - string tempMaterialId = outputList.FirstOrDefault(x=>x.mbom_process_id==mbomProcesssIds[mbomProcesssIds.Count-1])?.material_id; - for (int i = mbomProcesssIds.Count - 1; i > 0;i--) + string tempMaterialId = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[mbomProcesssIds.Count - 1])?.material_id; + for (int i = mbomProcesssIds.Count - 1; i > 0; i--) { List inputs = inputList.Where(x => x.mbom_process_id == mbomProcesssIds[i]).ToList(); - BasMbomOutput output = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[i] && x.material_id==tempMaterialId); + BasMbomOutput output = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[i] && x.material_id == tempMaterialId); List inputMaterialIds = inputs.Select(x => x.material_id).ToList(); - List lastOutputs = outputList.Where(x=>x.mbom_process_id==mbomProcesssIds[i-1]).ToList(); - decimal? inputNum = inputs.FirstOrDefault(x => inputMaterialIds.Contains(x.material_id))?.num; + List lastOutputs = outputList.Where(x => x.mbom_process_id == mbomProcesssIds[i - 1]).ToList(); + decimal? inputNum = inputs.FirstOrDefault(x => inputMaterialIds.Contains(x.material_id))?.num; if (inputNum == null) { throw new Exception("生产bom投入产出物料配置错误"); @@ -1171,7 +1171,7 @@ namespace Tnb.ProductionMgr reportIds.Add(prdReport.id); break; } - + flag = false; continue; @@ -1181,25 +1181,26 @@ namespace Tnb.ProductionMgr { residueNeed -= needNumTotal; reportIds.Add(prdReport.id); - }else + } + else { reportIds.Add(prdReport.id); break; } } } - - - + + + } else { return Array.Empty(); } } - - List barCodes = await _db.Queryable().Where(x=>reportIds.Contains(x.id)).Select(x=>x.barcode).ToListAsync(); - + + List barCodes = await _db.Queryable().Where(x => reportIds.Contains(x.id)).Select(x => x.barcode).ToListAsync(); + string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { @@ -1212,7 +1213,7 @@ namespace Tnb.ProductionMgr ["currentPage"] = 1, ["pageSize"] = int.MaxValue, }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE,JsonConvert.SerializeObject(postData),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE, JsonConvert.SerializeObject(postData), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -1223,7 +1224,7 @@ namespace Tnb.ProductionMgr else { BasMaterial basMaterial = await _db.Queryable().FirstAsync(x => x.id == prdMoTask.material_id); - PageResult output = JsonConvert.DeserializeObject>(authResponse.data.ToString(),new Tnb.Common.Utils.DateTimeJsonConverter()); + PageResult output = JsonConvert.DeserializeObject>(authResponse.data.ToString(), new Tnb.Common.Utils.DateTimeJsonConverter()); if (output.list != null && output.list.Count > 0) { foreach (var item in output.list) @@ -1235,7 +1236,7 @@ namespace Tnb.ProductionMgr return output.list; } } - + #endregion } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs index 72fd26ad..6aa2a463 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskIssueService.cs @@ -1,31 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Systems.Interfaces.System; +using JNPF.Systems.Entitys.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using NPOI.Util; +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.Interfaces; -using Aspose.Cells.Drawing; -using Microsoft.AspNetCore.Mvc; -using JNPF.Common.Extension; -using JNPF.Common.Filter; -using JNPF.Systems.Entitys.System; -using Newtonsoft.Json; -using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen; -using Tnb.BasicData; using Tnb.ProductionMgr.Entities.Dto; +using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr { @@ -101,7 +89,7 @@ namespace Tnb.ProductionMgr // } // return data!; // } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -112,24 +100,24 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => c.EnCode == DictConst.TaskStatus) .LeftJoin((a, b, c, d) => c.Id == d.DictionaryTypeId && a.mo_task_status == d.EnCode) - .LeftJoin((a,b,c,d,e)=>a.mold_id==e.id) - .LeftJoin((a,b,c,d,e,f)=>a.mo_id==f.id) - .LeftJoin((a,b,c,d,e,f,g)=>g.id==a.eqp_id) + .LeftJoin((a, b, c, d, e) => a.mold_id == e.id) + .LeftJoin((a, b, c, d, e, f) => a.mo_id == f.id) + .LeftJoin((a, b, c, d, e, f, g) => g.id == a.eqp_id) .WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c, d) => a.mo_task_code.Contains(moTaskCode)) .WhereIF(!string.IsNullOrEmpty(moTaskStatus), (a, b, c, d) => a.mo_task_status == moTaskStatus) - .Where((a,b,c,d,e,f)=>a.schedule_type==1) - .Select((a, b, c, d,e,f,g) => new PrdMoTaskIssueListOutput + .Where((a, b, c, d, e, f) => a.schedule_type == 1) + .Select((a, b, c, d, e, f, g) => new PrdMoTaskIssueListOutput { id = a.id, mo_task_code = a.mo_task_code, - material_id = b.code+"/"+b.name, - mold_id = e.mold_code+"/"+e.mold_name, - eqp_id = g.code+"/"+g.name, + material_id = b.code + "/" + b.name, + mold_id = e.mold_code + "/" + e.mold_name, + eqp_id = g.code + "/" + g.name, mo_task_status = d.FullName, plan_qty = f.plan_qty, scheduled_qty = a.scheduled_qty, - create_time = a.create_time==null ? "" :a.create_time.Value.ToString(DbTimeFormat.SS), - }).OrderByDescending(a=>a.create_time).ToPagedListAsync(input.currentPage, input.pageSize); + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + }).OrderByDescending(a => a.create_time).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index cda260c3..cfb0f976 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1,52 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using DbModels; +using System.Reflection; using JNPF.Common.Core.Manager; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using SqlSugar; -using Tnb.BasicData.Entities; -using Tnb.BasicData; -using Tnb.EquipMgr.Entities; -using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; -using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Interfaces; using JNPF.Common.Enums; using JNPF.Common.Extension; +using JNPF.Common.Filter; using JNPF.Common.Security; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; using JNPF.FriendlyException; -using Tnb.ProductionMgr.Entities.Enums; +using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.System; +using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; -using JNPF.VisualDev.Entitys; -using Aop.Api.Domain; -using Senparc.Weixin.MP.AdvancedAPIs.Card; -using Aspose.Cells.Drawing.Texts; -using JNPF.Systems.Entitys.Permission; -using WebSocketSharp.Frame; -using JNPF.Logging; -using System.Dynamic; -using Tnb.EquipMgr.Entities.Dto; -using JNPF.Common.Filter; -using JNPF.Systems.Entitys.System; -using Microsoft.ClearScript.Util.Web; +using Mapster; +using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using SqlSugar; +using Tnb.BasicData; +using Tnb.BasicData.Entities; using Tnb.BasicData.Entities.Dto; -using NPOI.SS.Formula.Functions; +using Tnb.EquipMgr.Entities; using Tnb.PerMgr.Entities; -using Tnb.QcMgr.Interfaces; +using Tnb.ProductionMgr.Entities; +using Tnb.ProductionMgr.Entities.Dto; +using Tnb.ProductionMgr.Entities.Dto.PrdManage; +using Tnb.ProductionMgr.Entities.Enums; +using Tnb.ProductionMgr.Interfaces; using Tnb.QcMgr.Entities; using Tnb.QcMgr.Entities.Enums; +using Tnb.QcMgr.Interfaces; // using Tnb.PerMgr.Entities; @@ -95,7 +78,7 @@ namespace Tnb.ProductionMgr OverideFuncs.GetListAsync = GetList; _billRuleService = billRullService; _prdInstockService = prdInstockService; - _qcCheckPlanService=qcCheckPlanService; + _qcCheckPlanService = qcCheckPlanService; } #region Get @@ -255,12 +238,12 @@ namespace Tnb.ProductionMgr var users = await db.Queryable().ToListAsync(); if (defects?.Count > 0) { - output.batchItems = defects.GroupBy(g => new { g.batch,g.create_id }).Select(t => new BatchItem + output.batchItems = defects.GroupBy(g => new { g.batch, g.create_id }).Select(t => new BatchItem { scrap_qty = t.Sum(d => d.defective_item_qty), batch = t.Key.batch, create_time = t.Key.batch.ParseToDateTime().ToString("yyyy-MM-dd HH:mm:ss"), - create_name = users.First(x=>x.Id==t.Key.create_id)?.RealName ?? "", + create_name = users.First(x => x.Id == t.Key.create_id)?.RealName ?? "", categoryItems = t.GroupBy(g => g.defective_cagetory_id).Select(c => new CategoryItem { name = _dicDefect[c.Key]?.ToString(), @@ -272,7 +255,7 @@ namespace Tnb.ProductionMgr }).ToList(), }).ToList(), }).ToList(); - + } return output; } @@ -310,7 +293,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d) => a.mold_id == d.id) .LeftJoin((a, b, c, d, e) => a.eqp_id == e.id) .Where((a, b, c, d, e) => a.mo_id == moId) - .OrderByDescending((a,b,c,d,e)=>a.create_time) + .OrderByDescending((a, b, c, d, e) => a.create_time) .Select((a, b, c, d, e) => new PrdMoTaskOutput { mo_task_code = a.mo_task_code, @@ -326,10 +309,10 @@ namespace Tnb.ProductionMgr estimated_start_date = a.estimated_start_date.Value.ToString(DbTimeFormat.SS), estimated_end_date = a.estimated_end_date.Value.ToString(DbTimeFormat.SS), plan_qty = a.scheduled_qty, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), process_code = SqlFunc.Subqueryable().Where(it => it.id == a.process_id).Select(it => it.process_code), process_name = SqlFunc.Subqueryable().Where(it => it.id == a.process_id).Select(it => it.process_name), - create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), }) .Mapper(it => { @@ -342,10 +325,10 @@ namespace Tnb.ProductionMgr result = await _db.Queryable().LeftJoin((a, b) => a.mo_id == b.id) .LeftJoin((a, b, c) => a.material_id == c.id) .LeftJoin((a, b, c, d) => a.workline_id == d.Id) - .LeftJoin((a,b,c,d,e)=>a.process_id==e.id) + .LeftJoin((a, b, c, d, e) => a.process_id == e.id) .Where((a, b, c, d) => (b.id == moId || b.parent_id == moId) && SqlFunc.IsNullOrEmpty(a.parent_id)) - .OrderByDescending((a,b,c,d,e)=>a.create_time) - .Select((a, b, c, d,e) => new PrdMoTaskOutput + .OrderByDescending((a, b, c, d, e) => a.create_time) + .Select((a, b, c, d, e) => new PrdMoTaskOutput { mo_task_code = a.mo_task_code, mo_task_status = a.mo_task_status, @@ -359,8 +342,8 @@ namespace Tnb.ProductionMgr estimated_start_date = a.estimated_start_date.Value.ToString(DbTimeFormat.SS), estimated_end_date = a.estimated_end_date.Value.ToString(DbTimeFormat.SS), plan_qty = a.scheduled_qty, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0), - create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS), }) .Mapper(it => { @@ -386,7 +369,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d) => a.bom_id == d.id) .WhereIF(!string.IsNullOrEmpty(input.mo_task_code), (a, b, c, d) => a.mo_task_code.Contains(input.mo_task_code)) .Where((a, b, c, d) => a.schedule_type == 2 && string.IsNullOrEmpty(a.parent_id)) - .OrderByDescending(a=>a.create_time) + .OrderByDescending(a => a.create_time) .Select((a, b, c, d) => new PackSechelToBeIssueListOutput { mo_task_id = a.id, @@ -402,8 +385,8 @@ namespace Tnb.ProductionMgr scheduled_qty = a.scheduled_qty, plan_qty = SqlFunc.Subqueryable().Where(it => it.id == a.mo_id).Select(it => it.plan_qty), complete_qty = a.last_process_complete_qty, - estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM), - estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM), + estimated_start_date = a.estimated_start_date == null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM), + estimated_end_date = a.estimated_end_date == null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM), bom_id = d.id, bom_version = d.version }) @@ -424,9 +407,9 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.workline_id == c.Id) .LeftJoin((a, b, c, d) => a.mo_id == d.id) - .LeftJoin((a,b,c,d,e)=>a.process_id==e.id) + .LeftJoin((a, b, c, d, e) => a.process_id == e.id) .Where((a, b, c, d) => a.parent_id == mo_task_id) - .Select((a, b, c, d,e) => new PackSechelToBeIssueListOutput + .Select((a, b, c, d, e) => new PackSechelToBeIssueListOutput { mo_task_id = a.id, mo_task_code = a.mo_task_code, @@ -438,9 +421,9 @@ namespace Tnb.ProductionMgr scheduled_qty = a.scheduled_qty, plan_qty = d.plan_qty, process_task_qty = a.process_task_qty, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0), - estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM), - estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), + estimated_start_date = a.estimated_start_date == null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM), + estimated_end_date = a.estimated_end_date == null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM), process_name = e.process_name, bom_version = SqlFunc.Subqueryable().Where(it => it.material_id == a.material_id).Select(it => it.version) }) @@ -530,8 +513,8 @@ namespace Tnb.ProductionMgr // }; // return PageResult.SqlSugarPageResult(pagedList); // } - - + + /// /// 获取组装、包装 待排产工单树形列表 /// @@ -541,17 +524,17 @@ namespace Tnb.ProductionMgr { Dictionary queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); List moStatusList = new List(); - if (queryJson!=null && queryJson.ContainsKey("mo_stauts")) + if (queryJson != null && queryJson.ContainsKey("mo_stauts")) { moStatusList = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(queryJson["mo_status"])); } List moTypeList = new List(); - if (queryJson!=null && queryJson.ContainsKey("mo_type")) + if (queryJson != null && queryJson.ContainsKey("mo_type")) { moTypeList = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(queryJson["mo_type"])); } - string moCode = queryJson!=null && queryJson.ContainsKey("mo_code") ? queryJson["mo_code"].ToString() : ""; - string combineMoCode = queryJson!=null && queryJson.ContainsKey("combine_mo_code") ? queryJson["combine_mo_code"].ToString() : ""; + string moCode = queryJson != null && queryJson.ContainsKey("mo_code") ? queryJson["mo_code"].ToString() : ""; + string combineMoCode = queryJson != null && queryJson.ContainsKey("combine_mo_code") ? queryJson["combine_mo_code"].ToString() : ""; var db = _repository.AsSugarClient(); var result = await db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) @@ -561,10 +544,10 @@ namespace Tnb.ProductionMgr .WhereIF(moStatusList != null && moStatusList.Count > 0, (a, b, c, d, e) => moStatusList.Contains(a.mo_status)) .WhereIF(moTypeList != null && moTypeList.Count > 0, (a, b, c, d, e) => moTypeList.Contains(a.mo_type)) - .WhereIF(!string.IsNullOrEmpty(moCode),(a,b,c,d,e)=>a.mo_code.Contains(moCode)) - .WhereIF(!string.IsNullOrEmpty(combineMoCode),(a,b,c,d,e)=>a.combine_mo_code.Contains(combineMoCode)) - .Where((a,b,c,d,e)=>SqlFunc.IsNullOrEmpty(a.parent_id)) - .OrderByDescending((a,b,c,d,e)=>a.create_time) + .WhereIF(!string.IsNullOrEmpty(moCode), (a, b, c, d, e) => a.mo_code.Contains(moCode)) + .WhereIF(!string.IsNullOrEmpty(combineMoCode), (a, b, c, d, e) => a.combine_mo_code.Contains(combineMoCode)) + .Where((a, b, c, d, e) => SqlFunc.IsNullOrEmpty(a.parent_id)) + .OrderByDescending((a, b, c, d, e) => a.create_time) .Select((a, b, c, d, e) => new PrdMoListTreeOutput { org_id = a.org_id, @@ -581,9 +564,9 @@ namespace Tnb.ProductionMgr scrap_qty = a.scrap_qty.Value.ToString(), plan_start_date = a.plan_start_date.Value.ToString("yyyy-MM-dd"), plan_end_date = a.plan_end_date.Value.ToString("yyyy-MM-dd"), - is_create_dispatch = a.is_create_dispatch==0 ? "否" : "是", + is_create_dispatch = a.is_create_dispatch == 0 ? "否" : "是", production_linecode = a.production_linecode, - is_merge = a.is_merge==0 ? "否" : "是", + is_merge = a.is_merge == 0 ? "否" : "是", combine_mo_code = a.combine_mo_code, time_stamp = a.time_stamp, create_id = e.RealName, @@ -593,49 +576,49 @@ namespace Tnb.ProductionMgr scheduled_qty = a.scheduled_qty.Value.ToString(), parent_id = "0", id = a.id, - hasChildren = SqlFunc.Subqueryable().Where(x=>x.parent_id==a.id).Any(), - num = SqlFunc.Subqueryable().Where(x=>x.parent_id==a.id).Count(), - isLeaf = SqlFunc.Subqueryable().Where(x=>x.parent_id==a.id).Any(), + hasChildren = SqlFunc.Subqueryable().Where(x => x.parent_id == a.id).Any(), + num = SqlFunc.Subqueryable().Where(x => x.parent_id == a.id).Count(), + isLeaf = SqlFunc.Subqueryable().Where(x => x.parent_id == a.id).Any(), children = SqlFunc.Subqueryable() - .LeftJoin((h,i) => h.material_id == i.id) - .LeftJoin((h,i,j) => h.mo_type == j.Id) - .LeftJoin((h,i,j,k) => h.mo_status == k.Id) - .LeftJoin((h,i,j,k,l) => h.create_id == l.Id) - .Where((h,i,j,k,l)=>a.id==h.parent_id).ToList((h,i,j,k,l)=>new PrdMoListTreeOutput() - { - org_id = h.org_id, - mo_id = h.id, - mo_code = h.mo_code, - material_code = i.code, - material_name = i.name, - material_standard = i.material_standard, - mo_type = j.FullName, - mo_status = k.FullName, - plan_qty = h.plan_qty.Value.ToString(), - input_qty = h.input_qty.Value.ToString(), - complete_qty = h.complete_qty.Value.ToString(), - scrap_qty = h.scrap_qty.Value.ToString(), - plan_start_date = h.plan_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = h.plan_end_date.Value.ToString("yyyy-MM-dd"), - is_create_dispatch = h.is_create_dispatch==0 ? "否" : "是", - production_linecode = h.production_linecode, - is_merge = h.is_merge==0 ? "否" : "是", - combine_mo_code = h.combine_mo_code, - time_stamp = h.time_stamp, - create_id = l.RealName, - create_time = h.create_time.Value.ToString("yyyy-MM-dd : HH:mm:ss"), - material_id = i.code, - material_id_id = h.material_id, - scheduled_qty = h.scheduled_qty.Value.ToString(), - parent_id = a.id, - id = h.id, - hasChildren = false, - num = 0, - isLeaf = true, - }) + .LeftJoin((h, i) => h.material_id == i.id) + .LeftJoin((h, i, j) => h.mo_type == j.Id) + .LeftJoin((h, i, j, k) => h.mo_status == k.Id) + .LeftJoin((h, i, j, k, l) => h.create_id == l.Id) + .Where((h, i, j, k, l) => a.id == h.parent_id).ToList((h, i, j, k, l) => new PrdMoListTreeOutput() + { + org_id = h.org_id, + mo_id = h.id, + mo_code = h.mo_code, + material_code = i.code, + material_name = i.name, + material_standard = i.material_standard, + mo_type = j.FullName, + mo_status = k.FullName, + plan_qty = h.plan_qty.Value.ToString(), + input_qty = h.input_qty.Value.ToString(), + complete_qty = h.complete_qty.Value.ToString(), + scrap_qty = h.scrap_qty.Value.ToString(), + plan_start_date = h.plan_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = h.plan_end_date.Value.ToString("yyyy-MM-dd"), + is_create_dispatch = h.is_create_dispatch == 0 ? "否" : "是", + production_linecode = h.production_linecode, + is_merge = h.is_merge == 0 ? "否" : "是", + combine_mo_code = h.combine_mo_code, + time_stamp = h.time_stamp, + create_id = l.RealName, + create_time = h.create_time.Value.ToString("yyyy-MM-dd : HH:mm:ss"), + material_id = i.code, + material_id_id = h.material_id, + scheduled_qty = h.scheduled_qty.Value.ToString(), + parent_id = a.id, + id = h.id, + hasChildren = false, + num = 0, + isLeaf = true, + }) }).ToPagedListAsync(input.currentPage, input.pageSize); - - + + return PageResult.SqlSugarPageResult(result); } @@ -674,7 +657,7 @@ namespace Tnb.ProductionMgr { var mo = await db.Queryable().FirstAsync(it => it.id == input.mo_id); BasMbomProcess basMbomProcess = null; - if(!string.IsNullOrEmpty(input.bom_id)) + if (!string.IsNullOrEmpty(input.bom_id)) basMbomProcess = await db.Queryable().FirstAsync(x => x.mbom_id == input.bom_id); var moTask = input.Adapt(); moTask.id = SnowflakeIdHelper.NextId(); @@ -688,9 +671,9 @@ namespace Tnb.ProductionMgr if (!string.IsNullOrEmpty(input.eqp_id)) { - OrganizeRelationEntity organizeRelationEntity = await db.Queryable() - .Where(x => x.ObjectId == input.eqp_id && x.ObjectType == "Eqp").FirstAsync(); - moTask.workstation_id = organizeRelationEntity?.OrganizeId ?? ""; + OrganizeRelationEntity organizeRelationEntity = await db.Queryable() + .Where(x => x.ObjectId == input.eqp_id && x.ObjectType == "Eqp").FirstAsync(); + moTask.workstation_id = organizeRelationEntity?.OrganizeId ?? ""; } var moCode = mo?.mo_code; @@ -730,29 +713,29 @@ namespace Tnb.ProductionMgr if (mo != null) {//判断如果当前 工单的已排产数大于工单计划数量则更新工单状态为 已排产 - // if (schedQty.HasValue && schedQty.Value >= mo.plan_qty) - // { - // mo.mo_status = DictConst.AlreadyId; - // } - // else - // { - // if (schedQty.HasValue) - // mo.scheduled_qty = schedQty.Value; - // } - // row = await db.Updateable(mo).ExecuteCommandAsync(); - + // if (schedQty.HasValue && schedQty.Value >= mo.plan_qty) + // { + // mo.mo_status = DictConst.AlreadyId; + // } + // else + // { + // if (schedQty.HasValue) + // mo.scheduled_qty = schedQty.Value; + // } + // row = await db.Updateable(mo).ExecuteCommandAsync(); + if (mo.scheduled_qty == null) { await _db.Updateable() .SetColumns(x => x.mo_status == DictConst.AlreadyId) .SetColumns(x => x.scheduled_qty == input.scheduled_qty) - .Where(x=>x.id==mo.id) + .Where(x => x.id == mo.id) .ExecuteCommandAsync(); } else { await _db.Updateable().SetColumns(x => x.scheduled_qty == x.scheduled_qty + input.scheduled_qty) - .Where(x=>x.id==mo.id) + .Where(x => x.id == mo.id) .ExecuteCommandAsync(); } } @@ -925,17 +908,17 @@ namespace Tnb.ProductionMgr await _db.Updateable() .SetColumns(x => x.mo_status == DictConst.AlreadyId) .SetColumns(x => x.scheduled_qty == input.scheduled_qty) - .Where(x=>x.id==mo.id) + .Where(x => x.id == mo.id) .ExecuteCommandAsync(); } else { await _db.Updateable().SetColumns(x => x.scheduled_qty == x.scheduled_qty + input.scheduled_qty) - .Where(x=>x.id==mo.id) + .Where(x => x.id == mo.id) .ExecuteCommandAsync(); } } - + var subTaskList = await _db.Queryable() .LeftJoin((a, b) => a.id == b.mbom_id) .LeftJoin((a, b, c) => a.route_id == c.id) @@ -943,7 +926,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d) => b.route_detail_id == d.id) .LeftJoin((a, b, c, d, e) => a.id == e.mbom_id && e.mbom_process_id == b.id) .Where((a, b, c, d, e) => a.id == input.bom_id) - .OrderBy((a,b,c,d,e)=>b.ordinal) + .OrderBy((a, b, c, d, e) => b.ordinal) .Select((a, b, c, d, e) => new SubBomListOutput { version = a.version, @@ -961,17 +944,17 @@ namespace Tnb.ProductionMgr { List workstationIds = await _db.Queryable().Where(x => x.Category == DictConst.RegionCategoryStationCode && - x.OrganizeIdTree.Contains(input.workline_id)).Select(x=>x.Id).ToListAsync(); - - + x.OrganizeIdTree.Contains(input.workline_id)).Select(x => x.Id).ToListAsync(); + + List subMoTasks = new(); List subMoTaskLogs = new(); foreach (var item in subTaskList) { - BasMbomProcess basMbomProcess = await _db.Queryable().SingleAsync(x=>x.id==item.mbom_process_id); - List mbomProcessStationIds = JsonConvert.DeserializeObject(basMbomProcess.station).Select(x=>x[x.Length-1]).ToList(); + BasMbomProcess basMbomProcess = await _db.Queryable().SingleAsync(x => x.id == item.mbom_process_id); + List mbomProcessStationIds = JsonConvert.DeserializeObject(basMbomProcess.station).Select(x => x[x.Length - 1]).ToList(); List? resultList = workstationIds.Intersect(mbomProcessStationIds).ToList(); - + PrdMoTask subMoTask = new(); subMoTask.mo_id = input.mo_id; subMoTask.material_id = item.material_id; @@ -992,7 +975,7 @@ namespace Tnb.ProductionMgr subMoTask.create_id = _userManager.UserId; subMoTask.create_time = DateTime.Now; subMoTasks.Add(subMoTask); - + var subTaskLog = new PrdTaskLog(); var subMaterial = await _db.Queryable().SingleAsync(x => x.id == item.material_id); subTaskLog.id = SnowflakeIdHelper.NextId(); @@ -1089,7 +1072,7 @@ namespace Tnb.ProductionMgr // } } - + var taskReportLogs = new List(); var prdTaskList = await db.Queryable().Where(it => input.TaskIds.Contains(it.id)).ToListAsync(); @@ -1127,7 +1110,7 @@ namespace Tnb.ProductionMgr throw Oops.Bah("已开始的不能再开始"); } - if (item.mo_task_status!=DictConst.ToBeStartedEnCode && item.mo_task_status!=DictConst.MoStatusPauseCode) + if (item.mo_task_status != DictConst.ToBeStartedEnCode && item.mo_task_status != DictConst.MoStatusPauseCode) { throw Oops.Bah("状态错误无法开始"); } @@ -1137,7 +1120,7 @@ namespace Tnb.ProductionMgr { throw Oops.Bah("已暂停的不能再暂停"); } - if (item.mo_task_status!=DictConst.InProgressEnCode) + if (item.mo_task_status != DictConst.InProgressEnCode) { throw Oops.Bah("状态错误无法暂停"); } @@ -1147,7 +1130,7 @@ namespace Tnb.ProductionMgr { throw Oops.Bah("已完成的不能再完成"); } - if (item.mo_task_status!=DictConst.InProgressEnCode && item.mo_task_status!=DictConst.MoStatusPauseCode) + if (item.mo_task_status != DictConst.InProgressEnCode && item.mo_task_status != DictConst.MoStatusPauseCode) { throw Oops.Bah("状态错误无法完成"); } @@ -1160,7 +1143,7 @@ namespace Tnb.ProductionMgr break; } } - + prdTaskList.ForEach(x => x.mo_task_status = status); if (behavior == PrdTaskBehavior.Start) { @@ -1176,7 +1159,7 @@ namespace Tnb.ProductionMgr if (string.IsNullOrEmpty(item.parent_id)) continue; //子任务所有状态相同才修改父任务状态 int count1 = await db.Queryable().CountAsync(y => y.parent_id == item.parent_id); - int count2 = await db.Queryable().CountAsync(y => y.parent_id == item.parent_id && y.mo_task_status==status); + int count2 = await db.Queryable().CountAsync(y => y.parent_id == item.parent_id && y.mo_task_status == status); if (count1 == count2) { await db.Updateable().SetColumns(x => x.mo_task_status == status) @@ -1376,7 +1359,7 @@ namespace Tnb.ProductionMgr row = await db.Updateable(icmoItem).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); return (row > 0); } - + // /// // /// 生产提报 // /// @@ -1425,7 +1408,7 @@ namespace Tnb.ProductionMgr // } // return row > 0; // } - + /// /// 生产提报 /// @@ -1446,9 +1429,9 @@ namespace Tnb.ProductionMgr { var db = _repository.AsSugarClient(); var prdMoTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); - var equip = await db.Queryable().SingleAsync(x=>x.id==prdMoTask.eqp_id); + var equip = await db.Queryable().SingleAsync(x => x.id == prdMoTask.eqp_id); var report = await db.Queryable().FirstAsync(it => it.mo_task_id == input.mo_task_id); - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { var row = -1; var prdMo = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mo_id); @@ -1467,9 +1450,9 @@ namespace Tnb.ProductionMgr var config2 = await db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.IS_SURPASS_PERCENTAGE); if (!string.IsNullOrEmpty(config2?.value)) { - if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty*(100+Convert.ToDecimal(config2?.value ?? "1"))/100) + if ((prdMoTask.reported_work_qty ?? 0) + input.reported_qty > prdMoTask.scheduled_qty * (100 + Convert.ToDecimal(config2?.value ?? "1")) / 100) { - throw Oops.Bah($"提报数量不能大于{100+Convert.ToDecimal(config2?.value ?? "0")}%排产数量"); + throw Oops.Bah($"提报数量不能大于{100 + Convert.ToDecimal(config2?.value ?? "0")}%排产数量"); } } } @@ -1500,7 +1483,7 @@ namespace Tnb.ProductionMgr report.material_id = prdMoTask.material_id; report.unit_id = prdMoTask.unit_id; report.process_id = mbomProcess?.process_id ?? ""; - + row = await db.Insertable(report).ExecuteCommandAsync(); #region 质检模块 @@ -1511,7 +1494,7 @@ namespace Tnb.ProductionMgr entity.workid = prdMoTask.workstation_id; var reported = prdMoTask.reported_work_qty == null ? 0 : prdMoTask.reported_work_qty; var scrap = prdMoTask.scrap_qty == null ? 0 : prdMoTask.scrap_qty; - entity.oldpronum = reported+ scrap; + entity.oldpronum = reported + scrap; entity.newpronum = input.reported_qty; entity.triggerevent = EnumTriggerEvent.生产检定量; await _qcCheckPlanService.CreateTask(entity); @@ -1533,7 +1516,7 @@ namespace Tnb.ProductionMgr .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); } - if (prdMoTask.schedule_type==1) + if (prdMoTask.schedule_type == 1) { if (prdMo.reported_work_qty == null) { @@ -1547,7 +1530,7 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.reported_work_qty == x.reported_work_qty + input.reported_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } - + if (prdMo.complete_qty == null) { await db.Updateable() @@ -1560,30 +1543,30 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.complete_qty == x.complete_qty + input.reported_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } - - PerProcessStandardsH processStandardsH = await db.Queryable() - .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && - x.output_material_id == prdMoTask.material_id && x.enabled == 1) - .OrderByDescending(x => x.create_time).FirstAsync(); - ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); - if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && - processStandardsH?.moulding_cycle > 0) + PerProcessStandardsH processStandardsH = await db.Queryable() + .Where(x => x.equip_id == prdMoTask.eqp_id && x.molds_id == prdMoTask.mold_id && + x.output_material_id == prdMoTask.material_id && x.enabled == 1) + .OrderByDescending(x => x.create_time).FirstAsync(); + + ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mold_id); + if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && + processStandardsH?.moulding_cycle > 0) + { + decimal? addTime = ((prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * processStandardsH?.moulding_cycle - 1) / toolMolds.mold_cavity + 1; + if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) { - decimal? addTime = ((prdMoTask.scheduled_qty-input.reported_qty-(prdMoTask.scrap_qty??0)) * processStandardsH?.moulding_cycle - 1) / toolMolds.mold_cavity + 1; - if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) - { - DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); - await db.Updateable() - .SetColumns(x => x.plan_end_date == cal_plan_end_date) - .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - } + DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); + await db.Updateable() + .SetColumns(x => x.plan_end_date == cal_plan_end_date) + .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); } + } } - if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id)) + if (prdMoTask.schedule_type == 2 && !string.IsNullOrEmpty(prdMoTask.mbom_process_id)) { - if (mbomProcess.is_last==1 && prdMoTask != null && !string.IsNullOrEmpty(prdMoTask.parent_id)) + if (mbomProcess.is_last == 1 && prdMoTask != null && !string.IsNullOrEmpty(prdMoTask.parent_id)) { var parentMoTask = await db.Queryable().SingleAsync(x => x.id == prdMoTask.parent_id); if (parentMoTask?.last_process_complete_qty == null) @@ -1592,14 +1575,15 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.last_process_complete_qty == input.reported_qty) // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync(); - }else if (parentMoTask?.last_process_complete_qty != null) + } + else if (parentMoTask?.last_process_complete_qty != null) { await db.Updateable() .SetColumns(x => x.last_process_complete_qty == x.last_process_complete_qty + input.reported_qty) // .SetColumnsIF(flag,x=>x.mo_task_status==DictConst.ComplatedEnCode) .Where(x => x.id == prdMoTask.parent_id).ExecuteCommandAsync(); } - + if (prdMo.reported_work_qty == null) { await db.Updateable() @@ -1612,7 +1596,7 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.reported_work_qty == x.reported_work_qty + input.reported_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } - + if (prdMo.complete_qty == null) { await db.Updateable() @@ -1626,13 +1610,13 @@ namespace Tnb.ProductionMgr .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } } - + var list = await db.Queryable() - .LeftJoin((a,b)=>a.process_id==b.process_id && b.enabled==1) - .Where((a,b)=>a.process_id==prdMoTask.process_id).Select((a,b)=>b).ToListAsync(); - + .LeftJoin((a, b) => a.process_id == b.process_id && b.enabled == 1) + .Where((a, b) => a.process_id == prdMoTask.process_id).Select((a, b) => b).ToListAsync(); + decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); - decimal? addTime = (prdMoTask.scheduled_qty-input.reported_qty-(prdMoTask.scrap_qty??0)) * max; + decimal? addTime = (prdMoTask.scheduled_qty - input.reported_qty - (prdMoTask.scrap_qty ?? 0)) * max; if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) { DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); @@ -1641,7 +1625,7 @@ namespace Tnb.ProductionMgr .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); } } - + var master = await db.Queryable().FirstAsync(it => it.mo_task_id == input.mo_task_id); if (master != null) { @@ -1649,8 +1633,8 @@ namespace Tnb.ProductionMgr master.completed_qty += input.reported_qty; await db.Updateable(master).ExecuteCommandAsync(); } - - + + //扣除生产投料 按最先投入的依次扣除 // List prdFeedingDs = await db.Queryable() // .LeftJoin((a,b)=>a.id==b.feeding_id) @@ -1728,7 +1712,7 @@ namespace Tnb.ProductionMgr // } // } - + }); @@ -1745,7 +1729,7 @@ namespace Tnb.ProductionMgr if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess; } - + /// /// 自检报废提交 /// @@ -1779,7 +1763,7 @@ namespace Tnb.ProductionMgr { throw Oops.Bah("暂停的任务单无法报废"); } - + var result = await db.Ado.UseTranAsync(async () => { List destDefects = new(); @@ -1809,7 +1793,7 @@ namespace Tnb.ProductionMgr { #region 质检模块 //质检模块 - + TriggerPlanEntity entity = new TriggerPlanEntity(); entity.materialid = prdMoTask.material_id; entity.processid = prdMoTask.process_id; @@ -1831,7 +1815,7 @@ namespace Tnb.ProductionMgr } var reportMaster = await db.Queryable().FirstAsync(it => it.mo_task_id == input.mo_task_id); var prdMo = await db.Queryable().SingleAsync(x => x.id == prdMoTask.mo_id); - + if (prdMo.reported_work_qty == null) { await db.Updateable() @@ -1844,7 +1828,7 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.scrap_qty == x.scrap_qty + input.scrap_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } - + if (prdMo.complete_qty == null) { await db.Updateable() @@ -1857,7 +1841,7 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.complete_qty == x.complete_qty + input.scrap_qty) .Where(x => x.id == prdMo.id).ExecuteCommandAsync(); } - + if (reportMaster != null) { reportMaster.completed_qty += input.scrap_qty; @@ -1875,7 +1859,7 @@ namespace Tnb.ProductionMgr if (toolMolds != null && toolMolds?.mold_cavity > 0 && processStandardsH != null && processStandardsH?.moulding_cycle > 0) { - decimal? addTime = ((prdMoTask.scheduled_qty-prdMoTask.reported_work_qty-input.scrap_qty) * processStandardsH?.moulding_cycle - 1) / toolMolds.mold_cavity + 1; + decimal? addTime = ((prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * processStandardsH?.moulding_cycle - 1) / toolMolds.mold_cavity + 1; if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) { DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); @@ -1888,11 +1872,11 @@ namespace Tnb.ProductionMgr else { var list = await db.Queryable() - .LeftJoin((a,b)=>a.process_id==b.process_id && b.enabled==1) - .Where((a,b)=>a.process_id==prdMoTask.process_id).Select((a,b)=>b).ToListAsync(); - + .LeftJoin((a, b) => a.process_id == b.process_id && b.enabled == 1) + .Where((a, b) => a.process_id == prdMoTask.process_id).Select((a, b) => b).ToListAsync(); + decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); - decimal? addTime = (prdMoTask.scheduled_qty-prdMoTask.reported_work_qty-input.scrap_qty) * max; + decimal? addTime = (prdMoTask.scheduled_qty - prdMoTask.reported_work_qty - input.scrap_qty) * max; if (prdMoTask.act_start_date != null && addTime != null && addTime > 0) { DateTime cal_plan_end_date = prdMoTask.act_start_date.Value.AddSeconds((double)addTime); @@ -2052,7 +2036,7 @@ namespace Tnb.ProductionMgr // } // return data!; // } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); @@ -2063,7 +2047,7 @@ namespace Tnb.ProductionMgr List equipIds = new List(); if (!string.IsNullOrEmpty(eqpId)) { - worklineIds = await db.Queryable().Where(x => x.ParentId == eqpId && x.Category==DictConst.RegionCategoryWorklineCode && x.DeleteMark==null).Select(x=>x.Id).ToListAsync(); + worklineIds = await db.Queryable().Where(x => x.ParentId == eqpId && x.Category == DictConst.RegionCategoryWorklineCode && x.DeleteMark == null).Select(x => x.Id).ToListAsync(); equipIds = await db.Queryable().Where(x => x.equip_type_id == eqpId).Select(x => x.id).ToListAsync(); } @@ -2081,26 +2065,26 @@ namespace Tnb.ProductionMgr (a, b, c, d) => a.workline_id == eqpId || a.eqp_id == eqpId) .WhereIF(worklineIds.Count > 0, (a, b, c, d) => worklineIds.Contains(a.workline_id)) .WhereIF(equipIds.Count > 0, (a, b, c, d) => equipIds.Contains(a.eqp_id)) - .Where((a)=>a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_code==DictConst.ToBeScheduledEncode || a.mo_task_code==DictConst.MoStatusPauseCode) - .Select((a, b, c, d,e,f,g,h) => new WorkOrderAdjustmentListOutput + .Where((a) => a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_code == DictConst.ToBeScheduledEncode || a.mo_task_code == DictConst.MoStatusPauseCode) + .Select((a, b, c, d, e, f, g, h) => new WorkOrderAdjustmentListOutput { id = a.id, mo_task_code = a.mo_task_code, - material_id = b.code+"/"+b.name, + material_id = b.code + "/" + b.name, material_id_id = a.material_id, - mold_id = e.mold_code+"/"+e.mold_name, + mold_id = e.mold_code + "/" + e.mold_name, mold_id_id = a.mold_id, mo_task_status = d.FullName, plan_qty = f.plan_qty, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), scheduled_qty = a.scheduled_qty, - workline_id = a.workline_id==null ? "" :g.EnCode+"/"+g.FullName, + workline_id = a.workline_id == null ? "" : g.EnCode + "/" + g.FullName, workline_id_id = a.workline_id, - estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), - estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd"), - eqp_id = a.eqp_id==null ? "" : h.code+"/"+h.name, + estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), + estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd"), + eqp_id = a.eqp_id == null ? "" : h.code + "/" + h.name, eqp_id_id = a.eqp_id, - create_time = a.create_time==null ? "" :a.create_time.Value.ToString(DbTimeFormat.SS) + create_time = a.create_time == null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS) }).OrderByDescending(a => a.create_time).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } @@ -2156,8 +2140,8 @@ namespace Tnb.ProductionMgr .OrderByDescending(x => x.create_time).FirstAsync(); ToolMolds toolMolds = await db.Queryable().SingleAsync(x => x.id == input.molds_id); - if(toolMolds==null) throw Oops.Bah("没找到模具"); - if(toolMolds?.mold_cavity<=0) throw Oops.Bah("模穴数错误"); + if (toolMolds == null) throw Oops.Bah("没找到模具"); + if (toolMolds?.mold_cavity <= 0) throw Oops.Bah("模穴数错误"); if (processStandardsH == null) throw Oops.Bah("工艺标准成型周期错误"); if (processStandardsH?.moulding_cycle <= 0) throw Oops.Bah("工艺标准成型周期错误"); @@ -2167,8 +2151,8 @@ namespace Tnb.ProductionMgr else { var list = await db.Queryable() - .LeftJoin((a,b)=>a.process_id==b.process_id && b.enabled==1) - .Where((a,b)=>a.mbom_id==input.mbom_id).Select((a,b)=>b).ToListAsync(); + .LeftJoin((a, b) => a.process_id == b.process_id && b.enabled == 1) + .Where((a, b) => a.mbom_id == input.mbom_id).Select((a, b) => b).ToListAsync(); decimal max = list.Select(x => Convert.ToDecimal(x.standard_time)).Max(x => x); decimal? addTime = input.scheduled_qty * max; @@ -2176,7 +2160,7 @@ namespace Tnb.ProductionMgr } } - + /// /// 获取这个产线生产中的任务单 @@ -2184,7 +2168,7 @@ namespace Tnb.ProductionMgr /// /// [HttpPost] - public async Task GetMoTaskByWorklineId(Dictionary dic) + public async Task GetMoTaskByWorklineId(Dictionary dic) { string id = dic["id"]; return await _repository.AsSugarClient().Queryable() @@ -2199,17 +2183,17 @@ namespace Tnb.ProductionMgr public async Task ChangeEquip(ChangeEquipInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { var moTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); if (moTask.eqp_id == input.equip_id) { throw new Exception("与原机台相同"); } - + await db.Updateable().SetColumns(x => x.eqp_id == input.equip_id) .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - + var mo = await db.Queryable().SingleAsync(x => x.id == moTask.mo_id); var material = await db.Queryable().SingleAsync(x => x.id == moTask.material_id); var process = await db.Queryable().SingleAsync(x => x.id == moTask.process_id); @@ -2228,15 +2212,15 @@ namespace Tnb.ProductionMgr taskLog.mo_task_code = moTask.mo_task_code; taskLog.station_code = ""; taskLog.process_code = process?.code; - + await db.Insertable(taskLog).ExecuteCommandAsync(); }); if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "更换成功" : result.ErrorMessage; - + } - + /// /// 更换模具 /// @@ -2245,17 +2229,17 @@ namespace Tnb.ProductionMgr public async Task ChangeMold(ChangeMoldInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { var moTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); if (moTask.mold_id == input.mold_id) { throw new Exception("与原模具相同"); } - + await db.Updateable().SetColumns(x => x.mold_id == input.mold_id) .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - + var mo = await db.Queryable().SingleAsync(x => x.id == moTask.mo_id); var mold = await db.Queryable().SingleAsync(x => x.id == input.mold_id); var material = await db.Queryable().SingleAsync(x => x.id == moTask.material_id); @@ -2275,15 +2259,15 @@ namespace Tnb.ProductionMgr taskLog.mo_task_code = moTask.mo_task_code; taskLog.station_code = ""; taskLog.process_code = process?.code; - + await db.Insertable(taskLog).ExecuteCommandAsync(); }); if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "更换成功" : result.ErrorMessage; - + } - + /// /// 更换产线 /// @@ -2292,18 +2276,18 @@ namespace Tnb.ProductionMgr public async Task ChangeWorkline(ChangeWorklineInput input) { var db = _repository.AsSugarClient(); - DbResult result = await db.Ado.UseTranAsync(async () => + DbResult result = await db.Ado.UseTranAsync(async () => { var moTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); if (moTask.workline_id == input.workline_id) { throw new Exception("与原产线相同"); } - - + + await db.Updateable().SetColumns(x => x.workline_id == input.workline_id) .Where(x => x.id == input.mo_task_id).ExecuteCommandAsync(); - + var mo = await db.Queryable().SingleAsync(x => x.id == moTask.mo_id); var material = await db.Queryable().SingleAsync(x => x.id == moTask.material_id); var process = await db.Queryable().SingleAsync(x => x.id == moTask.process_id); @@ -2322,21 +2306,21 @@ namespace Tnb.ProductionMgr taskLog.mo_task_code = moTask.mo_task_code; taskLog.station_code = ""; taskLog.process_code = process?.code; - + await db.Insertable(taskLog).ExecuteCommandAsync(); }); if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "更换成功" : result.ErrorMessage; - + } - + /// /// 根据id获取任务单相关信息 /// /// [HttpPost] - public async Task GetPrdMoTaskInfoById(Dictionary dic) + public async Task GetPrdMoTaskInfoById(Dictionary dic) { string id = dic.ContainsKey("id") ? dic["id"] : ""; if (string.IsNullOrEmpty(id)) return null; @@ -2345,11 +2329,11 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => a.eqp_id == d.id) - .LeftJoin((a,b,c,d,e)=>e.EnCode==a.mo_task_status && e.DictionaryTypeId==DictConst.PrdTaskStatusTypeId) - .LeftJoin((a,b,c,d,e,f)=>a.process_id==f.id) - .LeftJoin((a,b,c,d,e,f,g)=>a.workstation_id==g.Id) + .LeftJoin((a, b, c, d, e) => e.EnCode == a.mo_task_status && e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId) + .LeftJoin((a, b, c, d, e, f) => a.process_id == f.id) + .LeftJoin((a, b, c, d, e, f, g) => a.workstation_id == g.Id) .Where((a, b, c, d) => a.id == id) - .Select((a, b, c, d,e,f,g) => new + .Select((a, b, c, d, e, f, g) => new { id = a.id, mo_task_code = a.mo_task_code, @@ -2385,10 +2369,10 @@ namespace Tnb.ProductionMgr var db = _repository.AsSugarClient(); Dictionary result = new Dictionary(); var listRows = await db.Queryable() - .LeftJoin((a,b)=>a.equip_type_id==b.id) - .Where((a,b)=>b.code=="ZSJ" || b.code=="005") - .OrderBy((a,b)=>b.code) - .Select((a,b) => new + .LeftJoin((a, b) => a.equip_type_id == b.id) + .Where((a, b) => b.code == "ZSJ" || b.code == "005") + .OrderBy((a, b) => b.code) + .Select((a, b) => new { id = a.id, expanded = true, @@ -2396,21 +2380,21 @@ namespace Tnb.ProductionMgr parentId = "" }).ToListAsync(); - DateTime startTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddDays(-15).ToString("yyyy-MM-dd 00:00:00")); - DateTime endTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddMonths(1).AddDays(-1).AddDays(15).ToString("yyyy-MM-dd 23:59:59")); + DateTime startTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(-15).ToString("yyyy-MM-dd 00:00:00")); + DateTime endTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1).AddDays(15).ToString("yyyy-MM-dd 23:59:59")); var charItems = await db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .LeftJoin((a,b,c)=>c.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==c.EnCode) + .LeftJoin((a, b, c) => c.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == c.EnCode) .Where((a, b) => a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.ToBeScheduledEncode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.InProgressEnCode) - .Where((a,b)=>a.schedule_type==1 && string.IsNullOrEmpty(a.parent_id)) - .Where((a,b)=>a.estimated_start_date!=null && a.estimated_end_date!=null) - .Where((a,b)=>a.estimated_start_date>=startTime && a.estimated_end_date<=endTime) - .Select((a, b,c) => new + .Where((a, b) => a.schedule_type == 1 && string.IsNullOrEmpty(a.parent_id)) + .Where((a, b) => a.estimated_start_date != null && a.estimated_end_date != null) + .Where((a, b) => a.estimated_start_date >= startTime && a.estimated_end_date <= endTime) + .Select((a, b, c) => new { id = a.id, label = b.name, material_name = b.name, - reported_work_qty = a.reported_work_qty==null ? 0 : a.reported_work_qty, + reported_work_qty = a.reported_work_qty == null ? 0 : a.reported_work_qty, scheduled_qty = a.scheduled_qty, mo_task_status = c.FullName, // label = b.name +" " +(a.reported_work_qty==null?0:a.reported_work_qty)+"/"+a.scheduled_qty + " " +c.FullName, @@ -2437,16 +2421,16 @@ namespace Tnb.ProductionMgr TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(startTime.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts3 = ts1.Subtract(ts2).Duration(); - - - result.Add("listRows",listRows); - result.Add("charItems",charItems); - result.Add("startTime",startTime); - result.Add("endTime",endTime); - result.Add("totalDays",ts3.TotalDays); + + + result.Add("listRows", listRows); + result.Add("charItems", charItems); + result.Add("startTime", startTime); + result.Add("endTime", endTime); + result.Add("totalDays", ts3.TotalDays); return result; } - + /// /// 获取组装包装生产排产甘特图信息 /// @@ -2457,31 +2441,31 @@ namespace Tnb.ProductionMgr var db = _repository.AsSugarClient(); Dictionary result = new Dictionary(); var listRows = await db.Queryable() - .Where(x => x.DeleteMark==null && (x.Category == DictConst.RegionCategoryWorklineCode || x.Category == DictConst.RegionCategoryWorkshopCode)) - .OrderByDescending(x=>x.Category) + .Where(x => x.DeleteMark == null && (x.Category == DictConst.RegionCategoryWorklineCode || x.Category == DictConst.RegionCategoryWorkshopCode)) + .OrderByDescending(x => x.Category) .Select(x => new { id = x.Id, expanded = true, label = x.FullName, - parentId = x.Category==DictConst.RegionCategoryWorklineCode ? x.ParentId : "" + parentId = x.Category == DictConst.RegionCategoryWorklineCode ? x.ParentId : "" }).ToListAsync(); - DateTime startTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddDays(-15).ToString("yyyy-MM-dd 00:00:00")); - DateTime endTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddMonths(1).AddDays(-1).AddDays(15).ToString("yyyy-MM-dd 23:59:59")); + DateTime startTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(-15).ToString("yyyy-MM-dd 00:00:00")); + DateTime endTime = Convert.ToDateTime(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1).AddDays(15).ToString("yyyy-MM-dd 23:59:59")); var charItems = await db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .LeftJoin((a,b,c)=>c.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==c.EnCode) + .LeftJoin((a, b, c) => c.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == c.EnCode) .Where((a, b) => a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.ToBeScheduledEncode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.InProgressEnCode) - .Where((a,b)=>a.schedule_type==2 && string.IsNullOrEmpty(a.parent_id)) - .Where((a,b)=>a.estimated_start_date!=null && a.estimated_end_date!=null) - .Where((a,b)=>a.estimated_start_date>=startTime && a.estimated_end_date<=endTime) - .Select((a, b,c) => new + .Where((a, b) => a.schedule_type == 2 && string.IsNullOrEmpty(a.parent_id)) + .Where((a, b) => a.estimated_start_date != null && a.estimated_end_date != null) + .Where((a, b) => a.estimated_start_date >= startTime && a.estimated_end_date <= endTime) + .Select((a, b, c) => new { id = a.id, label = b.name, material_name = b.name, - reported_work_qty = a.reported_work_qty==null ? 0 : a.reported_work_qty, + reported_work_qty = a.reported_work_qty == null ? 0 : a.reported_work_qty, scheduled_qty = a.scheduled_qty, mo_task_status = c.FullName, // label = b.name +" " +(a.reported_work_qty==null?0:a.reported_work_qty)+"/"+a.scheduled_qty + " " +c.FullName, @@ -2508,16 +2492,16 @@ namespace Tnb.ProductionMgr TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(startTime.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts3 = ts1.Subtract(ts2).Duration(); - - - result.Add("listRows",listRows); - result.Add("charItems",charItems); - result.Add("startTime",startTime); - result.Add("endTime",endTime); - result.Add("totalDays",ts3.TotalDays); + + + result.Add("listRows", listRows); + result.Add("charItems", charItems); + result.Add("startTime", startTime); + result.Add("endTime", endTime); + result.Add("totalDays", ts3.TotalDays); return result; } - + /// /// 保存注塑挤出生产排产甘特图信息 /// @@ -2530,37 +2514,37 @@ namespace Tnb.ProductionMgr { foreach (var item in input) { - + // if(await db.Queryable().Where(x=>x.Id==item.row_id && x.Category==DictConst.RegionCategoryWorkshopCode).AnyAsync()) // throw Oops.Bah("不能排在车间上"); var prdMoTask = await db.Queryable().SingleAsync(x => x.id == item.id); if (prdMoTask.eqp_id != item.row_id) { await db.Updateable() - .SetColumns(x=>x.workline_id == item.row_id) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.workline_id == item.row_id) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } if (prdMoTask.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm") != item.time.start.Value.ToString("yyyy-MM-dd HH:mm")) { await db.Updateable() - .SetColumns(x=>x.estimated_start_date==item.time.start) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.estimated_start_date == item.time.start) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } - if (prdMoTask.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm")!=item.time.end.Value.ToString("yyyy-MM-dd HH:mm")) + if (prdMoTask.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm") != item.time.end.Value.ToString("yyyy-MM-dd HH:mm")) { await db.Updateable() - .SetColumns(x=>x.estimated_end_date==item.time.end) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.estimated_end_date == item.time.end) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } } }); - if(!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); + if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "排产成功" : result.ErrorMessage; } - + /// /// 保存组装包装生产排产甘特图信息 /// @@ -2573,33 +2557,33 @@ namespace Tnb.ProductionMgr { foreach (var item in input) { - - if(await db.Queryable().Where(x=>x.Id==item.row_id && x.Category==DictConst.RegionCategoryWorkshopCode).AnyAsync()) + + if (await db.Queryable().Where(x => x.Id == item.row_id && x.Category == DictConst.RegionCategoryWorkshopCode).AnyAsync()) throw Oops.Bah("不能排在车间上"); var prdMoTask = await db.Queryable().SingleAsync(x => x.id == item.id); if (prdMoTask.workline_id != item.row_id) { await db.Updateable() - .SetColumns(x=>x.workline_id == item.row_id) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.workline_id == item.row_id) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } if (prdMoTask.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm") != item.time.start.Value.ToString("yyyy-MM-dd HH:mm")) { await db.Updateable() - .SetColumns(x=>x.estimated_start_date==item.time.start) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.estimated_start_date == item.time.start) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } - if (prdMoTask.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm")!=item.time.end.Value.ToString("yyyy-MM-dd HH:mm")) + if (prdMoTask.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm") != item.time.end.Value.ToString("yyyy-MM-dd HH:mm")) { await db.Updateable() - .SetColumns(x=>x.estimated_end_date==item.time.end) - .Where(x=>x.id==item.id).ExecuteCommandAsync(); + .SetColumns(x => x.estimated_end_date == item.time.end) + .Where(x => x.id == item.id).ExecuteCommandAsync(); } } }); - if(!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); + if (!result.IsSuccess) throw Oops.Bah(result.ErrorMessage); return result.IsSuccess ? "排产成功" : result.ErrorMessage; } @@ -2612,19 +2596,19 @@ namespace Tnb.ProductionMgr public async Task GetMoTaskStatusNum() { return await _db.Queryable(). - LeftJoin((a,b)=>a.Id==b.DictionaryTypeId) - .LeftJoin((a,b,c)=>b.Id==c.mo_status) - .Where((a,b,c)=>a.EnCode==DictConst.MoTaskStatusCode) - .GroupBy((a,b,c)=>new { mo_status_code = b.EnCode,mo_status_name = b.FullName}) - .Select((a,b,c) => new + LeftJoin((a, b) => a.Id == b.DictionaryTypeId) + .LeftJoin((a, b, c) => b.Id == c.mo_status) + .Where((a, b, c) => a.EnCode == DictConst.MoTaskStatusCode) + .GroupBy((a, b, c) => new { mo_status_code = b.EnCode, mo_status_name = b.FullName }) + .Select((a, b, c) => new { mo_status_code = b.EnCode, mo_status_name = b.FullName, count = SqlFunc.AggregateCount(c.mo_status) }).ToListAsync(); } - - + + /// /// 获取备料计划 /// @@ -2661,8 +2645,8 @@ namespace Tnb.ProductionMgr var prdMoTaskList = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) - .Where(a => a.schedule_type == 2 && string.IsNullOrEmpty(a.parent_id) && a.estimated_start_date.Value.ToString("yyyy-MM-dd") == now && (a.mo_task_status==DictConst.MoStatusPauseCode || a.mo_task_status==DictConst.ToBeScheduledEncode || a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode)) - .Select((a,b)=>new MaterialPreparationPlanOutput() + .Where(a => a.schedule_type == 2 && string.IsNullOrEmpty(a.parent_id) && a.estimated_start_date.Value.ToString("yyyy-MM-dd") == now && (a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ToBeScheduledEncode || a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode)) + .Select((a, b) => new MaterialPreparationPlanOutput() { mo_task_id = a.id, mo_task_code = a.mo_task_code, @@ -2679,7 +2663,7 @@ namespace Tnb.ProductionMgr { foreach (var itemChildChild in itemChild.children) { - if (itemChildChild.num > 0 && itemChild.rate_num != null && itemChild.rate_num>0) + if (itemChildChild.num > 0 && itemChild.rate_num != null && itemChild.rate_num > 0) { itemChildChild.num = item.num * itemChildChild.num / itemChild.rate_num; } @@ -2700,17 +2684,17 @@ namespace Tnb.ProductionMgr { string station_id = dic.ContainsKey("station_id") ? dic["station_id"] : ""; if (string.IsNullOrEmpty(station_id)) throw Oops.Bah("工位错误"); - var prdMoTask = await _db.Queryable().Where(x => x.workstation_id == station_id && x.parent_id!=null && x.mo_task_status==DictConst.InProgressEnCode).FirstAsync(); + var prdMoTask = await _db.Queryable().Where(x => x.workstation_id == station_id && x.parent_id != null && x.mo_task_status == DictConst.InProgressEnCode).FirstAsync(); if (prdMoTask != null) { BasMaterial basMaterial = await _db.Queryable().SingleAsync(x => x.id == prdMoTask.material_id); prdMoTask.material_name = basMaterial.name; } - + return prdMoTask; } } - + } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs index cdd4c2b0..dae8b582 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdOutstockService.cs @@ -16,8 +16,6 @@ using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Spire.Pdf.Exporting.XPS.Schema; using SqlSugar; using Tnb.BasicData; using Tnb.BasicData.Entities; @@ -45,8 +43,8 @@ namespace Tnb.ProductionMgr private readonly IOrganizeService _organizeService; private readonly IUserManager _userManager; public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); - - public PrdOutstockService(ISqlSugarRepository repository, IOrganizeService organizeService,IRunService runService, IUserManager userManager,IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService) + + public PrdOutstockService(ISqlSugarRepository repository, IOrganizeService organizeService, IRunService runService, IUserManager userManager, IVisualDevService visualDevService, IDictionaryDataService dictionaryDataService) { _db = repository.AsSugarClient(); _runService = runService; @@ -57,7 +55,7 @@ namespace Tnb.ProductionMgr _organizeService = organizeService; OverideFuncs.CreateAsync = Create; } - + private async Task Create(VisualDevModelDataCrInput visualDevModelDataCrInput) { try @@ -67,7 +65,7 @@ namespace Tnb.ProductionMgr MESCreateOutstockInput input = new MESCreateOutstockInput(); input.outstock = new MESWmsOutstockHInput(); input.outstockDs = new List(); - + string locationId = visualDevModelDataCrInput.data.ContainsKey("location_id") ? visualDevModelDataCrInput.data["location_id"].ToString() : ""; BasLocation location = await db.Queryable().SingleAsync(x => x.id == locationId); @@ -91,14 +89,14 @@ namespace Tnb.ProductionMgr // source_id = item.Value("source_id"), // }); // } - + input.outstockDs = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(visualDevModelDataCrInput.data["tablefield107"])); string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK,JsonConvert.SerializeObject(input),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -119,7 +117,7 @@ namespace Tnb.ProductionMgr Log.Error(e.Message); throw Oops.Bah(e.Message); } - + } public async Task GeneralOutstock(GeneralOutstockInput generalOutstockInput) @@ -132,9 +130,9 @@ namespace Tnb.ProductionMgr MESCreateOutstockInput input = new MESCreateOutstockInput(); input.outstock = new MESWmsOutstockHInput(); input.outstockDs = new List(); - - PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x=>x.id==generalOutstockInput.mo_task_id); - BasLocation location = await db.Queryable().Where(x=>x.location_code==generalOutstockInput.location_code).FirstAsync(); + + PrdMoTask prdMoTask = await db.Queryable().SingleAsync(x => x.id == generalOutstockInput.mo_task_id); + BasLocation location = await db.Queryable().Where(x => x.location_code == generalOutstockInput.location_code).FirstAsync(); if (location == null) throw Oops.Bah("未找到库位"); string locationId = location.id; @@ -146,17 +144,17 @@ namespace Tnb.ProductionMgr input.outstock.create_id = _userManager.UserId; input.outstock.location_code = location?.location_code ?? ""; OrganizeEntity workline = await _organizeService.GetAnyParentByWorkstationId(generalOutstockInput.workstation_id, DictConst.RegionCategoryWorklineCode); - + List materialIds = generalOutstockInput.details.Select(x => x.material_id).ToList(); - List basMaterials = await db.Queryable().Where(x=>materialIds.Contains(x.id)).ToListAsync(); - Dictionary unitIdDic = await db.Queryable() + List basMaterials = await db.Queryable().Where(x => materialIds.Contains(x.id)).ToListAsync(); + Dictionary unitIdDic = await db.Queryable() .LeftJoin((a, b) => b.EnCode == DictConst.MeasurementUnit) .LeftJoin((a, b, c) => b.Id == c.DictionaryTypeId && a.unit_id == c.EnCode) - .Where((a,b,c)=>materialIds.Contains(a.id)) - .Select((a, b, c) => new + .Where((a, b, c) => materialIds.Contains(a.id)) + .Select((a, b, c) => new { key = a.id, - value = c.Id + value = c.Id }) .ToDictionaryAsync(x => x.key, x => x.value); @@ -165,18 +163,18 @@ namespace Tnb.ProductionMgr input.outstockDs.Add(new MESWmsOutstockDInput() { material_id = item.material_id, - material_code = basMaterials.First(x=>x.id==item.material_id).code, + material_code = basMaterials.First(x => x.id == item.material_id).code, pr_qty = item.num, unit_id = unitIdDic[item.material_id].ToString() }); } - + string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host; Dictionary header = new Dictionary() { ["Authorization"] = App.HttpContext.Request.Headers["Authorization"] }; - var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK,JsonConvert.SerializeObject(input),header); + var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CREATE_OUTSTOCK, JsonConvert.SerializeObject(input), header); Log.Information(sendResult); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); @@ -202,16 +200,16 @@ namespace Tnb.ProductionMgr prdOutstockDs.Add(new PrdOutstockD() { material_id = item.material_id, - material_code = basMaterials.First(x=>x.id==item.material_id).code, - material_name = basMaterials.First(x=>x.id==item.material_id).name, + material_code = basMaterials.First(x => x.id == item.material_id).code, + material_name = basMaterials.First(x => x.id == item.material_id).name, pr_qty = item.num, unit_id = unitIdDic[item.material_id].ToString(), outstock_id = prdOutstockH.id, source_id = prdMoTask.mo_task_code }); } - - DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => + + DbResult result = await _repository.AsSugarClient().Ado.UseTranAsync(async () => { await _repository.InsertAsync(prdOutstockH); if (prdOutstockDs.Count > 0) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index f7751cfd..06455d94 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -15,8 +15,8 @@ using Tnb.EquipMgr.Entities; using Tnb.PerMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto.PrdManage; -using Tnb.ProductionMgr.Interfaces; using Tnb.ProductionMgr.Entities.Entity; +using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr @@ -53,7 +53,7 @@ namespace Tnb.ProductionMgr list = Array.Empty() }; } - + List trees = new(); var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId); var list = await _db.Queryable().Where(it => it.Category == "workline").ToListAsync(); @@ -63,12 +63,12 @@ namespace Tnb.ProductionMgr _dicWorkLine = list.ToDictionary(x => x.Id, x => Tuple.Create(x.EnCode, x.FullName)); } bool start = false; - bool end=false; + bool end = false; DateTime[] startTimes = new DateTime[2]; DateTime[] endTimes = new DateTime[2]; if (input.estimated_start_date != null && input.estimated_start_date.Count() == 2) { - start=true; + start = true; startTimes[0] = GetDateTimeMilliseconds(input.estimated_start_date![0]); startTimes[1] = GetDateTimeMilliseconds(input.estimated_start_date![1]); @@ -83,14 +83,14 @@ namespace Tnb.ProductionMgr var items = await _db.Queryable() .LeftJoin((a, b) => a.process_id == b.id) .LeftJoin((a, b, c) => a.mo_id == c.id) - .LeftJoin((a,b,c,d)=>a.id==d.parent_id) + .LeftJoin((a, b, c, d) => a.id == d.parent_id) .WhereIF(!string.IsNullOrEmpty(input.mo_task_code), a => a.mo_task_code == input.mo_task_code.Trim()) - // .WhereIF(start, a => a.estimated_start_date != null&& startTimes[0] <= a.estimated_start_date && startTimes[1] >= a.estimated_start_date) - // .WhereIF(end, a => a.estimated_end_date != null && endTimes[0] <= a.estimated_end_date && endTimes[1] >= a.estimated_end_date) + // .WhereIF(start, a => a.estimated_start_date != null&& startTimes[0] <= a.estimated_start_date && startTimes[1] >= a.estimated_start_date) + // .WhereIF(end, a => a.estimated_end_date != null && endTimes[0] <= a.estimated_end_date && endTimes[1] >= a.estimated_end_date) .WhereIF(!string.IsNullOrEmpty(input.workline), a => list.Where(p => p.EnCode.Contains(input.workline) || p.FullName.Contains(input.workline)).Select(p => p.Id).ToList().Contains(a.workline_id!)) .Where(a => string.IsNullOrEmpty(a.parent_id) && a.schedule_type == 2 && a.mo_task_status != "ToBeScheduled") - .Where((a,b,c,d)=>d.workstation_id==input.stationId) - .OrderByDescending(a=>a.create_time) + .Where((a, b, c, d) => d.workstation_id == input.stationId) + .OrderByDescending(a => a.create_time) .Select((a, b, c) => new PrdMoTask { id = a.id, @@ -107,9 +107,9 @@ namespace Tnb.ProductionMgr }) .ToPagedListAsync(input.currentPage, input.pageSize); if (start) - items.list= items.list.Where(a => startTimes[0] <= a.plan_start_date && startTimes[1] >= a.plan_start_date).ToList(); + items.list = items.list.Where(a => startTimes[0] <= a.plan_start_date && startTimes[1] >= a.plan_start_date).ToList(); if (end) - items.list= items.list.Where(a => endTimes[0] <= a.plan_end_date && endTimes[1] >= a.plan_end_date).ToList(); + items.list = items.list.Where(a => endTimes[0] <= a.plan_end_date && endTimes[1] >= a.plan_end_date).ToList(); _db.ThenMapper(items.list, it => { it.mo_task_status = it.mo_task_status.IsNotEmptyOrNull() && dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : ""; @@ -131,31 +131,31 @@ namespace Tnb.ProductionMgr } node.plan_start_date = item.plan_start_date.HasValue ? item.plan_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; node.plan_end_date = item.plan_end_date.HasValue ? item.plan_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; - await GetChild(item.id, trees, dic,input.stationId); + await GetChild(item.id, trees, dic, input.stationId); trees.Add(node); } } var treeList = trees.ToTree(); if (!string.IsNullOrEmpty(input.process)) { - List< PackReportTreeOutput > removelist = new List< PackReportTreeOutput >(); + List removelist = new List(); foreach (var item in treeList) { bool flag = false; if (item.process_id != null && item.process_id.Contains(input.process)) flag = true; - if (item.children != null&& item.children.Count>0) + if (item.children != null && item.children.Count > 0) { - var childs = item.children.Adapt>(); + var childs = item.children.Adapt>(); if (childs.Where(p => p.process_id.Contains(input.process)).Any()) flag = true; } if (!flag) removelist.Add(item); - + } removelist.ForEach(p => treeList.Remove(p)); - + } SqlSugarPagedList pagedList = new() { @@ -179,13 +179,13 @@ namespace Tnb.ProductionMgr return dt; } - private async Task GetChild(string parentId, List nodes, Dictionary dic,string stationId) + private async Task GetChild(string parentId, List nodes, Dictionary dic, string stationId) { var items = await _db.Queryable() .LeftJoin((a, b) => a.process_id == b.id) .LeftJoin((a, b, c) => a.mo_id == c.id) .LeftJoin((a, b, c, d) => a.mbom_process_id == d.id) - .Where(a => a.parent_id == parentId && a.mo_task_status != "ToBeScheduled" && a.workstation_id==stationId) + .Where(a => a.parent_id == parentId && a.mo_task_status != "ToBeScheduled" && a.workstation_id == stationId) .OrderBy((a, b, c, d) => d.ordinal) .Select((a, b, c) => new PrdMoTask { @@ -199,7 +199,7 @@ namespace Tnb.ProductionMgr plan_end_date = a.estimated_end_date, plan_qty = a.scheduled_qty, //complete_qty = SqlFunc.Subqueryable().Where(it => it.mo_task_code == a.mo_task_code).Sum(it => it.reported_work_qty), - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), mo_task_status = a.mo_task_status, }).ToListAsync(); @@ -217,7 +217,7 @@ namespace Tnb.ProductionMgr nsChild[i].process_id = $"{items[i].process_code}/{items[i].process_name}"; 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()) { var workLine = _dicWorkLine.ContainsKey(nsChild[i].workline_id) ? (Tuple)_dicWorkLine[nsChild[i].workline_id] : null; @@ -231,11 +231,11 @@ namespace Tnb.ProductionMgr nodes.AddRange(nsChild); foreach (var item in items) { - await GetChild(item.id, nodes, dic,stationId); + await GetChild(item.id, nodes, dic, stationId); } } } - + /// /// pda端根据工位获取注塑挤出列表 /// @@ -251,16 +251,16 @@ namespace Tnb.ProductionMgr list = Array.Empty() }; } - + var result = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.process_id == c.id) .LeftJoin((a, b, c, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) - .LeftJoin((a,b,c,e,f)=>a.eqp_id==f.id) - .LeftJoin((a,b,c,e,f,g)=>a.mold_id==g.id) - .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==1) + .LeftJoin((a, b, c, e, f) => a.eqp_id == f.id) + .LeftJoin((a, b, c, e, f, g) => a.mold_id == g.id) + .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type == 1) .OrderByDescending((a, b) => a.create_time) - .Select((a, b, c, e,f,g) => new PADPackageTaskPageOutput + .Select((a, b, c, e, f, g) => new PADPackageTaskPageOutput { id = a.id, mo_task_code = a.mo_task_code, @@ -272,12 +272,12 @@ namespace Tnb.ProductionMgr // workline_name = d.FullName, bom_id = a.bom_id, mo_task_status = e.FullName, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), scrap_qty = a.scrap_qty, scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, - estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), - estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), + estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), + estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), parent_id = a.parent_id, process_id = a.process_id, process_name = c.process_name, @@ -308,13 +308,13 @@ namespace Tnb.ProductionMgr list = Array.Empty() }; } - + var result = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.process_id == c.id) .LeftJoin((a, b, c, d) => a.workline_id == d.Id) .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) - .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==2) + .Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type == 2) .OrderByDescending((a, b) => a.create_time) .Select((a, b, c, d, e) => new PADPackageTaskPageOutput { @@ -328,12 +328,12 @@ namespace Tnb.ProductionMgr workline_name = d.FullName, bom_id = a.bom_id, mo_task_status = e.FullName, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), scrap_qty = a.scrap_qty, scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, - estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), - estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), + estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), + estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), parent_id = a.parent_id, process_id = a.process_id, process_name = c.process_name, @@ -342,7 +342,7 @@ namespace Tnb.ProductionMgr return PageResult.SqlSugarPageResult(result); } - + /// /// pda端根据工位获取任务单列表 /// @@ -358,12 +358,12 @@ namespace Tnb.ProductionMgr list = Array.Empty() }; } - + Dictionary queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary() : input.queryJson.ToObject>(); string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; string status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : ""; - DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; - DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString()=="" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; + DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null; + DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null; List statusList = new List(); if (!string.IsNullOrEmpty(status)) { @@ -389,26 +389,26 @@ namespace Tnb.ProductionMgr input.sidx = "create_time"; input.sort = "desc"; } - + var result = await _db.Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.process_id == c.id) .LeftJoin((a, b, c, d) => a.workline_id == d.Id) .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) - .LeftJoin((a,b,c,d,e,f)=>a.eqp_id==f.id) - .LeftJoin((a,b,c,d,e,f,g)=>a.mold_id==g.id) - .LeftJoin((a,b,c,d,e,f,g,h)=>a.material_id==h.output_material_id && a.eqp_id==h.equip_id && a.mold_id==h.molds_id && h.enabled==1) - .LeftJoin((a,b,c,d,e,f,g,h,i)=>a.process_id==i.process_id && i.enabled==1) - .LeftJoin((a,b,c,d,e,f,g,h,i,j)=>a.mo_id==j.id) - .LeftJoin((a,b,c,d,e,f,g,h,i,j,k)=>a.material_id==k.material_id && k.auxiliary_unit_id=="kg") - .LeftJoin((a,b,c,d,e,f,g,h,i,j,k,l)=>a.eqp_id==l.equip_id && l.enabled==1 && l.label_point=="提报装箱称重点位") - .Where((a, b) => a.workstation_id == input.stationId && (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode || a.mo_task_status == DictConst.InProgressEnCode) ) - .WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code)) + .LeftJoin((a, b, c, d, e, f) => a.eqp_id == f.id) + .LeftJoin((a, b, c, d, e, f, g) => a.mold_id == g.id) + .LeftJoin((a, b, c, d, e, f, g, h) => a.material_id == h.output_material_id && a.eqp_id == h.equip_id && a.mold_id == h.molds_id && h.enabled == 1) + .LeftJoin((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1) + .LeftJoin((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) + .LeftJoin((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") + .LeftJoin((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "提报装箱称重点位") + .Where((a, b) => a.workstation_id == input.stationId && (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode || a.mo_task_status == DictConst.InProgressEnCode)) + .WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code)) //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) - .WhereIF(statusList.Count>0,a=>statusList.Contains(a.mo_task_status)) - .WhereIF(status=="3" && start_time!=null,a=>a.act_end_date>=start_time) - .WhereIF(status=="3" && end_time!=null,a=>a.act_end_date<=end_time) - .Select((a, b, c, d, e,f,g,h,i,j,k,l) => new PADPackageTaskPageOutput + .WhereIF(statusList.Count > 0, a => statusList.Contains(a.mo_task_status)) + .WhereIF(status == "3" && start_time != null, a => a.act_end_date >= start_time) + .WhereIF(status == "3" && end_time != null, a => a.act_end_date <= end_time) + .Select((a, b, c, d, e, f, g, h, i, j, k, l) => new PADPackageTaskPageOutput { id = a.id, mo_task_code = a.mo_task_code, @@ -421,12 +421,12 @@ namespace Tnb.ProductionMgr workline_name = d.FullName, bom_id = a.bom_id, mo_task_status = e.FullName, - complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0), + complete_qty = SqlFunc.IsNull(a.reported_work_qty, 0) + SqlFunc.IsNull(a.scrap_qty, 0), scrap_qty = a.scrap_qty, scheduled_qty = a.scheduled_qty, reported_work_qty = a.reported_work_qty, - estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), - estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), + estimated_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS), + estimated_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS), parent_id = a.parent_id, process_id = a.process_id, process_name = c.process_name, @@ -442,9 +442,9 @@ namespace Tnb.ProductionMgr mold_cavity = g.mold_cavity, moulding_cycle = h.moulding_cycle, standard_time = i.standard_time, - act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), - act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), + act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS), + act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS), tube = f.tube, minpacking = b.minpacking, main_num = k.number_of_primary_unit, @@ -457,7 +457,7 @@ namespace Tnb.ProductionMgr .ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); - + } /// @@ -468,8 +468,8 @@ namespace Tnb.ProductionMgr public async Task CheckMold(CheckMoldInput input) { PrdMoTask prdMoTask = await _db.Queryable().SingleAsync(x => x.id == input.mo_task_id); - BasQrcode basQrcode = await _db.Queryable().Where(x=>x.source_name=="TOOL_MOLDS" && x.code==input.mold_qrcode).FirstAsync(); - if (prdMoTask != null && basQrcode!=null) + BasQrcode basQrcode = await _db.Queryable().Where(x => x.source_name == "TOOL_MOLDS" && x.code == input.mold_qrcode).FirstAsync(); + if (prdMoTask != null && basQrcode != null) { return prdMoTask.mold_id == basQrcode.source_id; } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs index 62eee87e..931cf10c 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdTaskManageService.cs @@ -1,35 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using COSXML.Model.Tag; -using JNPF.Common.Core.Manager; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using NPOI.Util; -using SqlSugar; -using Tnb.BasicData.Entities; -using Tnb.EquipMgr.Entities; -using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Interfaces; -using Aspose.Cells.Drawing; -using Microsoft.AspNetCore.Mvc; -using DbModels; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Security; -using Tnb.ProductionMgr.Entities.Dto.PrdManage; -using NPOI.OpenXmlFormats; +using JNPF.DependencyInjection; +using JNPF.DynamicApiController; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.System; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using JNPF.VisualDev.Interfaces; +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.PrdManage; +using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr { @@ -113,13 +102,13 @@ namespace Tnb.ProductionMgr // } // return data!; // } - + private async Task GetList(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); Dictionary queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); - string moTaskCode = queryJson!=null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; - string stationId = queryJson!=null && queryJson.ContainsKey("stationId") ? queryJson["stationId"].ToString() : ""; + string moTaskCode = queryJson != null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; + string stationId = queryJson != null && queryJson.ContainsKey("stationId") ? queryJson["stationId"].ToString() : ""; if (string.IsNullOrEmpty(stationId)) { @@ -129,52 +118,52 @@ namespace Tnb.ProductionMgr list = Array.Empty() }; } - + Dictionary dic = await _dictionaryDataService.GetDicByKey(DictConst.TaskStatus); - + DateTime[] planStartDateArr = null; DateTime[] planEndDateArr = null; if (queryJson.TryGetValue("plan_start_date", out var value1)) { - planStartDateArr = value1.ToObject().Select(x=>x.TimeStampToDateTime()).ToArray(); + planStartDateArr = value1.ToObject().Select(x => x.TimeStampToDateTime()).ToArray(); } if (queryJson.TryGetValue("plan_end_date", out var value2)) { - planEndDateArr = value2.ToObject().Select(x=>x.TimeStampToDateTime()).ToArray(); + planEndDateArr = value2.ToObject().Select(x => x.TimeStampToDateTime()).ToArray(); } - - + + var result = await db.Queryable() .LeftJoin((a, b) => a.eqp_id == b.id) .LeftJoin((a, b, c) => a.material_id == c.id) .LeftJoin((a, b, c, d) => a.mold_id == d.id) - .Where((a,b,c,d)=>(a.mo_task_status==DictConst.ToBeStartedEnCode || a.mo_task_status==DictConst.InProgressEnCode || a.mo_task_status==DictConst.MoStatusExceptionCode || a.mo_task_status==DictConst.MoStatusPauseCode || a.mo_task_status==DictConst.ComplatedEnCode)) - .Where((a,b,c,d)=>a.schedule_type==1) - .WhereIF(!string.IsNullOrEmpty(moTaskCode),(a,b,c,d)=>a.mo_task_code.Contains(moTaskCode)) - .WhereIF(planStartDateArr!=null, (a, b, c, d) => a.estimated_start_date>=planStartDateArr[0] && a.estimated_start_date<=planStartDateArr[1]) - .WhereIF(planEndDateArr!=null, (a, b, c, d) => a.estimated_end_date>=planEndDateArr[0] && a.estimated_end_date<=planEndDateArr[1]) - .Where((a,b,c,d)=>a.workstation_id==stationId) + .Where((a, b, c, d) => (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode || a.mo_task_status == DictConst.MoStatusExceptionCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode)) + .Where((a, b, c, d) => a.schedule_type == 1) + .WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c, d) => a.mo_task_code.Contains(moTaskCode)) + .WhereIF(planStartDateArr != null, (a, b, c, d) => a.estimated_start_date >= planStartDateArr[0] && a.estimated_start_date <= planStartDateArr[1]) + .WhereIF(planEndDateArr != null, (a, b, c, d) => a.estimated_end_date >= planEndDateArr[0] && a.estimated_end_date <= planEndDateArr[1]) + .Where((a, b, c, d) => a.workstation_id == stationId) .OrderByDescending((a, b, c, d) => a.create_time) .Select((a, b, c, d) => new PrdTaskManageListOutput() { id = a.id, mo_task_code = a.mo_task_code, - material_id = c.code+"/"+c.name, - mold_id = d.mold_code+"/"+d.mold_name, - eqp_id = b.code+"/"+b.name, - plan_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), - plan_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd"), + material_id = c.code + "/" + c.name, + mold_id = d.mold_code + "/" + d.mold_name, + eqp_id = b.code + "/" + b.name, + plan_start_date = a.estimated_start_date == null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd"), + plan_end_date = a.estimated_end_date == null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd"), plan_qty = a.scheduled_qty, complete_qty = a.reported_work_qty, mo_task_status = a.mo_task_status, schedule_type = a.schedule_type.ToString(), }) - .Mapper(x=>x.mo_task_status=dic[x.mo_task_status].ToString()) + .Mapper(x => x.mo_task_status = dic[x.mo_task_status].ToString()) .ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - - + + // /// // /// 根据任务单号获取提报记录明细 // /// @@ -249,8 +238,8 @@ namespace Tnb.ProductionMgr // // return prdTask; // } - - + + /// /// 根据任务单号获取提报记录明细 /// @@ -270,14 +259,14 @@ namespace Tnb.ProductionMgr var db = _repository.AsSugarClient(); var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId); var prdTask = await db.Queryable() - .LeftJoin((a,b)=>a.material_id==b.id) - .LeftJoin((a,b,c)=>a.mold_id==c.id) - .LeftJoin((a,b,c,d)=>a.eqp_id==d.id) - .LeftJoin((a,b,c,d,e)=>e.DictionaryTypeId==DictConst.PrdTaskStatusTypeId && a.mo_task_status==e.EnCode) - .LeftJoin((a,b,c,d,e,f)=>a.workline_id==f.Id) - .LeftJoin((a,b,c,d,e,f,g)=>a.process_id==g.id) - .Where((a,b) => a.mo_task_code == mo_task_code) - .Select((a,b,c,d,e,f,g) => new + .LeftJoin((a, b) => a.material_id == b.id) + .LeftJoin((a, b, c) => a.mold_id == c.id) + .LeftJoin((a, b, c, d) => a.eqp_id == d.id) + .LeftJoin((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode) + .LeftJoin((a, b, c, d, e, f) => a.workline_id == f.Id) + .LeftJoin((a, b, c, d, e, f, g) => a.process_id == g.id) + .Where((a, b) => a.mo_task_code == mo_task_code) + .Select((a, b, c, d, e, f, g) => new { id = a.id, mo_task_code = a.mo_task_code, diff --git a/ProductionMgr/Tnb.ProductionMgr/ProductionReportRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/ProductionReportRecordService.cs index 6ebdb3ce..21fdb00c 100644 --- a/ProductionMgr/Tnb.ProductionMgr/ProductionReportRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/ProductionReportRecordService.cs @@ -1,31 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.VisualDev; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Mvc; -using SqlSugar; -using Tnb.BasicData.Entities; -using Tnb.ProductionMgr.Entities; -using Tnb.ProductionMgr.Interfaces; -using JNPF.Systems.Interfaces.System; -using Tnb.BasicData; -using JNPF.Common.Extension; -using JNPF.Common.Filter; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.System; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using JNPF.VisualDev.Interfaces; +using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using SqlSugar; +using Tnb.BasicData; +using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Entities.Dto; +using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr { @@ -85,7 +75,7 @@ namespace Tnb.ProductionMgr // //} // return data!; // } - + private async Task GetList(VisualDevModelListQueryInput input) { @@ -100,11 +90,11 @@ namespace Tnb.ProductionMgr } var db = _repository.AsSugarClient(); var result = await db.Queryable() - .LeftJoin((a,b)=>a.mo_task_type==b.Id) - .LeftJoin((a,b,c)=>a.status==c.EnCode) - .LeftJoin((a,b,c,d)=>a.mo_task_id==d.id) - .WhereIF(!string.IsNullOrEmpty(moTaskCode),(a,b,c)=>a.mo_task_code.Contains(moTaskCode)) - .Select((a,b,c,d)=>new ReportRecordListOutput + .LeftJoin((a, b) => a.mo_task_type == b.Id) + .LeftJoin((a, b, c) => a.status == c.EnCode) + .LeftJoin((a, b, c, d) => a.mo_task_id == d.id) + .WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c) => a.mo_task_code.Contains(moTaskCode)) + .Select((a, b, c, d) => new ReportRecordListOutput { id = a.id, masterial_code = a.masterial_code, @@ -113,27 +103,27 @@ namespace Tnb.ProductionMgr mo_task_id = a.mo_task_code, mo_task_id_id = a.mo_task_id, mo_task_type = b.FullName, - plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-mm-dd"), - plan_start_date = a.plan_start_date==null ? "" : a.plan_start_date.Value.ToString("yyyy-mm-dd"), + plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-mm-dd"), + plan_start_date = a.plan_start_date == null ? "" : a.plan_start_date.Value.ToString("yyyy-mm-dd"), plan_qty = d.scheduled_qty, reported_work_qty = a.reported_work_qty, - completed_qty = SqlFunc.IsNull(d.reported_work_qty,0) + SqlFunc.IsNull(d.scrap_qty,0), + completed_qty = SqlFunc.IsNull(d.reported_work_qty, 0) + SqlFunc.IsNull(d.scrap_qty, 0), status = c.FullName, tablefield107 = SqlFunc.Subqueryable() - .LeftJoin((x,y)=>x.create_id==y.Id) - .Where(x=>x.mo_task_code==a.mo_task_code).ToList((x,y)=>new ReportRecordListChildrenOutput - { - reported_qty = x.reported_qty, - create_id = y.RealName, - create_id_id = x.create_id, - create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.MM), - batch = x.barcode - }) + .LeftJoin((x, y) => x.create_id == y.Id) + .Where(x => x.mo_task_code == a.mo_task_code).ToList((x, y) => new ReportRecordListChildrenOutput + { + reported_qty = x.reported_qty, + create_id = y.RealName, + create_id_id = x.create_id, + create_time = x.create_time == null ? "" : x.create_time.Value.ToString(DbTimeFormat.MM), + batch = x.barcode + }) }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(result); } - private async Task AddRecord(string id,VisualDevModelDataUpInput input) + private async Task AddRecord(string id, VisualDevModelDataUpInput input) { var db = _repository.AsSugarClient(); var result = await db.Ado.UseTranAsync(async () => @@ -147,7 +137,7 @@ namespace Tnb.ProductionMgr { mo_task_id = input.data["mo_task_id"]?.ToString(), mo_task_code = input.data["mo_task_code"]?.ToString(), - reported_qty = item["reported_qty"]!=null ? (int)item["reported_qty"] : 0, + reported_qty = item["reported_qty"] != null ? (int)item["reported_qty"] : 0, create_id = item["create_id"]?.ToString(), create_time = DateTime.Now, }); diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs index 0d5cb241..2d8b55a1 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisBackGround.cs @@ -1,17 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Cache; +using JNPF.Common.Cache; using Microsoft.Extensions.Hosting; -using Newtonsoft.Json.Linq; using Newtonsoft.Json; -using UAParser; -using Tnb.ProductionMgr.Interfaces; +using Newtonsoft.Json.Linq; using Tnb.ProductionMgr.Entities.Dto; -using JNPF.ClayObject.Extensions; using Tnb.ProductionMgr.Entities.Enums; +using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr { @@ -100,7 +93,7 @@ namespace Tnb.ProductionMgr { if (res.Value("Value")) { - // + // } } } @@ -113,8 +106,8 @@ namespace Tnb.ProductionMgr } public Task StartAsync(CancellationToken cancellationToken) { - // packtimer = new Timer(GetPackStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(2)); - // limittimer = new Timer(GetLimitStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(2)); + // packtimer = new Timer(GetPackStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(2)); + // limittimer = new Timer(GetLimitStatus, null, TimeSpan.Zero, TimeSpan.FromSeconds(2)); return Task.CompletedTask; } public Task StopAsync(CancellationToken cancellationToken) diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs index 8f4836f5..dbbe2981 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs @@ -1,13 +1,8 @@ -using System.Collections; -using JNPF.Common.Cache; -using JNPF.Common.Extension; -using JNPF.Common.Manager; +using JNPF.Common.Cache; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.TaskScheduler; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Tnb.ProductionMgr.Interfaces; @@ -19,13 +14,13 @@ namespace Tnb.ProductionMgr /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] - public class RedisDataService: IRedisDataService, IDynamicApiController, ITransient + public class RedisDataService : IRedisDataService, IDynamicApiController, ITransient { private readonly RedisCache _redisCache; public RedisDataService(RedisCache redisCache) { _redisCache = redisCache; - + } /// /// 根据机号获取重量 @@ -33,23 +28,23 @@ namespace Tnb.ProductionMgr [HttpPost] public async Task GetWeight(string device, string jihao) { - /* - var dic =await _redisCache.HGetAll("TY4C-JICHU"); - string a = ""; - foreach (var kvp in dic) - { - a += kvp.Key + "&" + kvp.Value + "$"; - } + /* + var dic =await _redisCache.HGetAll("TY4C-JICHU"); + string a = ""; + foreach (var kvp in dic) + { + a += kvp.Key + "&" + kvp.Value + "$"; + } - string aa = ""; - var ss= aa.Split('$', StringSplitOptions.RemoveEmptyEntries); - foreach (var s in ss) - { - var b = s.Split('&'); - await _redisCache.HSet("TY4C-JICHU", b[0], b[1]); - }*/ - + string aa = ""; + var ss= aa.Split('$', StringSplitOptions.RemoveEmptyEntries); + foreach (var s in ss) + { + var b = s.Split('&'); + await _redisCache.HSet("TY4C-JICHU", b[0], b[1]); + }*/ + decimal result = 0; bool flag = await _redisCache.HashExist(device, jihao); if (!flag) diff --git a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj index c8532136..fde22e81 100644 --- a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj +++ b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/ProductionMgr/Tnb.ProductionMgr/WorkOrderSchedulingService.cs b/ProductionMgr/Tnb.ProductionMgr/WorkOrderSchedulingService.cs index 32fa0cee..daa990cc 100644 --- a/ProductionMgr/Tnb.ProductionMgr/WorkOrderSchedulingService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/WorkOrderSchedulingService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells; -using DingTalk.Api.Request; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; @@ -68,7 +61,7 @@ namespace Tnb.ProductionMgr var dic = new Dictionary { {"id",item.EqpId }, - { "mold_id", item.id} + { "mold_id", item.id} }; var row2 = await db.Updateable(dic).AS("eqp_equipment") .WhereColumns("id"). diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItem.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItem.cs index 7c4c1096..44c005ac 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItem.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItem.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class CheckItemOut { diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItems.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItems.cs index c6c9b706..ad5417ac 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItems.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckItems.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class CheckItemsInput { @@ -56,9 +50,10 @@ namespace Tnb.QcMgr.Entities public string? itemdid { get; set; } public Show? setShow { get; set; } public Data? setData { get; set; } - + } - public class Show { + public class Show + { public bool extype { get; set; } public bool excontent { get; set; } public bool check { get; set; } @@ -69,7 +64,8 @@ namespace Tnb.QcMgr.Entities public bool customer { get; set; } public bool isexec { get; set; } } - public class Data { + public class Data + { public string? extype { get; set; } public Excontent? excontent { get; set; } public string? check { get; set; } diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckPlan.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckPlan.cs index 7849ddde..00ad7332 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckPlan.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckPlan.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class CheckPlanInput { diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs index 23982478..ffc907f0 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class QcCheckExecHOut { @@ -84,8 +78,8 @@ namespace Tnb.QcMgr.Entities public IsexecE? isexec { get; set; } } public class Excontent - { - public string? excontentType { get; set; } + { + public string? excontentType { get; set; } public string? excontentNum { get; set; } public string? amongMaxNum { get; set; } public string? amongMinNum { get; set; } @@ -130,7 +124,7 @@ namespace Tnb.QcMgr.Entities } public class ExecItemInput { - public string? itemdid { get; set; } + public string? itemdid { get; set; } public string? itemid { get; set; } public string? code { get; set; } public string? name { get; set; } diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTaskData.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTaskData.cs index 0683b82b..555e4193 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTaskData.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/CheckTaskData.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class CheckTaskData { public string? checktype { get; set; } - + public string? materialid { get; set; } public string? processid { get; set; } public string? workid { get; set; } diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/SpcData.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/SpcData.cs index d9b3bf7b..cfc2c9e5 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/SpcData.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/SpcData.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Spire.Xls.Core.Spreadsheet.Charts; - -namespace Tnb.QcMgr.Entities +namespace Tnb.QcMgr.Entities { public class SpcDataInput { diff --git a/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs b/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs index 42983040..ff4126df 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Dto/Trigger.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NPOI.SS.Formula.PTG; -using Tnb.QcMgr.Entities.Enums; +using Tnb.QcMgr.Entities.Enums; namespace Tnb.QcMgr.Entities { @@ -13,7 +7,7 @@ namespace Tnb.QcMgr.Entities public string? id { get; set; } public string? name { get; set; } public string? code { get; set; } - public string? type { get; set; } + public string? type { get; set; } public string? cycle { get; set; } public string[]? trievent { get; set; } public string[]? trieventid { get; set; } diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSampleCode.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSampleCode.cs index 40291e15..827a84fc 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSampleCode.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSampleCode.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSamplePlan.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSamplePlan.cs index a17387ae..0f62c634 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSamplePlan.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcAqlSamplePlan.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs index c793007a..b15ec47c 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs index 8107f4c3..6b40831b 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItem.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItem.cs index 2d5aa266..3a886f64 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItem.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItem.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsD.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsD.cs index f90e3bcb..ac1c588b 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsD.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsD.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsH.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsH.cs index b6472209..9cf0df71 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsH.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsH.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsR.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsR.cs index 0266db63..70f0ee22 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsR.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckItemsR.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanAdd.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanAdd.cs index 9cbba68d..86c0d7d4 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanAdd.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanAdd.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanD.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanD.cs index f21854a9..208c9639 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanD.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanD.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; @@ -25,7 +20,7 @@ namespace Tnb.QcMgr.Entities.Entity /// 质检方案主表编号 /// public string? mainid { get; set; } - + /// /// 执行项格式 /// diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanH.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanH.cs index f3ea5cd6..fa738eda 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanH.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanH.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanMaterial.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanMaterial.cs index a93cf8ed..65adc0b6 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanMaterial.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanMaterial.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanProcess.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanProcess.cs index 7712d68f..8cfaeece 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanProcess.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanProcess.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanWork.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanWork.cs index c38b862a..fba3e678 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanWork.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckPlanWork.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckType.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckType.cs index 49266496..7a6e877d 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckType.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckType.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs index 8391c1d6..8eb72689 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs index eec0e3a7..ddbe3cda 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcConfig.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcConfig.cs index 4cf90a08..3ef1690c 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcConfig.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcConfig.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcD.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcD.cs index ec893256..c5f5ecbb 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcD.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcD.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcH.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcH.cs index 2a81b63e..b43a564e 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcH.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcSpcH.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerEvent.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerEvent.cs index 4f71db19..e0cfb20c 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerEvent.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerEvent.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerPlan.cs b/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerPlan.cs index 5eadc716..80060688 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerPlan.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Entity/QcTriggerPlan.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/QcMgr/Tnb.QcMgr.Entities/Enums/EnumTriggerType.cs b/QcMgr/Tnb.QcMgr.Entities/Enums/EnumTriggerType.cs index c6d5ccc8..33a749e2 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Enums/EnumTriggerType.cs +++ b/QcMgr/Tnb.QcMgr.Entities/Enums/EnumTriggerType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; +using System.Reflection; namespace Tnb.QcMgr.Entities.Enums { diff --git a/QcMgr/Tnb.QcMgr.Entities/Tnb.QcMgr.Entities.csproj b/QcMgr/Tnb.QcMgr.Entities/Tnb.QcMgr.Entities.csproj index edabb960..bd191439 100644 --- a/QcMgr/Tnb.QcMgr.Entities/Tnb.QcMgr.Entities.csproj +++ b/QcMgr/Tnb.QcMgr.Entities/Tnb.QcMgr.Entities.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckItemService.cs b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckItemService.cs index 3f2544ec..d08914d0 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckItemService.cs +++ b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckItemService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities; namespace Tnb.QcMgr.Interfaces { diff --git a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckPlanService.cs b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckPlanService.cs index c48775a2..1041014a 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckPlanService.cs +++ b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckPlanService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities; namespace Tnb.QcMgr.Interfaces { @@ -22,7 +17,7 @@ namespace Tnb.QcMgr.Interfaces /// /// public Task GetCheckItems(string id); - + /// /// 获取触发计划清单 /// diff --git a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs index 5eb82b69..be27c8dc 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs +++ b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities; namespace Tnb.QcMgr.Interfaces { diff --git a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTypeService.cs b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTypeService.cs index 75c5ae9b..0e8403ef 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTypeService.cs +++ b/QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTypeService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.QcMgr.Entities; - -namespace Tnb.QcMgr.Interfaces +namespace Tnb.QcMgr.Interfaces { public interface IQcCheckTypeService { diff --git a/QcMgr/Tnb.QcMgr.Interfaces/IQcSpcService.cs b/QcMgr/Tnb.QcMgr.Interfaces/IQcSpcService.cs index 77097e46..736c726a 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/IQcSpcService.cs +++ b/QcMgr/Tnb.QcMgr.Interfaces/IQcSpcService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.QcMgr.Entities; +using Tnb.QcMgr.Entities; namespace Tnb.QcMgr.Interfaces { diff --git a/QcMgr/Tnb.QcMgr.Interfaces/Tnb.QcMgr.Interfaces.csproj b/QcMgr/Tnb.QcMgr.Interfaces/Tnb.QcMgr.Interfaces.csproj index c2786e35..83334969 100644 --- a/QcMgr/Tnb.QcMgr.Interfaces/Tnb.QcMgr.Interfaces.csproj +++ b/QcMgr/Tnb.QcMgr.Interfaces/Tnb.QcMgr.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/QcMgr/Tnb.QcMgr/QcCheckItemService.cs b/QcMgr/Tnb.QcMgr/QcCheckItemService.cs index fea60fdb..615aa824 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckItemService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckItemService.cs @@ -1,26 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using COSXML.Model.Tag; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.JsonSerialization; using JNPF.VisualDev; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; -using NPOI.SS.Formula.Eval; -using NPOI.Util; using SqlSugar; -using Tnb.Common; using Tnb.QcMgr.Entities; using Tnb.QcMgr.Interfaces; @@ -48,8 +35,8 @@ namespace Tnb.QcMgr private async Task Delete(string id) { var db = _repository.AsSugarClient(); - var QcCheckItemsH=await db.Queryable< QcCheckItemsH >().Where(p=>p.id==id).FirstAsync(); - var QcCheckItemsRs = await db.Queryable().Where(p => p.itemshid == id).ToListAsync() ; + var QcCheckItemsH = await db.Queryable().Where(p => p.id == id).FirstAsync(); + var QcCheckItemsRs = await db.Queryable().Where(p => p.itemshid == id).ToListAsync(); var QcCheckItemsDs = await db.Queryable().Where(p => QcCheckItemsRs.Select(p => p.itemsdid).ToList().Contains(p.id)).ToListAsync(); await db.Ado.BeginTranAsync(); await db.Deleteable(QcCheckItemsH).ExecuteCommandAsync(); @@ -243,7 +230,7 @@ namespace Tnb.QcMgr await db.Ado.CommitTranAsync(); } catch (Exception) - { + { await db.Ado.RollbackTranAsync(); throw Oops.Oh(ErrorCode.COM1000); } diff --git a/QcMgr/Tnb.QcMgr/QcCheckPlanService.cs b/QcMgr/Tnb.QcMgr/QcCheckPlanService.cs index 0793142c..ae2f83f8 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckPlanService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckPlanService.cs @@ -1,14 +1,4 @@ -using System; -using System.ArrayExtensions; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using COSXML.Model.Tag; -using JNPF.Common.Contracts; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -21,10 +11,7 @@ using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; using JNPF.VisualDev; using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; using SqlSugar; -using Tnb.ProductionMgr.Entities; -using Tnb.QcMgr.Entities; using Tnb.QcMgr.Entities; using Tnb.QcMgr.Entities.Entity; using Tnb.QcMgr.Entities.Enums; @@ -142,13 +129,13 @@ namespace Tnb.QcMgr Item.setShow.isexec = false; } else - { - if(!Item.setData.isexec.attachment&& !Item.setData.isexec.remark) + { + if (!Item.setData.isexec.attachment && !Item.setData.isexec.remark) Item.setShow.isexec = false; - else + else Item.setShow.isexec = true; } - + CheckPlansOut.checktypes.Where(p => p.checktypeid == QcCheckPlanD.typeid).First()?.items?.Add(Item); } } diff --git a/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs b/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs index b6544561..7a49684f 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; +using System.Linq.Expressions; using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.DependencyInjection; @@ -15,7 +9,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; -using NPOI.SS.Formula.Functions; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.QcMgr.Entities; @@ -42,7 +35,7 @@ namespace Tnb.QcMgr private async Task GetListAsync(VisualDevModelListQueryInput input) { var db = _repository.AsSugarClient(); - Dictionary dic= new Dictionary(); + Dictionary dic = new Dictionary(); dic.Add("ok", "合格"); dic.Add("no", "不合格"); dic.Add("barelyok", "让步合格"); @@ -55,7 +48,7 @@ namespace Tnb.QcMgr var list = await db.Queryable() .LeftJoin((a, b) => a.DictionaryTypeId == b.Id) .Where((a, b) => b.FullName == "质检状态" || b.FullName == "质检类型选择").ToListAsync(); - var BasLocations= await db.Queryable().ToListAsync(); + var BasLocations = await db.Queryable().ToListAsync(); var result = await db.Queryable() .LeftJoin((a, b) => a.materialid == b.id) .LeftJoin((a, b, c) => a.processid == c.id) @@ -79,13 +72,13 @@ namespace Tnb.QcMgr tasktime = a.tasktime == null ? "" : a.tasktime, exectime = a.exectime == null ? "" : a.exectime, execuser = e.RealName == null ? "" : e.RealName, - }).OrderByDescending(a =>DateTime.Parse( a.exectime)).ToPagedListAsync(input.currentPage, input.pageSize); + }).OrderByDescending(a => DateTime.Parse(a.exectime)).ToPagedListAsync(input.currentPage, input.pageSize); foreach (var item in result.list) { item.checktype = list.Select(p => p.Id).Contains(item.checktype) ? list.Where(p => p.Id == item.checktype).First().FullName : ""; item.status = list.Select(p => p.Id).Contains(item.status) ? list.Where(p => p.Id == item.status).First().FullName : ""; item.result = dic.Where(p => p.Key == item.result).Any() ? dic.Where(p => p.Key == item.result).First().Value : ""; - item.wareid = BasLocations.Where(p => p.id == item.wareid).Any() ? BasLocations.Where(p => p.id == item.wareid).First().location_code: ""; + item.wareid = BasLocations.Where(p => p.id == item.wareid).Any() ? BasLocations.Where(p => p.id == item.wareid).First().location_code : ""; } return PageResult.SqlSugarPageResult(result); } @@ -125,7 +118,7 @@ namespace Tnb.QcMgr .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) - // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) + // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) .Select((a, b, c, d, e) => new QcCheckExecHOut { id = a.id, @@ -141,7 +134,7 @@ namespace Tnb.QcMgr exectime = a.exectime == null ? "" : a.exectime, execuser = e.RealName == null ? "" : e.RealName, }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); - + foreach (var item in result.list) { item.checktype = list.Select(p => p.Id).Contains(item.checktype) ? list.Where(p => p.Id == item.checktype).First().FullName : ""; diff --git a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs index 7582e695..1f1201d1 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTaskService.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; -using JNPF.Common.Enums; +using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -17,21 +9,12 @@ using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.BasicData; -using Tnb.EquipMgr.Entities; -using Tnb.ProductionMgr.Entities.Dto; -using Tnb.ProductionMgr.Entities; using Tnb.QcMgr.Entities; -using Tnb.QcMgr.Entities; -using Tnb.QcMgr.Entities.Entity; using Tnb.QcMgr.Interfaces; -using JNPF.Common.Extension; -using Microsoft.AspNetCore.Authorization; namespace Tnb.QcMgr { @@ -79,7 +62,7 @@ namespace Tnb.QcMgr .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) - .Where((a,b,c,d,e)=>a.status== list.Where(p=>p.FullName=="待执行").First().Id) + .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "待执行").First().Id) .Select((a, b, c, d, e) => new QcCheckExecHOut { id = a.id, @@ -145,7 +128,7 @@ namespace Tnb.QcMgr Item.name = QcCheckItems.Where(p => p.id == QcCheckExecD.itemid).First().name!; Item.setData = new ExecItemData(); Item.setData.extype = QcCheckExecD.extype!; - Item.setData.excontent = JSON.Deserialize(QcCheckExecD.excontent!); + Item.setData.excontent = JSON.Deserialize(QcCheckExecD.excontent!); Item.setData.check = QcCheckExecD.check!; if (!string.IsNullOrEmpty(QcCheckExecD.errorcause)) { @@ -174,7 +157,7 @@ namespace Tnb.QcMgr Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype); Item.setShow.excontent = !string.IsNullOrEmpty(QcCheckExecD.excontent); Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check); - Item.setShow.errorcause = Item.setData.errorcause==null|| Item.setData.errorcause?.Count == 0 ? false : true; + Item.setShow.errorcause = Item.setData.errorcause == null || Item.setData.errorcause?.Count == 0 ? false : true; Item.setShow.errorlevel = Item.setData.errorlevel == null || Item.setData.errorlevel?.Count == 0 ? false : true; Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark); Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment); @@ -197,8 +180,8 @@ namespace Tnb.QcMgr try { var QcCheckExecH = await db.Queryable().Where(p => p.id == CheckTaskInput.mainid).FirstAsync(); - var DictionaryType = await db.Queryable().Where(p=>p.FullName== "质检状态").FirstAsync(); - var DictionaryData = await db.Queryable< DictionaryDataEntity >().Where(p => p.DictionaryTypeId==DictionaryType.Id&&p.FullName== "已完成").FirstAsync(); + var DictionaryType = await db.Queryable().Where(p => p.FullName == "质检状态").FirstAsync(); + var DictionaryData = await db.Queryable().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "已完成").FirstAsync(); QcCheckExecH.checknum = CheckTaskInput.checknum; QcCheckExecH.status = DictionaryData.Id; QcCheckExecH.result = CheckTaskInput.result; @@ -209,7 +192,7 @@ namespace Tnb.QcMgr var QcCheckExecDinsert = new List(); if (CheckTaskInput.checktypes?.Count > 0) { - for (int i=0;i< CheckTaskInput.checktypes.Count;i++) + for (int i = 0; i < CheckTaskInput.checktypes.Count; i++) { if (CheckTaskInput.checktypes[i].Count > 0) { @@ -285,10 +268,10 @@ namespace Tnb.QcMgr Result.status = QcCheckExecH.status!; Result.checktypes = new List>(); Result.result = QcCheckExecH.result; - var groupkeys = QcCheckExecDs.Select(p=>p.checkindex).Distinct().ToList(); + var groupkeys = QcCheckExecDs.Select(p => p.checkindex).Distinct().ToList(); foreach (var key in groupkeys) - { - var QcCheckExecDsbykey= QcCheckExecDs.Where(p=>p.checkindex==key).ToList(); + { + var QcCheckExecDsbykey = QcCheckExecDs.Where(p => p.checkindex == key).ToList(); var checktype = new List(); foreach (var QcCheckExecD in QcCheckExecDsbykey) { @@ -349,7 +332,7 @@ namespace Tnb.QcMgr } Result.checktypes.Add(checktype); } - + return Result; } diff --git a/QcMgr/Tnb.QcMgr/QcCheckTypeService.cs b/QcMgr/Tnb.QcMgr/QcCheckTypeService.cs index ac18a64f..bff674e9 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTypeService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTypeService.cs @@ -1,24 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Entitys; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Mvc; -using NPOI.Util; using SqlSugar; -using Tnb.QcMgr.Interfaces; using Tnb.QcMgr.Entities; -using Microsoft.AspNetCore.Identity; -using JNPF.Systems.Entitys.Permission; +using Tnb.QcMgr.Interfaces; namespace Tnb.QcMgr { diff --git a/QcMgr/Tnb.QcMgr/QcSpcService.cs b/QcMgr/Tnb.QcMgr/QcSpcService.cs index 70a74eb1..44099ebb 100644 --- a/QcMgr/Tnb.QcMgr/QcSpcService.cs +++ b/QcMgr/Tnb.QcMgr/QcSpcService.cs @@ -1,25 +1,15 @@ -using System; -using System.ArrayExtensions; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Spire.Xls.Core; using SqlSugar; using Tnb.QcMgr.Entities; -using Tnb.QcMgr.Entities.Entity; using Tnb.QcMgr.Interfaces; namespace Tnb.QcMgr -{ +{ /// /// spc模块 /// @@ -41,15 +31,15 @@ namespace Tnb.QcMgr [HttpPost] public async Task GetSpcItems(string id) { - var datas= await _repository.AsSugarClient().Queryable().Where(p => p.mainid == id).ToListAsync(); - List SpcDataInputs=new List(); + var datas = await _repository.AsSugarClient().Queryable().Where(p => p.mainid == id).ToListAsync(); + List SpcDataInputs = new List(); datas.ForEach(p => { SpcDataInput SpcDataInput = new SpcDataInput(); SpcDataInput.mainid = p.mainid; SpcDataInput.checktime = p.checktime; SpcDataInput.batch = p.batch; - SpcDataInput.data = Array.ConvertAll(p.data!.Split(","),float.Parse); + SpcDataInput.data = Array.ConvertAll(p.data!.Split(","), float.Parse); SpcDataInput.checknum = p.checknum; SpcDataInput.defectivenum = p.defectivenum; SpcDataInputs.Add(SpcDataInput); @@ -74,7 +64,7 @@ namespace Tnb.QcMgr SpcDataInput.ForEach(p => { - QcSpcD QcSpcD=new QcSpcD(); + QcSpcD QcSpcD = new QcSpcD(); QcSpcD.mainid = p.mainid; QcSpcD.checktime = p.checktime; QcSpcD.batch = p.batch; @@ -82,7 +72,7 @@ namespace Tnb.QcMgr QcSpcD.checknum = p.checknum; QcSpcD.defectivenum = p.defectivenum; QcSpcD.create_id = _userManager.UserId; - QcSpcD.create_time=DateTime.Now; + QcSpcD.create_time = DateTime.Now; QcSpcDs.Add(QcSpcD); }); await db.Ado.BeginTranAsync(); @@ -371,8 +361,8 @@ namespace Tnb.QcMgr private static float CalculateMovRange(IEnumerable values) { List floats = new List(); - var arr=values.ToArray(); - for (int i = 0; i < arr.Length-1; i++) + var arr = values.ToArray(); + for (int i = 0; i < arr.Length - 1; i++) { floats.Add(Math.Abs((arr[i + 1] - arr[i]))); } @@ -380,6 +370,6 @@ namespace Tnb.QcMgr } - + } } diff --git a/QcMgr/Tnb.QcMgr/Tnb.QcMgr.csproj b/QcMgr/Tnb.QcMgr/Tnb.QcMgr.csproj index 518e6220..612c4841 100644 --- a/QcMgr/Tnb.QcMgr/Tnb.QcMgr.csproj +++ b/QcMgr/Tnb.QcMgr/Tnb.QcMgr.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/Tnb.Server.sln b/Tnb.Server.sln index 1b62b7aa..e21e89b9 100644 --- a/Tnb.Server.sln +++ b/Tnb.Server.sln @@ -15,14 +15,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-WorkFlow", "05-WorkFlow" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "06-VisualDev", "06-VisualDev", "{161853F8-ADB9-4281-B706-E2E23D40D0F1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "08-Extend", "08-Extend", "{A5AB62A9-B65A-4348-BC4A-60EF67FC1B9D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "07-App", "07-App", "{80FA1E47-5DA6-4688-A033-F867B0FA6F22}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{7876D0A1-7141-4904-8A3B-88DF61BEE7EE}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig - common.props = common.props Directory.Build.props = Directory.Build.props dotnet.ruleset = dotnet.ruleset global.json = global.json @@ -81,12 +78,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Systems.Interfaces", "s EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.API.Entry", "apihost\Tnb.API.Entry\Tnb.API.Entry.csproj", "{DB646C4B-D6FB-44CB-A8F6-C0F6AA83AB8A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend", "extend\Tnb.Extend\Tnb.Extend.csproj", "{0282541C-4295-4A2A-A826-54E9C69718D9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend.Entitys", "extend\Tnb.Extend.Entitys\Tnb.Extend.Entitys.csproj", "{08A36D02-DC53-4895-9E1C-E02BC1BBA890}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend.Interfaces", "extend\Tnb.Extend.Interfaces\Tnb.Extend.Interfaces.csproj", "{2E9F8B23-37B9-42BD-A62F-140A38C43A89}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.SqlSugar", "common\Tnb.SqlSugar\Tnb.SqlSugar.csproj", "{E600E59F-18EE-4DBC-8298-BEF4307F69D9}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "11-BasicData", "11-BasicData", "{52B19E13-6B04-444C-A38A-B9955B199A98}" @@ -296,24 +287,6 @@ Global {DB646C4B-D6FB-44CB-A8F6-C0F6AA83AB8A}.Release|Any CPU.Build.0 = Release|Any CPU {DB646C4B-D6FB-44CB-A8F6-C0F6AA83AB8A}.tianyi|Any CPU.ActiveCfg = Debug|Any CPU {DB646C4B-D6FB-44CB-A8F6-C0F6AA83AB8A}.tianyi|Any CPU.Build.0 = Debug|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.Release|Any CPU.Build.0 = Release|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.tianyi|Any CPU.ActiveCfg = Debug|Any CPU - {0282541C-4295-4A2A-A826-54E9C69718D9}.tianyi|Any CPU.Build.0 = Debug|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.Release|Any CPU.Build.0 = Release|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.tianyi|Any CPU.ActiveCfg = tianyi|Any CPU - {08A36D02-DC53-4895-9E1C-E02BC1BBA890}.tianyi|Any CPU.Build.0 = tianyi|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.Build.0 = Release|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.tianyi|Any CPU.ActiveCfg = tianyi|Any CPU - {2E9F8B23-37B9-42BD-A62F-140A38C43A89}.tianyi|Any CPU.Build.0 = tianyi|Any CPU {E600E59F-18EE-4DBC-8298-BEF4307F69D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E600E59F-18EE-4DBC-8298-BEF4307F69D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {E600E59F-18EE-4DBC-8298-BEF4307F69D9}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -455,9 +428,6 @@ Global {4062FBA9-7EBD-4B5E-A2EA-9BA0B96119A3} = {C617010A-DDB0-4C64-8706-5B9732AEC034} {1C97CF6C-B2DE-4261-824C-C2DE99307CCE} = {C617010A-DDB0-4C64-8706-5B9732AEC034} {6ACA8115-4403-4E04-8B4C-A409E0F0B289} = {C617010A-DDB0-4C64-8706-5B9732AEC034} - {0282541C-4295-4A2A-A826-54E9C69718D9} = {A5AB62A9-B65A-4348-BC4A-60EF67FC1B9D} - {08A36D02-DC53-4895-9E1C-E02BC1BBA890} = {A5AB62A9-B65A-4348-BC4A-60EF67FC1B9D} - {2E9F8B23-37B9-42BD-A62F-140A38C43A89} = {A5AB62A9-B65A-4348-BC4A-60EF67FC1B9D} {E600E59F-18EE-4DBC-8298-BEF4307F69D9} = {E4872924-2348-4E06-881A-08625ED98E9F} {FB41DBE3-4537-47AB-B248-7F6BDC1FC4B3} = {D90E2789-189A-4F05-B081-27F2FABB2E7E} {85E36D25-ACF8-4560-AD3F-05288B1ADD84} = {D90E2789-189A-4F05-B081-27F2FABB2E7E} diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/CallerAttribute.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/CallerAttribute.cs index 46153ecd..957bcac0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/CallerAttribute.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/CallerAttribute.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Attributes +namespace Tnb.WarehouseMgr.Entities.Attributes { [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class CallerAttribute : Attribute diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/RelationalFieldAttribute.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/RelationalFieldAttribute.cs index 4434e42b..f91882a5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/RelationalFieldAttribute.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/RelationalFieldAttribute.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Attributes +namespace Tnb.WarehouseMgr.Entities.Attributes { [AttributeUsage(AttributeTargets.Property)] diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/ServiceModuleAttribute.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/ServiceModuleAttribute.cs index 0224145f..5461e351 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/ServiceModuleAttribute.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/ServiceModuleAttribute.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Attributes +namespace Tnb.WarehouseMgr.Entities.Attributes { /// /// 业务类型模块特性 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/TimedAttribute.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/TimedAttribute.cs index 1b8edfd3..62cf3806 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/TimedAttribute.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Attributes/TimedAttribute.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Attributes +namespace Tnb.WarehouseMgr.Entities.Attributes { /// ///定时任务特性 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/AgvRequestConfig.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/AgvRequestConfig.cs index ac28e5aa..903932cf 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/AgvRequestConfig.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/AgvRequestConfig.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Configs +namespace Tnb.WarehouseMgr.Entities.Configs { public class AgvRequestConfig { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/ElevatorControlConfiguration.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/ElevatorControlConfiguration.cs index e9cc09d3..07ec571e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/ElevatorControlConfiguration.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Configs/ElevatorControlConfiguration.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Configs +namespace Tnb.WarehouseMgr.Entities.Configs { public class ElevatorControlConfiguration { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/ElevatorConsts.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/ElevatorConsts.cs index 7cff5b42..1a440145 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/ElevatorConsts.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/ElevatorConsts.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Consts +namespace Tnb.WarehouseMgr.Entities.Consts { public class ElevatorConsts { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/GenericEnumDicionary.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/GenericEnumDicionary.cs index c8183b00..cc514be2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/GenericEnumDicionary.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/GenericEnumDicionary.cs @@ -1,14 +1,7 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; +using System.Collections.Concurrent; using System.ComponentModel; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; using JNPF.Common.Extension; -using Spire.Pdf.Widget; -using Tnb.WarehouseMgr.Entities.Enums; namespace Tnb.WarehouseMgr.Entities.Consts { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs index df345851..4500944d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Consts +namespace Tnb.WarehouseMgr.Entities.Consts { public class WmsCarryConst { @@ -12,7 +6,7 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// 载具更换EnCode业务编码 /// public const string WMS_CARRY_REPLACE_ENCODE = "WmsCarryReplace"; - - + + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index f29e9c0a..0dc16b62 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -1,12 +1,4 @@ -using System; -using System.CodeDom; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Org.BouncyCastle.Asn1.Mozilla; - -namespace Tnb.WarehouseMgr.Entities.Consts +namespace Tnb.WarehouseMgr.Entities.Consts { public class WmsWareHouseConst { @@ -57,7 +49,7 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// 入库申请生成Encode /// public const string WMS_INSTOCK_ENCODE = "WmsInStock"; - + /// /// 任务执行ENCODE /// @@ -235,7 +227,7 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// /// 打印状态-打印完成 /// - public const string PRINT_STATUS_PRINTCOMPLETE= "26191372853541"; + public const string PRINT_STATUS_PRINTCOMPLETE = "26191372853541"; /// /// 同步状态-无需同步 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BarCodePrintInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BarCodePrintInput.cs index 32c63039..f47f84de 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BarCodePrintInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/BarCodePrintInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 条码打印输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ChainStatusReportingUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ChainStatusReportingUpInput.cs index 2eac52e8..35e56f0d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ChainStatusReportingUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ChainStatusReportingUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 创建任务链输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ConfirmInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ConfirmInput.cs index 9a5329fc..63db30c1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ConfirmInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ConfirmInput.cs @@ -1,6 +1,4 @@ -using Tnb.WarehouseMgr.Entities.Enums; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { public class ConfirmInput { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ExChangeCarryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ExChangeCarryInput.cs index 542665fa..1ff3c380 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ExChangeCarryInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ExChangeCarryInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 更换载具输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/GenPreTaskUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/GenPreTaskUpInput.cs index e705315c..e89398ff 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/GenPreTaskUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/GenPreTaskUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 生成预任务成功后输入参数 @@ -22,7 +16,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto /// /// 载具id集合 /// - public List? CarryIds { get; set; } + public List? CarryIds { get; set; } /// /// 载具Code /// @@ -50,7 +44,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto /// /// 预任务条码记录 /// - public List PreTaskHandleCodes { get; set; }=new List(); + public List PreTaskHandleCodes { get; set; } = new List(); /// /// 是否检验 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/InOutStockApplyforUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/InOutStockApplyforUpInput.cs index 3f1de637..3bbc7b41 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/InOutStockApplyforUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/InOutStockApplyforUpInput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Enums; +using Tnb.WarehouseMgr.Entities.Enums; namespace Tnb.WarehouseMgr.Entities.Dto { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryInput.cs index 4215b2fc..04800d45 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES载具查询接口输入 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryResultInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryResultInput.cs index 668a580c..b155ac15 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryResultInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarryQueryResultInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES载具查询返回接口输入 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarrySignInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarrySignInput.cs index c4e4bac6..bee2b79f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarrySignInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCarrySignInput.cs @@ -12,7 +12,7 @@ /// /// 载具Id /// - public string carry_code { get; set;} + public string carry_code { get; set; } /// /// 创建热Id /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCollocationSchemeQueryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCollocationSchemeQueryInput.cs index 26ea874e..203f2eba 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCollocationSchemeQueryInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCollocationSchemeQueryInput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Filter; +using JNPF.Common.Filter; namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateInstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateInstockInput.cs index 665a9b9f..d887b273 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateInstockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateInstockInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES入库输入 @@ -50,7 +44,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 来源单据ID /// - public string source_id { get; set; } + public string source_id { get; set; } /// /// 来源单据代码 @@ -65,19 +59,19 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 载具编号 /// - public string carry_code { get; set; } + public string carry_code { get; set; } /// /// 库位编号 /// - public string location_code { get; set; } + public string location_code { get; set; } /// /// 未检验:0,已检验:1 /// - public int is_check { get; set; } + public int is_check { get; set; } } - public class MESWmsInstockDInput + public class MESWmsInstockDInput { /// @@ -98,12 +92,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 入库需求数量 /// - public decimal pr_qty { get; set; } + public decimal pr_qty { get; set; } /// /// 批次 /// - public string code_batch { get; set; } + public string code_batch { get; set; } } @@ -137,6 +131,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 批次 /// - public string code_batch { get; set; } + public string code_batch { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateOutstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateOutstockInput.cs index 8c6e913c..b56f6fef 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateOutstockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESCreateOutstockInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES出库输入 @@ -14,15 +8,15 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 生产出库主表 /// - public MESWmsOutstockHInput outstock { get; set; } + public MESWmsOutstockHInput outstock { get; set; } /// /// 生产出库明细表 /// - public List outstockDs { get; set; } + public List outstockDs { get; set; } } public class MESWmsOutstockHInput { - + /// /// 所属组织ID /// @@ -98,5 +92,5 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// public string source_id { get; set; } } - + } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryInStockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryInStockInput.cs index 1c4d5452..2a766905 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryInStockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryInStockInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES空载具入库输入 @@ -14,22 +8,22 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 组织ID /// - public string org_id { get; set; } + public string org_id { get; set; } /// /// 库位编号 /// - public string location_code { get; set; } + public string location_code { get; set; } /// /// 载具编号 /// - public string carry_code { get; set; } + public string carry_code { get; set; } /// /// 创建用户 /// - public string create_id { get; set; } + public string create_id { get; set; } /// /// 入库仓库 /// - public string warehouse_id { get; set; } + public string warehouse_id { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryOutStkInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryOutStkInput.cs index f1393044..1e9fe062 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryOutStkInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESEmptyCarryOutStkInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES空载具出库输入 @@ -25,20 +19,20 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 创建用户 /// - public string create_id { get; set; } + public string create_id { get; set; } /// /// 入库仓库 /// - public string warehouse_id { get; set; } + public string warehouse_id { get; set; } /// /// 载具规格编号 /// - public string carrystd_id { get; set; } + public string carrystd_id { get; set; } /// /// 数量 /// - public int qty { get; set; } + public int qty { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESKittingOutStkInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESKittingOutStkInput.cs index c93af439..1c26eade 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESKittingOutStkInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MESKittingOutStkInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// MES齐套出库输入类 @@ -14,7 +8,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 所属组织ID /// - public string org_id { get; set; } + public string org_id { get; set; } /// /// 出库单创建日期 @@ -49,22 +43,22 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 载具编号 /// - public string carry_code { get; set; } + public string carry_code { get; set; } /// /// 产品ID /// - public string material_id { get; set; } + public string material_id { get; set; } /// /// 产品编号 /// - public string material_code { get; set; } + public string material_code { get; set; } /// /// 齐套搭配方案ID /// - public string collocation_scheme_id { get; set; } + public string collocation_scheme_id { get; set; } /// /// 齐套搭配方案编号 @@ -74,7 +68,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 来源单据ID /// - public string source_id { get; set; } + public string source_id { get; set; } /// /// 来源单据号 @@ -84,12 +78,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 创建用户ID /// - public string create_id { get; set; } + public string create_id { get; set; } /// /// MES齐套出库明细表输入 /// - public List wmsKittingoutDs { get; set; } + public List wmsKittingoutDs { get; set; } } /// @@ -107,33 +101,33 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// /// 单位编号 /// - public string unit_code { get; set; } + public string unit_code { get; set; } /// /// 产品ID /// - public string material_id { get; set; } + public string material_id { get; set; } /// /// 产品编号 /// - public string material_code { get; set; } + public string material_code { get; set; } /// /// 批次 /// - public string code_batch { get; set; } + public string code_batch { get; set; } /// /// 数量(件数) /// - public decimal pr_qty { get; set; } + public decimal pr_qty { get; set; } /// /// 箱数 /// - public int box { get; set; } + public int box { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ModifyPoliciesStatusInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ModifyPoliciesStatusInput.cs index 7f4098f8..4e5b9d31 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ModifyPoliciesStatusInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/ModifyPoliciesStatusInput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Enums; +using Tnb.WarehouseMgr.Entities.Enums; namespace Tnb.WarehouseMgr.Entities.Dto { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/NotifyMessage.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/NotifyMessage.cs index 0e4362e2..9bb2e1bd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/NotifyMessage.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/NotifyMessage.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 通知消息类 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/RobotCallBackInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/RobotCallBackInput.cs index a4ae81bf..c62f798d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/RobotCallBackInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/RobotCallBackInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 机器人回调操作输入参数s diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SacnBarCodeInStockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SacnBarCodeInStockInput.cs index f27031ce..c4821726 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SacnBarCodeInStockInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SacnBarCodeInStockInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 扫码入库输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs index 6ab920ac..09eb503d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/SignForDeliveryInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 出库签收输入参数 @@ -19,7 +13,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs /// 载具ID /// public string carryId { get; set; } - public string carry_code { get; set; } + public string carry_code { get; set; } public string new_carry_code { get; set; } @@ -31,5 +25,5 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs public List distaskCodes { get; set; } } - + } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCallBackInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCallBackInput.cs index 81ad0a54..99b13e57 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCallBackInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCallBackInput.cs @@ -1,6 +1,4 @@ -using Tnb.WarehouseMgr.Entities.Enums; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { public class TaskCallBackInput { @@ -28,7 +26,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto /// 取货/放货 /// public string action { get; set; } - + } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskChainCallBackInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskChainCallBackInput.cs index 5eb90d34..0afb4b8c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskChainCallBackInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskChainCallBackInput.cs @@ -1,6 +1,4 @@ -using Tnb.WarehouseMgr.Entities.Enums; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { public class TaskChainCallBackInput { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCompleUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCompleUpInput.cs index a9a09e06..d3dad8e0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCompleUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskCompleUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 任务完成输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteAfterUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteAfterUpInput.cs index ccf2943c..56e013ba 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteAfterUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteAfterUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 任务执行取操作输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteUpInput.cs index 496364b5..bd726fdd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TaskExecuteUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { /// /// 任务执行输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TimedtaskInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TimedtaskInput.cs index 398d08b8..dad15518 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TimedtaskInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/TimedtaskInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Inputs +namespace Tnb.WarehouseMgr.Entities.Dto.Inputs { public class TimedtaskInput { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/WareHouseUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/WareHouseUpInput.cs index fa48bda3..0eba2328 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/WareHouseUpInput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/WareHouseUpInput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 库房业务更新输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs index 41dec7d9..23538105 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryCodeDetailOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 载具条码明细输出类 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs index 279ad345..4a49a883 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryInfoOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Outputs +namespace Tnb.WarehouseMgr.Entities.Dto.Outputs { /// /// 载具信息输出类 @@ -128,7 +122,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// /// 载具明细列表 /// - public List carryDetails { get; set; }=new List(); + public List carryDetails { get; set; } = new List(); /// /// 载具条码列表 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryQueryOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryQueryOutput.cs index 787e5351..988f8a0b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryQueryOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CarryQueryOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Outputs +namespace Tnb.WarehouseMgr.Entities.Dto.Outputs { /// /// 载具查询输出类 @@ -47,7 +41,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// /// 来源单据ID /// - public string? source_id { get; set; } + public string? source_id { get; set; } /// /// 打包号 @@ -88,7 +82,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// /// 载具查询明细输出类 /// - public class CarryCodeQueryOutput + public class CarryCodeQueryOutput { /// /// 主键ID @@ -161,7 +155,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// 单位代码 /// public string unit_code { get; set; } = string.Empty; - + /// /// 仓库ID /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CollocationSchemeOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CollocationSchemeOutput.cs index 64ee7215..f85e388b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CollocationSchemeOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/CollocationSchemeOutput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Org.BouncyCastle.Asn1.Mozilla; -using SqlSugar; +using Newtonsoft.Json; namespace Tnb.WarehouseMgr.Entities.Dto.Outputs { @@ -70,7 +63,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// /// 齐套明细Json /// - public string CollocationSchemeDsJson { get; set; }=string.Empty; + public string CollocationSchemeDsJson { get; set; } = string.Empty; [JsonIgnore] public List? list { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs index f2602191..3a1520fb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/InStockDetailOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 入库单据物料明细信息 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/MaterailLabelOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/MaterailLabelOutput.cs index 556560e8..908efcc0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/MaterailLabelOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/MaterailLabelOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto.Outputs +namespace Tnb.WarehouseMgr.Entities.Dto.Outputs { /// /// 物料标签查询返回结果 @@ -22,7 +16,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// /// 批次 /// - public string code_batch { get; set;} + public string code_batch { get; set; } /// /// 采购单号 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/OutStockDetailOutput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/OutStockDetailOutput.cs index de687a8b..3186ed6a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/OutStockDetailOutput.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/OutStockDetailOutput.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 出库库单据物料明细信息 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs index 7e3012bd..1a247c43 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Enums; +using JNPF.Common.Enums; namespace Tnb.WarehouseMgr.Entities.Dto.Outputs { @@ -27,6 +22,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs /// public object data { get; set; } - + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InOutStockDetailQuery.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InOutStockDetailQuery.cs index 2a931b06..ce2fe3cf 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InOutStockDetailQuery.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InOutStockDetailQuery.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Enums; +using Tnb.WarehouseMgr.Entities.Enums; namespace Tnb.WarehouseMgr.Entities.Dto { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InStockStrategyQuery.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InStockStrategyQuery.cs index 54064105..2d17ead3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InStockStrategyQuery.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/InStockStrategyQuery.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { /// /// 入库策略输入参数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/MaterialLabelQuery.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/MaterialLabelQuery.cs index 96cc6a27..79031d9a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/MaterialLabelQuery.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/MaterialLabelQuery.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Filter; -using Microsoft.AspNetCore.Mvc.RazorPages; +using JNPF.Common.Filter; namespace Tnb.WarehouseMgr.Entities.Dto.Queries { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs index 879a02f1..cd4df518 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Queries/OutStockStrategyQuery.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Dto +namespace Tnb.WarehouseMgr.Entities.Dto { public class OutStockStrategyQuery { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockCode.cs index 8ace46ca..affe63ee 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockCode.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities +namespace Tnb.WarehouseMgr.Entities { public interface IInOutStockCode { string bill_d_id { get; set; } - + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockDetail.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockDetail.cs index 5869a54f..ca775bf6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockDetail.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IInOutStockDetail.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; namespace Tnb.WarehouseMgr.Entities { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/ITaskManagerDel.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/ITaskManagerDel.cs index 021221fc..89eb6faa 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/ITaskManagerDel.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/ITaskManagerDel.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Entity +namespace Tnb.WarehouseMgr.Entities.Entity { public interface ITaskManagerDel { string startlocation_id { get; set; } string endlocation_id { get; set; } string carry_id { get; set; } - string area_code { get;set; } + string area_code { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IUpdatePoliciesStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IUpdatePoliciesStatus.cs index 1757984b..6605ee81 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IUpdatePoliciesStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IUpdatePoliciesStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Entity +namespace Tnb.WarehouseMgr.Entities.Entity { /// /// 出入库策略状态契约接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsCarryEntity.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsCarryEntity.cs index 2130abef..fcdcccaa 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsCarryEntity.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsCarryEntity.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities +namespace Tnb.WarehouseMgr.Entities { public interface IWmsCarryEntity { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsRoadEntity.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsRoadEntity.cs index c0cd0c73..1cef139a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsRoadEntity.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/IWmsRoadEntity.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities +namespace Tnb.WarehouseMgr.Entities { public interface IWmsRoadEntity { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.part.cs index 698881c0..abc29c92 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.cs index 13a0fb4e..e2bbf362 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.cs @@ -1,7 +1,6 @@ using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; -using SqlSugar.DbConvert; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.part.cs index 336fd5bd..3f45a3ae 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryH.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockD.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockD.part.cs index d313bff9..26c04195 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockD.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCheckstockD.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.part.cs index e380d56d..c8f2d129 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; using Tnb.WarehouseMgr.Entities.Entity; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.cs index 6fafa4bf..88ca59b7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.cs @@ -1,5 +1,4 @@ -using System.Security.Principal; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.part.cs index ce417fad..a605cbb1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsElevatorH.part.cs @@ -1,7 +1,4 @@ -using System.Security.Principal; -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; +using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs index 7b191f25..e2f071d6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.cs @@ -1,9 +1,6 @@ -using JNPF.Common.Const; -using JNPF; using JNPF.Common.Contracts; using JNPF.Common.Security; using SqlSugar; -using Tnb.WarehouseMgr.Entities; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.part.cs index 24f8f909..bc250c13 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockCode.part.cs @@ -1,9 +1,3 @@ -using JNPF.Common.Const; -using JNPF; -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; - namespace Tnb.WarehouseMgr.Entities; /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.part.cs index 57477412..f3ee1510 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockD.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockPolicies.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockPolicies.part.cs index e51c8ca8..587b36be 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockPolicies.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockPolicies.part.cs @@ -1,6 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; using Tnb.WarehouseMgr.Entities.Entity; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.part.cs index cc9122cc..d6fa46d1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockCode.part.cs @@ -1,7 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; - namespace Tnb.WarehouseMgr.Entities; /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockPolicies.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockPolicies.part.cs index 63088f9c..34df3e68 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockPolicies.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockPolicies.part.cs @@ -1,6 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; using Tnb.WarehouseMgr.Entities.Entity; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.part.cs index aa14821e..4ab03baa 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; using Tnb.WarehouseMgr.Entities.Entity; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSetsortingH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSetsortingH.part.cs index 0d34f784..ed825483 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSetsortingH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsSetsortingH.part.cs @@ -1,5 +1,3 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; using SqlSugar; namespace Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsStockReportH.part.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsStockReportH.part.cs index fef9ccbb..984ecc3c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsStockReportH.part.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsStockReportH.part.cs @@ -1,13 +1,11 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Security; -using SqlSugar; +using SqlSugar; namespace Tnb.WarehouseMgr.Entities; /// /// 库存报表 /// -public partial class WmsStockReportH +public partial class WmsStockReportH { /// /// 物料名称 @@ -17,7 +15,7 @@ public partial class WmsStockReportH /// /// 明细列表 /// - [SugarColumn(IsIgnore =true)] + [SugarColumn(IsIgnore = true)] public List Details { get; set; } [SugarColumn(IsIgnore = true)] public decimal codeqty { get; set; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvControl.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvControl.cs index 938b5917..f9bdb970 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvControl.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvControl.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { public enum EnumAgvControl { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvStatus.cs index 570fe908..6f187d1f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumAgvStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { public enum EnumAgvStatus { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCarryStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCarryStatus.cs index c7bbef14..65a82d3b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCarryStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCarryStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 载具状态枚举 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckConclusion.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckConclusion.cs index 6de4aff1..880b317d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckConclusion.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckConclusion.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; namespace Tnb.WarehouseMgr.Entities.Enums { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckStatus.cs index e817fe91..a42a82bb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 盘点状态 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckType.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckType.cs index a497e2ee..e361b285 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckType.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumCheckType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { public enum EnumCheckType { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumDoorStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumDoorStatus.cs index 283ffedf..79ea3cc8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumDoorStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumDoorStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { public enum EnumDoorStatus { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumInOutStockType.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumInOutStockType.cs index ad03a4f7..d4e5eeb6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumInOutStockType.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumInOutStockType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 出入库申请类型 @@ -14,10 +8,10 @@ namespace Tnb.WarehouseMgr.Entities.Enums /// /// 入库 /// - In=1, + In = 1, /// /// 出库 /// - Out=2, + Out = 2, } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumLocationType.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumLocationType.cs index 68e38397..afa934c4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumLocationType.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumLocationType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 库位类型 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumOutStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumOutStatus.cs index f13e2e51..8b8ba82e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumOutStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumOutStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 出库状态 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumRunStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumRunStatus.cs index f3b6d1b0..13644f78 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumRunStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumRunStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 电梯运行状态 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumSysStatus.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumSysStatus.cs index cbfeb966..1d882190 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumSysStatus.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumSysStatus.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 电梯系统状态枚举 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumTaskChainType.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumTaskChainType.cs index 3b9f2dc1..5938fe77 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumTaskChainType.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumTaskChainType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 任务链类型 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumWareHouseModule.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumWareHouseModule.cs index 8c55ebb1..3fef0cf2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumWareHouseModule.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/EnumWareHouseModule.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { /// /// 库房模块 @@ -14,11 +8,11 @@ namespace Tnb.WarehouseMgr.Entities.Enums /// /// 其它 /// - other= 1, + other = 1, /// /// 空载具出库 /// - WmsEptyOutStk=2, + WmsEptyOutStk = 2, /// /// 载具移出 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/TimeSpanUnit.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/TimeSpanUnit.cs index b9a26e80..991c6564 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/TimeSpanUnit.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Enums/TimeSpanUnit.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Entities.Enums +namespace Tnb.WarehouseMgr.Entities.Enums { public enum TimeSpanUnit { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Exceptions/TimedTaskException.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Exceptions/TimedTaskException.cs index 5b73e217..b9d20df4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Exceptions/TimedTaskException.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Exceptions/TimedTaskException.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; +using System.Security.Claims; using JNPF.Common.Const; using JNPF.Common.Security; using SqlSugar; diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Mapper/Mapper.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Mapper/Mapper.cs index 832fb911..ece5b726 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Mapper/Mapper.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Mapper/Mapper.cs @@ -1,12 +1,8 @@ using Mapster; -using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Dto.Outputs; -using Tnb.Common; -using JNPF.Common.Extension; using Tnb.WarehouseMgr.Entities.Enums; -using Tnb.WarehouseMgr.Entities.Consts; namespace Tnb.WarehouseMgr.Entities.Mapper { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Tnb.WarehouseMgr.Entities.csproj b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Tnb.WarehouseMgr.Entities.csproj index edabb960..bd191439 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Tnb.WarehouseMgr.Entities.csproj +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Tnb.WarehouseMgr.Entities.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IBasRegionUserService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IBasRegionUserService.cs index 4f6eb634..d3cb46ed 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IBasRegionUserService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IBasRegionUserService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 区域人员设定服务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IElevatorControlService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IElevatorControlService.cs index 255d43da..f7e9baff 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IElevatorControlService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IElevatorControlService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 电梯控制服务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IPdaStroage.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IPdaStroage.cs index f260b905..f9c0150e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IPdaStroage.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IPdaStroage.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { public interface IPdaStroage { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/ITaskMessageNotify.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/ITaskMessageNotify.cs index 1b6eb44a..a2f0105c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/ITaskMessageNotify.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/ITaskMessageNotify.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; +using System.Threading.Channels; using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWHStorageService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWHStorageService.cs index 70965b9a..85f02655 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWHStorageService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWHStorageService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Dto; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs index d0af5e0d..e78df528 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWareHouseService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; +using System.Linq.Expressions; using Microsoft.AspNetCore.Mvc; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -71,6 +66,6 @@ namespace Tnb.WarehouseMgr.Interfaces /// /// /// Task TaskExecuteAfter(TaskExecuteAfterUpInput input); - Func AddUnExecuteTask { get; set; } + Func AddUnExecuteTask { get; set; } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryBindService.cs index 8a60fe25..d697abda 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryBindService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryLedgerService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryLedgerService.cs index a78c80c8..354fd05f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryLedgerService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryLedgerService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 载具台账服务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryMoveInStockService.cs index c6308eba..4e3caff2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryMoveInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryMoveInStockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryQueryService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryQueryService.cs index ddcfaf51..5842fd2e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryQueryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryQueryService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryService.cs index b35a8c3a..f2d67966 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCarryService.cs @@ -1,5 +1,4 @@ -using System.Runtime.CompilerServices; -using Tnb.WarehouseMgr.Entities; +using Tnb.WarehouseMgr.Entities; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCollocationSchemeSevice.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCollocationSchemeSevice.cs index 06731b64..f8cbbdce 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCollocationSchemeSevice.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsCollocationSchemeSevice.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsDeliveryService.cs index ffc91f56..f7addf8e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsDeliveryService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// Wms配送申请服务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyInstockService.cs index 915cd531..822a4d96 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyInstockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyOutstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyOutstockService.cs index 8948cbfe..4cadb8db 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyOutstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsEmptyOutstockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { @@ -17,6 +12,6 @@ namespace Tnb.WarehouseMgr.Interfaces /// /// /// - Task MESEmptyCarryOutStk(MESEmptyCarryOutStkInput input); + Task MESEmptyCarryOutStk(MESEmptyCarryOutStkInput input); } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsFeedingService.cs index be7e1b84..8e1a57d0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsFeedingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsFeedingService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 投料业务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsInStockService.cs index 1f4f080a..1c28a801 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsInStockService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 入库申请服务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsKittingInStkService.cs index 849a24b8..a42fb92f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsKittingInStkService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsKittingInStkService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsOutStockService.cs index f01d39f0..1b18a8e6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsOutStockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPDATransferSignService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPDATransferSignService.cs index 6916d30b..d8d71c66 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPDATransferSignService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPDATransferSignService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 转运签收服务接口类 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPdaWHService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPdaWHService.cs index c10e4bb1..894340eb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPdaWHService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsPdaWHService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { public interface IWmsPdaWHService { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsRouteMgrService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsRouteMgrService.cs index 044523da..48bfeacd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsRouteMgrService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsRouteMgrService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// Wms路径管理业务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSetSortingService.cs index 7ef0907f..cf78730c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSetSortingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSetSortingService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 齐套分拣业务接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSignForDeliveryService.cs index dd623785..078698c0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmsSignForDeliveryService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// WMS签收接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmskittingOutService.cs index 691f899b..a974b4c3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmskittingOutService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/IWmskittingOutService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.WarehouseMgr.Interfaces { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Interface1.cs b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Interface1.cs index ca71435b..c17dff80 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Interface1.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Interface1.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.WarehouseMgr.Interfaces +namespace Tnb.WarehouseMgr.Interfaces { /// /// 更新业务单据信息接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Tnb.WarehouseMgr.Interfaces.csproj b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Tnb.WarehouseMgr.Interfaces.csproj index a57bb353..abcaef0a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Tnb.WarehouseMgr.Interfaces.csproj +++ b/WarehouseMgr/Tnb.WarehouseMgr.Interfaces/Tnb.WarehouseMgr.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs index 3ca2e321..b220b5b9 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BasRegionUserService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs index fd7d2bb7..6579ac49 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs @@ -1,18 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; using System.Security.Claims; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JavaScriptEngineSwitcher.Core.Extensions; using JNPF; -using JNPF.Common.Contracts; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -21,29 +10,18 @@ using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.EventBus; using JNPF.Extras.CollectiveOAuth.Enums; -using JNPF.FriendlyException; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NPOI.HSSF.UserModel; -using NPOI.OpenXmlFormats.Dml; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.Common.Core.EventBus.Constants; using Tnb.Common.Core.EventBus.Sources; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Dto.Outputs; -using Tnb.WarehouseMgr.Entities.Entity; using Tnb.WarehouseMgr.Interfaces; using Tnb.WarehouseMgr.Print; @@ -117,9 +95,9 @@ namespace Tnb.WarehouseMgr } }); - protected Task InvokeGenPretaskExcute() + protected Task InvokeGenPretaskExcute() { - var wareHouseSvc =App.GetRequiredService(); + var wareHouseSvc = App.GetRequiredService(); return wareHouseSvc.GenTaskExecute(); } @@ -384,7 +362,7 @@ namespace Tnb.WarehouseMgr /// /// [NonAction] - protected Task ToApiResult(HttpStatusCode statusCode, object data) + protected Task ToApiResult(HttpStatusCode statusCode, object data) { Result result = new() { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService`1.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService`1.cs index b243375e..3109287a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService`1.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService`1.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Text; using JNPF; -using JNPF.Common.Contracts; -using JNPF.Logging; using Microsoft.Extensions.Logging; using SqlSugar; using Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs index 8615273b..3f7019a0 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aliyun.OSS; -using JNPF; +using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -13,17 +7,12 @@ using JNPF.Common.Net; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.EventHandler; -using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; -using JNPF.WorkFlow.Entitys.Dto.FlowLaunch; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using NPOI.OpenXmlFormats; -using Senparc.NeuChar.ApiHandlers; using SqlSugar; using Tnb.Common.Extension; using Tnb.EquipMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs index 06231ed2..b5709a50 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/ElevatorControlService.cs @@ -1,21 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; +using System.Dynamic; using JNPF; using JNPF.Common.Extension; -using JNPF.DependencyInjection; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using MimeKit.Cryptography; using Newtonsoft.Json.Linq; using Tnb.Common.Extension; using Tnb.Common.Utils; -using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Configs; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Enums; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/EventSubscribers/TaskStatusChangeSubscriber.cs b/WarehouseMgr/Tnb.WarehouseMgr/EventSubscribers/TaskStatusChangeSubscriber.cs index dda92314..d445daf5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/EventSubscribers/TaskStatusChangeSubscriber.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/EventSubscribers/TaskStatusChangeSubscriber.cs @@ -1,13 +1,5 @@ -using System.Reflection; -using System.Security.Claims; -using JNPF.Common.Configuration; -using JNPF.Common.Core.Manager; -using JNPF.DataEncryption; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.EventBus; -using JNPF.TaskScheduler.Entitys; -using NetTaste; -using SqlSugar; using Tnb.Common.Core.EventBus.Constants; using Tnb.Common.Core.EventBus.Sources; using Tnb.WarehouseMgr.Interfaces; @@ -71,4 +63,4 @@ public class TaskStatusChangeSubscriber : IEventSubscriber, ISingleton } } -} \ No newline at end of file +} \ No newline at end of file diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Extensions/BackgroundServiceExtensions.cs b/WarehouseMgr/Tnb.WarehouseMgr/Extensions/BackgroundServiceExtensions.cs index f640130e..8d7394b9 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Extensions/BackgroundServiceExtensions.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/Extensions/BackgroundServiceExtensions.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Spire.Pdf.Widget; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Extensions/WareHouseBasedControllerActivator.cs b/WarehouseMgr/Tnb.WarehouseMgr/Extensions/WareHouseBasedControllerActivator.cs index cc4150ae..6dd74dd8 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Extensions/WareHouseBasedControllerActivator.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/Extensions/WareHouseBasedControllerActivator.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Extensions.DependencyInjection; -using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { @@ -15,22 +8,22 @@ namespace Tnb.WarehouseMgr { public object Create(ControllerContext context) { - if(context == null) { throw new ArgumentNullException("context"); } + if (context == null) { throw new ArgumentNullException("context"); } var controllerType = context.ActionDescriptor.ControllerTypeInfo.AsType(); //获取Controller实例 - var controller =context.HttpContext.RequestServices.GetRequiredService(controllerType); + var controller = context.HttpContext.RequestServices.GetRequiredService(controllerType); //判断是否继承了自定义Controller基类 //if(controller is BaseWareHouseService basedWhSvc) //{ // basedWhSvc.WareHouseSrv = context.HttpContext.RequestServices.GetRequiredService(); //} - return controller; + return controller; } public void Release(ControllerContext context, object controller) { } - + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Filters/NotifyFilterAttribute.cs b/WarehouseMgr/Tnb.WarehouseMgr/Filters/NotifyFilterAttribute.cs index 059efe54..4c5164bb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Filters/NotifyFilterAttribute.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/Filters/NotifyFilterAttribute.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/LocationDefinitionService.cs b/WarehouseMgr/Tnb.WarehouseMgr/LocationDefinitionService.cs index 8484d02f..644251cd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/LocationDefinitionService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/LocationDefinitionService.cs @@ -1,29 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; +using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.FriendlyException; using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDev; using Mapster; -using Microsoft.AspNetCore.Http; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Entities; -using JNPF.Common.Extension; -using JNPF.Logging; -using System.Reflection.Emit; -using JNPF.VisualDev.Entitys.Dto.VisualDev; -using NPOI.SS.Formula.Functions; -using Spire.Pdf.Lists; -using Aop.Api.Domain; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; -using NPOI.HSSF.UserModel; -using Microsoft.AspNetCore.Mvc; namespace Tnb.WarehouseMgr { @@ -117,15 +101,16 @@ namespace Tnb.WarehouseMgr } else if (locs.Count > 400) { - _db.Utilities.PageEach(locs, 100, async pageList => { - row = await _db.Insertable(pageList).ExecuteCommandAsync(); + _db.Utilities.PageEach(locs, 100, async pageList => + { + row = await _db.Insertable(pageList).ExecuteCommandAsync(); }); } - else + else { row = await _db.Insertable(locs).ExecuteCommandAsync(); } - + } catch (Exception ex) { @@ -140,6 +125,6 @@ namespace Tnb.WarehouseMgr }; return result; } - + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/PDATransferSignService.cs b/WarehouseMgr/Tnb.WarehouseMgr/PDATransferSignService.cs index 13a386a9..499c5907 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/PDATransferSignService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/PDATransferSignService.cs @@ -1,27 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Immutable; +using JNPF; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; +using JNPF.Common.Security; using JNPF.Systems.Interfaces.System; +using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; -using Mapster; -using JNPF.Common.Security; -using System.Collections.Immutable; -using JNPF.Common.Core.Manager; -using Tnb.WarehouseMgr.Interfaces; -using Senparc.Weixin.Work.Entities; -using JNPF; using Tnb.WarehouseMgr.Entities.Exceptions; -using JNPF.Common.Const; +using Tnb.WarehouseMgr.Interfaces; //using JNPF.Extras.CollectiveOAuth.Utils; namespace Tnb.WarehouseMgr @@ -217,7 +210,7 @@ namespace Tnb.WarehouseMgr catch (Exception ex) { await curDb.Ado.RollbackTranAsync(); - if(_userManager?.ToKen.IsNullOrEmpty() ?? false) + if (_userManager?.ToKen.IsNullOrEmpty() ?? false) { TimedTaskErrorInfo ei = new() { @@ -227,7 +220,7 @@ namespace Tnb.WarehouseMgr }; var timedTaskEx = ex.ToTimedTaskException(ei); throw timedTaskEx; - } + } } } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/PcStroageService.cs b/WarehouseMgr/Tnb.WarehouseMgr/PcStroageService.cs index 123a358e..16976bef 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/PcStroageService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/PcStroageService.cs @@ -1,14 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Dynamic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; +using System.Reflection; using JNPF; -using JNPF.Common.Extension; -using Microsoft.Extensions.DependencyInjection; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Interfaces; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/PdaStroageService.cs b/WarehouseMgr/Tnb.WarehouseMgr/PdaStroageService.cs index 4c840d73..edf25d6b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/PdaStroageService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/PdaStroageService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; +using System.Reflection; using JNPF; using JNPF.Common.Extension; using Tnb.WarehouseMgr.Entities.Attributes; @@ -29,7 +24,7 @@ namespace Tnb.WarehouseMgr } } - public async Task Do(WareHouseUpInput input) + public async Task Do(WareHouseUpInput input) { if (_serviceMap.ContainsKey(input.bizTypeId)) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Print/PPLBUtility.cs b/WarehouseMgr/Tnb.WarehouseMgr/Print/PPLBUtility.cs index cc871701..4a742f5f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Print/PPLBUtility.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/Print/PPLBUtility.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyModel; +using System.Runtime.InteropServices; namespace Tnb.WarehouseMgr.Print { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/TaskManagerDelBase.cs b/WarehouseMgr/Tnb.WarehouseMgr/TaskManagerDelBase.cs index e1b220b1..049c912d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/TaskManagerDelBase.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/TaskManagerDelBase.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; using Tnb.BasicData.Entities; -using Tnb.ProductionMgr.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Entity; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/TaskMesageNotify.cs b/WarehouseMgr/Tnb.WarehouseMgr/TaskMesageNotify.cs index 6e0b6cc1..dc3f580c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/TaskMesageNotify.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/TaskMesageNotify.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; +using System.Threading.Channels; using Microsoft.Extensions.DependencyInjection; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/TimedTaskBackgroundService.cs b/WarehouseMgr/Tnb.WarehouseMgr/TimedTaskBackgroundService.cs index 043e0757..1f4faff6 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/TimedTaskBackgroundService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/TimedTaskBackgroundService.cs @@ -1,39 +1,15 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; +using System.Collections.Concurrent; using JNPF; -using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.Message; -using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.EventHandler; -using JNPF.FriendlyException; -using JNPF.Logging; -using JNPF.Message.Interfaces.Message; using JNPF.Systems.Entitys.System; -using Mapster; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -using Natasha.CSharp; -using NetTaste; using Tnb.Common.Extension; using Tnb.Common.Utils; -using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Configs; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; -using Tnb.WarehouseMgr.Entities.Dto.Outputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Entities.Exceptions; -using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj index d805e581..7d6b065d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj +++ b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj @@ -1,6 +1,5 @@  - net6.0 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index a56b3ecf..66954dcb 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Dynamic; -using System.Linq; using System.Linq.Expressions; using JNPF; using JNPF.Common.Contracts; @@ -17,7 +14,6 @@ using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; -using Microsoft.Extensions.Configuration; using Newtonsoft.Json; //using NPOI.SS.Formula.Functions; using SqlSugar; @@ -25,7 +21,6 @@ using Tnb.BasicData.Entities; using Tnb.Common.Extension; using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Configs; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; @@ -33,7 +28,6 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Entity; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; -using JNPF.Common.Extension; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs index 5640c695..1076b9e7 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryBindService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -13,15 +8,9 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; @@ -33,7 +22,7 @@ namespace Tnb.WarehouseMgr [OverideVisualDev(ModuleConsts.MODULE_WMSCARRYBIND_ID)] public class WmsCarryBindService : BaseWareHouseService, IWmsCarryBindService { - + private readonly ISqlSugarClient _db; private readonly IRunService _runService; private readonly IVisualDevService _visualDevService; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs index 991c2dbd..a2c35e74 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryLedgerService.cs @@ -1,31 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.Systems.Interfaces.System; +using JNPF.Common.Core.Manager; +using JNPF.Common.Security; +using JNPF.FriendlyException; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; +using JNPF.VisualDev.Entitys.Dto.VisualDev; using JNPF.VisualDev.Interfaces; +using Mapster; using SqlSugar; +using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; -using JNPF.Common.Extension; -using JNPF.VisualDev.Entitys; -using Aspose.Cells.Drawing; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Http; -using JNPF.Logging; -using JNPF.FriendlyException; -using JNPF.Common.Security; -using Tnb.BasicData.Entities; -using Mapster; -using Aop.Api.Domain; -using JNPF.VisualDev.Entitys.Dto.VisualDev; namespace Tnb.WarehouseMgr { @@ -102,7 +86,8 @@ namespace Tnb.WarehouseMgr } else if (carrys.Count > 400) { - _db.Utilities.PageEach(carrys, 100, async pageList => { + _db.Utilities.PageEach(carrys, 100, async pageList => + { await _db.Insertable(pageList).ExecuteCommandAsync(); }); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs index 646b7fd3..9927dad9 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs @@ -1,24 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Const; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.FriendlyException; -using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; @@ -26,7 +16,6 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -63,7 +52,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = CarryMoveIn; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs index 0f8bcfd3..7107f15f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,7 +10,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -56,7 +50,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = CarryMoveOut; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs index 4f75c5bd..9845ee8c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs @@ -1,20 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Dynamic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; +using System.Linq.Expressions; using JNPF.Common.Extension; using JNPF.FriendlyException; using Mapster; using Microsoft.AspNetCore.Mvc; -using Org.BouncyCastle.Crypto; using SqlSugar; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Dto.Outputs; using Tnb.WarehouseMgr.Interfaces; @@ -84,7 +75,7 @@ namespace Tnb.WarehouseMgr instock_time = b.create_time, }, true) .ToListAsync(); - + if (carry.carrystd_id == WmsWareHouseConst.CARRY_LJSTD_ID && mCarryIdDic?.Count > 0) { if (carryCodes.Count < mCarryIdDic.Keys?.Count) throw new AppFriendlyException("载具条码数据异常,有料箱为空", 500); diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs index a1911319..923c5e3a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryService.cs @@ -1,16 +1,12 @@ -using System.Runtime.CompilerServices; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Security; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; using Microsoft.AspNetCore.Mvc; @@ -228,7 +224,7 @@ namespace Tnb.WarehouseMgr public async Task BarCodePrint(List barCodes) { base.BarCodePrint(barCodes); - + } } } \ No newline at end of file diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs index 4be4e239..e68c5c3c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryUnbindService.cs @@ -1,27 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; -using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.FriendlyException; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs index 0e61c30a..7b74d59b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCheckTaskService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; +using System.Linq.Expressions; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; @@ -15,7 +10,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using OBS.Internal; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -54,7 +48,7 @@ namespace Tnb.WarehouseMgr _runService = runService; _billRullService = billRullService; _userManager = userManager; - + OverideFuncs.CreateAsync = Create; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs index 4c367e00..5da01d2b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs @@ -1,20 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using Aspose.Cells.Drawing; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; using JNPF.Common.Filter; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using SqlSugar; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs index 9005c12f..c74c9049 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDeliveryService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -18,7 +12,6 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; @@ -67,7 +60,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = Create; } /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs index 28bc827f..f088232c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsDistaskService.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.VisualDev; +using JNPF.VisualDev; using SqlSugar; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Entity; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs index f167cfb4..46e7c6fd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Contracts; +using System.Threading.Channels; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; @@ -17,10 +11,7 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; -using Spire.Doc.Formatting; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -28,7 +19,6 @@ using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; -using Tnb.WarehouseMgr.Filters; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs index 56b4530b..fcbc3b89 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,7 +9,6 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; @@ -24,7 +17,6 @@ using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; -using Tnb.WarehouseMgr.Entities.Entity; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; @@ -62,7 +54,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = WmsEmptyOut; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs index abbcdc7c..a2879510 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsFeedingService.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using Mapster; +using System.Linq.Expressions; using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockPoliciesService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockPoliciesService.cs index c347eff6..672ba305 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockPoliciesService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockPoliciesService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SqlSugar; +using SqlSugar; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs index 81307269..c5b62f54 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInStockService.cs @@ -1,24 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.FriendlyException; -using JNPF.Logging; using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; -using Minio.DataModel; -using Newtonsoft.Json.Linq; -using NPOI.SS.Formula.Functions; -using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.Common.Utils; @@ -65,7 +53,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _wareHouseService = wareHouseService; _prdInstockService = prdInstockService; - + } /// /// 根据入库申请单ID获取申请单明细信息 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs index 1b6ac354..a1ad04ac 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -59,7 +54,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = KittingInStk; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs index e901673c..e941f909 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,7 +10,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -59,7 +53,7 @@ namespace Tnb.WarehouseMgr _userManager = userManager; _billRullService = billRullService; _wmsCarryService = wmsCarryService; - + OverideFuncs.CreateAsync = CarryOutBale; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs index a9fe16b1..95959b54 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using System.Linq.Expressions; +using System.Runtime.InteropServices; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; using JNPF.Common.Security; +using JNPF.EventBus; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; @@ -20,9 +14,7 @@ using JNPF.VisualDev.Interfaces; using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; -using NPOI.SS.Formula.Functions; using SqlSugar; -using SqlSugar.DbConvert; using Tnb.BasicData.Entities; using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; @@ -32,10 +24,7 @@ using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; -using System.Reflection; using Tnb.WarehouseMgr.Print; -using System.Runtime.InteropServices; -using JNPF.EventBus; namespace Tnb.WarehouseMgr { @@ -79,7 +68,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _wmsCarryMoveInStockService = wmsCarryMoveInStockService; _wareCarryService = wareCarryService; - + OverideFuncs.CreateAsync = OutStockApplyFor; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs index 392adc56..5ad60040 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDABindService.cs @@ -1,24 +1,9 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Security; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.FriendlyException; -using JNPF.Logging; +using JNPF.Common.Core.Manager; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs index dd207182..d7b8e5bc 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -13,17 +8,9 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Enums; -using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs index 199b9a7f..acc6e8c4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs @@ -1,23 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Const; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.FriendlyException; -using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -60,7 +51,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = PDACarryMoveIn; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs index 111d5263..c5df2aa5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,7 +10,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -57,7 +51,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = PDACarryMoveOut; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs index 711685ce..3db0094d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryReplaceService.cs @@ -1,24 +1,9 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Security; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; -using JNPF.FriendlyException; -using JNPF.Logging; +using JNPF.Common.Core.Manager; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -27,16 +12,16 @@ namespace Tnb.WarehouseMgr /// PDA载具更换 /// [OverideVisualDev(ModuleConsts.MODULE_WMSCARRYREPLACEPDA_ID)] - public class WmsPDACarryReplaceService : WmsCarryService ,IPdaStroage + public class WmsPDACarryReplaceService : WmsCarryService, IPdaStroage { public WmsPDACarryReplaceService( - ISqlSugarRepository repository, - IUserManager userManager, - IBillRullService billRullService, + ISqlSugarRepository repository, + IUserManager userManager, + IBillRullService billRullService, IRunService runService, IVisualDevService visualDevService) : base(repository, userManager, billRullService, runService, visualDevService) { - + } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs index 2e4ebb7a..21564566 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryUnbindService .cs @@ -1,27 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; -using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.FriendlyException; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; @@ -112,7 +98,7 @@ namespace Tnb.WarehouseMgr await _db.Ado.CommitTranAsync(); } - catch (Exception) + catch (Exception) { await _db.Ado.RollbackTranAsync(); throw; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs index 412c9266..69f6921e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs @@ -1,15 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; using JNPF.EventBus; using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; @@ -62,7 +54,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _wareHouseService = wareHouseService; _userManager = userManager; - + OverideFuncs.CreateAsync = Create; } /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs index 9926e68e..ecce2711 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,7 +10,6 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -57,7 +51,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = PDAWmsEmptyIn; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs index aedad1a5..51381f57 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,8 +10,6 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -59,7 +52,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = PDAWmsEmptyOut; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs index a858ef0e..0c64a0ca 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCancelService.cs @@ -1,27 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Security; -using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { @@ -61,7 +46,8 @@ namespace Tnb.WarehouseMgr try { await _db.Ado.BeginTranAsync(); - if (input.data.ContainsKey(nameof(WmsDistaskH.bill_code))) { + if (input.data.ContainsKey(nameof(WmsDistaskH.bill_code))) + { //更新任务执行状态 已取消 await _db.Updateable().SetColumns(it => new WmsDistaskH { status = WmsWareHouseConst.TASK_BILL_STATUS_CANCEL_ID }).Where(it => it.bill_code == input.data[nameof(WmsDistaskH.bill_code)].ToString()).ExecuteCommandAsync(); @@ -76,7 +62,7 @@ namespace Tnb.WarehouseMgr { //载具解锁 await _db.Updateable().SetColumns(it => new WmsCarryH { is_lock = 0 }).Where(it => it.id == input.data[nameof(WmsDistaskH.carry_id)].ToString()).ExecuteCommandAsync(); - } + } if (input.data.ContainsKey(nameof(WmsDistaskH.startlocation_id)) && input.data.ContainsKey(nameof(WmsDistaskH.endlocation_id))) { //所有库位解锁 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs index a64b2feb..6a260a36 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionCompleteService.cs @@ -1,27 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Security; -using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -70,7 +53,7 @@ namespace Tnb.WarehouseMgr taskCompleUpInput.disTaskIds = list; await _wareHouseService.TaskComplate(taskCompleUpInput); } - + await _db.Ado.CommitTranAsync(); } catch (Exception) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs index 5ee18bfa..5fa02e04 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAExceptionReexcuteService.cs @@ -1,27 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Security; -using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs index 206fe46b..95adfc5b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAFeedingService.cs @@ -1,24 +1,14 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; -using JNPF.Common.Security; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index f502e6c5..560da974 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -1,26 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; -using NPOI.OpenXmlFormats.Vml; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.Common.Utils; @@ -28,7 +16,6 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; @@ -65,7 +52,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = ScanCodeInStock; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs index 939e05d9..48aa70fa 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -13,17 +7,13 @@ using JNPF.EventBus; using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; @@ -60,7 +50,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = Inbale; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs index c86d5f92..f111f450 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAKittingInStkService.cs @@ -1,28 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Security; +using JNPF.Common.Core.Manager; using JNPF.EventBus; -using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; -using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; -using Tnb.WarehouseMgr.Entities.Attributes; -using Tnb.WarehouseMgr.Entities.Consts; -using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs index afa30529..f5503d9b 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -16,14 +10,12 @@ using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -50,7 +42,7 @@ namespace Tnb.WarehouseMgr IUserManager userManager, IBillRullService billRullService, IEventPublisher eventPublisher - ) + ) { _db = repository.AsSugarClient(); _runService = runService; @@ -58,7 +50,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = PDAOutBale; } @@ -158,7 +150,7 @@ namespace Tnb.WarehouseMgr await _db.Ado.RollbackTranAsync(); throw; - + } finally { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs index 7be5ce4b..06855e5c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAScanInStockService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; using JNPF.Common.Security; @@ -13,7 +7,6 @@ using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using Mapster; -using Microsoft.AspNetCore.Mvc; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.ProductionMgr.Interfaces; @@ -56,7 +49,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _wareHouseService = wareHouseService; _prdInstockService = prdInstockService; - + OverideFuncs.CreateAsync = ScanInStock; } public async Task ScanInStock(VisualDevModelDataCrInput input) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs index 4b145362..271fc586 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -15,8 +9,6 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; using SqlSugar; using Tnb.BasicData.Entities; @@ -24,7 +16,6 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -61,7 +52,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = CarryTransfer; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPointService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPointService.cs index b2786d36..25f71638 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPointService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPointService.cs @@ -1,20 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.FriendlyException; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDev; using Mapster; -using Microsoft.AspNetCore.Mvc; -using NPOI.HSSF.UserModel; -using NPOI.SS.Formula; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -100,7 +90,7 @@ namespace Tnb.WarehouseMgr { _db.Utilities.PageEach(points, 100, async pageList => { - row = await _db.Insertable(pageList).ExecuteCommandAsync(); + row = await _db.Insertable(pageList).ExecuteCommandAsync(); }); } else diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPretaskService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPretaskService.cs index d8668c42..834189c5 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPretaskService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPretaskService.cs @@ -1,13 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using JNPF.VisualDev; -using NPOI.SS.Formula.Functions; +using JNPF.VisualDev; using SqlSugar; -using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; namespace Tnb.WarehouseMgr diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs index ef7ce566..2aa5e33d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsRobotCallbackService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Extension; using JNPF.Common.Security; @@ -14,8 +7,6 @@ using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; -using NPOI.OpenXmlFormats; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -55,7 +46,7 @@ namespace Tnb.WarehouseMgr _warehouseService = warehouseService; _billRullService = billRullService; _wmsKittingInStkService = wmsKittingInStkService; - + } /// /// 机器人完成任务后回调接口 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs index 1b405274..5e76dee1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsRouteMgrService.cs @@ -1,29 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells.Drawing; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Security; -using JNPF.DependencyInjection; -using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.VisualDev; using JNPF.VisualDev.Interfaces; using Mapster; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using NPOI.HSSF.UserModel; -using NPOI.SS.Formula; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; using SqlSugar; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Interfaces; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs index 4429c4d5..4e681733 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs @@ -1,15 +1,6 @@ -using System; -using System.ArrayExtensions; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; -using JNPF; -using JNPF.Common.Const; +using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Security; @@ -21,9 +12,7 @@ using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; using Mapster; using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula; using SqlSugar; -using TencentCloud.Common; using Tnb.BasicData.Entities; using Tnb.Common.Utils; using Tnb.WarehouseMgr.Entities; @@ -33,7 +22,6 @@ using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Entities.Exceptions; using Tnb.WarehouseMgr.Interfaces; -using UAParser; namespace Tnb.WarehouseMgr { @@ -70,7 +58,7 @@ namespace Tnb.WarehouseMgr _cacheManager = cacheManager; _runService = runService; _visualDevService = visualDevService; - + //OverideFuncs.CreateAsync = Create; } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs index aa2258b8..fccf6a02 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs @@ -1,18 +1,8 @@ -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.Core.Manager; -using JNPF.Common.Enums; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; -using JNPF.FriendlyException; using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis.Operations; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsStockReportService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsStockReportService.cs index ab1a2f9c..b96ebaa3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsStockReportService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsStockReportService.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Dynamic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Mapster; -using MimeKit.Cryptography; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -51,7 +43,7 @@ namespace Tnb.WarehouseMgr }, true) .ToListAsync(); var carryCodes = await _db.Queryable().ToListAsync(); - var storeMap = items.DistinctBy(x=> new {x.warehouse_id,x.material_id }).ToDictionary(x => new {x.warehouse_id,x.material_id }, x => x); + var storeMap = items.DistinctBy(x => new { x.warehouse_id, x.material_id }).ToDictionary(x => new { x.warehouse_id, x.material_id }, x => x); var result = items.GroupBy(g => new { g.warehouse_id, g.material_id }).Select(itGroup => { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs index 41d978f1..ee047edd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -16,8 +9,6 @@ using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Interfaces; -using Mapster; -using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; using SqlSugar; using Tnb.BasicData.Entities; @@ -25,7 +16,6 @@ using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; -using Tnb.WarehouseMgr.Entities.Dto.Inputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Interfaces; namespace Tnb.WarehouseMgr @@ -61,7 +51,7 @@ namespace Tnb.WarehouseMgr _wareHouseService = wareHouseService; _userManager = userManager; _billRullService = billRullService; - + OverideFuncs.CreateAsync = CarryTransfer; } @@ -146,7 +136,7 @@ namespace Tnb.WarehouseMgr await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync(); await _db.Updateable().SetColumns(it => new WmsTransfer { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.data["ReturnIdentity"].ToString()).ExecuteCommandAsync(); - + } } @@ -161,7 +151,7 @@ namespace Tnb.WarehouseMgr } finally { - await InvokeGenPretaskExcute();; + await InvokeGenPretaskExcute(); ; } return Task.FromResult(true); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs index b7b26e4b..f9f506d2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs @@ -1,34 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.Common; -using System.Linq; +using System.Data; using System.Linq.Expressions; -using System.Net.Http; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; -using System.Transactions; -using Aop.Api.Domain; using JNPF; -using JNPF.Common.Const; using JNPF.Common.Core.Manager; -using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Security; -using JNPF.DataEncryption; using JNPF.EventBus; using JNPF.FriendlyException; using JNPF.LinqBuilder; using JNPF.Logging; -using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.System; using Mapster; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis.CSharp.Syntax; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.WarehouseMgr.Entities; @@ -36,7 +20,6 @@ using Tnb.WarehouseMgr.Entities.Attributes; using Tnb.WarehouseMgr.Entities.Consts; using Tnb.WarehouseMgr.Entities.Dto; using Tnb.WarehouseMgr.Entities.Dto.Inputs; -using Tnb.WarehouseMgr.Entities.Dto.Outputs; using Tnb.WarehouseMgr.Entities.Enums; using Tnb.WarehouseMgr.Entities.Exceptions; using Tnb.WarehouseMgr.Interfaces; @@ -72,7 +55,7 @@ namespace Tnb.WarehouseMgr _billRullService = billRullService; _carryService = carryService; _cacheManager = cacheManager; - + } /// /// 齐套出库(新增状态) diff --git a/apihost/Tnb.API.Entry/Extensions/ConfigureEventBusExtensions.cs b/apihost/Tnb.API.Entry/Extensions/ConfigureEventBusExtensions.cs index 214f6c8a..8689ae1d 100644 --- a/apihost/Tnb.API.Entry/Extensions/ConfigureEventBusExtensions.cs +++ b/apihost/Tnb.API.Entry/Extensions/ConfigureEventBusExtensions.cs @@ -1,8 +1,6 @@ using JNPF; using JNPF.Common.Core; -using JNPF.Common.Options; using JNPF.EventHandler; -using OnceMi.AspNetCore.OSS; namespace Microsoft.Extensions.DependencyInjection; @@ -11,13 +9,13 @@ namespace Microsoft.Extensions.DependencyInjection; /// public static class ConfigureEventBusExtensions { - /// - /// OSS服务配置. - /// - /// - /// - public static IServiceCollection ConfigureEventBus(this IServiceCollection services) - { + /// + /// OSS服务配置. + /// + /// + /// + public static IServiceCollection ConfigureEventBus(this IServiceCollection services) + { // 注册EventBus服务 // 注册EventBus服务 services.AddEventBus(options => @@ -66,5 +64,5 @@ public static class ConfigureEventBusExtensions services.AddConfigurableOptions(); return services; - } + } } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Extensions/ConfigureLoggingExtensions.cs b/apihost/Tnb.API.Entry/Extensions/ConfigureLoggingExtensions.cs index 31797ac2..882201be 100644 --- a/apihost/Tnb.API.Entry/Extensions/ConfigureLoggingExtensions.cs +++ b/apihost/Tnb.API.Entry/Extensions/ConfigureLoggingExtensions.cs @@ -1,9 +1,4 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using JNPF; -using JNPF.Logging; -using Spire.Xls; -using SqlSugar; +using JNPF.Logging; namespace Microsoft.Extensions.DependencyInjection; @@ -12,69 +7,69 @@ namespace Microsoft.Extensions.DependencyInjection; /// public static class ConfigureLoggingExtensions { - const string DATEFORMAT = "HH:mm:ss.fff"; + const string DATEFORMAT = "HH:mm:ss.fff"; - public static IServiceCollection ConfigureLogging(this IServiceCollection services) - { - services.AddConsoleFormatter(option => + public static IServiceCollection ConfigureLogging(this IServiceCollection services) { - option.MessageFormat = LoggerConsoleFormat; - }).AddFileLogging(options => - { - options.MessageFormat = LoggerFileFormat; - options.FileNameRule = fileName => string.Format(fileName, DateTime.Now); // 每天创建一个文件 - options.HandleWriteError = (writeError) => // 写入失败时启用备用文件 - { - writeError.UseRollbackFileName(Path.GetFileNameWithoutExtension(writeError.CurrentFileName) + "-oops" + Path.GetExtension(writeError.CurrentFileName)); - }; - }); - // 日志监听 - // services.AddMonitorLogging(options => - //{ - // options.IgnorePropertyNames = new[] { "Byte" }; - // options.IgnorePropertyTypes = new[] { typeof(byte[]) }; - //}); + services.AddConsoleFormatter(option => + { + option.MessageFormat = LoggerConsoleFormat; + }).AddFileLogging(options => + { + options.MessageFormat = LoggerFileFormat; + options.FileNameRule = fileName => string.Format(fileName, DateTime.Now); // 每天创建一个文件 + options.HandleWriteError = (writeError) => // 写入失败时启用备用文件 + { + writeError.UseRollbackFileName(Path.GetFileNameWithoutExtension(writeError.CurrentFileName) + "-oops" + Path.GetExtension(writeError.CurrentFileName)); + }; + }); + // 日志监听 + // services.AddMonitorLogging(options => + //{ + // options.IgnorePropertyNames = new[] { "Byte" }; + // options.IgnorePropertyTypes = new[] { typeof(byte[]) }; + //}); - return services; - } - private static string LoggerLevelName(LogLevel level) - { - return level switch - { - LogLevel.Trace => "Trace", - LogLevel.Debug => "Debug", - LogLevel.Information => "Info", - LogLevel.Warning => "Warn", - LogLevel.Error => "Error", - LogLevel.Critical => "Crit", - _ => "None" - }; - } - private static string LoggerFileFormat(LogMessage msg) - { - var txt = $"{LoggerLevelName(msg.LogLevel)} {msg.LogDateTime.ToString(DATEFORMAT)} {msg.ThreadId}# {msg.Message}"; - if (msg.Exception != null) - { - //var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString(); - txt += $"{Environment.NewLine}{msg.Exception}"; + return services; } - return txt; - } - private static string LoggerConsoleFormat(LogMessage msg) - { - var fclr = msg.LogLevel switch + private static string LoggerLevelName(LogLevel level) { - LogLevel.Warning => "\u001b[1m\u001b[33m", - LogLevel.Error => "\u001b[1m\u001b[31m", - _ => "\u001b[39m\u001b[22m" - }; - var txt = $"{fclr}{LoggerLevelName(msg.LogLevel)}\u001b[49m \u001b[36m{msg.LogDateTime.ToString(DATEFORMAT)}\u001b[49m \u001b[39m\u001b[22m{msg.ThreadId}#\u001b[49m {fclr}{msg.Message}\u001b[49m"; - if (msg.Exception != null) - { - //var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString(); - txt += $"{Environment.NewLine}{fclr}{msg.Exception}\u001b[49m"; + return level switch + { + LogLevel.Trace => "Trace", + LogLevel.Debug => "Debug", + LogLevel.Information => "Info", + LogLevel.Warning => "Warn", + LogLevel.Error => "Error", + LogLevel.Critical => "Crit", + _ => "None" + }; + } + private static string LoggerFileFormat(LogMessage msg) + { + var txt = $"{LoggerLevelName(msg.LogLevel)} {msg.LogDateTime.ToString(DATEFORMAT)} {msg.ThreadId}# {msg.Message}"; + if (msg.Exception != null) + { + //var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString(); + txt += $"{Environment.NewLine}{msg.Exception}"; + } + return txt; + } + private static string LoggerConsoleFormat(LogMessage msg) + { + var fclr = msg.LogLevel switch + { + LogLevel.Warning => "\u001b[1m\u001b[33m", + LogLevel.Error => "\u001b[1m\u001b[31m", + _ => "\u001b[39m\u001b[22m" + }; + var txt = $"{fclr}{LoggerLevelName(msg.LogLevel)}\u001b[49m \u001b[36m{msg.LogDateTime.ToString(DATEFORMAT)}\u001b[49m \u001b[39m\u001b[22m{msg.ThreadId}#\u001b[49m {fclr}{msg.Message}\u001b[49m"; + if (msg.Exception != null) + { + //var EXCEPTION_SEPARATOR_WITHCOLOR = AppendWithColor(default, EXCEPTION_SEPARATOR, logLevelColors).ToString(); + txt += $"{Environment.NewLine}{fclr}{msg.Exception}\u001b[49m"; + } + return txt; } - return txt; - } } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Extensions/ConfigureMvcControllerExtensions.cs b/apihost/Tnb.API.Entry/Extensions/ConfigureMvcControllerExtensions.cs index 4a984aa6..a3f102db 100644 --- a/apihost/Tnb.API.Entry/Extensions/ConfigureMvcControllerExtensions.cs +++ b/apihost/Tnb.API.Entry/Extensions/ConfigureMvcControllerExtensions.cs @@ -1,17 +1,12 @@ using System.Globalization; -using JNPF; +using JNPF.API.Entry.Handlers; using JNPF.Common.Core.Filter; -using JNPF.Common.Options; -using JNPF.EventHandler; using JNPF.JsonSerialization; using JNPF.UnifyResult; -using Microsoft.AspNetCore.HttpOverrides; -using Newtonsoft.Json.Serialization; -using Newtonsoft.Json; -using OnceMi.AspNetCore.OSS; -using JNPF.API.Entry.Handlers; -using JNPF.Common.Cache; using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.HttpOverrides; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; namespace Microsoft.Extensions.DependencyInjection; @@ -125,7 +120,7 @@ public static class ConfigureMvcControllerExtensions return services; } - + public class MyNewtonsoftDateTimeJsonConverter : NewtonsoftDateTimeJsonConverter { public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) @@ -134,20 +129,20 @@ public static class ConfigureMvcControllerExtensions if (reader.TokenType == JsonToken.Null || string.IsNullOrEmpty(reader.Value.ToString())) { if (!flag) - throw new JsonSerializationException(string.Format((IFormatProvider) CultureInfo.InvariantCulture, "Cannot convert null value to {0}.", (object) objectType)); - return (object) null; + throw new JsonSerializationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Cannot convert null value to {0}.", (object)objectType)); + return (object)null; } long result = 0; if (reader.TokenType == JsonToken.Integer) - result = (long) reader.Value; + result = (long)reader.Value; else if (reader.TokenType == JsonToken.String) { - if (!long.TryParse((string) reader.Value, out result)) - return (object) Convert.ToDateTime(reader.Value.ToString()); - return reader.TokenType == JsonToken.Date ? reader.Value : throw new JsonSerializationException(string.Format((IFormatProvider) CultureInfo.InvariantCulture, "Unexpected token parsing date. Expected Integer or String, got {0}.", (object) reader.TokenType)); + if (!long.TryParse((string)reader.Value, out result)) + return (object)Convert.ToDateTime(reader.Value.ToString()); + return reader.TokenType == JsonToken.Date ? reader.Value : throw new JsonSerializationException(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Unexpected token parsing date. Expected Integer or String, got {0}.", (object)reader.TokenType)); } if (result < 0L) - return (object) DateTime.Now; + return (object)DateTime.Now; try { DateTime dt = Convert.ToDateTime(reader.Value.ToString()); @@ -158,7 +153,7 @@ public static class ConfigureMvcControllerExtensions DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(result); dateTimeOffset = dateTimeOffset.ToLocalTime(); DateTime dateTime = dateTimeOffset.DateTime; - return (flag ? Nullable.GetUnderlyingType(objectType) : objectType) == typeof (DateTimeOffset) ? (object) new DateTimeOffset(dateTime, TimeSpan.Zero) : (object) dateTime; + return (flag ? Nullable.GetUnderlyingType(objectType) : objectType) == typeof(DateTimeOffset) ? (object)new DateTimeOffset(dateTime, TimeSpan.Zero) : (object)dateTime; } } } diff --git a/apihost/Tnb.API.Entry/Extensions/ConfigureSqlSugarExtensions.cs b/apihost/Tnb.API.Entry/Extensions/ConfigureSqlSugarExtensions.cs index 6dbf0ca7..2204c17e 100644 --- a/apihost/Tnb.API.Entry/Extensions/ConfigureSqlSugarExtensions.cs +++ b/apihost/Tnb.API.Entry/Extensions/ConfigureSqlSugarExtensions.cs @@ -1,9 +1,5 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using JNPF; +using JNPF; using JNPF.DatabaseAccessor; -using JNPF.Logging; -using Spire.Xls; using SqlSugar; namespace Microsoft.Extensions.DependencyInjection; diff --git a/apihost/Tnb.API.Entry/Handlers/JwtHandler.cs b/apihost/Tnb.API.Entry/Handlers/JwtHandler.cs index f0e9de90..0c57894a 100644 --- a/apihost/Tnb.API.Entry/Handlers/JwtHandler.cs +++ b/apihost/Tnb.API.Entry/Handlers/JwtHandler.cs @@ -1,6 +1,5 @@ using JNPF.Authorization; using JNPF.Common.Const; -using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.DataEncryption; using Microsoft.AspNetCore.Authorization; diff --git a/apihost/Tnb.API.Entry/Program.cs b/apihost/Tnb.API.Entry/Program.cs index 5dfadd09..1f9701d7 100644 --- a/apihost/Tnb.API.Entry/Program.cs +++ b/apihost/Tnb.API.Entry/Program.cs @@ -1,27 +1,25 @@ -using JNPF.Common.Security; - Serve.Run(RunOptions.Default .AddWebComponent().WithArgs(args)); public class WebComponent : IWebComponent { - public void Load(WebApplicationBuilder builder, ComponentContext componentContext) - { - builder.Host.UseWindowsService(); - //// 日志过滤 - //builder.Logging.AddFilter((provider, category, logLevel) => - //{ - // return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information; - //}); - builder.WebHost.ConfigureKestrel(options => + public void Load(WebApplicationBuilder builder, ComponentContext componentContext) { - // 长度最好不要设置 null - options.Limits.MaxRequestBodySize = 52428800; - }); + builder.Host.UseWindowsService(); + //// 日志过滤 + //builder.Logging.AddFilter((provider, category, logLevel) => + //{ + // return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information; + //}); + builder.WebHost.ConfigureKestrel(options => + { + // 长度最好不要设置 null + options.Limits.MaxRequestBodySize = 52428800; + }); - //builder.Logging.AddConsoleFormatter(options => - //{ - // options.DateFormat = "yyyy-MM-dd HH:mm:ss(zzz) dddd"; - //}); - } + //builder.Logging.AddConsoleFormatter(options => + //{ + // options.DateFormat = "yyyy-MM-dd HH:mm:ss(zzz) dddd"; + //}); + } } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Startup.cs b/apihost/Tnb.API.Entry/Startup.cs index f517e4d4..d7d716d8 100644 --- a/apihost/Tnb.API.Entry/Startup.cs +++ b/apihost/Tnb.API.Entry/Startup.cs @@ -1,28 +1,16 @@ -using System.Reflection; -using IGeekFan.AspNetCore.Knife4jUI; -using JNPF.API.Entry.Handlers; +using IGeekFan.AspNetCore.Knife4jUI; using JNPF.Common.Cache; -using JNPF.Common.Core; -using JNPF.Common.Core.Filter; using JNPF.Common.Core.Handlers; using JNPF.Common.Security; -using JNPF.DatabaseAccessor; -using JNPF.EventHandler; -using JNPF.JsonSerialization; using JNPF.SpecificationDocument; using JNPF.TaskScheduler.Interfaces.TaskScheduler; -using JNPF.UnifyResult; using JNPF.VisualDev; -using Microsoft.AspNetCore.HttpOverrides; using Microsoft.Extensions.Options; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; using Senparc.CO2NET; using Senparc.CO2NET.RegisterServices; using Senparc.Weixin; using Senparc.Weixin.Entities; using Senparc.Weixin.RegisterServices; -using SqlSugar; using Tnb.ProductionMgr; using Tnb.WarehouseMgr; diff --git a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj index e2a9a094..8267f70f 100644 --- a/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj +++ b/apihost/Tnb.API.Entry/Tnb.API.Entry.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/app/Tnb.Apps.Entitys/Tnb.Apps.Entitys.csproj b/app/Tnb.Apps.Entitys/Tnb.Apps.Entitys.csproj index 08bcb7bf..91e9762b 100644 --- a/app/Tnb.Apps.Entitys/Tnb.Apps.Entitys.csproj +++ b/app/Tnb.Apps.Entitys/Tnb.Apps.Entitys.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/app/Tnb.Apps.Interfaces/Tnb.Apps.Interfaces.csproj b/app/Tnb.Apps.Interfaces/Tnb.Apps.Interfaces.csproj index 52320baa..f86b6da1 100644 --- a/app/Tnb.Apps.Interfaces/Tnb.Apps.Interfaces.csproj +++ b/app/Tnb.Apps.Interfaces/Tnb.Apps.Interfaces.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/app/Tnb.Apps/AppMenuService.cs b/app/Tnb.Apps/AppMenuService.cs index b276558b..1102d5a0 100644 --- a/app/Tnb.Apps/AppMenuService.cs +++ b/app/Tnb.Apps/AppMenuService.cs @@ -3,8 +3,8 @@ using JNPF.Apps.Interfaces; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using Microsoft.AspNetCore.Mvc; using Mapster; +using Microsoft.AspNetCore.Mvc; namespace JNPF.Apps; diff --git a/app/Tnb.Apps/Tnb.Apps.csproj b/app/Tnb.Apps/Tnb.Apps.csproj index 23b2954e..602d4ac6 100644 --- a/app/Tnb.Apps/Tnb.Apps.csproj +++ b/app/Tnb.Apps/Tnb.Apps.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/AlipayMpAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/AlipayMpAuthRequest.cs index 1be2a407..7fcdc5cb 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/AlipayMpAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/AlipayMpAuthRequest.cs @@ -1,10 +1,10 @@ -using JNPF.Extras.CollectiveOAuth.Config; -using JNPF.Extras.CollectiveOAuth.Models; -using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Cache; -using Aop.Api; +using Aop.Api; using Aop.Api.Request; using Aop.Api.Response; +using JNPF.Extras.CollectiveOAuth.Cache; +using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Models; +using JNPF.Extras.CollectiveOAuth.Utils; using Newtonsoft.Json; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs index e3a0da6f..95d3b9b4 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs @@ -1,8 +1,8 @@ -using JNPF.Extras.CollectiveOAuth.Cache; +using System.Net; +using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using System.Net; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs index c80983d5..3be3576b 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs @@ -1,13 +1,8 @@ -using JNPF.Extras.CollectiveOAuth.Cache; +using JNPF.Common.Security; +using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; -using Newtonsoft.Json; -using DingTalk.Api; -using DingTalk.Api.Response; -using DingTalk.Api.Request; -using JNPF.Common.Security; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs index 4b46cdd1..e38587ac 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs index cf0ad9a1..6a2769dc 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs @@ -1,10 +1,10 @@ -using JNPF.Extras.CollectiveOAuth.Cache; +using System.Security.Cryptography; +using System.Text; +using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; -using System.Text; -using System.Security.Cryptography; using Newtonsoft.Json; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/FeiShuAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/FeiShuAuthRequest.cs index 1181f506..b8dd6ba1 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/FeiShuAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/FeiShuAuthRequest.cs @@ -1,9 +1,9 @@ -using JNPF.Common.Security; +using System.Web; +using JNPF.Common.Security; using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using System.Web; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GithubAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GithubAuthRequest.cs index d3555c2a..7c8600cd 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GithubAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GithubAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs index 12ac6648..72c2a31d 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs index 9a70189c..7fde18c9 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs index b964f757..f4f2a30e 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; @@ -71,7 +71,7 @@ public class HuaweiAuthRequest : DefaultAuthRequest authUser.nickname = userObj.getString("userName"); authUser.gender = gender; authUser.avatar = userObj.getString("headPictureURL"); - + authUser.token = authToken; authUser.source = source.getName(); authUser.originalUser = userObj; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/KujialeAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/KujialeAuthRequest.cs index 5f658a17..b2bca70e 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/KujialeAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/KujialeAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/LinkedinAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/LinkedinAuthRequest.cs index f1fdc967..ceb9a4e9 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/LinkedinAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/LinkedinAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs index 7429d596..f49baf40 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs index 52bc26d1..8b8d07e6 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; using Newtonsoft.Json; namespace JNPF.Extras.CollectiveOAuth.Request; @@ -136,7 +136,7 @@ public class MicrosoftAuthRequest : DefaultAuthRequest * * @param authToken 用户授权后的token * @return 返回获取userInfo的url - */ + */ protected override string userInfoUrl(AuthToken authToken) { return UrlBuilder.fromBaseUrl(source.userInfo()).build(); diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs index b614d36b..7dce8614 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/QQAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/QQAuthRequest.cs index 92793fd6..5d6727d7 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/QQAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/QQAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs index 1de6cdc3..d65974da 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs index 97b40a6d..2bc0bba1 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs index c6fe9c1c..3c1396cc 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; @@ -74,7 +74,7 @@ public class TeambitionAuthRequest : DefaultAuthRequest return authUser; } - + public override AuthResponse refresh(AuthToken oldToken) { string uid = oldToken.uid; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs index 77104017..97fbf7e7 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseAuthRequest.cs index b36efbee..cc45525e 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseAuthRequest.cs @@ -12,7 +12,7 @@ public class WeChatEnterpriseAuthRequest : DefaultAuthRequest { } - public WeChatEnterpriseAuthRequest(ClientConfig config, IAuthStateCache authStateCache) + public WeChatEnterpriseAuthRequest(ClientConfig config, IAuthStateCache authStateCache) : base(config, new WechatEnterpriseAuthSource(), authStateCache) { } diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseScanAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseScanAuthRequest.cs index d0fafb1c..4bf1a8bd 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseScanAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseScanAuthRequest.cs @@ -61,7 +61,7 @@ public class WeChatEnterpriseScanAuthRequest : DefaultAuthRequest authUser.location = userDetailObj.getString("address"); authUser.email = userDetailObj.getString("email"); authUser.uuid = userDetailObj.getString("userId"); - if(authUser.uuid.IsNullOrWhiteSpace()) authUser.uuid = userDetailObj.getString("userid"); + if (authUser.uuid.IsNullOrWhiteSpace()) authUser.uuid = userDetailObj.getString("userid"); authUser.token = authToken; authUser.source = source.getName(); authUser.gender = GlobalAuthUtil.getWechatRealGender(userDetailObj.getString("gender")); diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatMpAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatMpAuthRequest.cs index bbbd3bed..9cfcfd92 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatMpAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatMpAuthRequest.cs @@ -1,8 +1,8 @@ -using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Cache; +using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; -using JNPF.Extras.CollectiveOAuth.Cache; namespace JNPF.Extras.CollectiveOAuth.Request; diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatOpenAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatOpenAuthRequest.cs index b9761019..683a4399 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatOpenAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeChatOpenAuthRequest.cs @@ -1,8 +1,8 @@ -using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Cache; +using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; -using JNPF.Extras.CollectiveOAuth.Cache; namespace JNPF.Extras.CollectiveOAuth.Request; @@ -12,7 +12,7 @@ public partial class WeChatOpenAuthRequest : DefaultAuthRequest { } - public WeChatOpenAuthRequest(ClientConfig config, IAuthStateCache authStateCache) + public WeChatOpenAuthRequest(ClientConfig config, IAuthStateCache authStateCache) : base(config, new WechatOpenAuthSource(), authStateCache) { } diff --git a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeiboAuthRequest.cs b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeiboAuthRequest.cs index 2fb525cb..e95e5b3a 100644 --- a/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeiboAuthRequest.cs +++ b/common/Tnb.CollectiveOAuth/Request/AuthRequests/WeiboAuthRequest.cs @@ -1,8 +1,8 @@ using JNPF.Extras.CollectiveOAuth.Cache; using JNPF.Extras.CollectiveOAuth.Config; +using JNPF.Extras.CollectiveOAuth.Enums; using JNPF.Extras.CollectiveOAuth.Models; using JNPF.Extras.CollectiveOAuth.Utils; -using JNPF.Extras.CollectiveOAuth.Enums; namespace JNPF.Extras.CollectiveOAuth.Request; @@ -46,7 +46,7 @@ public class WeiboAuthRequest : DefaultAuthRequest reqParams.Add("API-RemoteIP", "application/x-www-form-urlencoded"); string response = HttpUtils.RequestGet(userInfoUrl(authToken), reqParams); - + var userObj = response.parseObject(); if (userObj.ContainsKey("error")) { diff --git a/common/Tnb.CollectiveOAuth/Tnb.CollectiveOAuth.csproj b/common/Tnb.CollectiveOAuth/Tnb.CollectiveOAuth.csproj index c151ca4a..d6e59035 100644 --- a/common/Tnb.CollectiveOAuth/Tnb.CollectiveOAuth.csproj +++ b/common/Tnb.CollectiveOAuth/Tnb.CollectiveOAuth.csproj @@ -1,6 +1,4 @@  - - net6.0 enable diff --git a/common/Tnb.CollectiveOAuth/Utils/ConfigurationManager.cs b/common/Tnb.CollectiveOAuth/Utils/ConfigurationManager.cs index f8408026..20a18ad8 100644 --- a/common/Tnb.CollectiveOAuth/Utils/ConfigurationManager.cs +++ b/common/Tnb.CollectiveOAuth/Utils/ConfigurationManager.cs @@ -1,6 +1,6 @@ -using Newtonsoft.Json.Linq; -using System.Collections.Specialized; +using System.Collections.Specialized; using System.Text; +using Newtonsoft.Json.Linq; namespace JNPF.Extras.CollectiveOAuth.Utils; diff --git a/common/Tnb.CollectiveOAuth/Utils/GlobalAuthUtil.cs b/common/Tnb.CollectiveOAuth/Utils/GlobalAuthUtil.cs index f2e15340..375ebacc 100644 --- a/common/Tnb.CollectiveOAuth/Utils/GlobalAuthUtil.cs +++ b/common/Tnb.CollectiveOAuth/Utils/GlobalAuthUtil.cs @@ -1,7 +1,7 @@ -using JNPF.Extras.CollectiveOAuth.Enums; -using System.Text; -using Newtonsoft.Json; +using System.Text; using System.Web; +using JNPF.Extras.CollectiveOAuth.Enums; +using Newtonsoft.Json; namespace JNPF.Extras.CollectiveOAuth.Utils; diff --git a/common/Tnb.Common.Core/EventBus/Constants/EventSubscribeEventConsts.cs b/common/Tnb.Common.Core/EventBus/Constants/EventSubscribeEventConsts.cs index 6203f9ef..05bcd5b6 100644 --- a/common/Tnb.Common.Core/EventBus/Constants/EventSubscribeEventConsts.cs +++ b/common/Tnb.Common.Core/EventBus/Constants/EventSubscribeEventConsts.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.Common.Core.EventBus.Constants +namespace Tnb.Common.Core.EventBus.Constants { public class EventSubscribeEventConsts { diff --git a/common/Tnb.Common.Core/EventBus/Sources/TaskStatusChangeSource.cs b/common/Tnb.Common.Core/EventBus/Sources/TaskStatusChangeSource.cs index fde34ead..717116c3 100644 --- a/common/Tnb.Common.Core/EventBus/Sources/TaskStatusChangeSource.cs +++ b/common/Tnb.Common.Core/EventBus/Sources/TaskStatusChangeSource.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.EventBus; -using SqlSugar; +using JNPF.EventBus; namespace Tnb.Common.Core.EventBus.Sources { diff --git a/common/Tnb.Common.Core/EventBus/Storers/RabbitMQEventSourceStorer.cs b/common/Tnb.Common.Core/EventBus/Storers/RabbitMQEventSourceStorer.cs index 016b366e..8d7a6908 100644 --- a/common/Tnb.Common.Core/EventBus/Storers/RabbitMQEventSourceStorer.cs +++ b/common/Tnb.Common.Core/EventBus/Storers/RabbitMQEventSourceStorer.cs @@ -1,12 +1,12 @@ +using System.Text; +using System.Text.Json; +using System.Threading.Channels; using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.EventBus; using JNPF.Logging; using RabbitMQ.Client; using RabbitMQ.Client.Events; -using System.Text; -using System.Text.Json; -using System.Threading.Channels; namespace JNPF.EventHandler; diff --git a/common/Tnb.Common.Core/Filter/LogExceptionHandler.cs b/common/Tnb.Common.Core/Filter/LogExceptionHandler.cs index 2c019ac4..38f7a194 100644 --- a/common/Tnb.Common.Core/Filter/LogExceptionHandler.cs +++ b/common/Tnb.Common.Core/Filter/LogExceptionHandler.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Const; +using System.Security.Claims; +using JNPF.Common.Const; using JNPF.Common.Extension; using JNPF.Common.Net; using JNPF.Common.Security; @@ -8,9 +9,8 @@ using JNPF.EventBus; using JNPF.EventHandler; using JNPF.FriendlyException; using JNPF.Logging.Attributes; -using Microsoft.AspNetCore.Mvc.Filters; using JNPF.Systems.Entitys.System; -using System.Security.Claims; +using Microsoft.AspNetCore.Mvc.Filters; using SqlSugar; namespace JNPF.Common.Core.Filter; diff --git a/common/Tnb.Common.Core/Filter/RequestActionFilter.cs b/common/Tnb.Common.Core/Filter/RequestActionFilter.cs index 10cb0f5d..46d764a8 100644 --- a/common/Tnb.Common.Core/Filter/RequestActionFilter.cs +++ b/common/Tnb.Common.Core/Filter/RequestActionFilter.cs @@ -1,19 +1,19 @@ -using JNPF.Common.Const; +using System.Diagnostics; +using System.Security.Claims; +using JNPF.Common.Const; using JNPF.Common.Extension; using JNPF.Common.Net; using JNPF.Common.Security; using JNPF.DataEncryption; using JNPF.EventBus; using JNPF.EventHandler; +using JNPF.Logging; using JNPF.Logging.Attributes; using JNPF.Systems.Entitys.System; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using System.Diagnostics; -using System.Security.Claims; -using SqlSugar; using Microsoft.AspNetCore.Mvc.Controllers; -using JNPF.Logging; +using Microsoft.AspNetCore.Mvc.Filters; +using SqlSugar; namespace JNPF.Common.Core.Filter; diff --git a/common/Tnb.Common.Core/Manager/DataBase/DataBaseManager.cs b/common/Tnb.Common.Core/Manager/DataBase/DataBaseManager.cs index 2ce7223d..b51c4019 100644 --- a/common/Tnb.Common.Core/Manager/DataBase/DataBaseManager.cs +++ b/common/Tnb.Common.Core/Manager/DataBase/DataBaseManager.cs @@ -339,50 +339,50 @@ public class DataBaseManager : IDataBaseManager, ITransient //try //{ - int total = 0; + int total = 0; - if (_sqlSugarClient.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle) strSql = strSql.Replace(";", string.Empty); + if (_sqlSugarClient.CurrentConnectionConfig.DbType == SqlSugar.DbType.Oracle) strSql = strSql.Replace(";", string.Empty); - var sidx = pageInput.sidx.IsNotEmptyOrNull() && pageInput.sort.IsNotEmptyOrNull(); // 按前端参数排序 - var defaultSidx = columnDesign.defaultSidx.IsNotEmptyOrNull() && columnDesign.sort.IsNotEmptyOrNull(); // 按模板默认排序 + var sidx = pageInput.sidx.IsNotEmptyOrNull() && pageInput.sort.IsNotEmptyOrNull(); // 按前端参数排序 + var defaultSidx = columnDesign.defaultSidx.IsNotEmptyOrNull() && columnDesign.sort.IsNotEmptyOrNull(); // 按模板默认排序 - var dataRuleJson = new List(); - if (pageInput.dataRuleJson.IsNotEmptyOrNull()) dataRuleJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.dataRuleJson); + var dataRuleJson = new List(); + if (pageInput.dataRuleJson.IsNotEmptyOrNull()) dataRuleJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.dataRuleJson); - var querJson = new List(); - if (pageInput.queryJson.IsNotEmptyOrNull()) querJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.queryJson); + var querJson = new List(); + if (pageInput.queryJson.IsNotEmptyOrNull()) querJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.queryJson); - var superQueryJson = new List(); - if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson); - // var sql = _sqlSugarClient.SqlQueryable(strSql) - // .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString(); - DataTable dt = _sqlSugarClient.SqlQueryable(strSql) - .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions) - .OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort) - .ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total); + var superQueryJson = new List(); + if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson); + // var sql = _sqlSugarClient.SqlQueryable(strSql) + // .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString(); + DataTable dt = _sqlSugarClient.SqlQueryable(strSql) + .Where(dataRuleJson).Where(querJson).Where(superQueryJson).Where(dataPermissions) + .OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort) + .ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total); - // 如果有字段别名 替换 ColumnName - if (outColumnName != null && outColumnName.Count > 0) + // 如果有字段别名 替换 ColumnName + if (outColumnName != null && outColumnName.Count > 0) + { + var resultKey = string.Empty; + for (var i = 0; i < dt.Columns.Count; i++) + dt.Columns[i].ColumnName = outColumnName.TryGetValue(dt.Columns[i].ColumnName.ToUpper(), out resultKey) == true ? outColumnName[dt.Columns[i].ColumnName.ToUpper()] : dt.Columns[i].ColumnName.ToUpper(); + } + + var data = new PageResult>() + { + pagination = new PageResult() { - var resultKey = string.Empty; - for (var i = 0; i < dt.Columns.Count; i++) - dt.Columns[i].ColumnName = outColumnName.TryGetValue(dt.Columns[i].ColumnName.ToUpper(), out resultKey) == true ? outColumnName[dt.Columns[i].ColumnName.ToUpper()] : dt.Columns[i].ColumnName.ToUpper(); - } + currentPage = pageInput.currentPage, + pageSize = pageInput.pageSize, + total = total + }, + list = dt.ToObject>>().ToObject>>() + }; - var data = new PageResult>() - { - pagination = new PageResult() - { - currentPage = pageInput.currentPage, - pageSize = pageInput.pageSize, - total = total - }, - list = dt.ToObject>>().ToObject>>() - }; + _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); - _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); - - return data; + return data; //} //catch (Exception ex) //{ @@ -456,15 +456,15 @@ public class DataBaseManager : IDataBaseManager, ITransient _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); return list.Adapt>(); } - - public List GetPrimaries(DbLinkEntity? link, string tableName) + + public List GetPrimaries(DbLinkEntity? link, string tableName) { if (link != null && _sqlSugarClient.CurrentConnectionConfig.ConfigId != link.Id) - _sqlSugarClient = ChangeDataBase(link); + _sqlSugarClient = ChangeDataBase(link); var data = _sqlSugarClient.DbMaintenance.GetPrimaries(tableName); - _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); - return data; + _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); + return data; } /// @@ -597,7 +597,7 @@ public class DataBaseManager : IDataBaseManager, ITransient //var modelList = _sqlSugarClient.Ado.SqlQuery(sql).ToList(); var modelList = _sqlSugarClient.Ado.SqlQuery(sql).ToList(); //return modelList.Select(x => new DatabaseTableListOutput { table = x.F_TABLE, tableName = x.F_TABLENAME, sum = x.F_SUM.ParseToInt() }).ToList(); - _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); + _sqlSugarClient.ChangeDatabase(_connectionStrings.ConfigId); return modelList; } diff --git a/common/Tnb.Common.Core/Manager/DataBase/IDataBaseManager.cs b/common/Tnb.Common.Core/Manager/DataBase/IDataBaseManager.cs index baeba4e2..5e2723df 100644 --- a/common/Tnb.Common.Core/Manager/DataBase/IDataBaseManager.cs +++ b/common/Tnb.Common.Core/Manager/DataBase/IDataBaseManager.cs @@ -80,7 +80,7 @@ public interface IDataBaseManager /// /// 表名. /// 表字段集合. - void AddTableColumn(DbLinkEntity link ,string tableName, List tableFieldList); + void AddTableColumn(DbLinkEntity link, string tableName, List tableFieldList); /// /// 删除表. diff --git a/common/Tnb.Common.Core/Manager/Files/FileManager.cs b/common/Tnb.Common.Core/Manager/Files/FileManager.cs index b96df78c..b0ed00d7 100644 --- a/common/Tnb.Common.Core/Manager/Files/FileManager.cs +++ b/common/Tnb.Common.Core/Manager/Files/FileManager.cs @@ -1,5 +1,4 @@ -using System.IO; -using System.Text; +using System.Text; using JNPF.Common.Configuration; using JNPF.Common.Enums; using JNPF.Common.Extension; @@ -321,7 +320,8 @@ namespace JNPF.Common.Core.Manager.Files var stream = new MemoryStream(byteList); await UploadFileByType(stream, _filePath, _fileName); _cacheManager.Set(_fileName, string.Empty); - return new { + return new + { name = _fileName, url = string.Format("/api/file/Download?encryption={0}", DESCEncryption.Encrypt(string.Format("{0}|{1}|json", _userManager.UserId, _fileName), "JNPF")) }; diff --git a/common/Tnb.Common.Core/Manager/User/UserManager.cs b/common/Tnb.Common.Core/Manager/User/UserManager.cs index 0b202ff7..cd6974f0 100644 --- a/common/Tnb.Common.Core/Manager/User/UserManager.cs +++ b/common/Tnb.Common.Core/Manager/User/UserManager.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Const; +using System.Security.Claims; +using JNPF.Common.Const; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Manager; @@ -14,7 +15,6 @@ using JNPF.Systems.Entitys.System; using Mapster; using Microsoft.AspNetCore.Http; using SqlSugar; -using System.Security.Claims; namespace JNPF.Common.Core.Manager; diff --git a/common/Tnb.Common.Core/Manager/User/UserManager.part.cs b/common/Tnb.Common.Core/Manager/User/UserManager.part.cs index 18b70051..a36fd66a 100644 --- a/common/Tnb.Common.Core/Manager/User/UserManager.part.cs +++ b/common/Tnb.Common.Core/Manager/User/UserManager.part.cs @@ -1,22 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Manager; -using JNPF.Common.Models.Authorize; -using JNPF.Common.Models.User; -using JNPF.Common.Net; -using JNPF.Common.Security; -using JNPF.DataEncryption; -using JNPF.DependencyInjection; -using JNPF.Systems.Entitys.Entity.Permission; -using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Entitys.System; -using Mapster; -using Microsoft.AspNetCore.Http; -using SqlSugar; -using System.Security.Claims; - -namespace JNPF.Common.Core.Manager; +namespace JNPF.Common.Core.Manager; /// /// 用户管理 . diff --git a/common/Tnb.Common.Core/Tnb.Common.Core.csproj b/common/Tnb.Common.Core/Tnb.Common.Core.csproj index 71303e8b..08b9033e 100644 --- a/common/Tnb.Common.Core/Tnb.Common.Core.csproj +++ b/common/Tnb.Common.Core/Tnb.Common.Core.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/common/Tnb.Common/Cache/MemoryCache.cs b/common/Tnb.Common/Cache/MemoryCache.cs index 7f982516..4e243ab1 100644 --- a/common/Tnb.Common/Cache/MemoryCache.cs +++ b/common/Tnb.Common/Cache/MemoryCache.cs @@ -1,6 +1,6 @@ -using JNPF.DependencyInjection; +using System.Reflection; +using JNPF.DependencyInjection; using Microsoft.Extensions.Caching.Memory; -using System.Reflection; namespace JNPF.Common.Cache; diff --git a/common/Tnb.Common/Cache/RedisCache.cs b/common/Tnb.Common/Cache/RedisCache.cs index a57fe0c5..4a177bbd 100644 --- a/common/Tnb.Common/Cache/RedisCache.cs +++ b/common/Tnb.Common/Cache/RedisCache.cs @@ -226,7 +226,7 @@ public class RedisCache : ICache, ISingleton } public Task GetHash(string key, string field) { - return RedisHelper.HGetAsync(key, field); + return RedisHelper.HGetAsync(key, field); } public Task HashExist(string key, string field) { @@ -238,6 +238,6 @@ public class RedisCache : ICache, ISingleton } public Task HSet(string key, string field, string value) { - return RedisHelper.HSetAsync(key, field,value); + return RedisHelper.HSetAsync(key, field, value); } } \ No newline at end of file diff --git a/common/Tnb.Common/Captcha/General/GeneralCaptcha.cs b/common/Tnb.Common/Captcha/General/GeneralCaptcha.cs index 934c957b..6bfa8bbc 100644 --- a/common/Tnb.Common/Captcha/General/GeneralCaptcha.cs +++ b/common/Tnb.Common/Captcha/General/GeneralCaptcha.cs @@ -1,8 +1,8 @@ -using JNPF.Common.Const; -using JNPF.Common.Manager; +using System.Runtime.InteropServices; +using JNPF.Common.Const; using JNPF.Common.Extension; +using JNPF.Common.Manager; using JNPF.DependencyInjection; -using System.Runtime.InteropServices; using SkiaSharp; namespace JNPF.Common.Captcha.General; diff --git a/common/Tnb.Common/Contracts/BaseEntity`1.cs b/common/Tnb.Common/Contracts/BaseEntity`1.cs index b74bb002..1f20b6e3 100644 --- a/common/Tnb.Common/Contracts/BaseEntity`1.cs +++ b/common/Tnb.Common/Contracts/BaseEntity`1.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Security; -using SqlSugar; +using SqlSugar; namespace JNPF.Common.Contracts; @@ -16,6 +10,6 @@ public class BaseEntity : IEntity where TKey : IEquatable [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true)] public TKey id { get; set; } - + } diff --git a/common/Tnb.Common/Contracts/CEntityBase.cs b/common/Tnb.Common/Contracts/CEntityBase.cs index da3cbe15..57037ec5 100644 --- a/common/Tnb.Common/Contracts/CEntityBase.cs +++ b/common/Tnb.Common/Contracts/CEntityBase.cs @@ -1,7 +1,6 @@ using JNPF.Common.Const; using JNPF.Common.Security; using JNPF.DependencyInjection; -using JNPF.Extras.DatabaseAccessor.SqlSugar.Models; using SqlSugar; namespace JNPF.Common.Contracts; diff --git a/common/Tnb.Common/DataValidation/Check.cs b/common/Tnb.Common/DataValidation/Check.cs index cc102ead..b583e8c3 100644 --- a/common/Tnb.Common/DataValidation/Check.cs +++ b/common/Tnb.Common/DataValidation/Check.cs @@ -1,7 +1,4 @@ -using JetBrains.Annotations; -using System; -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace Tnb.Common; @@ -159,11 +156,11 @@ public static class Check short value, string parameterName) { - if(value == 0) + if (value == 0) { throw new ArgumentException($"{parameterName} is equal to zero"); } - else if(value < 0) + else if (value < 0) { throw new ArgumentException($"{parameterName} is less than zero"); } @@ -251,7 +248,7 @@ public static class Check Int16 minimumValue, Int16 maximumValue = Int16.MaxValue) { - if(value < minimumValue || value > maximumValue) + if (value < minimumValue || value > maximumValue) { throw new ArgumentException($"{parameterName} is out of range min: {minimumValue} - max: {maximumValue}"); } diff --git a/common/Tnb.Common/Dtos/VisualDev/VisualDevModelDataCrInput.cs b/common/Tnb.Common/Dtos/VisualDev/VisualDevModelDataCrInput.cs index c58b1dca..d2f4ea7a 100644 --- a/common/Tnb.Common/Dtos/VisualDev/VisualDevModelDataCrInput.cs +++ b/common/Tnb.Common/Dtos/VisualDev/VisualDevModelDataCrInput.cs @@ -7,7 +7,7 @@ namespace JNPF.Common.Dtos.VisualDev; /// 在线功能开发数据创建输入. /// [SuppressSniffer] -public class VisualDevModelDataCrInput: FlowTaskOtherModel +public class VisualDevModelDataCrInput : FlowTaskOtherModel { /// /// 数据. diff --git a/common/Tnb.Common/Enums/AccountType.cs b/common/Tnb.Common/Enums/AccountType.cs index 05d9f4da..f7c0e284 100644 --- a/common/Tnb.Common/Enums/AccountType.cs +++ b/common/Tnb.Common/Enums/AccountType.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/FileLocation.cs b/common/Tnb.Common/Enums/FileLocation.cs index 6d986468..5ade4e5c 100644 --- a/common/Tnb.Common/Enums/FileLocation.cs +++ b/common/Tnb.Common/Enums/FileLocation.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/Gender.cs b/common/Tnb.Common/Enums/Gender.cs index 804c5c5a..459276e2 100644 --- a/common/Tnb.Common/Enums/Gender.cs +++ b/common/Tnb.Common/Enums/Gender.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/HttpStatusCode.cs b/common/Tnb.Common/Enums/HttpStatusCode.cs index c6675dc3..fc5fcd7a 100644 --- a/common/Tnb.Common/Enums/HttpStatusCode.cs +++ b/common/Tnb.Common/Enums/HttpStatusCode.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/LoginMethod.cs b/common/Tnb.Common/Enums/LoginMethod.cs index 0bab083e..773b1f8c 100644 --- a/common/Tnb.Common/Enums/LoginMethod.cs +++ b/common/Tnb.Common/Enums/LoginMethod.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/NoticeStatus.cs b/common/Tnb.Common/Enums/NoticeStatus.cs index c3a465b6..235ce52d 100644 --- a/common/Tnb.Common/Enums/NoticeStatus.cs +++ b/common/Tnb.Common/Enums/NoticeStatus.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/NoticeUserStatus.cs b/common/Tnb.Common/Enums/NoticeUserStatus.cs index a394e3d8..7bbbd754 100644 --- a/common/Tnb.Common/Enums/NoticeUserStatus.cs +++ b/common/Tnb.Common/Enums/NoticeUserStatus.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/PreviewType.cs b/common/Tnb.Common/Enums/PreviewType.cs index b20fb5a9..ceea0446 100644 --- a/common/Tnb.Common/Enums/PreviewType.cs +++ b/common/Tnb.Common/Enums/PreviewType.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/QueryType.cs b/common/Tnb.Common/Enums/QueryType.cs index af367735..a9b5d6bb 100644 --- a/common/Tnb.Common/Enums/QueryType.cs +++ b/common/Tnb.Common/Enums/QueryType.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Common.Enums; diff --git a/common/Tnb.Common/Enums/RequestType.cs b/common/Tnb.Common/Enums/RequestType.cs index 45154e1c..9044284e 100644 --- a/common/Tnb.Common/Enums/RequestType.cs +++ b/common/Tnb.Common/Enums/RequestType.cs @@ -22,7 +22,7 @@ public enum RequestType /// POST请求. /// Run = 2, - + /// /// 本地方法 /// diff --git a/common/Tnb.Common/Extension/ConcurrentDictionaryExtensions.cs b/common/Tnb.Common/Extension/ConcurrentDictionaryExtensions.cs index 77775dca..06c1ccca 100644 --- a/common/Tnb.Common/Extension/ConcurrentDictionaryExtensions.cs +++ b/common/Tnb.Common/Extension/ConcurrentDictionaryExtensions.cs @@ -1,7 +1,7 @@ -using JNPF.DependencyInjection; -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Dynamic; using System.Reflection; +using JNPF.DependencyInjection; using Newtonsoft.Json; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/ConfigurationExtensions.cs b/common/Tnb.Common/Extension/ConfigurationExtensions.cs index d0c8173d..4f3906f0 100644 --- a/common/Tnb.Common/Extension/ConfigurationExtensions.cs +++ b/common/Tnb.Common/Extension/ConfigurationExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Configuration; namespace Tnb.Common.Extension { diff --git a/common/Tnb.Common/Extension/DictionaryExtensions.cs b/common/Tnb.Common/Extension/DictionaryExtensions.cs index d01410dd..2c715227 100644 --- a/common/Tnb.Common/Extension/DictionaryExtensions.cs +++ b/common/Tnb.Common/Extension/DictionaryExtensions.cs @@ -1,5 +1,4 @@ -using System.Reflection; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/EnumExtensions.cs b/common/Tnb.Common/Extension/EnumExtensions.cs index 891eb758..da3d0314 100644 --- a/common/Tnb.Common/Extension/EnumExtensions.cs +++ b/common/Tnb.Common/Extension/EnumExtensions.cs @@ -1,8 +1,8 @@ -using JNPF.Common.Security; -using JNPF.DependencyInjection; -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.ComponentModel; using System.Reflection; +using JNPF.Common.Security; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/EnumerableExtensions.cs b/common/Tnb.Common/Extension/EnumerableExtensions.cs index 54ff27bb..6f4c9688 100644 --- a/common/Tnb.Common/Extension/EnumerableExtensions.cs +++ b/common/Tnb.Common/Extension/EnumerableExtensions.cs @@ -1,8 +1,5 @@ -using JNPF.DependencyInjection; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Text; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/LambdaExpressionExtensions.cs b/common/Tnb.Common/Extension/LambdaExpressionExtensions.cs index c4c0ddd9..a87f09b4 100644 --- a/common/Tnb.Common/Extension/LambdaExpressionExtensions.cs +++ b/common/Tnb.Common/Extension/LambdaExpressionExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; +using System.Linq.Expressions; namespace JNPF.Common.Extension { @@ -55,7 +50,7 @@ namespace JNPF.Common.Extension var castPropertyValue = Expression.Convert(propertyValue, property!.PropertyType); var assignExp = Expression.Assign(propExp, castPropertyValue); - return Expression.Lambda>(assignExp, new[] { target,propertyValue }).Compile(); + return Expression.Lambda>(assignExp, new[] { target, propertyValue }).Compile(); } } diff --git a/common/Tnb.Common/Extension/StreamExtensions.cs b/common/Tnb.Common/Extension/StreamExtensions.cs index a5835f44..f86207aa 100644 --- a/common/Tnb.Common/Extension/StreamExtensions.cs +++ b/common/Tnb.Common/Extension/StreamExtensions.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.Text; +using System.Text; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/StringBuilderExtensions.cs b/common/Tnb.Common/Extension/StringBuilderExtensions.cs index 69899427..bc50f3e6 100644 --- a/common/Tnb.Common/Extension/StringBuilderExtensions.cs +++ b/common/Tnb.Common/Extension/StringBuilderExtensions.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.Text; +using System.Text; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/StringExtensions.cs b/common/Tnb.Common/Extension/StringExtensions.cs index 0541e0f1..e58c88de 100644 --- a/common/Tnb.Common/Extension/StringExtensions.cs +++ b/common/Tnb.Common/Extension/StringExtensions.cs @@ -1,11 +1,11 @@ -using JNPF.Common.Security; -using JNPF.DependencyInjection; -using System.Diagnostics; +using System.Diagnostics; using System.Globalization; -using System.Text.Json; using System.Text; +using System.Text.Json; using System.Text.RegularExpressions; using System.Web; +using JNPF.Common.Security; +using JNPF.DependencyInjection; namespace JNPF.Common.Extension; diff --git a/common/Tnb.Common/Extension/TaskExtensions.cs b/common/Tnb.Common/Extension/TaskExtensions.cs index 96f5a278..28b01717 100644 --- a/common/Tnb.Common/Extension/TaskExtensions.cs +++ b/common/Tnb.Common/Extension/TaskExtensions.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.Common.Extension +namespace Tnb.Common.Extension { public static class TaskEx { @@ -25,7 +19,7 @@ namespace Tnb.Common.Extension return tcs.Task; } - public static async Task Retry(Func> task, int retries, + public static async Task Retry(Func> task, int retries, TimeSpan delay, CancellationToken cts = default) => await task().ContinueWith(async innerTask => { @@ -40,7 +34,7 @@ namespace Tnb.Common.Extension - public static async Task Catch(this Task task, Func exceptionHandler) + public static async Task Catch(this Task task, Func exceptionHandler) { try { diff --git a/common/Tnb.Common/Extension/TnbStringExtensions.cs b/common/Tnb.Common/Extension/TnbStringExtensions.cs index 8be6669e..25e9d5d8 100644 --- a/common/Tnb.Common/Extension/TnbStringExtensions.cs +++ b/common/Tnb.Common/Extension/TnbStringExtensions.cs @@ -1,6 +1,5 @@ using System.Text.RegularExpressions; using JNPF.Common.Extension; -using Microsoft.CodeAnalysis.CSharp.Syntax; namespace System; @@ -188,7 +187,7 @@ public static class StringExtensions public static (string, string) LastSplit(this string str, char seperate) { int n = str.LastIndexOf(seperate); - if(n > 0) + if (n > 0) { return (str.Substring(0, n), str.Substring(n + 1)); } diff --git a/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs b/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs index 394a2a52..4d665ed8 100644 --- a/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs +++ b/common/Tnb.Common/Models/NPOI/ExcelColumnModel.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.Drawing; +using System.Drawing; +using JNPF.DependencyInjection; namespace JNPF.Common.Models.NPOI; diff --git a/common/Tnb.Common/Models/SocialsLoginConfigModel.cs b/common/Tnb.Common/Models/SocialsLoginConfigModel.cs index ae261a9e..ad27fc48 100644 --- a/common/Tnb.Common/Models/SocialsLoginConfigModel.cs +++ b/common/Tnb.Common/Models/SocialsLoginConfigModel.cs @@ -1,6 +1,4 @@ -using NPOI.SS.Formula.Functions; - -namespace JNPF.Common.Models; +namespace JNPF.Common.Models; /// /// 通用登录配置-第三方登录配置. diff --git a/common/Tnb.Common/Net/IUserAgent.cs b/common/Tnb.Common/Net/IUserAgent.cs index 42d0611c..74f7a792 100644 --- a/common/Tnb.Common/Net/IUserAgent.cs +++ b/common/Tnb.Common/Net/IUserAgent.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -namespace JNPF.Common.Net; +namespace JNPF.Common.Net; public interface IUserAgent { diff --git a/common/Tnb.Common/Options/ConfigureSwaggerUIOptions.cs b/common/Tnb.Common/Options/ConfigureSwaggerUIOptions.cs index 2b17b266..6705209c 100644 --- a/common/Tnb.Common/Options/ConfigureSwaggerUIOptions.cs +++ b/common/Tnb.Common/Options/ConfigureSwaggerUIOptions.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.SwaggerUI; diff --git a/common/Tnb.Common/Options/OauthOptions.cs b/common/Tnb.Common/Options/OauthOptions.cs index c6017eb2..86a3f094 100644 --- a/common/Tnb.Common/Options/OauthOptions.cs +++ b/common/Tnb.Common/Options/OauthOptions.cs @@ -1,7 +1,4 @@ -using Aspose.Cells; -using JNPF.Common.Enums; -using JNPF.ConfigurableOptions; -using NPOI.SS.Formula.Functions; +using JNPF.ConfigurableOptions; namespace JNPF.Common.Options; diff --git a/common/Tnb.Common/Options/SocialsOptions.cs b/common/Tnb.Common/Options/SocialsOptions.cs index 56732d7d..ed95d457 100644 --- a/common/Tnb.Common/Options/SocialsOptions.cs +++ b/common/Tnb.Common/Options/SocialsOptions.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Enums; -using JNPF.ConfigurableOptions; +using JNPF.ConfigurableOptions; namespace JNPF.Common.Options; diff --git a/common/Tnb.Common/Security/CodeGenExportDataHelper.cs b/common/Tnb.Common/Security/CodeGenExportDataHelper.cs index 61b8e36a..5034d7bf 100644 --- a/common/Tnb.Common/Security/CodeGenExportDataHelper.cs +++ b/common/Tnb.Common/Security/CodeGenExportDataHelper.cs @@ -1,6 +1,5 @@ using System.Text.RegularExpressions; using JNPF.Common.Configuration; -using JNPF.Common.Extension; using JNPF.Common.Models.NPOI; using JNPF.DataEncryption; using JNPF.DependencyInjection; diff --git a/common/Tnb.Common/Security/ExcelImportHelper.cs b/common/Tnb.Common/Security/ExcelImportHelper.cs index 1d1deff8..77b164b1 100644 --- a/common/Tnb.Common/Security/ExcelImportHelper.cs +++ b/common/Tnb.Common/Security/ExcelImportHelper.cs @@ -1,8 +1,8 @@ -using JNPF.DependencyInjection; +using System.Data; +using JNPF.DependencyInjection; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; -using System.Data; namespace JNPF.Common.Helper { @@ -10,7 +10,7 @@ namespace JNPF.Common.Helper /// Excel导入操作类 /// 版 本:V3.2.0 /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) - /// 日 期:2017.03.12. + /// 日 期:2017.03.12. /// [SuppressSniffer] public class ExcelImportHelper @@ -108,7 +108,7 @@ namespace JNPF.Common.Helper //} //else //{ - dataRow[j] = cell.ToString()?.Trim(); + dataRow[j] = cell.ToString()?.Trim(); //} } } @@ -134,7 +134,7 @@ namespace JNPF.Common.Helper sheet = null; } #region 清除最后的空行 - for (int i = table.Rows.Count-1; i >= 0; i--) + for (int i = table.Rows.Count - 1; i >= 0; i--) { bool isnull = true; for (int j = 0; j < table.Columns.Count; j++) diff --git a/common/Tnb.Common/Security/FileHelper.cs b/common/Tnb.Common/Security/FileHelper.cs index 55d4b8d8..06985c42 100644 --- a/common/Tnb.Common/Security/FileHelper.cs +++ b/common/Tnb.Common/Security/FileHelper.cs @@ -1,11 +1,11 @@ -using JNPF.Common.Configuration; -using JNPF.Common.Extension; -using JNPF.Common.Models; -using JNPF.DependencyInjection; -using System.Drawing; +using System.Drawing; using System.Drawing.Imaging; using System.Text; using System.Web; +using JNPF.Common.Configuration; +using JNPF.Common.Extension; +using JNPF.Common.Models; +using JNPF.DependencyInjection; namespace JNPF.Common.Security; diff --git a/common/Tnb.Common/Security/NetHelper.cs b/common/Tnb.Common/Security/NetHelper.cs index 6424734f..9444de66 100644 --- a/common/Tnb.Common/Security/NetHelper.cs +++ b/common/Tnb.Common/Security/NetHelper.cs @@ -1,7 +1,6 @@ using System.Net.NetworkInformation; using System.Text; using JNPF.DependencyInjection; -using JNPF.JsonSerialization; using JNPF.RemoteRequest.Extensions; using Microsoft.AspNetCore.Http; diff --git a/common/Tnb.Common/Security/PinyinHelper.cs b/common/Tnb.Common/Security/PinyinHelper.cs index fe4ea1c5..1d862a43 100644 --- a/common/Tnb.Common/Security/PinyinHelper.cs +++ b/common/Tnb.Common/Security/PinyinHelper.cs @@ -108,16 +108,16 @@ public class PinyinHelper #region 汉字转换成全拼的拼音 - /// - /// 汉字转换成全拼的拼音. - /// - /// - /// - public static string Pinyin(string Chstr) - { - // 定义拼音区编码数组 - int[] getValue = new int[] + /// + /// 汉字转换成全拼的拼音. + /// + /// + /// + public static string Pinyin(string Chstr) { + // 定义拼音区编码数组 + int[] getValue = new int[] + { -20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036, -20032, -20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741, -19739, -19728, -19725, -19715, -19540, -19531, -19525, -19515, @@ -151,11 +151,11 @@ public class PinyinHelper -11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014, -10838, -10832, -10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328, -10322, -10315, -10309, -10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254 - }; + }; - // 定义拼音数组 - string[] getName = new string[] - { + // 定义拼音数组 + string[] getName = new string[] + { "A", "Ai", "An", "Ang", "Ao", "Ba", "Bai", "Ban", "Bang", "Bao", "Bei", "Ben", "Beng", "Bi", "Bian", "Biao", "Bie", "Bin", "Bing", "Bo", "Bu", "Ba", "Cai", "Can", "Cang", "Cao", "Ce", "Ceng", "Cha", "Chai", "Chan", "Chang", "Chao", "Che", "Chen", "Cheng", @@ -189,7 +189,7 @@ public class PinyinHelper "Za", "Zai", "Zan", "Zang", "Zao", "Ze", "Zei", "Zen", "Zeng", "Zha", "Zhai", "Zhan", "Zhang", "Zhao", "Zhe", "Zhen", "Zheng", "Zhi", "Zhong", "Zhou", "Zhu", "Zhua", "Zhuai", "Zhuan", "Zhuang", "Zhui", "Zhun", "Zhuo", "Zi", "Zong", "Zou", "Zu", "Zuan", "Zui", "Zun", "Zuo" - }; + }; // 验证是否输入汉字 Regex reg = new Regex("^[\u4e00-\u9fa5]$"); diff --git a/common/Tnb.Common/Security/QueryTreeHelper.cs b/common/Tnb.Common/Security/QueryTreeHelper.cs index 9c2497d5..3baf070b 100644 --- a/common/Tnb.Common/Security/QueryTreeHelper.cs +++ b/common/Tnb.Common/Security/QueryTreeHelper.cs @@ -1,6 +1,6 @@ -using JNPF.DependencyInjection; -using System.Data; +using System.Data; using System.Reflection; +using JNPF.DependencyInjection; namespace JNPF.Common.Security; diff --git a/common/Tnb.Common/Security/SnowflakeIdHelper.cs b/common/Tnb.Common/Security/SnowflakeIdHelper.cs index 211fe01d..e3bf078f 100644 --- a/common/Tnb.Common/Security/SnowflakeIdHelper.cs +++ b/common/Tnb.Common/Security/SnowflakeIdHelper.cs @@ -1,7 +1,5 @@ using System.Runtime.InteropServices; using JNPF.Common.Cache; -using JNPF.Common.Const; -using JNPF.FriendlyException; using Yitter.IdGenerator; namespace JNPF.Common.Security; @@ -11,56 +9,56 @@ namespace JNPF.Common.Security; /// public class SnowflakeIdHelper { - // 定义dll路径 - public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll"; + // 定义dll路径 + public const string RegWorkerId_DLL_NAME = "lib\\regworkerid_lib_v1.3.1\\yitidgengo.dll"; - // 根据文档定义三个接口 + // 根据文档定义三个接口 - // 注册一个 WorkerId,会先注销所有本机已注册的记录 - // ip: redis 服务器地址 - // port: redis 端口 - // password: redis 访问密码,可为空字符串“” - // maxWorkerId: 最大 WorkerId - [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] - private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId); + // 注册一个 WorkerId,会先注销所有本机已注册的记录 + // ip: redis 服务器地址 + // port: redis 端口 + // password: redis 访问密码,可为空字符串“” + // maxWorkerId: 最大 WorkerId + [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "RegisterOne", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] + private static extern ushort RegisterOne(string ip, int port, string password, int maxWorkerId); - // 注销本机已注册的 WorkerId - [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] - private static extern void UnRegister(); + // 注销本机已注册的 WorkerId + [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "UnRegister", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] + private static extern void UnRegister(); - // 检查本地WorkerId是否有效(0-有效,其它-无效) - [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] - private static extern int Validate(int workerId); + // 检查本地WorkerId是否有效(0-有效,其它-无效) + [DllImport(RegWorkerId_DLL_NAME, EntryPoint = "Validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = false)] + private static extern int Validate(int workerId); - /// - /// 初始化YitId配置 - /// - public static void InitYitIdWorker() - { - //var option = new IdGeneratorOptions - //{ - // WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1 - // //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳 - // WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16] - // //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数 - // //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber] - // //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0 - //}; - var option = App.GetConfig("YitId"); - if (option.WorkerId == 0) + /// + /// 初始化YitId配置 + /// + public static void InitYitIdWorker() { - CacheOptions _cacheOptions = App.GetConfig("Cache", true); - option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63); + //var option = new IdGeneratorOptions + //{ + // WorkerId = 1, //必须 全局唯一,必须 程序设定,理论最大值 2^WorkerIdBitLength-1 + // //BaseTime = new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), //用生成ID时的系统时间与基础时间的差值(毫秒数)作为生成ID的时间戳 + // WorkerIdBitLength = 16, //机器码位长,决定 WorkerId 的最大值,默认值6,取值范围 [1, 16] + // //SeqBitLength = 4, //序列数位长,默认值6,取值范围 [3, 21](建议不小于4),决定每毫秒基础生成的ID个数 + // //MinSeqNumber = 5, //最小序列数,默认值5,取值范围 [5, MaxSeqNumber] + // //MaxSeqNumber 最大序列数,设置范围 [MinSeqNumber, 2^SeqBitLength-1],默认值0 + //}; + var option = App.GetConfig("YitId"); + if (option.WorkerId == 0) + { + CacheOptions _cacheOptions = App.GetConfig("Cache", true); + option.WorkerId = RegisterOne(_cacheOptions.ip, _cacheOptions.port, _cacheOptions.password, 63); + } + YitIdHelper.SetIdGenerator(option); } - YitIdHelper.SetIdGenerator(option); - } - /// - /// 生成ID. - /// - /// - public static string NextId() - { - return YitIdHelper.NextId().ToString(); - } + /// + /// 生成ID. + /// + /// + public static string NextId() + { + return YitIdHelper.NextId().ToString(); + } } \ No newline at end of file diff --git a/common/Tnb.Common/Utils/DateTimeJsonConverter.cs b/common/Tnb.Common/Utils/DateTimeJsonConverter.cs index 5a5d3a37..0a192660 100644 --- a/common/Tnb.Common/Utils/DateTimeJsonConverter.cs +++ b/common/Tnb.Common/Utils/DateTimeJsonConverter.cs @@ -8,17 +8,17 @@ namespace Tnb.Common.Utils { return objectType == typeof(DateTime); } - + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { TypeCode typeCode = Type.GetTypeCode(reader.Value.GetType()); if (typeCode == TypeCode.DateTime) return reader.Value; - + var t = long.Parse((string)(reader.Value.ToString())); return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(t); } - + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { throw new NotImplementedException(); diff --git a/common/Tnb.Common/Utils/DeepCopyHelper.cs b/common/Tnb.Common/Utils/DeepCopyHelper.cs index 1c4cc78c..1ffd127c 100644 --- a/common/Tnb.Common/Utils/DeepCopyHelper.cs +++ b/common/Tnb.Common/Utils/DeepCopyHelper.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Reflection; -using System.Text; -using System.Threading.Tasks; namespace Tnb.Common.Utils { diff --git a/common/Tnb.Common/Utils/Dijkstra.cs b/common/Tnb.Common/Utils/Dijkstra.cs index 6d1cfb3c..355dbb79 100644 --- a/common/Tnb.Common/Utils/Dijkstra.cs +++ b/common/Tnb.Common/Utils/Dijkstra.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Contracts; -using NPOI.SS.Formula.Functions; - -namespace Tnb.Common.Utils +namespace Tnb.Common.Utils { /// /// 迪杰斯特拉(最短路径算法) diff --git a/common/Tnb.Common/Utils/HttpClientHelper.cs b/common/Tnb.Common/Utils/HttpClientHelper.cs index ae4a9599..57fd4041 100644 --- a/common/Tnb.Common/Utils/HttpClientHelper.cs +++ b/common/Tnb.Common/Utils/HttpClientHelper.cs @@ -1,13 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Reflection; -using System.Security.Policy; +using System.Net.Http.Headers; using System.Text; -using System.Threading; -using System.Threading.Tasks; using JNPF.Logging; using Microsoft.AspNetCore.WebUtilities; using Newtonsoft.Json; @@ -130,7 +122,7 @@ namespace Tnb.Common.Utils } - public static async Task PostStreamAsync(string url,object content, CancellationToken cancellationToken) + public static async Task PostStreamAsync(string url, object content, CancellationToken cancellationToken) { using (var client = new HttpClient()) using (var request = new HttpRequestMessage(HttpMethod.Post, url)) diff --git a/common/Tnb.Common/Utils/ParameterCheckHelper.cs b/common/Tnb.Common/Utils/ParameterCheckHelper.cs index 2553d6d0..fcf316d5 100644 --- a/common/Tnb.Common/Utils/ParameterCheckHelper.cs +++ b/common/Tnb.Common/Utils/ParameterCheckHelper.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.Common.Utils +namespace Tnb.Common.Utils { public class PropertyNotNullChecker { diff --git a/common/Tnb.Common/Utils/SkipNormalizationAttribute.cs b/common/Tnb.Common/Utils/SkipNormalizationAttribute.cs index 384def4e..93bcc410 100644 --- a/common/Tnb.Common/Utils/SkipNormalizationAttribute.cs +++ b/common/Tnb.Common/Utils/SkipNormalizationAttribute.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tnb.Common.Utils +namespace Tnb.Common.Utils { [AttributeUsage(AttributeTargets.Method)] public class SkipNormalizationAttribute : Attribute diff --git a/common/Tnb.Common/Utils/SkipNormalizationAttributeConventionalRegistrar.cs b/common/Tnb.Common/Utils/SkipNormalizationAttributeConventionalRegistrar.cs index 5ec1b080..b983cc5f 100644 --- a/common/Tnb.Common/Utils/SkipNormalizationAttributeConventionalRegistrar.cs +++ b/common/Tnb.Common/Utils/SkipNormalizationAttributeConventionalRegistrar.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.SpecificationDocument; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace Tnb.Common.Utils +namespace Tnb.Common.Utils { //public class SkipNormalizationAttributeConventionalRegistrar : IConventionalRegistrar //{ diff --git a/common/Tnb.Common/Utils/ThrowIf.cs b/common/Tnb.Common/Utils/ThrowIf.cs index 578062bd..b1cea249 100644 --- a/common/Tnb.Common/Utils/ThrowIf.cs +++ b/common/Tnb.Common/Utils/ThrowIf.cs @@ -5,133 +5,133 @@ namespace System; public static class ThrowIf { - public static void When(bool isMatch, string msg) - { - if (isMatch) + public static void When(bool isMatch, string msg) { - throw new ArgumentException(msg); - } - } - - public static T IsNull([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) - { - if (value == null) - { - throw string.IsNullOrEmpty(msg) ? new ArgumentNullException(paraName) : new ArgumentException(msg); + if (isMatch) + { + throw new ArgumentException(msg); + } } - return value; - } - - public static T IsNullOrDefault([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) where T : struct - { - if (!value.HasValue || value.Value.Equals(default(T))) + public static T IsNull([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) { - throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或默认值", paraName) : new ArgumentException(msg); + if (value == null) + { + throw string.IsNullOrEmpty(msg) ? new ArgumentNullException(paraName) : new ArgumentException(msg); + } + + return value; } - return value.Value; - } - - - public static string IsNullOrWhiteSpace([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) - { - if (string.IsNullOrWhiteSpace(value)) + public static T IsNullOrDefault([NotNull] T? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) where T : struct { - throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或空格", paraName) : new ArgumentException(msg); - } - return value; - } + if (!value.HasValue || value.Value.Equals(default(T))) + { + throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或默认值", paraName) : new ArgumentException(msg); + } - public static string IsNullOrEmpty([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) - { - if (string.IsNullOrEmpty(value)) - { - throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空", paraName) : new ArgumentException(msg); + return value.Value; } - return value; - } - //public static ICollection NotNullOrEmpty(ICollection value, string paraName) - //{ - // if (value.IsNullOrEmpty()) - // { - // throw new ArgumentException(paraName + " can not be null or empty!", paraName); - // } - - // return value; - //} - - //public static Type AssignableTo(Type type, string paraName) - //{ - // NotNull(type, paraName); - // if (!type.IsAssignableTo()) - // { - // throw new ArgumentException(paraName + " (type of " + type.AssemblyQualifiedName + ") should be assignable to the " + typeof(TBaseType).GetFullNameWithAssemblyName() + "!"); - // } - - // return type; - //} - - public static short OutOfRange(short value, string paraName, short minimumValue, short maximumValue = short.MaxValue) - { - if (value < minimumValue || value > maximumValue) + public static string IsNullOrWhiteSpace([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (string.IsNullOrWhiteSpace(value)) + { + throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空或空格", paraName) : new ArgumentException(msg); + } + return value; } - return value; - } - - public static int OutOfRange(int value, string paraName, int minimumValue, int maximumValue = int.MaxValue) - { - if (value < minimumValue || value > maximumValue) + public static string IsNullOrEmpty([NotNull] string? value, string? msg = null, [CallerArgumentExpression("value")] string? paraName = null) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (string.IsNullOrEmpty(value)) + { + throw string.IsNullOrEmpty(msg) ? new ArgumentException("值不可为空", paraName) : new ArgumentException(msg); + } + + return value; } - return value; - } + //public static ICollection NotNullOrEmpty(ICollection value, string paraName) + //{ + // if (value.IsNullOrEmpty()) + // { + // throw new ArgumentException(paraName + " can not be null or empty!", paraName); + // } - public static long OutOfRange(long value, string paraName, long minimumValue, long maximumValue = long.MaxValue) - { - if (value < minimumValue || value > maximumValue) + // return value; + //} + + //public static Type AssignableTo(Type type, string paraName) + //{ + // NotNull(type, paraName); + // if (!type.IsAssignableTo()) + // { + // throw new ArgumentException(paraName + " (type of " + type.AssemblyQualifiedName + ") should be assignable to the " + typeof(TBaseType).GetFullNameWithAssemblyName() + "!"); + // } + + // return type; + //} + + public static short OutOfRange(short value, string paraName, short minimumValue, short maximumValue = short.MaxValue) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; } - return value; - } - - public static float OutOfRange(float value, string paraName, float minimumValue, float maximumValue = float.MaxValue) - { - if (value < minimumValue || value > maximumValue) + public static int OutOfRange(int value, string paraName, int minimumValue, int maximumValue = int.MaxValue) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; } - return value; - } - - public static double OutOfRange(double value, string paraName, double minimumValue, double maximumValue = double.MaxValue) - { - if (value < minimumValue || value > maximumValue) + public static long OutOfRange(long value, string paraName, long minimumValue, long maximumValue = long.MaxValue) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; } - return value; - } - - public static decimal OutOfRange(decimal value, string paraName, decimal minimumValue, decimal maximumValue = decimal.MaxValue) - { - if (value < minimumValue || value > maximumValue) + public static float OutOfRange(float value, string paraName, float minimumValue, float maximumValue = float.MaxValue) { - throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; } - return value; - } + public static double OutOfRange(double value, string paraName, double minimumValue, double maximumValue = double.MaxValue) + { + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; + } + + public static decimal OutOfRange(decimal value, string paraName, decimal minimumValue, decimal maximumValue = decimal.MaxValue) + { + if (value < minimumValue || value > maximumValue) + { + throw new ArgumentException($"{paraName} is out of range min: {minimumValue} - max: {maximumValue}"); + } + + return value; + } } diff --git a/common/Tnb.SqlSugar/Extensions/TenantLinkExtensions.cs b/common/Tnb.SqlSugar/Extensions/TenantLinkExtensions.cs index 723aafd0..c12e0b4c 100644 --- a/common/Tnb.SqlSugar/Extensions/TenantLinkExtensions.cs +++ b/common/Tnb.SqlSugar/Extensions/TenantLinkExtensions.cs @@ -1,6 +1,5 @@ using JNPF; using JNPF.DataEncryption; -using JNPF.Extras.DatabaseAccessor.SqlSugar; using JNPF.Extras.DatabaseAccessor.SqlSugar.Extensions; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; diff --git a/common/Tnb.SqlSugar/Internal/SqlSugarPagedList.cs b/common/Tnb.SqlSugar/Internal/SqlSugarPagedList.cs index a47780fd..3c332ba7 100644 --- a/common/Tnb.SqlSugar/Internal/SqlSugarPagedList.cs +++ b/common/Tnb.SqlSugar/Internal/SqlSugarPagedList.cs @@ -42,4 +42,4 @@ public class SqlSugarPagedList /// 分页集合 /// public class PagedModel : SqlSugarPagedList -{} \ No newline at end of file +{ } \ No newline at end of file diff --git a/common/Tnb.SqlSugar/Repositories/ISqlSugarRepository.cs b/common/Tnb.SqlSugar/Repositories/ISqlSugarRepository.cs index 3ca58074..228bd3ca 100644 --- a/common/Tnb.SqlSugar/Repositories/ISqlSugarRepository.cs +++ b/common/Tnb.SqlSugar/Repositories/ISqlSugarRepository.cs @@ -1,5 +1,3 @@ -using System.Linq.Expressions; - namespace SqlSugar; /// diff --git a/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs b/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs index e24fece9..18a55888 100644 --- a/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs +++ b/common/Tnb.SqlSugar/Repositories/SqlSugarRepository.cs @@ -1,5 +1,4 @@ using JNPF; -using JNPF.DataEncryption; using JNPF.Extras.DatabaseAccessor.SqlSugar.Models; using JNPF.FriendlyException; using JNPF.JsonSerialization; diff --git a/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj b/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj index 1db069e8..87c80703 100644 --- a/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj +++ b/common/Tnb.SqlSugar/Tnb.SqlSugar.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/common/Tnb.Thirdparty/Email/MailUtil.cs b/common/Tnb.Thirdparty/Email/MailUtil.cs index bfb16c7c..3e8b01a5 100644 --- a/common/Tnb.Thirdparty/Email/MailUtil.cs +++ b/common/Tnb.Thirdparty/Email/MailUtil.cs @@ -75,7 +75,7 @@ public class MailUtil var mult = new Multipart("mixed") { body }; foreach (var attachment in mailModel.Attachment) { - var file = new FileInfo(Path.Combine(mailFilePath , attachment.fileId)); + var file = new FileInfo(Path.Combine(mailFilePath, attachment.fileId)); if (file.Exists) { var mimePart = new MimePart(); diff --git a/common/Tnb.Thirdparty/Tnb.Thirdparty.csproj b/common/Tnb.Thirdparty/Tnb.Thirdparty.csproj index 697f654a..a89997d5 100644 --- a/common/Tnb.Thirdparty/Tnb.Thirdparty.csproj +++ b/common/Tnb.Thirdparty/Tnb.Thirdparty.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/common/Tnb.WebSockets/Middlewares/WebSocketMiddleware.cs b/common/Tnb.WebSockets/Middlewares/WebSocketMiddleware.cs index 756b27b8..1bb98120 100644 --- a/common/Tnb.WebSockets/Middlewares/WebSocketMiddleware.cs +++ b/common/Tnb.WebSockets/Middlewares/WebSocketMiddleware.cs @@ -1,5 +1,4 @@ -using System.Net; -using System.Net.WebSockets; +using System.Net.WebSockets; using System.Text; using System.Web; using JNPF.Common.Net; diff --git a/common/Tnb.WebSockets/Tnb.WebSockets.csproj b/common/Tnb.WebSockets/Tnb.WebSockets.csproj index 7993a15e..7800fba6 100644 --- a/common/Tnb.WebSockets/Tnb.WebSockets.csproj +++ b/common/Tnb.WebSockets/Tnb.WebSockets.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/message/Tnb.Message.Entitys/Dto/MessageAccount/EmailSendTestQuery.cs b/message/Tnb.Message.Entitys/Dto/MessageAccount/EmailSendTestQuery.cs index 519dadc3..6dd01c10 100644 --- a/message/Tnb.Message.Entitys/Dto/MessageAccount/EmailSendTestQuery.cs +++ b/message/Tnb.Message.Entitys/Dto/MessageAccount/EmailSendTestQuery.cs @@ -1,6 +1,4 @@ -using JNPF.Common.Filter; - -namespace JNPF.Message.Entitys.Dto.MessageAccount; +namespace JNPF.Message.Entitys.Dto.MessageAccount; public class EmailSendTestQuery : MessageAccountListOutput { diff --git a/message/Tnb.Message.Entitys/Mapper/Mapper.cs b/message/Tnb.Message.Entitys/Mapper/Mapper.cs index 4eafbabb..157aeb49 100644 --- a/message/Tnb.Message.Entitys/Mapper/Mapper.cs +++ b/message/Tnb.Message.Entitys/Mapper/Mapper.cs @@ -1,6 +1,5 @@ using JNPF.Common.Models.User; using JNPF.Message.Entitys.Dto.IM; -using JNPF.Message.Entitys.Dto.MessageAccount; using JNPF.Message.Entitys.Model.IM; using Mapster; diff --git a/message/Tnb.Message.Entitys/Tnb.Message.Entitys.csproj b/message/Tnb.Message.Entitys/Tnb.Message.Entitys.csproj index 08bcb7bf..91e9762b 100644 --- a/message/Tnb.Message.Entitys/Tnb.Message.Entitys.csproj +++ b/message/Tnb.Message.Entitys/Tnb.Message.Entitys.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/message/Tnb.Message.Interfaces/Tnb.Message.Interfaces.csproj b/message/Tnb.Message.Interfaces/Tnb.Message.Interfaces.csproj index a60a47f8..82a14c27 100644 --- a/message/Tnb.Message.Interfaces/Tnb.Message.Interfaces.csproj +++ b/message/Tnb.Message.Interfaces/Tnb.Message.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/message/Tnb.Message/Service/ImReplyService.cs b/message/Tnb.Message/Service/ImReplyService.cs index cff13fc2..13b6cbe9 100644 --- a/message/Tnb.Message/Service/ImReplyService.cs +++ b/message/Tnb.Message/Service/ImReplyService.cs @@ -59,7 +59,7 @@ public class ImReplyService : IImReplyService, IDynamicApiController, ITransient // 获取全部聊天对象列表 var objectList = _repository.AsSugarClient().UnionAll( - _repository.AsQueryable().Where(i => i.ReceiveUserId == _userManager.UserId && (SqlFunc.IsNullOrEmpty(i.ImreplySendDeleteMark)||i.ImreplySendDeleteMark != _userManager.UserId)).Select(it => new ImReplyObjectIdOutput { userId = it.UserId, latestDate = it.ReceiveTime }), + _repository.AsQueryable().Where(i => i.ReceiveUserId == _userManager.UserId && (SqlFunc.IsNullOrEmpty(i.ImreplySendDeleteMark) || i.ImreplySendDeleteMark != _userManager.UserId)).Select(it => new ImReplyObjectIdOutput { userId = it.UserId, latestDate = it.ReceiveTime }), _repository.AsQueryable().Where(i => i.UserId == _userManager.UserId && (SqlFunc.IsNullOrEmpty(i.ImreplySendDeleteMark) || i.ImreplySendDeleteMark != _userManager.UserId)).Select(it => new ImReplyObjectIdOutput { userId = it.ReceiveUserId, latestDate = it.ReceiveTime })).MergeTable().GroupBy(it => new { it.userId }).Select(it => new { it.userId, latestDate = SqlFunc.AggregateMax(it.latestDate) }).ToList(); var objectUserList = objectList.Adapt>(); if (objectUserList.Count > 0) @@ -78,7 +78,7 @@ public class ImReplyService : IImReplyService, IDynamicApiController, ITransient it.realName = item.RealName; it.headIcon = "/api/File/Image/userAvatar/" + item.HeadIcon; - var imContent = _repository.AsSugarClient().Queryable().Where(i => (i.SendUserId == _userManager.UserId && i.ReceiveUserId == it.userId) || (i.SendUserId == it.userId && i.ReceiveUserId == _userManager.UserId)).Where(i => i.SendTime.Equals(it.latestDate) && (SqlFunc.IsNullOrEmpty(i.SendDeleteMark)|| i.SendDeleteMark != _userManager.UserId)).ToList().FirstOrDefault(); + var imContent = _repository.AsSugarClient().Queryable().Where(i => (i.SendUserId == _userManager.UserId && i.ReceiveUserId == it.userId) || (i.SendUserId == it.userId && i.ReceiveUserId == _userManager.UserId)).Where(i => i.SendTime.Equals(it.latestDate) && (SqlFunc.IsNullOrEmpty(i.SendDeleteMark) || i.SendDeleteMark != _userManager.UserId)).ToList().FirstOrDefault(); // 获取最信息 if (imContent != null) diff --git a/message/Tnb.Message/Service/MessageDataTypeService.cs b/message/Tnb.Message/Service/MessageDataTypeService.cs index 2bb38b32..3198d3db 100644 --- a/message/Tnb.Message/Service/MessageDataTypeService.cs +++ b/message/Tnb.Message/Service/MessageDataTypeService.cs @@ -1,13 +1,6 @@ -using JNPF.Common.Enums; -using JNPF.Common.Extension; -using JNPF.Common.Filter; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.FriendlyException; -using JNPF.Message.Entitys.Dto.MessageAccount; using JNPF.Message.Entitys.Entity; -using JNPF.Systems.Entitys.Permission; -using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -40,7 +33,7 @@ public class MessageDataTypeService : IDynamicApiController, ITransient [HttpGet("getTypeList/{type}")] public async Task GetTypeList(string type) { - return (await _repository.GetListAsync(x => x.Type == type && x.DeleteMark == null)).Select(x => new { id = x.Id, fullName = x.FullName ,enCode=x.EnCode}).ToList(); + return (await _repository.GetListAsync(x => x.Type == type && x.DeleteMark == null)).Select(x => new { id = x.Id, fullName = x.FullName, enCode = x.EnCode }).ToList(); } #endregion } diff --git a/message/Tnb.Message/Service/MessageMonitorService.cs b/message/Tnb.Message/Service/MessageMonitorService.cs index 08a335ad..1b20d43f 100644 --- a/message/Tnb.Message/Service/MessageMonitorService.cs +++ b/message/Tnb.Message/Service/MessageMonitorService.cs @@ -1,6 +1,5 @@ using JNPF.Common.Extension; using JNPF.Common.Filter; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.LinqBuilder; @@ -8,7 +7,6 @@ using JNPF.Message.Entitys.Dto.MessageMonitor; using JNPF.Message.Entitys.Entity; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Interfaces.Permission; -using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; diff --git a/message/Tnb.Message/Service/MessageService.cs b/message/Tnb.Message/Service/MessageService.cs index 65d59f29..4c6d71de 100644 --- a/message/Tnb.Message/Service/MessageService.cs +++ b/message/Tnb.Message/Service/MessageService.cs @@ -120,7 +120,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient title = a.Title, type = a.Type, isRead = b.IsRead, - flowType=a.FlowType + flowType = a.FlowType }).ToPagedListAsync(input.currentPage, input.pageSize); return PageResult.SqlSugarPageResult(list); } @@ -414,7 +414,7 @@ public class MessageService : IMessageService, IDynamicApiController, ITransient //modifyby zhoukeda 20230704 定时任务发起的推送消息没有user string userManagerUserId = _userManager.UserId ?? ""; string userManagerTenantId = _userManager.TenantId ?? ""; - + MessageEntity entity = new MessageEntity(); entity.Id = SnowflakeIdHelper.NextId(); entity.Title = title; diff --git a/message/Tnb.Message/Service/MessageTemplateService.cs b/message/Tnb.Message/Service/MessageTemplateService.cs index 14df414f..41b56eaa 100644 --- a/message/Tnb.Message/Service/MessageTemplateService.cs +++ b/message/Tnb.Message/Service/MessageTemplateService.cs @@ -203,7 +203,7 @@ public class MessageTemplateService : IDynamicApiController, ITransient { var paramEntity = item.Adapt(); paramEntity.TemplateId = entity.Id; - paramEntity.Id= SnowflakeIdHelper.NextId(); + paramEntity.Id = SnowflakeIdHelper.NextId(); await _repository.AsSugarClient().Insertable(paramEntity).IgnoreColumns(ignoreNullColumn: true).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); } var smsFieldList = await _repository.AsSugarClient().Queryable().Where(x => x.TemplateId == id && x.DeleteMark == null).ToListAsync(); diff --git a/message/Tnb.Message/Service/SendMessageService.cs b/message/Tnb.Message/Service/SendMessageService.cs index e934651a..658e4e59 100644 --- a/message/Tnb.Message/Service/SendMessageService.cs +++ b/message/Tnb.Message/Service/SendMessageService.cs @@ -360,7 +360,7 @@ public class SendMessageService : ISendMessageService, IDynamicApiController, IT var paramsDic = messageSendModel.paramJson.ToDictionary(x => x.field, y => y.value);//参数 var title = messageTemplateEntity.Title; var content = messageTemplateEntity.Content; - if (messageTemplateEntity.MessageType=="6") + if (messageTemplateEntity.MessageType == "6") { try { @@ -462,9 +462,9 @@ public class SendMessageService : ISendMessageService, IDynamicApiController, IT return errorList.Any() ? string.Join(",", errorList) : string.Empty; } - public async Task SendMessageDefult(string enCode, List toUser,string creatorUser, string flowName, Dictionary bodyDic) + public async Task SendMessageDefult(string enCode, List toUser, string creatorUser, string flowName, Dictionary bodyDic) { - var msgTemplateEntity= await _repository.AsSugarClient().Queryable().FirstAsync(x => x.EnCode == enCode && x.TemplateType=="1" && x.DeleteMark == null); + var msgTemplateEntity = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.EnCode == enCode && x.TemplateType == "1" && x.DeleteMark == null); msgTemplateEntity.Title = msgTemplateEntity.Title.Replace("@流程发起人", creatorUser).Replace("@流程名称", flowName); msgTemplateEntity.Content = msgTemplateEntity.Content.Replace("@流程发起人", creatorUser).Replace("@流程名称", flowName); await _messageService.SentMessage(toUser, msgTemplateEntity.Title, msgTemplateEntity.Content, bodyDic); @@ -534,7 +534,7 @@ public class SendMessageService : ISendMessageService, IDynamicApiController, IT Password = messageAccountEntity.SmtpPassword, SMTPHost = messageAccountEntity.SmtpServer, SMTPPort = messageAccountEntity.SmtpPort.ParseToInt(), - Ssl=messageAccountEntity.SslLink.Equals("1") + Ssl = messageAccountEntity.SslLink.Equals("1") }, mailModel); } diff --git a/message/Tnb.Message/Service/ShortLinkService.cs b/message/Tnb.Message/Service/ShortLinkService.cs index 5e5cba1f..85b77538 100644 --- a/message/Tnb.Message/Service/ShortLinkService.cs +++ b/message/Tnb.Message/Service/ShortLinkService.cs @@ -99,8 +99,8 @@ public class ShortLinkService : IShortLinkService, IDynamicApiController, ITrans } else { - _sqlSugarClient.AddConnection(JNPFTenantExtensions.GetConfig(options)); - _sqlSugarClient.ChangeDatabase(tenantId); + _sqlSugarClient.AddConnection(JNPFTenantExtensions.GetConfig(options)); + _sqlSugarClient.ChangeDatabase(tenantId); } } diff --git a/message/Tnb.Message/Service/WechatOpenService.cs b/message/Tnb.Message/Service/WechatOpenService.cs index dc3ef1a6..d7d5a4fa 100644 --- a/message/Tnb.Message/Service/WechatOpenService.cs +++ b/message/Tnb.Message/Service/WechatOpenService.cs @@ -1,18 +1,14 @@ using System.Text; using System.Xml; -using JNPF.Common.Enums; using JNPF.Common.Extension; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Extras.Thirdparty.WeChat; using JNPF.Extras.Thirdparty.WeChat.Internal; -using JNPF.FriendlyException; using JNPF.Logging.Attributes; using JNPF.Message.Entitys.Entity; using JNPF.Systems.Entitys.Permission; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Senparc.Weixin.MP; using SqlSugar; @@ -122,7 +118,7 @@ public class WechatOpenService : IDynamicApiController, ITransient var input = new WechatMPEvent(); input.ToUserName = doc.DocumentElement.SelectSingleNode("ToUserName").InnerText.Trim(); input.FromUserName = doc.DocumentElement.SelectSingleNode("FromUserName").InnerText.Trim(); - input.Event= doc.DocumentElement.SelectSingleNode("Event").InnerText.Trim(); + input.Event = doc.DocumentElement.SelectSingleNode("Event").InnerText.Trim(); return input; } } diff --git a/message/Tnb.Message/Tnb.Message.csproj b/message/Tnb.Message/Tnb.Message.csproj index ca7ad31b..532b9e1f 100644 --- a/message/Tnb.Message/Tnb.Message.csproj +++ b/message/Tnb.Message/Tnb.Message.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/system/Tnb.OAuth/Dto/CurrentUserOutput.cs b/system/Tnb.OAuth/Dto/CurrentUserOutput.cs index 8916d9d6..06194d1d 100644 --- a/system/Tnb.OAuth/Dto/CurrentUserOutput.cs +++ b/system/Tnb.OAuth/Dto/CurrentUserOutput.cs @@ -1,5 +1,4 @@ using JNPF.Common.Models.User; -using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.Systems.Entitys.Dto.Module; diff --git a/system/Tnb.OAuth/Dto/LockScreenInput.cs b/system/Tnb.OAuth/Dto/LockScreenInput.cs index 26991f2c..82486c43 100644 --- a/system/Tnb.OAuth/Dto/LockScreenInput.cs +++ b/system/Tnb.OAuth/Dto/LockScreenInput.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; +using JNPF.DependencyInjection; namespace JNPF.OAuth.Dto; diff --git a/system/Tnb.OAuth/Dto/LoginInput.cs b/system/Tnb.OAuth/Dto/LoginInput.cs index 091fba62..e15bde48 100644 --- a/system/Tnb.OAuth/Dto/LoginInput.cs +++ b/system/Tnb.OAuth/Dto/LoginInput.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; +using JNPF.DependencyInjection; namespace JNPF.OAuth.Dto; diff --git a/system/Tnb.OAuth/OAuthService.cs b/system/Tnb.OAuth/OAuthService.cs index 2bb9ddd6..086e5692 100644 --- a/system/Tnb.OAuth/OAuthService.cs +++ b/system/Tnb.OAuth/OAuthService.cs @@ -1,50 +1,46 @@ -using JNPF.Common.Const; -using JNPF.Common.Captcha.General; +using JNPF.Common.Captcha.General; +using JNPF.Common.Const; +using JNPF.Common.Core.Handlers; using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.OAuth; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Manager; +using JNPF.Common.Models; using JNPF.Common.Models.User; using JNPF.Common.Net; +using JNPF.Common.Options; using JNPF.Common.Security; using JNPF.DataEncryption; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.EventBus; using JNPF.EventHandler; +using JNPF.Extras.CollectiveOAuth.Models; +using JNPF.Extras.DatabaseAccessor.SqlSugar.Models; using JNPF.FriendlyException; using JNPF.Logging.Attributes; +using JNPF.Message.Interfaces.Message; using JNPF.OAuth.Dto; using JNPF.OAuth.Model; using JNPF.RemoteRequest.Extensions; +using JNPF.Systems.Entitys.Dto.Module; using JNPF.Systems.Entitys.Enum; +using JNPF.Systems.Entitys.Model.Permission.SocialsUser; using JNPF.Systems.Entitys.Model.SysConfig; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.Permission; using JNPF.Systems.Interfaces.System; using JNPF.UnifyResult; using Mapster; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.CodeAnalysis; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using SqlSugar; -using JNPF.Systems.Entitys.Dto.Module; -using JNPF.Systems.Entitys.Model.Permission.SocialsUser; -using JNPF.Systems.Interfaces.Permission; -using JNPF.Extras.CollectiveOAuth.Models; -using JNPF.Common.Models; -using JNPF.Common.Options; -using Microsoft.CodeAnalysis; -using JNPF.Common.Core.Handlers; -using JNPF.Message.Interfaces.Message; -using JNPF.Extras.DatabaseAccessor.SqlSugar.Models; -using Aop.Api.Domain; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using bf = System.Reflection.BindingFlags; -using System.Linq.Expressions; namespace JNPF.OAuth; @@ -417,10 +413,10 @@ public class OAuthService : IDynamicApiController, ITransient public async Task Logout([FromQuery] string ticket) { //modify by ly on 20230918 -/* stopTimedTaskSvcCTS ??= new(); - await _backgroundService.StopAsync(stopTimedTaskSvcCTS.Token); - stopTimedTaskSvcCTS.Cancel(); -*/ //stopTimedTaskSvcCTS.Dispose(); + /* stopTimedTaskSvcCTS ??= new(); + await _backgroundService.StopAsync(stopTimedTaskSvcCTS.Token); + stopTimedTaskSvcCTS.Cancel(); + */ //stopTimedTaskSvcCTS.Dispose(); UserManager.AsscessToken = string.Empty; diff --git a/system/Tnb.OAuth/Tnb.OAuth.csproj b/system/Tnb.OAuth/Tnb.OAuth.csproj index fa156afa..0abba9be 100644 --- a/system/Tnb.OAuth/Tnb.OAuth.csproj +++ b/system/Tnb.OAuth/Tnb.OAuth.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/Department/DepartmentCrInput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/Department/DepartmentCrInput.cs index f1d38fef..7de4e26d 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/Department/DepartmentCrInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/Department/DepartmentCrInput.cs @@ -1,5 +1,4 @@ using JNPF.DependencyInjection; -using JNPF.Systems.Entitys.Model.Organize; using Newtonsoft.Json.Linq; namespace JNPF.Systems.Entitys.Dto.Department; diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/OrganizeAdministrator/OrganizeAdminIsTratorCrInput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/OrganizeAdministrator/OrganizeAdminIsTratorCrInput.cs index b932ea81..387bc840 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/OrganizeAdministrator/OrganizeAdminIsTratorCrInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/OrganizeAdministrator/OrganizeAdminIsTratorCrInput.cs @@ -7,7 +7,7 @@ namespace JNPF.Systems.Entitys.Dto.OrganizeAdministrator; /// 机构分级管理创建输入. /// [SuppressSniffer] -public class OrganizeAdminIsTratorCrInput: TreeModel +public class OrganizeAdminIsTratorCrInput : TreeModel { /// /// 用户主键. diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/Socials/SocialsUserListOutput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/Socials/SocialsUserListOutput.cs index c1f72198..dcc5bedc 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/Socials/SocialsUserListOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/Socials/SocialsUserListOutput.cs @@ -1,7 +1,4 @@ -using System.Text.Json.Nodes; -using JNPF.Common.Filter; -using JNPF.Common.Models.User; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.Socials; diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/User/GetDefaultCurrentValueInput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/User/GetDefaultCurrentValueInput.cs index 85c0a9d6..3cc760ae 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/User/GetDefaultCurrentValueInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/User/GetDefaultCurrentValueInput.cs @@ -1,5 +1,4 @@ -using System.Text.Json.Serialization; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.User; diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/User/UserListAllOutput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/User/UserListAllOutput.cs index 4c9301e3..4e5dff2d 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/User/UserListAllOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/User/UserListAllOutput.cs @@ -1,5 +1,4 @@ using JNPF.DependencyInjection; -using System.Text.Json.Serialization; namespace JNPF.Systems.Entitys.Dto.User; diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentInfoUpInput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentInfoUpInput.cs index 1240c6de..0afc7b64 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentInfoUpInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentInfoUpInput.cs @@ -1,5 +1,4 @@ using JNPF.DependencyInjection; -using System; namespace JNPF.Systems.Entitys.Dto.UsersCurrent; diff --git a/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentSystemLogOutput.cs b/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentSystemLogOutput.cs index 9882fe2d..825d3c86 100644 --- a/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentSystemLogOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/Permission/UsersCurrent/UsersCurrentSystemLogOutput.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.UsersCurrent; diff --git a/system/Tnb.Systems.Entitys/Dto/System/ComFields/ComFieldsUpInput.cs b/system/Tnb.Systems.Entitys/Dto/System/ComFields/ComFieldsUpInput.cs index adbf2f22..0d7b2eb4 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/ComFields/ComFieldsUpInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/ComFields/ComFieldsUpInput.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.ComFields; diff --git a/system/Tnb.Systems.Entitys/Dto/System/DataBase/DatabaseTableDataCleanInput.cs b/system/Tnb.Systems.Entitys/Dto/System/DataBase/DatabaseTableDataCleanInput.cs index 4dba9466..ae317f45 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/DataBase/DatabaseTableDataCleanInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/DataBase/DatabaseTableDataCleanInput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.Database { @@ -13,7 +8,7 @@ namespace JNPF.Systems.Entitys.Dto.Database [SuppressSniffer] public class DatabaseTableDataCleanInput { - + /// /// 数据库名称 /// diff --git a/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncActionsExecuteInput.cs b/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncActionsExecuteInput.cs index 433896d0..834e5c25 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncActionsExecuteInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncActionsExecuteInput.cs @@ -36,5 +36,5 @@ public class DbSyncActionsExecuteInput /// /// 字段类型. /// - public Dictionary convertRuleMap { get; set; } + public Dictionary convertRuleMap { get; set; } } \ No newline at end of file diff --git a/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncOutput.cs b/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncOutput.cs index 49b7e7a2..ff217ac0 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/DataSync/DbSyncOutput.cs @@ -20,5 +20,5 @@ public class DbSyncOutput /// /// 映射字段. /// - public Dictionary> convertRuleMap { get; set; } + public Dictionary> convertRuleMap { get; set; } } diff --git a/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthInput.cs b/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthInput.cs index 926c757a..3da81d66 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthInput.cs @@ -1,6 +1,4 @@ -using Newtonsoft.Json; - -namespace JNPF.Systems.Entitys.Dto.System.InterfaceOauth +namespace JNPF.Systems.Entitys.Dto.System.InterfaceOauth { public class InterfaceOauthInput { diff --git a/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthOutput.cs b/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthOutput.cs index 51ffafe7..7142e2f4 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/InterfaceOauth/InterfaceOauthOutput.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Systems.Entitys.Dto.DataInterFace; +using JNPF.Systems.Entitys.Dto.DataInterFace; namespace JNPF.Systems.Entitys.Dto.System.InterfaceOauth { diff --git a/system/Tnb.Systems.Entitys/Dto/System/PrintDev/PrintDevListOutput.cs b/system/Tnb.Systems.Entitys/Dto/System/PrintDev/PrintDevListOutput.cs index f85a72c8..0ee3c339 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/PrintDev/PrintDevListOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/PrintDev/PrintDevListOutput.cs @@ -1,5 +1,4 @@ -using System.Text.Json.Serialization; -using JNPF.Common.Security; +using JNPF.Common.Security; using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.PrintDev; diff --git a/system/Tnb.Systems.Entitys/Dto/System/SysConfig/SetAdminInput.cs b/system/Tnb.Systems.Entitys/Dto/System/SysConfig/SetAdminInput.cs index d55f6378..5e1d50a4 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/SysConfig/SetAdminInput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/SysConfig/SetAdminInput.cs @@ -9,7 +9,7 @@ namespace JNPF.Systems.Entitys.Dto.SysConfig; public class SetAdminInput { /// - /// 赋予超级管理员 Id 集合. - /// + /// 赋予超级管理员 Id 集合. + /// public List adminIds { get; set; } } \ No newline at end of file diff --git a/system/Tnb.Systems.Entitys/Dto/System/SysLog/LogExceptionOutput.cs b/system/Tnb.Systems.Entitys/Dto/System/SysLog/LogExceptionOutput.cs index 55a3e4f3..1cd0a661 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/SysLog/LogExceptionOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/SysLog/LogExceptionOutput.cs @@ -1,5 +1,4 @@ -using System.Text.Json.Serialization; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Dto.SysLog; diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.part.cs b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.part.cs index 6602eeae..6c9a01ab 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.part.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeEntity.part.cs @@ -1,9 +1,8 @@ -using JNPF.Common.Contracts; -using SqlSugar; +using SqlSugar; namespace JNPF.Systems.Entitys.Permission; -public partial class OrganizeEntity +public partial class OrganizeEntity { /// /// diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/SignImgEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/SignImgEntity.cs index 8c5ed972..d768cdaa 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/SignImgEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/SignImgEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.Entity.Permission; diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/TenantSocialsEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/TenantSocialsEntity.cs index d1001d35..b03410d7 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/TenantSocialsEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/TenantSocialsEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.Permission; diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.cs index dbae17a6..dc5136cb 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.Permission; diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.part.cs b/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.part.cs index 351c0b51..9d6b23de 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.part.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/UserEntity.part.cs @@ -1,6 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; -using SqlSugar; +using SqlSugar; namespace JNPF.Systems.Entitys.Permission; diff --git a/system/Tnb.Systems.Entitys/Entity/Permission/UserRelationEntity.cs b/system/Tnb.Systems.Entitys/Entity/Permission/UserRelationEntity.cs index d47c4940..ff3f63b1 100644 --- a/system/Tnb.Systems.Entitys/Entity/Permission/UserRelationEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/Permission/UserRelationEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.Permission; diff --git a/system/Tnb.Systems.Entitys/Entity/System/SmsTemplateEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/SmsTemplateEntity.cs index a1545404..1c4d9c12 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/SmsTemplateEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/SmsTemplateEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.System; diff --git a/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs index f440ea21..c0369c37 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/SynThirdInfoEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.System; diff --git a/system/Tnb.Systems.Entitys/Entity/System/SysConfigEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/SysConfigEntity.cs index bd5c8a33..5b378ef0 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/SysConfigEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/SysConfigEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.System; diff --git a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs index 7655e1fa..613d40fe 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using JNPF.Common.Enums; using SqlSugar; diff --git a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs index aebb6e8c..27d5d357 100644 --- a/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs +++ b/system/Tnb.Systems.Entitys/Entity/System/TimeTaskLogEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.Systems.Entitys.System; diff --git a/system/Tnb.Systems.Entitys/Enum/AreaType.cs b/system/Tnb.Systems.Entitys/Enum/AreaType.cs index 24b9fda8..a37f87f9 100644 --- a/system/Tnb.Systems.Entitys/Enum/AreaType.cs +++ b/system/Tnb.Systems.Entitys/Enum/AreaType.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Enum; diff --git a/system/Tnb.Systems.Entitys/Enum/ErrorStrategy.cs b/system/Tnb.Systems.Entitys/Enum/ErrorStrategy.cs index 2d4cc0b2..6731faee 100644 --- a/system/Tnb.Systems.Entitys/Enum/ErrorStrategy.cs +++ b/system/Tnb.Systems.Entitys/Enum/ErrorStrategy.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Enum; diff --git a/system/Tnb.Systems.Entitys/Enum/MenuCategory.cs b/system/Tnb.Systems.Entitys/Enum/MenuCategory.cs index 8c08264f..fc681968 100644 --- a/system/Tnb.Systems.Entitys/Enum/MenuCategory.cs +++ b/system/Tnb.Systems.Entitys/Enum/MenuCategory.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Enum; diff --git a/system/Tnb.Systems.Entitys/Enum/MenuType.cs b/system/Tnb.Systems.Entitys/Enum/MenuType.cs index c64881f5..866f7b66 100644 --- a/system/Tnb.Systems.Entitys/Enum/MenuType.cs +++ b/system/Tnb.Systems.Entitys/Enum/MenuType.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Enum; diff --git a/system/Tnb.Systems.Entitys/Enum/SysConfig.cs b/system/Tnb.Systems.Entitys/Enum/SysConfig.cs index ee963396..3642e78e 100644 --- a/system/Tnb.Systems.Entitys/Enum/SysConfig.cs +++ b/system/Tnb.Systems.Entitys/Enum/SysConfig.cs @@ -1,5 +1,5 @@ -using JNPF.DependencyInjection; -using System.ComponentModel; +using System.ComponentModel; +using JNPF.DependencyInjection; namespace JNPF.Systems.Entitys.Enum; diff --git a/system/Tnb.Systems.Entitys/Mapper/ConnectionMapper.cs b/system/Tnb.Systems.Entitys/Mapper/ConnectionMapper.cs index 346b6708..b578ea9a 100644 --- a/system/Tnb.Systems.Entitys/Mapper/ConnectionMapper.cs +++ b/system/Tnb.Systems.Entitys/Mapper/ConnectionMapper.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Mapster; +using Mapster; using SqlSugar; namespace Tnb.Systems.Entitys.Mapper diff --git a/system/Tnb.Systems.Entitys/Model/Permission/SocialsUser/SocialsUserModel.cs b/system/Tnb.Systems.Entitys/Model/Permission/SocialsUser/SocialsUserModel.cs index 443dd180..25ce46c6 100644 --- a/system/Tnb.Systems.Entitys/Model/Permission/SocialsUser/SocialsUserModel.cs +++ b/system/Tnb.Systems.Entitys/Model/Permission/SocialsUser/SocialsUserModel.cs @@ -46,7 +46,7 @@ public class SocialsUserInfo public string socialName { get; set; } } -public class AuthCallbackNew: AuthCallback +public class AuthCallbackNew : AuthCallback { public string authCode; } diff --git a/system/Tnb.Systems.Entitys/Model/System/DataBase/DbEntityInfo.cs b/system/Tnb.Systems.Entitys/Model/System/DataBase/DbEntityInfo.cs index 28111354..b6da75e9 100644 --- a/system/Tnb.Systems.Entitys/Model/System/DataBase/DbEntityInfo.cs +++ b/system/Tnb.Systems.Entitys/Model/System/DataBase/DbEntityInfo.cs @@ -1,6 +1,4 @@ using JNPF.DependencyInjection; -using NPOI.SS.Formula.Functions; -using SqlSugar; namespace JNPF.Systems.Entitys.Dto.Database; diff --git a/system/Tnb.Systems.Entitys/Model/System/DataBase/DynamicDbTableModel.cs b/system/Tnb.Systems.Entitys/Model/System/DataBase/DynamicDbTableModel.cs index b6e07638..84314fac 100644 --- a/system/Tnb.Systems.Entitys/Model/System/DataBase/DynamicDbTableModel.cs +++ b/system/Tnb.Systems.Entitys/Model/System/DataBase/DynamicDbTableModel.cs @@ -1,6 +1,4 @@ -using JNPF.DependencyInjection; - -namespace JNPF.Systems.Entitys.Model.DataBase; +namespace JNPF.Systems.Entitys.Model.DataBase; ///// ///// 表列表实体. diff --git a/system/Tnb.Systems.Entitys/Tnb.Systems.Entitys.csproj b/system/Tnb.Systems.Entitys/Tnb.Systems.Entitys.csproj index 5cb0a5a3..3eb5ce90 100644 --- a/system/Tnb.Systems.Entitys/Tnb.Systems.Entitys.csproj +++ b/system/Tnb.Systems.Entitys/Tnb.Systems.Entitys.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/system/Tnb.Systems.Interfaces/Common/IFileService.cs b/system/Tnb.Systems.Interfaces/Common/IFileService.cs index 07938eeb..d1f10b82 100644 --- a/system/Tnb.Systems.Interfaces/Common/IFileService.cs +++ b/system/Tnb.Systems.Interfaces/Common/IFileService.cs @@ -1,7 +1,4 @@ -using Microsoft.AspNetCore.Http; -using OnceMi.AspNetCore.OSS; - -namespace JNPF.Systems.Interfaces.Common; +namespace JNPF.Systems.Interfaces.Common; /// /// 通用控制器. diff --git a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs index 92a02c9b..beb26e7b 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs @@ -85,5 +85,5 @@ public interface IOrganizeService /// /// /// - Task GetAnyParentByWorkstationId(string id,string type); + Task GetAnyParentByWorkstationId(string id, string type); } \ No newline at end of file diff --git a/system/Tnb.Systems.Interfaces/Permission/ISocialsUserService.cs b/system/Tnb.Systems.Interfaces/Permission/ISocialsUserService.cs index 64f4bde2..fb1b160f 100644 --- a/system/Tnb.Systems.Interfaces/Permission/ISocialsUserService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/ISocialsUserService.cs @@ -17,7 +17,7 @@ public interface ISocialsUserService List GetLoginList(string ticket); - Task Binding([FromQuery] SocialsUserInputModel model); + Task Binding([FromQuery] SocialsUserInputModel model); Task GetSocialsUserInfo([FromQuery] SocialsUserInputModel model); diff --git a/system/Tnb.Systems.Interfaces/Permission/IUserRelationService.cs b/system/Tnb.Systems.Interfaces/Permission/IUserRelationService.cs index 641fa8d4..a616d894 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IUserRelationService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IUserRelationService.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Filter; -using JNPF.Systems.Entitys.Dto.User; +using JNPF.Systems.Entitys.Dto.User; using JNPF.Systems.Entitys.Permission; namespace JNPF.Systems.Interfaces.Permission; diff --git a/system/Tnb.Systems.Interfaces/Permission/IUsersService.cs b/system/Tnb.Systems.Interfaces/Permission/IUsersService.cs index a352eb73..b498d785 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IUsersService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IUsersService.cs @@ -1,6 +1,6 @@ -using JNPF.Common.Models.User; +using System.Linq.Expressions; +using JNPF.Common.Models.User; using JNPF.Systems.Entitys.Permission; -using System.Linq.Expressions; namespace JNPF.Systems.Interfaces.Permission; diff --git a/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs b/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs index f0ea634f..5ebe0623 100644 --- a/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs +++ b/system/Tnb.Systems.Interfaces/System/IDataInterfaceService.cs @@ -1,7 +1,7 @@ -using JNPF.Common.Dtos.VisualDev; +using System.Data; +using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Models; using JNPF.Systems.Entitys.System; -using System.Data; namespace JNPF.Systems.Interfaces.System; diff --git a/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs b/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs index f1b50014..465af3eb 100644 --- a/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs +++ b/system/Tnb.Systems.Interfaces/System/IModuleColumnService.cs @@ -1,5 +1,4 @@ -using JNPF.Systems.Entitys.Dto.ModuleColumn; -using JNPF.Systems.Entitys.System; +using JNPF.Systems.Entitys.System; namespace JNPF.Systems.Interfaces.System; diff --git a/system/Tnb.Systems.Interfaces/Tnb.Systems.Interfaces.csproj b/system/Tnb.Systems.Interfaces/Tnb.Systems.Interfaces.csproj index cceae252..2cc455e7 100644 --- a/system/Tnb.Systems.Interfaces/Tnb.Systems.Interfaces.csproj +++ b/system/Tnb.Systems.Interfaces/Tnb.Systems.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/system/Tnb.Systems/Common/HeartbeatService.cs b/system/Tnb.Systems/Common/HeartbeatService.cs index 43b96649..2e4a6061 100644 --- a/system/Tnb.Systems/Common/HeartbeatService.cs +++ b/system/Tnb.Systems/Common/HeartbeatService.cs @@ -1,19 +1,8 @@ -using System.Data; -using JNPF.Common.Core.Manager; -using JNPF.Common.Filter; -using JNPF.Common.Security; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extras.Thirdparty.JSEngine; -using JNPF.JsonSerialization; using JNPF.Logging.Attributes; -using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Entitys.System; -using JNPF.TaskScheduler; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; -using SqlSugar; namespace JNPF.Systems.Common; @@ -24,12 +13,12 @@ namespace JNPF.Systems.Common; [Route("api")] public class HeartbeatService : IDynamicApiController, ITransient { - [HttpGet("heartbeat")] - [AllowAnonymous] - [IgnoreLog] - public string Heartbeat() - { - return DateTime.Now.ToString(); - } + [HttpGet("heartbeat")] + [AllowAnonymous] + [IgnoreLog] + public string Heartbeat() + { + return DateTime.Now.ToString(); + } } diff --git a/system/Tnb.Systems/Common/SampleService.cs b/system/Tnb.Systems/Common/SampleService.cs index 1a0a5523..03ccfd4b 100644 --- a/system/Tnb.Systems/Common/SampleService.cs +++ b/system/Tnb.Systems/Common/SampleService.cs @@ -1,23 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; +using JNPF.Common.Filter; using JNPF.DependencyInjection; using JNPF.DynamicApiController; +using JNPF.Systems.Entitys.Permission; using JNPF.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Mvc; -using NPOI.Util; -using SqlSugar; -using JNPF.Systems.Entitys.Permission; using Mapster; -using JNPF.Common.Filter; -using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; namespace Tnb.BasicData { diff --git a/system/Tnb.Systems/Common/TestService.cs b/system/Tnb.Systems/Common/TestService.cs index ac3b083f..68d6783c 100644 --- a/system/Tnb.Systems/Common/TestService.cs +++ b/system/Tnb.Systems/Common/TestService.cs @@ -1,15 +1,9 @@ -using System.Data; -using JNPF.Common.Core.Manager; -using JNPF.Common.Filter; -using JNPF.Common.Security; +using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extras.Thirdparty.JSEngine; using JNPF.JsonSerialization; using JNPF.Logging.Attributes; using JNPF.Systems.Entitys.Permission; -using JNPF.Systems.Entitys.System; -using JNPF.TaskScheduler; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; @@ -71,17 +65,17 @@ public class TestService : IDynamicApiController, ITransient } - public async Task ImportMoldData() + public async Task ImportMoldData() { - + } - public void xx(UserEntity user) - { - user.Account = "2312321"; + public void xx(UserEntity user) + { + user.Account = "2312321"; - } + } public void xx1(UserEntity user) { diff --git a/system/Tnb.Systems/Permission/AuthorizeService.cs b/system/Tnb.Systems/Permission/AuthorizeService.cs index a680dfc6..ae68c5d3 100644 --- a/system/Tnb.Systems/Permission/AuthorizeService.cs +++ b/system/Tnb.Systems/Permission/AuthorizeService.cs @@ -1,5 +1,4 @@ -using Aop.Api.Domain; -using JNPF.Common.Const; +using JNPF.Common.Const; using JNPF.Common.Core.Handlers; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; @@ -7,7 +6,6 @@ using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Models.User; using JNPF.Common.Security; -using JNPF.DatabaseAccessor; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; diff --git a/system/Tnb.Systems/Permission/DepartmentService.cs b/system/Tnb.Systems/Permission/DepartmentService.cs index 872c5ce1..2233e3db 100644 --- a/system/Tnb.Systems/Permission/DepartmentService.cs +++ b/system/Tnb.Systems/Permission/DepartmentService.cs @@ -1,12 +1,9 @@ -using System.Collections; -using Aop.Api.Domain; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extras.CollectiveOAuth.Models; using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Entitys.Dto.Department; @@ -20,7 +17,6 @@ using Mapster; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Senparc.Weixin.MP.AdvancedAPIs.Comment.CommentJson; using SqlSugar; using Tnb.BasicData; using Tnb.BasicData.Entities; @@ -315,7 +311,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra if (adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync(); #endregion - + if (input.category != DictConst.RegionCategoryCompanyCode) { var jsonObj = input.propertyJson; @@ -478,7 +474,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra int isOK = await _repository.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommandAsync(); if (!(isOK > 0)) throw Oops.Oh(ErrorCode.D2018); - + //modified by zkd on 20230718 处理二维码 if (input.category != DictConst.RegionCategoryCompanyCode) { @@ -486,7 +482,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra var qrcode = jsonObj.GetValue("qrcode"); if (qrcode is not null && !string.IsNullOrEmpty(qrcode.ToString())) { - if (await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == qrcode.ToString() && x.source_id!=id)) + if (await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == qrcode.ToString() && x.source_id != id)) { throw Oops.Bah("二维码总表中已存在该二维码"); } @@ -514,7 +510,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra } } } - + //modified by ly on 20230426 处理工位信息,将工位插入到设备表 if (input.category == DictConst.RegionCategoryStationCode) { @@ -555,7 +551,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra if (processVal is not null) { //modifyby zhoukeda 2023.06.25 - var dic = _repository.GetList(x=>x.DeleteMark==null).ToDictionary(x => x.FullName, x => x.Id); + var dic = _repository.GetList(x => x.DeleteMark == null).ToDictionary(x => x.FullName, x => x.Id); var procList = jsonObj.Value("rowprocess"); var pids = procList.Select(x => x.Value("id")).Distinct().ToList(); var dbProcIds = await _repository.AsSugarClient().Queryable().Where(it => pids.Contains(it.process_id)).Select(it => it.process_id).ToListAsync(); @@ -584,11 +580,11 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra isOK = await _repository.AsSugarClient().Updateable(it => new BasProcessStation { station_id = "", station_code = "" }).Where(it => curProcIds.Contains(it.process_id)).ExecuteCommandAsync(); } } - var correlation= jsonObj.GetValue("correlation"); + var correlation = jsonObj.GetValue("correlation"); if (correlation is not null) { await _repository.AsSugarClient().Deleteable(p => p.OrganizeId == id && p.ObjectType == "User").ExecuteCommandAsync(); - var OrganizeRelationEntitys=new List(); + var OrganizeRelationEntitys = new List(); for (int i = 0; i < correlation.Count(); i++) { OrganizeRelationEntity organizeRelationEntity = new OrganizeRelationEntity(); @@ -651,7 +647,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra /// /// [HttpPost] - public async Task GetFpropertyjsonById(Dictionary dic) + public async Task GetFpropertyjsonById(Dictionary dic) { string id = dic["id"]; string type = dic["type"]; @@ -681,9 +677,9 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra if (dictionary.TryGetValue("rowprocess", out var value)) { List processes = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(value)); - return new Dictionary() + return new Dictionary() { - ["list"] = processes.Select(x=>new + ["list"] = processes.Select(x => new { id = x.id, code = x.process_code, @@ -693,7 +689,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra } } } - return new Dictionary() + return new Dictionary() { ["list"] = Enumerable.Empty() }; @@ -720,7 +716,7 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra return null; } - + /// /// 根据工位id获取车间信息 /// diff --git a/system/Tnb.Systems/Permission/GroupService.cs b/system/Tnb.Systems/Permission/GroupService.cs index 693e2f67..c6fa135d 100644 --- a/system/Tnb.Systems/Permission/GroupService.cs +++ b/system/Tnb.Systems/Permission/GroupService.cs @@ -6,10 +6,10 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.Systems.Interfaces.Permission; using JNPF.Systems.Entitys.Dto.Group; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.Permission; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; diff --git a/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs b/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs index 111711c9..fa2e3cb8 100644 --- a/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs +++ b/system/Tnb.Systems/Permission/OrganizeAdministratorService.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Contracts; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Filter; @@ -78,7 +77,8 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna List? orgIds = dataScope.Where(x => x.ThisLayerSelect.Equals(1)).Select(x => x.OrganizeId).ToList(); if (dataScope.Any(x => x.SubLayerSelect.Equals(1))) { - dataScope.Where(x => x.SubLayerSelect.Equals(1)).ToList().ForEach(item => { + dataScope.Where(x => x.SubLayerSelect.Equals(1)).ToList().ForEach(item => + { var resList = _repository.AsSugarClient().Queryable().Where(o => !o.Id.Equals(item.OrganizeId) && o.OrganizeIdTree.Contains(item.OrganizeId) && o.DeleteMark == null && o.EnabledMark == 1).Select(x => x.Id).ToList(); orgIds.AddRange(resList); }); @@ -352,7 +352,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna resultItem.organizeIdTree = orgItem.OrganizeIdTree; if (userItem.ThisLayerAdd.Equals(0)) resultItem.thisLayerAdd = -1; - else if(userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 2; + else if (userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 2; else if (userItem.ThisLayerAdd.Equals(3) || userItem.ThisLayerAdd.Equals(1)) resultItem.thisLayerAdd = 3; if (userItem.ThisLayerEdit.Equals(0)) resultItem.thisLayerEdit = -1; @@ -504,7 +504,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna [UnitOfWork] public async Task Save([FromBody] OrganizeAdminIsTratorUpInput input) { - if(input.userId.Equals(_userManager.UserId)) throw Oops.Oh(ErrorCode.D2304); + if (input.userId.Equals(_userManager.UserId)) throw Oops.Oh(ErrorCode.D2304); // 处理组织树 名称 List orgTreeNameList = GetOrgListTreeName(); @@ -552,7 +552,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna }); // 管理员权限 - var adminList= currList.Where(x => x.ThisLayerAdd.Equals(1) || x.ThisLayerEdit.Equals(1) || x.ThisLayerDelete.Equals(1) || x.ThisLayerSelect.Equals(1) || + var adminList = currList.Where(x => x.ThisLayerAdd.Equals(1) || x.ThisLayerEdit.Equals(1) || x.ThisLayerDelete.Equals(1) || x.ThisLayerSelect.Equals(1) || x.SubLayerAdd.Equals(1) || x.SubLayerEdit.Equals(1) || x.SubLayerDelete.Equals(1) || x.SubLayerSelect.Equals(1)).Where(x => x.UserId.Equals(_userManager.UserId)).ToList().Copy(); adminList.Where(x => x.SubLayerAdd.Equals(1) || x.SubLayerEdit.Equals(1) || x.SubLayerDelete.Equals(1) || x.SubLayerSelect.Equals(1)).ToList().ForEach(item => { @@ -733,7 +733,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna /// private List GetOrganizeAdministrators(List orgAdminList, string userId, List oldList, List adminList) { - if(!_userManager.IsAdministrator) + if (!_userManager.IsAdministrator) { var addItems = new List(); orgAdminList.ForEach(item => @@ -768,7 +768,7 @@ public class OrganizeAdministratorService : IOrganizeAdministratorService, IDyna }); oldList.ForEach(item => { - if(!orgAdminList.Any(x => x.organizeId.Equals(item.OrganizeId)) && !adminList.Any(x => x.OrganizeId.Equals(item.OrganizeId))) + if (!orgAdminList.Any(x => x.organizeId.Equals(item.OrganizeId)) && !adminList.Any(x => x.OrganizeId.Equals(item.OrganizeId))) { addItems.Add(new OrganizeAdminCrInput() { diff --git a/system/Tnb.Systems/Permission/OrganizeService.cs b/system/Tnb.Systems/Permission/OrganizeService.cs index e2a7bf88..a0a14251 100644 --- a/system/Tnb.Systems/Permission/OrganizeService.cs +++ b/system/Tnb.Systems/Permission/OrganizeService.cs @@ -19,7 +19,6 @@ using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using Tnb.BasicData; using Yitter.IdGenerator; namespace JNPF.Systems; @@ -317,19 +316,19 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie queryWhere = queryWhere.And(x => x.DeleteMark == null); List? data = await _repository.AsQueryable().Where(queryWhere) .WhereIF(input.keyword.IsNotEmptyOrNull(), a => a.FullName.Contains(input.keyword) || a.EnCode.Contains(input.keyword)).Select(a => new OrganizeListOutput - { - id = a.Id, - organizeIdTree = a.OrganizeIdTree, - type = a.Category, - parentId = a.ParentId, - lastFullName = a.FullName, - fullName = a.FullName, - enabledMark = a.EnabledMark, - creatorTime = a.CreatorTime, - icon = a.Category.Equals("company") ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1", - sortCode = a.SortCode, - isLeaf = true - }).ToListAsync(); + { + id = a.Id, + organizeIdTree = a.OrganizeIdTree, + type = a.Category, + parentId = a.ParentId, + lastFullName = a.FullName, + fullName = a.FullName, + enabledMark = a.EnabledMark, + creatorTime = a.CreatorTime, + icon = a.Category.Equals("company") ? "icon-ym icon-ym-tree-organization3" : "icon-ym icon-ym-tree-department1", + sortCode = a.SortCode, + isLeaf = true + }).ToListAsync(); // 获取所有组织 List? allOrgList = GetOrgListTreeName(); @@ -420,7 +419,7 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie }); }); - if(adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync(); + if (adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync(); #endregion #region 第三方同步 @@ -839,9 +838,9 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie public async Task GetAnyParentByWorkstationId(string id, string type) { return await _repository.AsQueryable() - .LeftJoin((a,b)=>a.OrganizeIdTree.Contains(b.Id) && b.Category==type) - .Where((a,b)=>a.Id==id) - .Select((a,b)=>b).FirstAsync(); + .LeftJoin((a, b) => a.OrganizeIdTree.Contains(b.Id) && b.Category == type) + .Where((a, b) => a.Id == id) + .Select((a, b) => b).FirstAsync(); } /// diff --git a/system/Tnb.Systems/Permission/PositionService.cs b/system/Tnb.Systems/Permission/PositionService.cs index 9bb961ca..29753cdd 100644 --- a/system/Tnb.Systems/Permission/PositionService.cs +++ b/system/Tnb.Systems/Permission/PositionService.cs @@ -4,7 +4,6 @@ using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Manager; -using JNPF.Common.Models.User; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; diff --git a/system/Tnb.Systems/Permission/SocialsUserService.cs b/system/Tnb.Systems/Permission/SocialsUserService.cs index 2c0df364..22b4b979 100644 --- a/system/Tnb.Systems/Permission/SocialsUserService.cs +++ b/system/Tnb.Systems/Permission/SocialsUserService.cs @@ -1,5 +1,4 @@ using System.Web; -using JNPF.Common.Const; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Manager; @@ -354,7 +353,7 @@ public class SocialsUserService : ISocialsUserService, IDynamicApiController, IT return new WeChatOpenAuthRequest(clientConfig, authStateCache); case DefaultAuthSourceEnum.WECHAT_ENTERPRISE: - //return new WeChatEnterpriseAuthRequest(clientConfig, authStateCache); + //return new WeChatEnterpriseAuthRequest(clientConfig, authStateCache); case DefaultAuthSourceEnum.WECHAT_ENTERPRISE_SCAN: clientConfig.redirectUri = HttpUtility.UrlEncode(clientConfig.redirectUri); diff --git a/system/Tnb.Systems/Permission/UserRelationService.cs b/system/Tnb.Systems/Permission/UserRelationService.cs index 5c8ee7bc..cb97df41 100644 --- a/system/Tnb.Systems/Permission/UserRelationService.cs +++ b/system/Tnb.Systems/Permission/UserRelationService.cs @@ -384,7 +384,7 @@ public class UserRelationService : IUserRelationService, IDynamicApiController, else { return _repository.AsSugarClient().Queryable((a, b) => new JoinQueryInfos(JoinType.Left, a.UserId == b.Id)) - .Where((a, b) => b.DeleteMark == null && (objId.Contains(a.ObjectId)|| objId.Contains(a.UserId)) && b.EnabledMark > 0).Select(a => a.UserId).Distinct().ToList(); + .Where((a, b) => b.DeleteMark == null && (objId.Contains(a.ObjectId) || objId.Contains(a.UserId)) && b.EnabledMark > 0).Select(a => a.UserId).Distinct().ToList(); } } else diff --git a/system/Tnb.Systems/Permission/UsersCurrentService.cs b/system/Tnb.Systems/Permission/UsersCurrentService.cs index 09535467..e01ca9e2 100644 --- a/system/Tnb.Systems/Permission/UsersCurrentService.cs +++ b/system/Tnb.Systems/Permission/UsersCurrentService.cs @@ -335,7 +335,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, user.ChangePasswordDate = DateTime.Now; user.LastModifyTime = DateTime.Now; user.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new + { it.Password, it.ChangePasswordDate, it.LastModifyUserId, @@ -356,7 +357,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, userInfo.IsAdministrator = Convert.ToInt32(_userManager.IsAdministrator); userInfo.LastModifyTime = DateTime.Now; userInfo.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new + { it.RealName, it.Signature, it.Gender, @@ -390,7 +392,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, user.Theme = input.theme; user.LastModifyTime = DateTime.Now; user.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new + { it.Theme, it.LastModifyUserId, it.LastModifyTime @@ -409,7 +412,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, user.Language = input.language; user.LastModifyTime = DateTime.Now; user.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new + { it.Language, it.LastModifyUserId, it.LastModifyTime @@ -428,7 +432,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, user.HeadIcon = name; user.LastModifyTime = DateTime.Now; user.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(user).UpdateColumns(it => new + { it.HeadIcon, it.LastModifyUserId, it.LastModifyTime @@ -521,7 +526,8 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController, userInfo.LastModifyTime = DateTime.Now; userInfo.LastModifyUserId = _userManager.UserId; - int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new { + int isOk = await _repository.AsUpdateable(userInfo).UpdateColumns(it => new + { it.OrganizeId, it.PositionId, it.LastModifyUserId, diff --git a/system/Tnb.Systems/Permission/UsersService.cs b/system/Tnb.Systems/Permission/UsersService.cs index 18cf74b8..ad73a566 100644 --- a/system/Tnb.Systems/Permission/UsersService.cs +++ b/system/Tnb.Systems/Permission/UsersService.cs @@ -1,4 +1,4 @@ -using Aop.Api.Domain; +using System.Linq.Expressions; using JNPF.Common.Configuration; using JNPF.Common.Const; using JNPF.Common.Core.Manager; @@ -32,21 +32,11 @@ using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.Permission; using JNPF.Systems.Interfaces.System; using Mapster; -using Microsoft.AspNetCore.Authentication.OAuth; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Options; -using NPOI.SS.Formula.Eval; -using NPOI.SS.Formula.Functions; -using Org.BouncyCastle.Ocsp; -using Qiniu.Util; -using Senparc.NeuChar.App.AppStore; using SqlSugar; -using System; -using System.Linq.Expressions; -using System.Security.Principal; -using System.Text.Json.Nodes; namespace JNPF.Systems; @@ -312,7 +302,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient .Where((a, b) => b.ObjectType == "Organize" && orgList.Contains(b.ObjectId)).Where((a, b) => a.EnabledMark == 1 && a.DeleteMark == null) .Where((a, b) => a.RealName.Contains(input.keyword) || a.Account.Contains(input.keyword)) .GroupBy((a, b) => new { a.Id, a.RealName, a.Account, a.EnabledMark }) - .Select((a, b) => new { + .Select((a, b) => new + { id = a.Id, fullName = SqlFunc.MergeString(a.RealName, "/", a.Account), enabledMark = a.EnabledMark, @@ -357,7 +348,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient var res = await _repository.AsSugarClient().Queryable((a, b) => new JoinQueryInfos(JoinType.Left, b.UserId == a.Id)) .Where((a, b) => b.ObjectType == "Organize" && b.ObjectId == input.organizeId).Where((a, b) => a.EnabledMark == 1 && a.DeleteMark == null) .GroupBy((a, b) => new { a.Id, a.RealName, a.Account, a.EnabledMark }) - .Select((a, b) => new { + .Select((a, b) => new + { id = a.Id, fullName = SqlFunc.MergeString(a.RealName, "/", a.Account), enabledMark = a.EnabledMark, @@ -564,7 +556,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient var oids = userList.Where(x => x.UserId.Equals(item.id)).Select(x => x.ObjectId).ToList(); var oTree = orgList.Where(x => oids.Contains(x.Id)).Select(x => x.Description).ToList(); item.organize = string.Join(",", oTree); - //item.type = org.fullName; + //item.type = org.fullName; }); } @@ -1148,7 +1140,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient public async Task Update(string id, [FromBody] UserUpInput input) { UserEntity? oldUserEntity = await _repository.GetFirstAsync(it => it.Id == id); - input.roleId = input.roleId == null ? string.Empty : input.roleId; + input.roleId = input.roleId == null ? string.Empty : input.roleId; // 超级管理员 只有 admin 账号才有变更权限 if (_userManager.UserId != oldUserEntity.Id && oldUserEntity.IsAdministrator == 1 && _userManager.Account != "admin") @@ -1240,7 +1232,8 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient try { // 更新用户记录 - int newEntity = await _repository.AsUpdateable(entity).UpdateColumns(it => new { + int newEntity = await _repository.AsUpdateable(entity).UpdateColumns(it => new + { it.Account, it.RealName, it.QuickQuery, diff --git a/system/Tnb.Systems/System/BillRuleService.cs b/system/Tnb.Systems/System/BillRuleService.cs index 77a35854..07e3b943 100644 --- a/system/Tnb.Systems/System/BillRuleService.cs +++ b/system/Tnb.Systems/System/BillRuleService.cs @@ -311,7 +311,7 @@ public class BillRuleService : IBillRullService, IDynamicApiController, ITransie if (entity != null) { // 处理隔天流水号归0 - if (entity.OutputNumber != null) + if (entity.OutputNumber != null) { var serialDate = entity.OutputNumber.Remove(entity.OutputNumber.Length - (int)entity.Digit).Replace(entity.Prefix, string.Empty); var thisDate = entity.DateFormat == "no" ? string.Empty : DateTime.Now.ToString(entity.DateFormat); diff --git a/system/Tnb.Systems/System/DataInterfaceService.cs b/system/Tnb.Systems/System/DataInterfaceService.cs index f6379698..91a451b7 100644 --- a/system/Tnb.Systems/System/DataInterfaceService.cs +++ b/system/Tnb.Systems/System/DataInterfaceService.cs @@ -4,7 +4,6 @@ using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Web; -using JNPF.ClayObject; using JNPF.Common.Configuration; using JNPF.Common.Const; using JNPF.Common.Core.Manager; @@ -521,7 +520,8 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController if (interfaceOauthEntity == null) return null; var ymDate = DateTime.Now.ParseToUnixTime().ToString(); var authorization = GetVerifySignature(interfaceOauthEntity, intefaceId, ymDate); - return new { + return new + { YmDate = ymDate, Authorization = authorization, }; @@ -564,7 +564,7 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController var result = await Preview(id, input); if (result is DataTable) { - List> list = JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(result)); + List> list = JsonConvert.DeserializeObject>>(JsonConvert.SerializeObject(result)); return list.FirstOrDefault()?.Keys.ToList() ?? Enumerable.Empty(); } else @@ -712,7 +712,8 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController { // 分页 var dt = GetPageToDataTable(resTable, input.currentPage, input.pageSize); - output = new { + output = new + { pagination = new PageResult() { currentPage = input.currentPage, @@ -759,7 +760,8 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController // }); //} resList = resList.FindAll(x => x.Where(xx => xx.Value != null && xx.Value.Contains(input.keyword)).Any()); - output = new { + output = new + { pagination = new PageResult() { currentPage = input.currentPage, @@ -798,7 +800,8 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController if (input.sort.Equals("desc")) resList = resList.OrderBy(x => x[input.sidx]).ToList(); else resList = resList.OrderByDescending(x => x[input.sidx]).ToList(); } - output = new { + output = new + { pagination = new PageResult() { currentPage = input.currentPage, @@ -810,7 +813,8 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController } else { - output = new { + output = new + { pagination = new PageResult() { currentPage = input.currentPage, diff --git a/system/Tnb.Systems/System/DataSyncService.cs b/system/Tnb.Systems/System/DataSyncService.cs index 96bfcbf8..6d70632a 100644 --- a/system/Tnb.Systems/System/DataSyncService.cs +++ b/system/Tnb.Systems/System/DataSyncService.cs @@ -242,7 +242,7 @@ public class DataSyncService : IDynamicApiController, ITransient fieldTypeList.Add("number", GetDataTypeList(3, dbTypeTo)); fieldTypeList.Add("number", GetDataTypeList(4, dbTypeTo)); fieldTypeList.Add("clob", GetDataTypeList(5, dbTypeTo)); - break ; + break; case "dm": fieldTypeList.Add("varchar", GetDataTypeList(0, dbTypeTo)); fieldTypeList.Add("int", GetDataTypeList(1, dbTypeTo)); diff --git a/system/Tnb.Systems/System/DictionaryDataService.cs b/system/Tnb.Systems/System/DictionaryDataService.cs index e4171e29..ec5ed2db 100644 --- a/system/Tnb.Systems/System/DictionaryDataService.cs +++ b/system/Tnb.Systems/System/DictionaryDataService.cs @@ -1,5 +1,4 @@ -using JNPF.ClayObject.Extensions; -using JNPF.Common.Core.Manager; +using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager.Files; using JNPF.Common.Enums; using JNPF.Common.Manager; diff --git a/system/Tnb.Systems/System/InterfaceOauthService.cs b/system/Tnb.Systems/System/InterfaceOauthService.cs index 97525968..a67f4a2a 100644 --- a/system/Tnb.Systems/System/InterfaceOauthService.cs +++ b/system/Tnb.Systems/System/InterfaceOauthService.cs @@ -22,7 +22,7 @@ namespace JNPF.Systems.System; /// 接口认证 /// 版 本:V3.2 /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) - /// 日 期:2021-06-01. +/// 日 期:2021-06-01. /// [ApiDescriptionSettings(Tag = "System", Name = "InterfaceOauth", Order = 202)] [Route("api/system/[controller]")] diff --git a/system/Tnb.Systems/System/ModuleColumnService.cs b/system/Tnb.Systems/System/ModuleColumnService.cs index 27d2a174..bd3a250e 100644 --- a/system/Tnb.Systems/System/ModuleColumnService.cs +++ b/system/Tnb.Systems/System/ModuleColumnService.cs @@ -12,7 +12,6 @@ using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev.Engine; -using JNPF.VisualDev.Engine.Core; using JNPF.VisualDev.Entitys; using Mapster; using Microsoft.AspNetCore.Mvc; @@ -74,7 +73,7 @@ public class ModuleColumnService : IModuleColumnService, IDynamicApiController, fullName = a.FullName, enCode = SqlFunc.IF(a.FieldRule == 1 && !SqlFunc.IsNullOrEmpty(a.BindTable)).Return(a.EnCode.Replace("jnpf_" + a.BindTable + "_jnpf_", "")) .ElseIF(b.Type == 3 && a.FieldRule == 1).Return(a.EnCode.Replace(a.BindTable + ".", "")) - .ElseIF(a.FieldRule == 2).Return(a.EnCode.Replace(a.ChildTableKey+"-", "")).End(a.EnCode), + .ElseIF(a.FieldRule == 2).Return(a.EnCode.Replace(a.ChildTableKey + "-", "")).End(a.EnCode), id = a.Id, sortCode = a.SortCode }).ToListAsync(); @@ -91,7 +90,7 @@ public class ModuleColumnService : IModuleColumnService, IDynamicApiController, { var data = await _repository.GetFirstAsync(x => x.Id == id && x.DeleteMark == null); if (data.FieldRule == 2 && data.ChildTableKey.IsNotEmptyOrNull()) - data.EnCode = data.EnCode.Replace(data.ChildTableKey+"-", string.Empty); + data.EnCode = data.EnCode.Replace(data.ChildTableKey + "-", string.Empty); var menu = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.Id == data.ModuleId && x.DeleteMark == null); if (menu.IsNotEmptyOrNull() && data.BindTable.IsNotEmptyOrNull() && data.FieldRule == 1) { @@ -138,7 +137,7 @@ public class ModuleColumnService : IModuleColumnService, IDynamicApiController, { var entity = input.Adapt(); if (entity.FieldRule == 2 && input.childTableKey.IsNotEmptyOrNull()) - entity.EnCode = input.childTableKey +"-"+ entity.EnCode; + entity.EnCode = input.childTableKey + "-" + entity.EnCode; var menu = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.Id == input.moduleId && x.DeleteMark == null); if (menu.IsNotEmptyOrNull() && entity.BindTable.IsNotEmptyOrNull() && entity.FieldRule == 1) { @@ -236,7 +235,7 @@ public class ModuleColumnService : IModuleColumnService, IDynamicApiController, entity.FullName = item.fullName; entity.BindTable = item.bindTable; entity.FieldRule = item.fieldRule; - entity.ChildTableKey=item.childTableKey; + entity.ChildTableKey = item.childTableKey; entity.SortCode = 0; if (entity.FieldRule == 2 && item.childTableKey.IsNotEmptyOrNull()) entity.EnCode = item.childTableKey + "-" + entity.EnCode; diff --git a/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs b/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs index 05a0deba..1d6cdea0 100644 --- a/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs +++ b/system/Tnb.Systems/System/ModuleDataAuthorizeService.cs @@ -10,7 +10,6 @@ using JNPF.Systems.Entitys.Dto.ModuleDataAuthorize; using JNPF.Systems.Entitys.Dto.ModuleDataAuthorizeScheme; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev.Engine; using JNPF.VisualDev.Engine.Core; using JNPF.VisualDev.Entitys; using Mapster; diff --git a/system/Tnb.Systems/System/ModuleFormService.cs b/system/Tnb.Systems/System/ModuleFormService.cs index 2b43ecbd..bdf22970 100644 --- a/system/Tnb.Systems/System/ModuleFormService.cs +++ b/system/Tnb.Systems/System/ModuleFormService.cs @@ -12,7 +12,6 @@ using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev.Engine; -using JNPF.VisualDev.Engine.Core; using JNPF.VisualDev.Entitys; using Mapster; using Microsoft.AspNetCore.Mvc; diff --git a/system/Tnb.Systems/System/MonitorService.cs b/system/Tnb.Systems/System/MonitorService.cs index 89541a3d..f304fe7b 100644 --- a/system/Tnb.Systems/System/MonitorService.cs +++ b/system/Tnb.Systems/System/MonitorService.cs @@ -1,10 +1,9 @@ -using JNPF.Common.Security; +using System.Runtime.InteropServices; +using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.Systems.Entitys.Dto.Monitor; -using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; -using System.Runtime.InteropServices; namespace JNPF.Systems; diff --git a/system/Tnb.Systems/System/PrintDevService.cs b/system/Tnb.Systems/System/PrintDevService.cs index 98c3d510..35c0f307 100644 --- a/system/Tnb.Systems/System/PrintDevService.cs +++ b/system/Tnb.Systems/System/PrintDevService.cs @@ -90,9 +90,9 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("")] public async Task GetList_Api([FromQuery] PrintDevListInput input) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => - new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId,JoinType.Left,d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) - .Where((a, b, c, d,e) => a.DeleteMark == null ) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d, e) => + new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, d.EnCode == "printDev", JoinType.Left, a.Category == e.EnCode && d.Id == e.DictionaryTypeId)) + .Where((a, b, c, d, e) => a.DeleteMark == null) .WhereIF(input.category.IsNotEmptyOrNull(), a => a.Category == input.category) .WhereIF(input.keyword.IsNotEmptyOrNull(), a => a.FullName.Contains(input.keyword) || a.EnCode.Contains(input.keyword)) .OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) @@ -120,10 +120,10 @@ public class PrintDevService : IDynamicApiController, ITransient [HttpGet("Selector")] public async Task GetList_Api([FromQuery] string type) { - var list = await _repository.AsSugarClient().Queryable((a, b, c, d,e) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, d.EnCode=="printDev", JoinType.Left, a.Category == e.EnCode && d.Id==e.DictionaryTypeId)) + var list = await _repository.AsSugarClient().Queryable((a, b, c, d, e) => new JoinQueryInfos(JoinType.Left, b.Id == a.CreatorUserId, JoinType.Left, c.Id == a.LastModifyUserId, JoinType.Left, d.EnCode == "printDev", JoinType.Left, a.Category == e.EnCode && d.Id == e.DictionaryTypeId)) .Where((a, b, c, d) => a.DeleteMark == null && a.EnabledMark == 1).OrderBy(a => a.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc) .WhereIF(type.IsNotEmptyOrNull(), (a) => a.Type == type.ParseToInt()) - .Select((a, b, c, d,e) => new PrintDevListOutput + .Select((a, b, c, d, e) => new PrintDevListOutput { category = a.Category, id = a.Id, diff --git a/system/Tnb.Systems/System/PrintLogService.cs b/system/Tnb.Systems/System/PrintLogService.cs index 4d038345..45f27513 100644 --- a/system/Tnb.Systems/System/PrintLogService.cs +++ b/system/Tnb.Systems/System/PrintLogService.cs @@ -1,5 +1,6 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Enums; +using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; @@ -12,7 +13,6 @@ using JNPF.Systems.Entitys.Permission; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using JNPF.Common.Extension; namespace JNPF.Systems.System; @@ -94,7 +94,7 @@ public class PrintLogService : IDynamicApiController, ITransient public async Task Delete([FromBody] PrintLogOutuut input) { var entity = input.Adapt(); - entity.Id= SnowflakeIdHelper.NextId(); + entity.Id = SnowflakeIdHelper.NextId(); entity.PrintMan = _userManager.UserId; entity.PrintTime = DateTime.Now; var isOk = await _repository.AsInsertable(entity).ExecuteCommandAsync(); diff --git a/system/Tnb.Systems/System/ProvinceService.cs b/system/Tnb.Systems/System/ProvinceService.cs index 586c2901..da0db5e5 100644 --- a/system/Tnb.Systems/System/ProvinceService.cs +++ b/system/Tnb.Systems/System/ProvinceService.cs @@ -6,7 +6,6 @@ using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Dto.Province; using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; diff --git a/system/Tnb.Systems/System/SysLogService.cs b/system/Tnb.Systems/System/SysLogService.cs index 8ece9d8f..20d6453d 100644 --- a/system/Tnb.Systems/System/SysLogService.cs +++ b/system/Tnb.Systems/System/SysLogService.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Extension; +using System.Reflection; +using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.DatabaseAccessor; using JNPF.DependencyInjection; @@ -10,7 +11,6 @@ using JNPF.Systems.Entitys.System; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; -using System.Reflection; namespace JNPF.Systems; diff --git a/system/Tnb.Systems/System/SystemService.cs b/system/Tnb.Systems/System/SystemService.cs index a7cb7e81..7685865d 100644 --- a/system/Tnb.Systems/System/SystemService.cs +++ b/system/Tnb.Systems/System/SystemService.cs @@ -1,10 +1,8 @@ -using Aop.Api.Domain; -using JNPF.Common.Const; +using JNPF.Common.Const; using JNPF.Common.Core.Handlers; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; -using JNPF.Common.Filter; using JNPF.Common.Manager; using JNPF.Common.Models.User; using JNPF.Common.Security; diff --git a/system/Tnb.Systems/Tnb.Systems.csproj b/system/Tnb.Systems/Tnb.Systems.csproj index 1baf4b60..ef1765d0 100644 --- a/system/Tnb.Systems/Tnb.Systems.csproj +++ b/system/Tnb.Systems/Tnb.Systems.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Dto/TaskScheduler/TimeTaskUpInput.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Dto/TaskScheduler/TimeTaskUpInput.cs index ea39fb97..1c785009 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Dto/TaskScheduler/TimeTaskUpInput.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Dto/TaskScheduler/TimeTaskUpInput.cs @@ -3,7 +3,7 @@ namespace JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; [SuppressSniffer] -public class TimeTaskUpInput:TimeTaskCrInput +public class TimeTaskUpInput : TimeTaskCrInput { /// /// id. diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs index a0993514..ee306a88 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/SnowId.cs @@ -14,6 +14,6 @@ namespace JNPF.TaskScheduler.Entitys.Entity; [Tenant(ClaimConst.TENANTID)] public class SnowIdEntity : IEntity { - //[SugarColumn(ColumnName = "id")] - public string Id { get; set; } + //[SugarColumn(ColumnName = "id")] + public string Id { get; set; } } diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs index ea046fd7..6528ad2f 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Entity/TimeTaskEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using JNPF.Common.Contracts; +using JNPF.Common.Contracts; using SqlSugar; namespace JNPF.TaskScheduler.Entitys; diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Mapper/Mapper.cs b/taskschedule/Tnb.TaskScheduler.Entitys/Mapper/Mapper.cs index 4663f2e8..d784042b 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Mapper/Mapper.cs +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Mapper/Mapper.cs @@ -1,6 +1,5 @@ using JNPF.Common.Extension; using JNPF.Common.Security; -using JNPF.TaskScheduler.Entitys; using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; using Mapster; diff --git a/taskschedule/Tnb.TaskScheduler.Entitys/Tnb.TaskScheduler.Entitys.csproj b/taskschedule/Tnb.TaskScheduler.Entitys/Tnb.TaskScheduler.Entitys.csproj index f42db347..76ff6275 100644 --- a/taskschedule/Tnb.TaskScheduler.Entitys/Tnb.TaskScheduler.Entitys.csproj +++ b/taskschedule/Tnb.TaskScheduler.Entitys/Tnb.TaskScheduler.Entitys.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/taskschedule/Tnb.TaskScheduler.Interfaces/Tnb.TaskScheduler.Interfaces.csproj b/taskschedule/Tnb.TaskScheduler.Interfaces/Tnb.TaskScheduler.Interfaces.csproj index 296a711e..06e5f273 100644 --- a/taskschedule/Tnb.TaskScheduler.Interfaces/Tnb.TaskScheduler.Interfaces.csproj +++ b/taskschedule/Tnb.TaskScheduler.Interfaces/Tnb.TaskScheduler.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs index a58f132d..baba20a4 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateMaintainPlanTimeWorker.cs @@ -1,6 +1,5 @@ using JNPF.Common.Security; using JNPF.Logging; -using Microsoft.AspNetCore.Components; using SqlSugar; using Tnb.EquipMgr.Entities; @@ -17,7 +16,7 @@ namespace JNPF.TaskScheduler.Listener // _repository = repository; // } - [SpareTime("0 0 0 * * ?", "生成设备保养计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)] + [SpareTime("0 0 0 * * ?", "生成设备保养计划", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] public async void GenerateSpotInspectionPlan(SpareTimer timer, long count) { Log.Information("----------------------开始生成设备保养计划----------------------"); @@ -25,12 +24,12 @@ namespace JNPF.TaskScheduler.Listener try { var db = _repository.CopyNew(); - List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "1").ToListAsync(); - List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "2").ToListAsync(); + List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start == "1" && x.plan_cycle_unit == "1").ToListAsync(); + List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start == "1" && x.plan_cycle_unit == "2").ToListAsync(); List tobeCreateList = new List(); List tobeCreateTemplets = new List(); - - + + foreach (var item in eqpSpotInsTemEquipHsByOne) { if (item.start_time.AddDays((double)item.plan_cycle).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")) @@ -38,7 +37,7 @@ namespace JNPF.TaskScheduler.Listener tobeCreateTemplets.Add(item); } } - + if (eqpSpotInsTemEquipHsByCirculate != null && eqpSpotInsTemEquipHsByCirculate.Count > 0) { @@ -48,24 +47,24 @@ namespace JNPF.TaskScheduler.Listener TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(item.start_time.ToString("yyyy-MM-dd")).Ticks); TimeSpan ts3 = ts1.Subtract(ts2).Duration(); - if (ts3.TotalDays * 10 % (10 * (double)item.plan_cycle)==0) + if (ts3.TotalDays * 10 % (10 * (double)item.plan_cycle) == 0) { tobeCreateTemplets.Add(item); } } } - + if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0) { - List equipments = await db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); + List equipments = await db.Queryable().Where(x => x.life == Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); int index = 1; foreach (var item in tobeCreateTemplets) { //只有启用设备才生成计划 if (equipments.FirstOrDefault(x => x.id == item.equip_id) == null) continue; - - string code = $"{DateTime.Now.ToString("yyyyMMdd")+(index++).ToString().PadLeft(3,'0')}"; + + string code = $"{DateTime.Now.ToString("yyyyMMdd") + (index++).ToString().PadLeft(3, '0')}"; tobeCreateList.Add(new EqpMaintainRecordH() { code = code, @@ -94,7 +93,7 @@ namespace JNPF.TaskScheduler.Listener List spotInsItemIDs = spotInsTemEquipDs.Select(x => x.maintain_item_id).ToList(); List spotCheckItems = await db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToListAsync(); - + List spotInsRecordDs = new List(); foreach (var tobeCreatePlan in tobeCreateList) { @@ -120,7 +119,7 @@ namespace JNPF.TaskScheduler.Listener } } - if (spotInsRecordDs.Count<=0) + if (spotInsRecordDs.Count <= 0) { return; } @@ -151,7 +150,7 @@ namespace JNPF.TaskScheduler.Listener Log.Error(e.Message); } - + Log.Information("----------------------结束生成设备保养计划----------------------"); } } diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpEquipCheckPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpEquipCheckPlanTimeWorker.cs index b2742ceb..dc39847b 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpEquipCheckPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpEquipCheckPlanTimeWorker.cs @@ -11,8 +11,8 @@ namespace JNPF.TaskScheduler.Listener public class GenerateSpEquipCheckPlanTimeWorker : ISpareTimeWorker { private ISqlSugarRepository _repository => App.GetService>(); - - [SpareTime("0 0 0 * * ?", "生成特种设备检验计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)] + + [SpareTime("0 0 0 * * ?", "生成特种设备检验计划", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] public void GenerateSpotInspectionPlan(SpareTimer timer, long count) { Log.Information("----------------------开始生成特种设备检验计划----------------------"); @@ -23,20 +23,20 @@ namespace JNPF.TaskScheduler.Listener List ids = _repository.GetList(x => x.status == "0").Select(x => x.equip_id).Distinct() .ToList(); - - List list = db.Queryable().GroupBy(x=>new - { - x.equip_id, - }).Where(x => x.status == "1" && !ids.Contains(x.equip_id))//排除有未检验的 - .Select(x=>new + + List list = db.Queryable().GroupBy(x => new + { + x.equip_id, + }).Where(x => x.status == "1" && !ids.Contains(x.equip_id))//排除有未检验的 + .Select(x => new { equip_id = x.equip_id, create_time = SqlFunc.AggregateMax(x.create_time), - + }) .MergeTable() - .LeftJoin((x,y)=>x.equip_id==y.equip_id && x.create_time!.Value.ToString("yyyy-MM-dd")==y.create_time!.Value.ToString("yyyy-MM-dd")) - .Select((x,y)=>y) + .LeftJoin((x, y) => x.equip_id == y.equip_id && x.create_time!.Value.ToString("yyyy-MM-dd") == y.create_time!.Value.ToString("yyyy-MM-dd")) + .Select((x, y) => y) .ToList(); List insertList = new List(); @@ -44,7 +44,7 @@ namespace JNPF.TaskScheduler.Listener { foreach (var item in list) { - if (item.end_time != null && item.warn_unit!=null) + if (item.end_time != null && item.warn_unit != null) { if (item.warn_unit == "1") { @@ -58,8 +58,9 @@ namespace JNPF.TaskScheduler.Listener status = "0" }); } - - }else if (item.warn_unit == "2") + + } + else if (item.warn_unit == "2") { if (item.end_time.Value.AddDays(-item.warm_time!.Value).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")) @@ -72,9 +73,9 @@ namespace JNPF.TaskScheduler.Listener }); } } - + } - + } _repository.InsertRange(insertList); @@ -86,7 +87,7 @@ namespace JNPF.TaskScheduler.Listener Log.Error(e.Message); } - + Log.Information("----------------------结束生成特种设备检验计划----------------------"); } } diff --git a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs index 6fd44130..67761aed 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/GenerateSpotInspectionPlanTimeWorker.cs @@ -1,6 +1,5 @@ using JNPF.Common.Security; using JNPF.Logging; -using Microsoft.AspNetCore.Components; using SqlSugar; using Tnb.EquipMgr.Entities; @@ -17,7 +16,7 @@ namespace JNPF.TaskScheduler.Listener // _repository = repository; // } - [SpareTime("0 0,30 * * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)] + [SpareTime("0 0,30 * * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] public async void GenerateSpotInspectionPlan(SpareTimer timer, long count) { Log.Information("----------------------开始生成点巡检计划----------------------"); @@ -25,11 +24,11 @@ namespace JNPF.TaskScheduler.Listener try { var db = _repository.CopyNew(); - List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "1").ToListAsync(); - List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start=="1" && x.plan_cycle_unit == "2").ToListAsync(); + List eqpSpotInsTemEquipHsByOne = await db.Queryable().Where(x => x.is_start == "1" && x.plan_cycle_unit == "1").ToListAsync(); + List eqpSpotInsTemEquipHsByCirculate = await db.Queryable().Where(x => x.is_start == "1" && x.plan_cycle_unit == "2").ToListAsync(); List tobeCreateList = new List(); List tobeCreateTemplets = new List(); - + foreach (var item in eqpSpotInsTemEquipHsByOne) { if (item.start_time.AddHours((double)item.plan_cycle).ToString("yyyy-MM-dd HH:mm") == DateTime.Now.ToString("yyyy-MM-dd HH:mm")) @@ -37,7 +36,7 @@ namespace JNPF.TaskScheduler.Listener tobeCreateTemplets.Add(item); } } - + if (eqpSpotInsTemEquipHsByCirculate != null && eqpSpotInsTemEquipHsByCirculate.Count > 0) { //查询最后一条数据加上周期是否等于现在等于表示周期到了 已废除 @@ -71,24 +70,24 @@ namespace JNPF.TaskScheduler.Listener TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm")).Ticks); TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(item.start_time.ToString("yyyy-MM-dd HH:mm")).Ticks); TimeSpan ts3 = ts1.Subtract(ts2).Duration(); - if ((ts3.TotalMinutes+offsetMinute) * 10 / 60 % (10 * (double)item.plan_cycle)==0) + if ((ts3.TotalMinutes + offsetMinute) * 10 / 60 % (10 * (double)item.plan_cycle) == 0) { tobeCreateTemplets.Add(item); } } } - + if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0) { - List equipments = await db.Queryable().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); + List equipments = await db.Queryable().Where(x => x.life == Tnb.EquipMgr.EquipmentLife.ENABLE).ToListAsync(); int index = 1; foreach (var item in tobeCreateTemplets) { //只有启用设备才生成计划 if (equipments.FirstOrDefault(x => x.id == item.equip_id) == null) continue; - - string code = $"{DateTime.Now.ToString("yyyyMMddHHmm")+(index++).ToString().PadLeft(3,'0')}"; + + string code = $"{DateTime.Now.ToString("yyyyMMddHHmm") + (index++).ToString().PadLeft(3, '0')}"; tobeCreateList.Add(new EqpSpotInsRecordH() { id = SnowflakeIdHelper.NextId(), @@ -118,7 +117,7 @@ namespace JNPF.TaskScheduler.Listener List spotInsItemIDs = spotInsTemEquipDs.Select(x => x.spot_ins_item_id).ToList(); List spotCheckItems = await db.Queryable().Where(x => spotInsItemIDs.Contains(x.id)).ToListAsync(); - + List spotInsRecordDs = new List(); foreach (var tobeCreatePlan in tobeCreateList) { @@ -147,9 +146,9 @@ namespace JNPF.TaskScheduler.Listener remark = tobeCreateItem.remark }); } - + } - if (spotInsRecordDs.Count<=0) + if (spotInsRecordDs.Count <= 0) { return; } @@ -180,9 +179,9 @@ namespace JNPF.TaskScheduler.Listener Log.Error(e.Message); } - + Log.Information("----------------------结束生成点巡检计划----------------------"); } - + } } \ No newline at end of file diff --git a/taskschedule/Tnb.TaskScheduler/Listener/MoldMaintainTask.cs b/taskschedule/Tnb.TaskScheduler/Listener/MoldMaintainTask.cs index 8c0418e3..9ab69020 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/MoldMaintainTask.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/MoldMaintainTask.cs @@ -1,32 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF; +using JNPF; using JNPF.Common.Security; -using JNPF.Systems.Entitys.System; using JNPF.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; using JNPF.TaskScheduler.Interfaces.TaskScheduler; using SqlSugar; using Tnb.EquipMgr.Entities; -using Tnb.ProductionMgr.Entities; -using Tnb.QcMgr.Entities; -using Tnb.QcMgr.Entities.Entity; namespace Tnb.TaskScheduler.Listener { public class MoldMaintainTask : ISpareTimeWorker { private ISqlSugarRepository repository => App.GetService>(); - private ITimeTaskService timeTaskService => App.GetService(); + private ITimeTaskService timeTaskService => App.GetService(); [SpareTime("0 0 0 * * ?", "生成模具保养任务", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false)] public async void CreateTask(SpareTimer timer, long count) { try { - var TimeTasks =await timeTaskService.GetTasks(); + var TimeTasks = await timeTaskService.GetTasks(); var timeTaskEntity = TimeTasks.Where(p => p.Id == timer.WorkerName && p.EnabledMark == 1).FirstOrDefault(); if (timeTaskEntity == null) return; @@ -35,12 +26,12 @@ namespace Tnb.TaskScheduler.Listener var ToolMoldMaintainRule = await client.Queryable().Where(p => p.id == comtentModel.parameter.Where(p => p.field == "id").First().value).FirstAsync(); if (ToolMoldMaintainRule == null) return; - var ToolMoldMaintainRuleRelations= await client.Queryable().Where(p => p.rule_id == ToolMoldMaintainRule.id).ToListAsync(); + var ToolMoldMaintainRuleRelations = await client.Queryable().Where(p => p.rule_id == ToolMoldMaintainRule.id).ToListAsync(); if (ToolMoldMaintainRuleRelations.Count() > 0) { var now = DateTime.Now; Random rNum = new Random(); - ToolMoldMaintainPlan toolMoldMaintainPlan=new ToolMoldMaintainPlan(); + ToolMoldMaintainPlan toolMoldMaintainPlan = new ToolMoldMaintainPlan(); toolMoldMaintainPlan.id = SnowflakeIdHelper.NextId(); toolMoldMaintainPlan.plan_code = "JHDM" + now.ToString("yyyyMMdd") + rNum.Next(1000, 9999).ToString(); toolMoldMaintainPlan.mode = ToolMoldMaintainRule.mode; @@ -53,7 +44,7 @@ namespace Tnb.TaskScheduler.Listener foreach (var ToolMoldMaintainRuleRelation in ToolMoldMaintainRuleRelations) { ToolMoldMaintainPlanRelation toolMoldMaintainPlanRelation = new ToolMoldMaintainPlanRelation(); - toolMoldMaintainPlanRelation.id= SnowflakeIdHelper.NextId(); + toolMoldMaintainPlanRelation.id = SnowflakeIdHelper.NextId(); toolMoldMaintainPlanRelation.maintain_plan_id = toolMoldMaintainPlan.id; toolMoldMaintainPlanRelation.mold_id = ToolMoldMaintainRuleRelation.mold_id; toolMoldMaintainPlanRelation.group_id = ToolMoldMaintainRuleRelation.item_group_id; diff --git a/taskschedule/Tnb.TaskScheduler/Listener/PushMsgTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/PushMsgTimeWorker.cs index 0d9a8089..039211fd 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/PushMsgTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/PushMsgTimeWorker.cs @@ -1,6 +1,5 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Dtos.Message; -using JNPF.Common.Enums; using JNPF.Common.Security; using JNPF.Logging; using JNPF.Message.Entitys.Entity; @@ -9,7 +8,6 @@ using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Model; -using JNPF.TaskScheduler.Interfaces.TaskScheduler; using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; @@ -23,14 +21,14 @@ namespace JNPF.TaskScheduler.Listener public class PushMsgTimeWorker : ISpareTimeWorker { private ISqlSugarRepository _repository => App.GetService>(); - + private TimeTaskService _timeTaskService => App.GetService(); private SendMessageService _sendMessageService => App.GetService(); private IUserManager _userManager => App.GetService(); - - + + // [SpareTime(2*60, "推送消息", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false,DoOnce = true)] - [SpareTime("* * * * * ?", "推送消息", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false,DoOnce = true)] + [SpareTime("* * * * * ?", "推送消息", ExecuteType = SpareTimeExecuteTypes.Serial, StartNow = false, DoOnce = true)] public async void PushMsg(SpareTimer timer, long count) { // Log.Information("----------------------开始生成特种设备检验计划----------------------"); @@ -40,14 +38,14 @@ namespace JNPF.TaskScheduler.Listener var db = _repository.AsSugarClient(); BasPushRuleLog basPushRuleLog = await db.Queryable().FirstAsync(x => x.timetask_id == timer.WorkerName); - + if (basPushRuleLog?.is_push == 1) { - BasPushRuleH basPushRuleH = await db.Queryable().FirstAsync(x=>x.id==basPushRuleLog.push_rule_id); - BasPushRuleD basPushRuleD = await db.Queryable().FirstAsync(x=>x.push_rule_id==basPushRuleLog.push_rule_id && x.ordinal==basPushRuleLog.ordinal); - BasPushRuleD nextBasPushRuleD = await db.Queryable().FirstAsync(x=>x.push_rule_id==basPushRuleLog.push_rule_id && x.ordinal==basPushRuleLog.ordinal+1); + BasPushRuleH basPushRuleH = await db.Queryable().FirstAsync(x => x.id == basPushRuleLog.push_rule_id); + BasPushRuleD basPushRuleD = await db.Queryable().FirstAsync(x => x.push_rule_id == basPushRuleLog.push_rule_id && x.ordinal == basPushRuleLog.ordinal); + BasPushRuleD nextBasPushRuleD = await db.Queryable().FirstAsync(x => x.push_rule_id == basPushRuleLog.push_rule_id && x.ordinal == basPushRuleLog.ordinal + 1); - if (basPushRuleH?.enabled==1 && basPushRuleD != null) + if (basPushRuleH?.enabled == 1 && basPushRuleD != null) { TimeTaskEntity timeTaskEntity = await db.Queryable().SingleAsync(x => x.Id == timer.WorkerName); List list = await _sendMessageService.SendTest(basPushRuleD.send_config_id); @@ -57,16 +55,16 @@ namespace JNPF.TaskScheduler.Listener { toUsers.AddRange(JsonConvert.DeserializeObject>(basPushRuleD.user_ids)); } - + if (!string.IsNullOrEmpty(basPushRuleD.position_ids)) { - + toUsers.AddRange(db.Queryable().Where(x => basPushRuleD.position_ids.Contains(x.Id)).Select(s => s.UserId).ToList()); } - + if (!string.IsNullOrEmpty(basPushRuleD.role_ids)) { - + toUsers.AddRange(db.Queryable().Where(x => basPushRuleD.role_ids.Contains(x.Id)).Select(s => s.UserId).ToList()); } @@ -88,7 +86,7 @@ namespace JNPF.TaskScheduler.Listener { DateTime executeTime = DateTime.Now.AddMinutes(nextBasPushRuleD.interval); string cron = $"0 {executeTime.Minute} {executeTime.Hour} {executeTime.Day} {executeTime.Month} ?"; - + var comtentModel = new ContentModel(); var timeTaskComtentModel = JsonConvert.DeserializeObject(timeTaskEntity.ExecuteContent); // comtentModel.cron = (nextBasPushRuleD.interval * 60).ToString(); @@ -107,7 +105,7 @@ namespace JNPF.TaskScheduler.Listener comtentModel.TenantDbName = timeTaskComtentModel?.TenantDbName; comtentModel.ConnectionConfig = timeTaskComtentModel?.ConnectionConfig; comtentModel.Token = timeTaskComtentModel?.Token; - + List nextMessageList = await _sendMessageService.SendTest(nextBasPushRuleD.send_config_id); List messageSendParams = JsonConvert.DeserializeObject>(timeTaskEntity.Description); string paramJson = ""; @@ -115,7 +113,7 @@ namespace JNPF.TaskScheduler.Listener { foreach (var param in item.paramJson) { - var field = messageSendParams.FirstOrDefault(x=>x.fieldName==param.fieldName); + var field = messageSendParams.FirstOrDefault(x => x.fieldName == param.fieldName); if (field != null) { param.value = field.value; @@ -148,20 +146,20 @@ namespace JNPF.TaskScheduler.Listener enabledMark = 1, }; - await _timeTaskService.Create(timeTaskCrInput,false); + await _timeTaskService.Create(timeTaskCrInput, false); TimeTaskEntity timeTaskEntityNew = await db.Queryable().Where(x => x.EnCode == timeTaskCrInput.enCode).FirstAsync(); string newId = timeTaskEntityNew?.Id ?? ""; - + await db.Updateable() - .SetColumns(x=>x.timetask_id==newId) + .SetColumns(x => x.timetask_id == newId) .SetColumns(x => x.ordinal == x.ordinal + 1) - .Where(x=>x.timetask_id==timer.WorkerName).ExecuteCommandAsync(); + .Where(x => x.timetask_id == timer.WorkerName).ExecuteCommandAsync(); } } - + } } - + //进入次方法后删除次定时任务 // _timeTaskService.Delete(timer.WorkerName); SpareTime.Cancel(timer.WorkerName); @@ -173,10 +171,10 @@ namespace JNPF.TaskScheduler.Listener Log.Error(e.Message); } - + // Log.Information("----------------------结束生成特种设备检验计划----------------------"); } - + private List SendTest(string id) { var db = _repository.AsSugarClient(); diff --git a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs index be66dff6..3b041b3c 100644 --- a/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs +++ b/taskschedule/Tnb.TaskScheduler/Listener/QcTaskTimeWorker.cs @@ -1,23 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aop.Api.Domain; -using JNPF; +using JNPF; using JNPF.Common.Security; using JNPF.Systems.Entitys.System; using JNPF.TaskScheduler; -using JNPF.TaskScheduler.Entitys; using JNPF.TaskScheduler.Entitys.Model; using JNPF.TaskScheduler.Interfaces.TaskScheduler; using SqlSugar; -using Tnb.BasicData.Entities; -using Tnb.EquipMgr.Entities; using Tnb.ProductionMgr.Entities; using Tnb.QcMgr.Entities; using Tnb.QcMgr.Entities.Entity; -using TimeTaskEntity = JNPF.TaskScheduler.Entitys.TimeTaskEntity; namespace Tnb.TaskScheduler.Listener { @@ -33,12 +23,12 @@ namespace Tnb.TaskScheduler.Listener { try { - var TimeTasks =await timeTaskService.GetTasks(); + var TimeTasks = await timeTaskService.GetTasks(); var timeTaskEntity = TimeTasks.Where(p => p.Id == timer.WorkerName && p.EnabledMark == 1).FirstOrDefault(); if (timeTaskEntity == null) return; ContentModel? comtentModel = timeTaskEntity.ExecuteContent.ToObject(); - var client= repository.CopyNew(); + var client = repository.CopyNew(); var PlanH = await client.Queryable().Where(p => p.id == comtentModel.parameter.Where(p => p.field == "id").First().value).FirstAsync(); var PlanDs = await client.Queryable().Where(p => p.mainid == PlanH.id).ToListAsync(); if (PlanH == null || PlanDs.Count == 0) diff --git a/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs b/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs index 32d30c37..3261e1ed 100644 --- a/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs +++ b/taskschedule/Tnb.TaskScheduler/TimeTaskService.cs @@ -12,14 +12,12 @@ using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.LinqBuilder; -using JNPF.Schedule; using JNPF.Systems.Interfaces.System; using JNPF.TaskScheduler.Entitys; using JNPF.TaskScheduler.Entitys.Dto.TaskScheduler; using JNPF.TaskScheduler.Entitys.Enum; using JNPF.TaskScheduler.Entitys.Model; using JNPF.TaskScheduler.Interfaces.TaskScheduler; -using JNPF.TimeCrontab; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -149,7 +147,7 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie /// 实体对象. /// [HttpPost("")] - public async Task Create([FromBody] TimeTaskCrInput input,bool startNow = true) + public async Task Create([FromBody] TimeTaskCrInput input, bool startNow = true) { if (await _repository.IsAnyAsync(x => (x.EnCode == input.enCode || x.FullName == input.fullName) && x.DeleteMark == null)) throw Oops.Oh(ErrorCode.COM1004); @@ -168,7 +166,7 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie _ = result ?? throw Oops.Oh(ErrorCode.COM1000); // 添加到任务调度里 - AddTimerJob(result,startNow); + AddTimerJob(result, startNow); //await AddJob(result); } @@ -233,11 +231,11 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie [HttpDelete("{fullName}")] public async Task DeleteByName(string fullName) { - var entitys = await _repository.AsQueryable().Where(p=>p.FullName==fullName).ToListAsync(); + var entitys = await _repository.AsQueryable().Where(p => p.FullName == fullName).ToListAsync(); foreach (var entity in entitys) { - await _repository.AsSugarClient().Deleteable(entity).ExecuteCommandAsync(); - + await _repository.AsSugarClient().Deleteable(entity).ExecuteCommandAsync(); + // 从调度器里取消 SpareTime.Cancel(entity.Id); } @@ -308,7 +306,7 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie // 非多租户模式启动自启任务 if (!KeyVariable.MultiTenancy) { - _repository.AsSugarClient().CopyNew().Queryable().Where(x => x.DeleteMark == null && x.EnabledMark == 1).ToList().ForEach(x=>AddTimerJob(x,false));//modifyby zhoukeda 20230607 + _repository.AsSugarClient().CopyNew().Queryable().Where(x => x.DeleteMark == null && x.EnabledMark == 1).ToList().ForEach(x => AddTimerJob(x, false));//modifyby zhoukeda 20230607 } } @@ -356,7 +354,7 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie /// 新增定时任务. /// /// - private async void AddTimerJob(TimeTaskEntity input,bool startNow = true) + private async void AddTimerJob(TimeTaskEntity input, bool startNow = true) { Action? action = null; ContentModel? comtentModel = input.ExecuteContent.ToObject(); @@ -402,7 +400,7 @@ public class TimeTaskService : ITimeTaskService, IDynamicApiController, ITransie var isRun = comtentModel.endTime.IsNullOrEmpty() ? DateTime.Now >= starTime : DateTime.Now >= starTime && DateTime.Now < endTime; if (isRun) { - nextHandle = ()=>SpareTime.GetCronNextOccurrence(comtentModel.cron); + nextHandle = () => SpareTime.GetCronNextOccurrence(comtentModel.cron); } SpareTime.Do(nextHandle , diff --git a/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj b/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj index 6d63dc6b..64004e32 100644 --- a/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj +++ b/taskschedule/Tnb.TaskScheduler/Tnb.TaskScheduler.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/visualdev/Tnb.Vengine/AppService/BaseAppService.cs b/visualdev/Tnb.Vengine/AppService/BaseAppService.cs index 96f5268e..48475349 100644 --- a/visualdev/Tnb.Vengine/AppService/BaseAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/BaseAppService.cs @@ -3,13 +3,8 @@ // https://git.tuotong-tech.com/tnb/tnb.server // ///////////////////////////////////////////////////////////////////////////////// -using Aspose.Cells.Drawing; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Tnb.Core; -using Tnb.Vengine.Domain; namespace Tnb.Vengine.AppService; diff --git a/visualdev/Tnb.Vengine/AppService/VengineAppService.cs b/visualdev/Tnb.Vengine/AppService/VengineAppService.cs index 26b70109..735622de 100644 --- a/visualdev/Tnb.Vengine/AppService/VengineAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/VengineAppService.cs @@ -40,7 +40,7 @@ public class VengineAppService : BaseAppService, IVengineAppService /// 获取一条 数据信息 /// [HttpGet("api/[area]/[controller]/{vmid}/get")] - public async Task GetAsync(string vmid, [FromQuery]VmGetInput input) + public async Task GetAsync(string vmid, [FromQuery] VmGetInput input) { var vm = await _dataAccess.GetVmodelAsync(vmid, true); VmListInput arg = input.Adapt(); diff --git a/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs b/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs index bf3abee6..750b130d 100644 --- a/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs +++ b/visualdev/Tnb.Vengine/AppService/VengineAppServiceT.cs @@ -4,7 +4,6 @@ ///////////////////////////////////////////////////////////////////////////////// using System.Reflection; -using JNPF.Common.Security; using Mapster; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; diff --git a/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs b/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs index 7ded486e..9cac3067 100644 --- a/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs +++ b/visualdev/Tnb.Vengine/AppService/VmodelAppService.cs @@ -4,7 +4,6 @@ ///////////////////////////////////////////////////////////////////////////////// using JNPF; -using JNPF.Common.Extension; using JNPF.Common.Security; using JNPF.ViewEngine; using Mapster; @@ -48,7 +47,7 @@ public class VmodelAppService : VengineAppService, IVmodelAppService { vm = await _dataAccess.GetVmodelAsync(input.id, para.drill); } - else if(!string.IsNullOrEmpty(para.areaCode) && !string.IsNullOrEmpty(para.vmCode)) + else if (!string.IsNullOrEmpty(para.areaCode) && !string.IsNullOrEmpty(para.vmCode)) { vm = await _dataAccess.GetVmodelAsync(para.areaCode, para.vmCode, para.drill); } diff --git a/visualdev/Tnb.Vengine/CodeGenerator/TemplateContext.cs b/visualdev/Tnb.Vengine/CodeGenerator/TemplateContext.cs index c0d9f40f..b3fc49b9 100644 --- a/visualdev/Tnb.Vengine/CodeGenerator/TemplateContext.cs +++ b/visualdev/Tnb.Vengine/CodeGenerator/TemplateContext.cs @@ -1,5 +1,4 @@ using System.Text.RegularExpressions; -using JNPF.Common.Configuration; namespace Tnb.Vengine; diff --git a/visualdev/Tnb.Vengine/DataAccess/DataAccess.cs b/visualdev/Tnb.Vengine/DataAccess/DataAccess.cs index 22299cdb..bf523801 100644 --- a/visualdev/Tnb.Vengine/DataAccess/DataAccess.cs +++ b/visualdev/Tnb.Vengine/DataAccess/DataAccess.cs @@ -1,10 +1,8 @@ using System.Collections.Concurrent; -using System.Security.Cryptography.Xml; using JNPF; using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.DependencyInjection; -using Microsoft.Extensions.Configuration; using SqlSugar; using Tnb.Core; using Tnb.Vengine.Domain; diff --git a/visualdev/Tnb.Vengine/Domain/VmQueryParser.cs b/visualdev/Tnb.Vengine/Domain/VmQueryParser.cs index 68763d1f..dc1729f7 100644 --- a/visualdev/Tnb.Vengine/Domain/VmQueryParser.cs +++ b/visualdev/Tnb.Vengine/Domain/VmQueryParser.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Extension; +using JNPF.Common.Extension; using Tnb.Vengine.DataAccess; namespace Tnb.Vengine.Domain @@ -100,6 +95,6 @@ namespace Tnb.Vengine.Domain internal class NavigateVmodel { public Vmodel? navModel { get; set; } - public string navPath { get; set; } + public string navPath { get; set; } } } diff --git a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs index 39a3b500..cee6be81 100644 --- a/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs +++ b/visualdev/Tnb.VisualDev.Engine/Core/FormDataParsing.cs @@ -122,7 +122,8 @@ public class FormDataParsing : ITransient { conversionData = data.ToString() + ".".PadRight((int)fieldsModel.precision + 1, '0'); conversionData = conversionData.ParseToDouble();//modifyby zhoukeda 20230605 - }else conversionData = data; + } + else conversionData = data; break; case JnpfKeyConst.JNPFAMOUNT: conversionData = data.ParseToDecimal(); // 金额输入 @@ -525,7 +526,7 @@ public class FormDataParsing : ITransient { if (isShortLink && model.__config__.jnpfKey.Equals(JnpfKeyConst.CREATETIME)) return null; - else if(model.__config__.jnpfKey.Equals(JnpfKeyConst.CREATETIME) || model.__config__.jnpfKey.Equals(JnpfKeyConst.DATE)) + else if (model.__config__.jnpfKey.Equals(JnpfKeyConst.CREATETIME) || model.__config__.jnpfKey.Equals(JnpfKeyConst.DATE)) return res.ToString().ParseToDateTime(); else if (model.__config__.jnpfKey.Equals(JnpfKeyConst.NUMINPUT) || model.__config__.jnpfKey.Equals(JnpfKeyConst.SWITCH))//modify by zhoukeda 2023427 开关默认数字 return res; @@ -1826,7 +1827,7 @@ public class FormDataParsing : ITransient var res = _runService.GetRelationFormList(relationFormModel, listQueryInput).WaitAsync(TimeSpan.FromMinutes(2)).Result; relationFormDataList = res.list.ToList(); _cacheManager.Set(redisName, relationFormDataList, TimeSpan.FromMinutes(10)); // 缓存10分钟 - }); + }); } } @@ -1908,7 +1909,7 @@ public class FormDataParsing : ITransient form.__config__.templateJson.ForEach(x => x.defaultValue = (dataMap.ContainsKey(x.relationField) && dataMap[x.relationField] != null) ? dataMap[x.relationField]?.ToString() : x.defaultValue); _databaseService.ChangeDataBase(_databaseService.GetTenantDbLink(_userManager.TenantId, _userManager.TenantDbName)); var res = _dataInterfaceService.GetResponseByType(form.__config__.propsUrl, 0, string.Empty, new Common.Dtos.VisualDev.VisualDevDataFieldDataListInput() { paramList = form.__config__.templateJson.Adapt>(), pageSize = 500, currentPage = 1 }).Result; - var resList = res.ToObject>>(); + var resList = res.ToObject>>(); if (resList != null && resList.list.Any()) { foreach (object? item in mValue) diff --git a/visualdev/Tnb.VisualDev.Engine/Model/IndexSearchFieldModel.cs b/visualdev/Tnb.VisualDev.Engine/Model/IndexSearchFieldModel.cs index ed53d852..d4ad3ab0 100644 --- a/visualdev/Tnb.VisualDev.Engine/Model/IndexSearchFieldModel.cs +++ b/visualdev/Tnb.VisualDev.Engine/Model/IndexSearchFieldModel.cs @@ -1,5 +1,4 @@ using JNPF.DependencyInjection; -using JNPF.VisualDev.Engine.Model.CodeGen; namespace JNPF.VisualDev.Engine; diff --git a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/IOverideVisualDevService.cs b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/IOverideVisualDevService.cs index 492348c2..84c71918 100644 --- a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/IOverideVisualDevService.cs +++ b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/IOverideVisualDevService.cs @@ -1,43 +1,28 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Extension; -using JNPF.DependencyInjection; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; +using JNPF.DependencyInjection; namespace JNPF.VisualDev { - public interface IVisualDevOverideActionManager : ISingleton - { - void Set(string modelId, IOverideVisualDevService overideVisualDev); + public interface IVisualDevOverideActionManager : ISingleton + { + void Set(string modelId, IOverideVisualDevService overideVisualDev); - IOverideVisualDevService? GetOrDefault(string modelId); - } + IOverideVisualDevService? GetOrDefault(string modelId); + } - public interface IOverideVisualDevService - { - //string ModelId { get; set; } - OverideVisualDevFunc OverideFuncs { get; } + public interface IOverideVisualDevService + { + //string ModelId { get; set; } + OverideVisualDevFunc OverideFuncs { get; } - //Task? GetList(VisualDevModelListQueryInput input); - //Task? GetInfo(string id); - //Task? GetDetails(string id, string modelId); - //Task? Create(VisualDevModelDataCrInput visualdevModelDataCrForm); - //Task? Update(string id, VisualDevModelDataUpInput visualdevModelDataUpForm); - //Task? Delete(string id); - //Task? BatchDelete(VisualDevModelDataBatchDelInput input); - //Task? Export(VisualDevModelListQueryInput input); - //Task? Import(IFormFile file); - } + //Task? GetList(VisualDevModelListQueryInput input); + //Task? GetInfo(string id); + //Task? GetDetails(string id, string modelId); + //Task? Create(VisualDevModelDataCrInput visualdevModelDataCrForm); + //Task? Update(string id, VisualDevModelDataUpInput visualdevModelDataUpForm); + //Task? Delete(string id); + //Task? BatchDelete(VisualDevModelDataBatchDelInput input); + //Task? Export(VisualDevModelListQueryInput input); + //Task? Import(IFormFile file); + } } diff --git a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevAttribute.cs b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevAttribute.cs index 57a8c83a..008b6ee4 100644 --- a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevAttribute.cs +++ b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevAttribute.cs @@ -1,22 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Extension; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace JNPF.VisualDev +namespace JNPF.VisualDev { - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] //modified by ly on 20230428 允许特性在一个类上多重定义 - public class OverideVisualDevAttribute : Attribute - { - public string ModelId { get; set; } - public OverideVisualDevAttribute(string modelId) + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] //modified by ly on 20230428 允许特性在一个类上多重定义 + public class OverideVisualDevAttribute : Attribute { - ModelId = modelId; + public string ModelId { get; set; } + public OverideVisualDevAttribute(string modelId) + { + ModelId = modelId; + } } - } } diff --git a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevFunc.cs b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevFunc.cs index 2b19c03e..accae107 100644 --- a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevFunc.cs +++ b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevFunc.cs @@ -1,34 +1,21 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Dtos.VisualDev; -using JNPF.Common.Extension; -using JNPF.DependencyInjection; -using JNPF.VisualDev.Entitys; +using JNPF.Common.Dtos.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDev; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; -using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; namespace JNPF.VisualDev { - public class OverideVisualDevFunc - { - public Func>? GetListAsync { get; set; } = null; - public Func>? GetAsync { get; set; } = null; - public Func>? GetDetailsAsync { get; set; } = null; - public Func>? CreateAsync { get; set; } = null; - public Func>? UpdateAsync { get; set; } = null; - public Func? DeleteAsync { get; set; } = null; - public Func? DeleteRangeAsync { get; set; } = null; - public Func>? ExportAsync { get; set; } = null; - public Func>? ImportAsync { get; set; } = null; - public Func>? ImportDataAsync { get; set; } = null; + public class OverideVisualDevFunc + { + public Func>? GetListAsync { get; set; } = null; + public Func>? GetAsync { get; set; } = null; + public Func>? GetDetailsAsync { get; set; } = null; + public Func>? CreateAsync { get; set; } = null; + public Func>? UpdateAsync { get; set; } = null; + public Func? DeleteAsync { get; set; } = null; + public Func? DeleteRangeAsync { get; set; } = null; + public Func>? ExportAsync { get; set; } = null; + public Func>? ImportAsync { get; set; } = null; + public Func>? ImportDataAsync { get; set; } = null; } } diff --git a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevManager.cs b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevManager.cs index 0e449307..382635a6 100644 --- a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevManager.cs +++ b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevManager.cs @@ -1,38 +1,28 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Concurrent; using JNPF.Common.Extension; -using JNPF.DependencyInjection; -using JNPF.VisualDev.Entitys; -using JNPF.VisualDev.Interfaces; -using Microsoft.AspNetCore.Mvc.Filters; namespace JNPF.VisualDev { - public class OverideVisualDevManager - { - private static ConcurrentDictionary actions = new ConcurrentDictionary(); - public OverideVisualDevManager() + public class OverideVisualDevManager { - } + private static ConcurrentDictionary actions = new ConcurrentDictionary(); + public OverideVisualDevManager() + { + } - public static IOverideVisualDevService? GetOrDefault(string modelId) - { - var tp = actions.GetOrDefault(modelId); - if (tp != null) { return (IOverideVisualDevService)App.GetService(tp); } - return null; - } + public static IOverideVisualDevService? GetOrDefault(string modelId) + { + var tp = actions.GetOrDefault(modelId); + if (tp != null) { return (IOverideVisualDevService)App.GetService(tp); } + return null; + } - public static void Add(string modelId, Type overideVisualDev) - { - if (!actions.ContainsKey(modelId)) - { - actions.TryAdd(modelId, overideVisualDev); - } + public static void Add(string modelId, Type overideVisualDev) + { + if (!actions.ContainsKey(modelId)) + { + actions.TryAdd(modelId, overideVisualDev); + } + } } - } } diff --git a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevServiceCollectionExtensions.cs b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevServiceCollectionExtensions.cs index f7c72bdd..1ff2eff6 100644 --- a/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevServiceCollectionExtensions.cs +++ b/visualdev/Tnb.VisualDev.Engine/OverideVisualDev/OverideVisualDevServiceCollectionExtensions.cs @@ -4,28 +4,28 @@ using Microsoft.Extensions.DependencyInjection; namespace JNPF.VisualDev { - [SuppressSniffer] - public static class OverideVisualDevServiceCollectionExtensions - { - /// - /// 添加重写在线开发接口的服务 - /// - /// - /// - public static IServiceCollection AddOverideVisualDev(this IServiceCollection services) + [SuppressSniffer] + public static class OverideVisualDevServiceCollectionExtensions { - var actions = App.EffectiveTypes.Where(u => u.IsClass && !u.IsInterface && !u.IsAbstract && typeof(IOverideVisualDevService).IsAssignableFrom(u)).ToList(); - foreach (var item in actions) - { - var attr = item.GetAttribute(); - if (attr != null) + /// + /// 添加重写在线开发接口的服务 + /// + /// + /// + public static IServiceCollection AddOverideVisualDev(this IServiceCollection services) { - OverideVisualDevManager.Add(attr.ModelId, item); + var actions = App.EffectiveTypes.Where(u => u.IsClass && !u.IsInterface && !u.IsAbstract && typeof(IOverideVisualDevService).IsAssignableFrom(u)).ToList(); + foreach (var item in actions) + { + var attr = item.GetAttribute(); + if (attr != null) + { + OverideVisualDevManager.Add(attr.ModelId, item); + } + } + + return services; } - } - return services; } - - } } diff --git a/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/CodeGenControlsAttributeHelper.cs b/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/CodeGenControlsAttributeHelper.cs index 876c77ac..f615e5bc 100644 --- a/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/CodeGenControlsAttributeHelper.cs +++ b/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/CodeGenControlsAttributeHelper.cs @@ -1,5 +1,4 @@ -using Aop.Api.Domain; -using JNPF.Common.Const; +using JNPF.Common.Const; using JNPF.Common.Extension; using JNPF.Common.Models; using JNPF.Common.Models.Authorize; diff --git a/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/GetCodeGenIndexButtonHelper.cs b/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/GetCodeGenIndexButtonHelper.cs index bbef17b2..0e68e27f 100644 --- a/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/GetCodeGenIndexButtonHelper.cs +++ b/visualdev/Tnb.VisualDev.Engine/Security/BackEnd/GetCodeGenIndexButtonHelper.cs @@ -1,6 +1,4 @@ -using Microsoft.AspNetCore.Components.Forms; - -namespace JNPF.VisualDev.Engine.Security; +namespace JNPF.VisualDev.Engine.Security; /// /// 代码生成列表按钮帮助类. diff --git a/visualdev/Tnb.VisualDev.Engine/Tnb.VisualDev.Engine.csproj b/visualdev/Tnb.VisualDev.Engine/Tnb.VisualDev.Engine.csproj index 178ed887..39aadc75 100644 --- a/visualdev/Tnb.VisualDev.Engine/Tnb.VisualDev.Engine.csproj +++ b/visualdev/Tnb.VisualDev.Engine/Tnb.VisualDev.Engine.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/visualdev/Tnb.VisualDev.Entitys/Dto/Dashboard/EmailHomeOutput.cs b/visualdev/Tnb.VisualDev.Entitys/Dto/Dashboard/EmailHomeOutput.cs new file mode 100644 index 00000000..2a01b2ec --- /dev/null +++ b/visualdev/Tnb.VisualDev.Entitys/Dto/Dashboard/EmailHomeOutput.cs @@ -0,0 +1,22 @@ +using JNPF.DependencyInjection; + +namespace JNPF.VisualDev.Entitys.Dto.Dashboard; + +[SuppressSniffer] +public class EmailHomeOutput +{ + /// + /// ID. + /// + public string? id { get; set; } + + /// + /// 标题. + /// + public string? fullName { get; set; } + + /// + /// 创建时间. + /// + public DateTime? creatorTime { get; set; } +} diff --git a/visualdev/Tnb.VisualDev.Entitys/Dto/Screen/ScreenInfoOutput.cs b/visualdev/Tnb.VisualDev.Entitys/Dto/Screen/ScreenInfoOutput.cs index e558c49d..dfde724f 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Dto/Screen/ScreenInfoOutput.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Dto/Screen/ScreenInfoOutput.cs @@ -1,6 +1,4 @@ -using System; - -namespace JNPF.VisualData.Entitys.Dto.Screen; +namespace JNPF.VisualData.Entitys.Dto.Screen; /// /// 大屏信息输出. diff --git a/visualdev/Tnb.VisualDev.Entitys/Dto/VisualDevModelData/VisualDevModelListQueryInput.cs b/visualdev/Tnb.VisualDev.Entitys/Dto/VisualDevModelData/VisualDevModelListQueryInput.cs index 5a28bb9a..5463d159 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Dto/VisualDevModelData/VisualDevModelListQueryInput.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Dto/VisualDevModelData/VisualDevModelListQueryInput.cs @@ -26,7 +26,7 @@ public class VisualDevModelListQueryInput : PageInputBase /// 高级查询. /// public virtual string superQueryJson { get; set; } - // TODO 不能放在这里 + // TODO 不能放在这里 /// /// 工位编码 /// diff --git a/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs b/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs new file mode 100644 index 00000000..ab28635e --- /dev/null +++ b/visualdev/Tnb.VisualDev.Entitys/Entity/EmailReceiveEntity.cs @@ -0,0 +1,93 @@ +using JNPF.Common.Contracts; +using SqlSugar; + +namespace JNPF.VisualDev.Entitys; + +/// +/// 邮件接收 +/// 版 本:V3.2 +/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com) +/// 作 者:JNPF开发平台组 +/// 日 期:2021-06-01. +/// +[SugarTable("EXT_EMAILRECEIVE")] +public class EmailReceiveEntity : CLDEntityBase +{ + /// + /// 类型:【1-外部、0-内部】. + /// + [SugarColumn(ColumnName = "F_TYPE")] + public int? Type { get; set; } + + /// + /// 邮箱账户. + /// + [SugarColumn(ColumnName = "F_MACCOUNT")] + public string? MAccount { get; set; } + + /// + /// MID. + /// + [SugarColumn(ColumnName = "F_MID")] + public string? MID { get; set; } + + /// + /// 发件人. + /// + [SugarColumn(ColumnName = "F_SENDER")] + public string? Sender { get; set; } + + /// + /// 发件人名称. + /// + [SugarColumn(ColumnName = "F_SENDERNAME")] + public string? SenderName { get; set; } + + /// + /// 主题. + /// + [SugarColumn(ColumnName = "F_SUBJECT")] + public string? Subject { get; set; } + + /// + /// 正文. + /// + [SugarColumn(ColumnName = "F_BODYTEXT")] + public string? BodyText { get; set; } + + /// + /// 附件. + /// + [SugarColumn(ColumnName = "F_ATTACHMENT")] + public string? Attachment { get; set; } + + /// + /// 阅读. + /// + [SugarColumn(ColumnName = "F_READ")] + public int? Read { get; set; } + + /// + /// Date. + /// + [SugarColumn(ColumnName = "F_DATE")] + public DateTime? Date { get; set; } + + /// + /// 星标. + /// + [SugarColumn(ColumnName = "F_STARRED")] + public int? Starred { get; set; } + + /// + /// 描述. + /// + [SugarColumn(ColumnName = "F_DESCRIPTION")] + public string? Description { get; set; } + + /// + /// 排序码. + /// + [SugarColumn(ColumnName = "F_SORTCODE")] + public long? SortCode { get; set; } +} diff --git a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualCategoryEntity.cs b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualCategoryEntity.cs index 5a2de0b2..25c3323f 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualCategoryEntity.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualCategoryEntity.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Const; -using SqlSugar; +using SqlSugar; namespace JNPF.VisualData.Entity; diff --git a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualEntity.cs b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualEntity.cs index 72c425c6..bcb06dd4 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Entity/VisualEntity.cs +++ b/visualdev/Tnb.VisualDev.Entitys/Entity/VisualEntity.cs @@ -1,6 +1,5 @@ using JNPF.Common.Const; using SqlSugar; -using System; using Yitter.IdGenerator; namespace JNPF.VisualData.Entity; @@ -92,7 +91,7 @@ public class VisualEntity var userId = App.User.FindFirst(ClaimConst.CLAINMUSERID)?.Value; this.CreateTime = DateTime.Now; this.Id = YitIdHelper.NextId().ToString(); - this.BackgroundUrl = (this.BackgroundUrl == null || this.BackgroundUrl == string.Empty)? "/api/file/VisusalImg/bg/bg1.png" : this.BackgroundUrl; + this.BackgroundUrl = (this.BackgroundUrl == null || this.BackgroundUrl == string.Empty) ? "/api/file/VisusalImg/bg/bg1.png" : this.BackgroundUrl; this.IsDeleted = 0; this.Status = 1; if (!string.IsNullOrEmpty(userId)) diff --git a/visualdev/Tnb.VisualDev.Entitys/Tnb.VisualDev.Entitys.csproj b/visualdev/Tnb.VisualDev.Entitys/Tnb.VisualDev.Entitys.csproj index 08bcb7bf..91e9762b 100644 --- a/visualdev/Tnb.VisualDev.Entitys/Tnb.VisualDev.Entitys.csproj +++ b/visualdev/Tnb.VisualDev.Entitys/Tnb.VisualDev.Entitys.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/visualdev/Tnb.VisualDev.Interfaces/Tnb.VisualDev.Interfaces.csproj b/visualdev/Tnb.VisualDev.Interfaces/Tnb.VisualDev.Interfaces.csproj index dbf40cd5..b05836bd 100644 --- a/visualdev/Tnb.VisualDev.Interfaces/Tnb.VisualDev.Interfaces.csproj +++ b/visualdev/Tnb.VisualDev.Interfaces/Tnb.VisualDev.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/visualdev/Tnb.VisualDev/CodeGen/DataParsing/ControlParsing.cs b/visualdev/Tnb.VisualDev/CodeGen/DataParsing/ControlParsing.cs index 3d5e91ba..e06593b5 100644 --- a/visualdev/Tnb.VisualDev/CodeGen/DataParsing/ControlParsing.cs +++ b/visualdev/Tnb.VisualDev/CodeGen/DataParsing/ControlParsing.cs @@ -1,20 +1,20 @@ using JNPF.Common.Const; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Security; using JNPF.DependencyInjection; +using JNPF.RemoteRequest.Extensions; +using JNPF.Systems.Entitys.Model.DataInterFace; using JNPF.Systems.Entitys.Permission; +using JNPF.Systems.Entitys.System; +using JNPF.Systems.Interfaces.System; using JNPF.VisualDev.Engine; -using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Entitys; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Interfaces; using Newtonsoft.Json.Linq; using SqlSugar; -using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; -using JNPF.RemoteRequest.Extensions; -using JNPF.Systems.Entitys.Model.DataInterFace; -using JNPF.Common.Core.Manager; namespace JNPF.Common.CodeGen.DataParsing; diff --git a/visualdev/Tnb.VisualDev/CodeGenService.cs b/visualdev/Tnb.VisualDev/CodeGenService.cs index 489d1922..96e00624 100644 --- a/visualdev/Tnb.VisualDev/CodeGenService.cs +++ b/visualdev/Tnb.VisualDev/CodeGenService.cs @@ -1,4 +1,6 @@ -using JNPF.Common.Configuration; +using System.IO.Compression; +using System.Text; +using JNPF.Common.Configuration; using JNPF.Common.Const; using JNPF.Common.Core.Manager; using JNPF.Common.Enums; @@ -21,10 +23,7 @@ using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.CodeGen; using JNPF.VisualDev.Entitys.Enum; using Microsoft.AspNetCore.Mvc; -using NPOI.Util; using SqlSugar; -using System.IO.Compression; -using System.Text; namespace JNPF.CodeGen; @@ -393,7 +392,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, NameSpace = formDataModel.areasName, @@ -528,7 +528,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { string tContent = File.ReadAllText(templatePathList[i]); - string tResult = _viewEngine.RunCompileFromCached(tContent, new { + string tResult = _viewEngine.RunCompileFromCached(tContent, new + { NameSpace = codeGenConfigModel.NameSpace, BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, @@ -648,7 +649,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, NameSpace = formDataModel.areasName, @@ -773,7 +775,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (var i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { NameSpace = codeGenConfigModel.NameSpace, BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, @@ -904,7 +907,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, NameSpace = formDataModel.areasName, @@ -984,7 +988,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, NameSpace = formDataModel.areasName, @@ -1117,7 +1122,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { string tContent = File.ReadAllText(templatePathList[i]); - string tResult = _viewEngine.RunCompileFromCached(tContent, new { + string tResult = _viewEngine.RunCompileFromCached(tContent, new + { NameSpace = codeGenConfigModel.NameSpace, BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, @@ -1272,7 +1278,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (var i = 0; i < templatePathList.Count; i++) { var tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { NameSpace = codeGenConfigModel.NameSpace, BusName = codeGenConfigModel.BusName, ClassName = codeGenConfigModel.ClassName, @@ -1558,7 +1565,8 @@ public class CodeGenService : IDynamicApiController, ITransient for (int i = 0; i < templatePathList.Count; i++) { string tContent = File.ReadAllText(templatePathList[i]); - var tResult = _viewEngine.RunCompileFromCached(tContent, new { + var tResult = _viewEngine.RunCompileFromCached(tContent, new + { NameSpace = frondEndGenConfig.NameSpace, ClassName = frondEndGenConfig.ClassName, FormRef = frondEndGenConfig.FormRef, diff --git a/visualdev/Tnb.VisualDev/DashboardService.cs b/visualdev/Tnb.VisualDev/DashboardService.cs index 5783aa08..a8c6dcee 100644 --- a/visualdev/Tnb.VisualDev/DashboardService.cs +++ b/visualdev/Tnb.VisualDev/DashboardService.cs @@ -1,10 +1,9 @@ using JNPF.Common.Core.Manager; using JNPF.DependencyInjection; using JNPF.DynamicApiController; -using JNPF.Extend.Entitys; -using JNPF.Extend.Entitys.Dto.Email; using JNPF.Message.Entitys; using JNPF.Message.Interfaces.Message; +using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.Dashboard; using JNPF.WorkFlow.Entitys.Entity; using JNPF.WorkFlow.Interfaces.Repository; diff --git a/visualdev/Tnb.VisualDev/HmiService.cs b/visualdev/Tnb.VisualDev/HmiService.cs index 58e53dd9..240ed82d 100644 --- a/visualdev/Tnb.VisualDev/HmiService.cs +++ b/visualdev/Tnb.VisualDev/HmiService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aspose.Cells; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; using JNPF.DynamicApiController; using Microsoft.AspNetCore.Mvc; diff --git a/visualdev/Tnb.VisualDev/PortalService.cs b/visualdev/Tnb.VisualDev/PortalService.cs index 709275c9..127de427 100644 --- a/visualdev/Tnb.VisualDev/PortalService.cs +++ b/visualdev/Tnb.VisualDev/PortalService.cs @@ -3,14 +3,12 @@ using JNPF.Common.Core.Manager.Files; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Filter; -using JNPF.Common.Models.User; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.Common; using JNPF.VisualDev.Entitys; using JNPF.VisualDev.Entitys.Dto.Portal; using JNPF.VisualDev.Entitys.Dto.VisualDev; @@ -169,7 +167,7 @@ public class PortalService : IDynamicApiController, ITransient { if (_userManager.Roles != null && !_userManager.IsAdministrator) { - List? roleId = await _portalRepository.AsSugarClient().Queryable().Where(r =>_userManager.Roles.Contains(r.Id)).Where(r => r.EnabledMark == 1 && r.DeleteMark == null).Select(r => r.Id).ToListAsync(); + List? roleId = await _portalRepository.AsSugarClient().Queryable().Where(r => _userManager.Roles.Contains(r.Id)).Where(r => r.EnabledMark == 1 && r.DeleteMark == null).Select(r => r.Id).ToListAsync(); var items = await _portalRepository.AsSugarClient().Queryable().Where(a => roleId.Contains(a.ObjectId)).Where(a => a.ItemType == "portal").GroupBy(it => new { it.ItemId }).Select(it => new { it.ItemId }).ToListAsync(); if (items.Count == 0) return null; PortalEntity? entity = await _portalRepository.AsQueryable().Where(p => items.Select(it => it.ItemId).Contains(p.Id)).SingleAsync(p => p.Id == id && p.EnabledMark == 1 && p.DeleteMark == null); diff --git a/visualdev/Tnb.VisualDev/RunService.cs b/visualdev/Tnb.VisualDev/RunService.cs index 3bef9517..59bc6a60 100644 --- a/visualdev/Tnb.VisualDev/RunService.cs +++ b/visualdev/Tnb.VisualDev/RunService.cs @@ -1,5 +1,4 @@ using System.Data; -using System.Text; using System.Text.RegularExpressions; using JNPF.Common.Const; using JNPF.Common.Core.Manager; @@ -14,7 +13,6 @@ using JNPF.DependencyInjection; using JNPF.FriendlyException; using JNPF.JsonSerialization; using JNPF.RemoteRequest.Extensions; -using JNPF.Systems.Entitys.Dto.Authorize; using JNPF.Systems.Entitys.Model.DataBase; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; @@ -824,7 +822,7 @@ public class RunService : IRunService, ITransient if (child.Key.Equals("id") && child.Value.IsNotEmptyOrNull()) { //modify by ly on 20230720 判断如果子表主键为空的把原主键值赋值给子表主键,直接复制会导致主键重复 - if(tableField[childPrimary.field].IsNull() || tableField[childPrimary.field].ToString().IsNullOrEmpty()) + if (tableField[childPrimary.field].IsNull() || tableField[childPrimary.field].ToString().IsNullOrEmpty()) { tableField[childPrimary.field] = child.Value; } diff --git a/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj b/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj index 20d4ac1d..bf53fff4 100644 --- a/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj +++ b/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj @@ -12,7 +12,6 @@ - diff --git a/visualdev/Tnb.VisualDev/VisualDevService.cs b/visualdev/Tnb.VisualDev/VisualDevService.cs index 0d9ca71d..2d9166bc 100644 --- a/visualdev/Tnb.VisualDev/VisualDevService.cs +++ b/visualdev/Tnb.VisualDev/VisualDevService.cs @@ -723,9 +723,9 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans moduleModel.ModuleId = input.id; moduleModel.ParentId = oldWebModule != null ? oldWebModule.ParentId : (input.pcModuleParentId.Equals(input.pcSystemId) ? "-1" : input.pcModuleParentId); // 父级菜单节点 moduleModel.Category = "Web"; - moduleModel.FullName = oldWebModule!=null ? oldWebModule.FullName : entity.FullName; //modifyby zhoukeda 发布功能不更新名称排序图标 + moduleModel.FullName = oldWebModule != null ? oldWebModule.FullName : entity.FullName; //modifyby zhoukeda 发布功能不更新名称排序图标 moduleModel.EnCode = entity.EnCode; - moduleModel.Icon = oldWebModule!=null ? oldWebModule.Icon : "icon-ym icon-ym-webForm"; //modifyby zhoukeda 发布功能不更新名称排序图标 + moduleModel.Icon = oldWebModule != null ? oldWebModule.Icon : "icon-ym icon-ym-webForm"; //modifyby zhoukeda 发布功能不更新名称排序图标 moduleModel.UrlAddress = oldWebModule != null ? oldWebModule.UrlAddress : "model/" + entity.EnCode; moduleModel.Type = 3; moduleModel.EnabledMark = 1; @@ -789,7 +789,8 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans SortCode = 0 }); }); - ctList.ForEach(item => { + ctList.ForEach(item => + { formAuth.Add(new ModuleFormEntity() { @@ -993,7 +994,8 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans SortCode = 0 }); }); - ctList.ForEach(item => { + ctList.ForEach(item => + { formAuth.Add(new ModuleFormEntity() { diff --git a/workflow/Tnb.WorkFlow.Entitys/Dto/FlowBefore/FlowBeforeInfoOutput.cs b/workflow/Tnb.WorkFlow.Entitys/Dto/FlowBefore/FlowBeforeInfoOutput.cs index 174aaa20..00eb6ebd 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Dto/FlowBefore/FlowBeforeInfoOutput.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Dto/FlowBefore/FlowBeforeInfoOutput.cs @@ -31,7 +31,7 @@ public class FlowBeforeInfoOutput /// /// 流程任务节点. /// - public List? flowTaskNodeList { get; set; }=new List(){ }; + public List? flowTaskNodeList { get; set; } = new List() { }; /// /// 流程任务经办. diff --git a/workflow/Tnb.WorkFlow.Entitys/Dto/FlowMonitor/FlowMonitorListOutput.cs b/workflow/Tnb.WorkFlow.Entitys/Dto/FlowMonitor/FlowMonitorListOutput.cs index 433c3b96..155724c9 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Dto/FlowMonitor/FlowMonitorListOutput.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Dto/FlowMonitor/FlowMonitorListOutput.cs @@ -78,7 +78,7 @@ public class FlowMonitorListOutput /// /// 用户名称. /// - public string? userName{ get; set; } + public string? userName { get; set; } /// /// 描述. diff --git a/workflow/Tnb.WorkFlow.Entitys/Dto/WorkFlowForm/LeaveApply/LeaveApplyInput.cs b/workflow/Tnb.WorkFlow.Entitys/Dto/WorkFlowForm/LeaveApply/LeaveApplyInput.cs index 81f65fbf..99db178c 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Dto/WorkFlowForm/LeaveApply/LeaveApplyInput.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Dto/WorkFlowForm/LeaveApply/LeaveApplyInput.cs @@ -1,5 +1,4 @@ -using JNPF.Common.Models.WorkFlow; -using JNPF.DependencyInjection; +using JNPF.DependencyInjection; namespace JNPF.WorkFlow.Entitys.Dto.WorkFlowForm.LeaveApply; diff --git a/workflow/Tnb.WorkFlow.Entitys/Entity/WorkFlowForm/SalesOrderEntryEntity.cs b/workflow/Tnb.WorkFlow.Entitys/Entity/WorkFlowForm/SalesOrderEntryEntity.cs index 8e351a68..08e03ba9 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Entity/WorkFlowForm/SalesOrderEntryEntity.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Entity/WorkFlowForm/SalesOrderEntryEntity.cs @@ -4,11 +4,11 @@ using SqlSugar; namespace JNPF.WorkFlow.Entitys { -    /// + /// /// 订单明细 /// 版 本:V3.2 /// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com) - /// 日 期:2018-07-23 . + /// 日 期:2018-07-23 . /// [SugarTable("WFORM_SALESORDERENTRY")] [Tenant(ClaimConst.TENANTID)] diff --git a/workflow/Tnb.WorkFlow.Entitys/Mapper/Mapper.cs b/workflow/Tnb.WorkFlow.Entitys/Mapper/Mapper.cs index d4e015e7..708d3ec9 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Mapper/Mapper.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Mapper/Mapper.cs @@ -1,7 +1,6 @@ using JNPF.Common.Extension; using JNPF.WorkFlow.Entitys.Dto.FlowBefore; using JNPF.WorkFlow.Entitys.Dto.FlowEngine; -using JNPF.WorkFlow.Entitys.Dto.FlowLaunch; using JNPF.WorkFlow.Entitys.Entity; using JNPF.WorkFlow.Entitys.Model; using JNPF.WorkFlow.Entitys.Model.Properties; diff --git a/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/FuncConfig.cs b/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/FuncConfig.cs index 51fea2ee..c08125d3 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/FuncConfig.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/FuncConfig.cs @@ -1,6 +1,5 @@ using JNPF.Common.Dtos.Message; using JNPF.DependencyInjection; -using JNPF.WorkFlow.Entitys.Model.Item; namespace JNPF.WorkFlow.Entitys.Model.Conifg; diff --git a/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/MsgConfig.cs b/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/MsgConfig.cs index c5bb453a..3ebe56fb 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/MsgConfig.cs +++ b/workflow/Tnb.WorkFlow.Entitys/Model/Conifg/MsgConfig.cs @@ -1,6 +1,5 @@ using JNPF.Common.Dtos.Message; using JNPF.DependencyInjection; -using JNPF.WorkFlow.Entitys.Model.Item; namespace JNPF.WorkFlow.Entitys.Model.Conifg; diff --git a/workflow/Tnb.WorkFlow.Entitys/Tnb.WorkFlow.Entitys.csproj b/workflow/Tnb.WorkFlow.Entitys/Tnb.WorkFlow.Entitys.csproj index 7efd33cf..1d28267e 100644 --- a/workflow/Tnb.WorkFlow.Entitys/Tnb.WorkFlow.Entitys.csproj +++ b/workflow/Tnb.WorkFlow.Entitys/Tnb.WorkFlow.Entitys.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTaskService.cs b/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTaskService.cs index dfa9b3db..2fc7ea15 100644 --- a/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTaskService.cs +++ b/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTaskService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JNPF.Common.Models.WorkFlow; +using JNPF.Common.Models.WorkFlow; namespace JNPF.WorkFlow.Interfaces.Service { diff --git a/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTemplateService.cs b/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTemplateService.cs index 49a2f0c2..79b3ff2b 100644 --- a/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTemplateService.cs +++ b/workflow/Tnb.WorkFlow.Interfaces/Service/IFlowTemplateService.cs @@ -1,5 +1,4 @@ -using JNPF.WorkFlow.Entitys.Dto.FlowEngine; -using JNPF.WorkFlow.Entitys.Dto.FlowTemplate; +using JNPF.WorkFlow.Entitys.Dto.FlowTemplate; namespace JNPF.WorkFlow.Interfaces.Service; diff --git a/workflow/Tnb.WorkFlow.Interfaces/Service/ILeaveApplyService.cs b/workflow/Tnb.WorkFlow.Interfaces/Service/ILeaveApplyService.cs index 53c898fb..5837bde0 100644 --- a/workflow/Tnb.WorkFlow.Interfaces/Service/ILeaveApplyService.cs +++ b/workflow/Tnb.WorkFlow.Interfaces/Service/ILeaveApplyService.cs @@ -1,6 +1,4 @@ -using System.Threading.Tasks; - -namespace JNPF.WorkFlow.Interfaces.Service; +namespace JNPF.WorkFlow.Interfaces.Service; /// /// 请假申请 diff --git a/workflow/Tnb.WorkFlow.Interfaces/Tnb.WorkFlow.Interfaces.csproj b/workflow/Tnb.WorkFlow.Interfaces/Tnb.WorkFlow.Interfaces.csproj index e5f53fe4..f6218d45 100644 --- a/workflow/Tnb.WorkFlow.Interfaces/Tnb.WorkFlow.Interfaces.csproj +++ b/workflow/Tnb.WorkFlow.Interfaces/Tnb.WorkFlow.Interfaces.csproj @@ -1,5 +1,4 @@ - net6.0 diff --git a/workflow/Tnb.WorkFlow/Manager/FlowTaskMsgUtil.cs b/workflow/Tnb.WorkFlow/Manager/FlowTaskMsgUtil.cs index f4ea1ecf..6c5815d9 100644 --- a/workflow/Tnb.WorkFlow/Manager/FlowTaskMsgUtil.cs +++ b/workflow/Tnb.WorkFlow/Manager/FlowTaskMsgUtil.cs @@ -61,7 +61,7 @@ public class FlowTaskMsgUtil //默认消息 if (msgConfig.on == 3) { - var crUser =await _usersService.GetUserName(flowTaskParamter.flowTaskEntity.CreatorUserId, false); + var crUser = await _usersService.GetUserName(flowTaskParamter.flowTaskEntity.CreatorUserId, false); var flowName = _flowTaskRepository.GetFlowTemplateJsonInfo(x => x.Id == flowTaskParamter.flowTaskEntity.FlowId).FullName; await _sendMessageService.SendMessageDefult(enCode, users, crUser, flowName, bodyDic); } @@ -164,7 +164,8 @@ public class FlowTaskMsgUtil { foreach (var item in flowTaskOperatorEntities) { - var value = new { + var value = new + { enCode = flowTaskParamter.flowTaskEntity.FlowCode, flowId = flowTaskParamter.flowTaskEntity.FlowId, status = type == 1 ? 0 : 1, @@ -184,7 +185,8 @@ public class FlowTaskMsgUtil } else { - var value = new { + var value = new + { enCode = flowTaskParamter.flowTaskEntity.FlowCode, flowId = flowTaskParamter.flowTaskEntity.FlowId, status = type == 1 ? 0 : 1, diff --git a/workflow/Tnb.WorkFlow/Manager/FlowTaskOtherUtil.cs b/workflow/Tnb.WorkFlow/Manager/FlowTaskOtherUtil.cs index 1b441c1e..d28500c2 100644 --- a/workflow/Tnb.WorkFlow/Manager/FlowTaskOtherUtil.cs +++ b/workflow/Tnb.WorkFlow/Manager/FlowTaskOtherUtil.cs @@ -364,7 +364,7 @@ public class FlowTaskOtherUtil { try { - var value=jobj[timeOutConfig.formField].ToString(); + var value = jobj[timeOutConfig.formField].ToString(); if (!DateTime.TryParse(value, out dt)) { dt = jobj[timeOutConfig.formField].ParseToLong().TimeStampToDateTime(); @@ -417,12 +417,12 @@ public class FlowTaskOtherUtil { mapRule = GetMapRule(approversPro.assignList, flowTaskParamter.flowTaskNodeEntity.NodeCode); } - var data =await _runService.GetFlowFormDataDetails(thisFormId, flowTaskParamter.flowTaskEntity.Id); + var data = await _runService.GetFlowFormDataDetails(thisFormId, flowTaskParamter.flowTaskEntity.Id); if (!data.ContainsKey("flowId"))//modifyby zhoukeda 20230704 { - if (((Dictionary)flowTaskParamter.formData).TryGetValue("flowId",out var value)) + if (((Dictionary)flowTaskParamter.formData).TryGetValue("flowId", out var value)) { - data.Add("flowId",value); + data.Add("flowId", value); } } var nextFormData = await _runService.SaveDataToDataByFId(thisFormId, nextFormId, mapRule, data); diff --git a/workflow/Tnb.WorkFlow/Repository/FlowTaskRepository.cs b/workflow/Tnb.WorkFlow/Repository/FlowTaskRepository.cs index 7c8aaaf4..9f73b929 100644 --- a/workflow/Tnb.WorkFlow/Repository/FlowTaskRepository.cs +++ b/workflow/Tnb.WorkFlow/Repository/FlowTaskRepository.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Core.Manager; +using System.Linq.Expressions; +using JNPF.Common.Core.Manager; using JNPF.Common.Extension; using JNPF.Common.Filter; using JNPF.Common.Models.WorkFlow; @@ -21,7 +22,6 @@ using JNPF.WorkFlow.Entitys.Model.Properties; using JNPF.WorkFlow.Interfaces.Repository; using Mapster; using SqlSugar; -using System.Linq.Expressions; namespace JNPF.WorkFlow.Repository; @@ -512,7 +512,8 @@ public class FlowTaskRepository : IFlowTaskRepository, ITransient var output = new List(); foreach (var item in list.GroupBy(x => x.TemplateId)) { - output.Add(new { + output.Add(new + { id = item.Key, fullName = string.Format("{0}({1})", item.FirstOrDefault().FlowName, item.Count()), count = item.Count() @@ -1390,7 +1391,7 @@ public class FlowTaskRepository : IFlowTaskRepository, ITransient userName = SqlFunc.Subqueryable().Where(u => u.Id == a.HandleId).Select(u => SqlFunc.MergeString(u.RealName, "/", u.Account)), operatorId = SqlFunc.Subqueryable().Where(u => u.Id == a.OperatorId).Select(u => SqlFunc.MergeString(u.RealName, "/", u.Account)), // creatorTime = SqlFunc.IsNullOrEmpty(b.CreatorTime) ? a.HandleTime : b.CreatorTime, - creatorTime = b.CreatorTime==null ? a.HandleTime : b.CreatorTime, //modifyby zhoukeda 20230704 + creatorTime = b.CreatorTime == null ? a.HandleTime : b.CreatorTime, //modifyby zhoukeda 20230704 fileList = a.FileList }).ToListAsync(); } diff --git a/workflow/Tnb.WorkFlow/Service/FlowBeforeService.cs b/workflow/Tnb.WorkFlow/Service/FlowBeforeService.cs index b4a66a95..55e8dbc9 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowBeforeService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowBeforeService.cs @@ -194,7 +194,7 @@ public class FlowBeforeService : IDynamicApiController, ITransient var flowJson = _flowTaskRepository.GetFlowTemplateJsonInfo(x => x.Id == item.FlowId && x.DeleteMark == null); if (flowJson.IsNotEmptyOrNull()) { - output.Add(new { id = flowJson.Id, fullName =string.Format("{0}(v{1})", flowJson.FullName, flowJson.Version), flowTemplateJson= flowJson.FlowTemplateJson }); + output.Add(new { id = flowJson.Id, fullName = string.Format("{0}(v{1})", flowJson.FullName, flowJson.Version), flowTemplateJson = flowJson.FlowTemplateJson }); } } return output.Distinct(); @@ -304,7 +304,7 @@ public class FlowBeforeService : IDynamicApiController, ITransient [HttpGet("Suspend/{taskId}")] public async Task Suspend(string taskId) { - return await _flowTaskRepository.AnyFlowTask(x => x.ParentId == taskId && x.IsAsync == 1 && x.DeleteMark == null); + return await _flowTaskRepository.AnyFlowTask(x => x.ParentId == taskId && x.IsAsync == 1 && x.DeleteMark == null); } #endregion @@ -491,7 +491,7 @@ public class FlowBeforeService : IDynamicApiController, ITransient /// 审批参数. /// [HttpPost("Suspend/{taskId}")] - public async Task Suspend(string taskId,[FromBody] FlowHandleModel flowHandleModel) + public async Task Suspend(string taskId, [FromBody] FlowHandleModel flowHandleModel) { var flowTaskParamter = await _flowTaskRepository.GetTaskParamterByTaskId(taskId, flowHandleModel); await _flowTaskManager.Suspend(flowTaskParamter); diff --git a/workflow/Tnb.WorkFlow/Service/FlowDelegateService.cs b/workflow/Tnb.WorkFlow/Service/FlowDelegateService.cs index d12b1df6..4908953f 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowDelegateService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowDelegateService.cs @@ -182,7 +182,7 @@ public class FlowDelegateService : IDynamicApiController, ITransient public async Task GetFlowList([FromQuery] string flowId) { var userList = await _repository.AsSugarClient() - .Queryable((a, b, c) => new JoinQueryInfos(JoinType.Left, b.FlowId.Contains(a.TemplateId)||b.FlowName=="全部流程", JoinType.Left, b.UserId == c.Id)) + .Queryable((a, b, c) => new JoinQueryInfos(JoinType.Left, b.FlowId.Contains(a.TemplateId) || b.FlowName == "全部流程", JoinType.Left, b.UserId == c.Id)) .Where((a, b, c) => a.Id == flowId && b.Type == "0" && b.ToUserId == _userManager.UserId && b.EndTime > DateTime.Now && b.StartTime < DateTime.Now).Select((a, b, c) => new UserListOutput { id = c.Id, diff --git a/workflow/Tnb.WorkFlow/Service/FlowEngineService.cs b/workflow/Tnb.WorkFlow/Service/FlowEngineService.cs index 802cddc3..839561b9 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowEngineService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowEngineService.cs @@ -147,7 +147,7 @@ public class FlowEngineService : IFlowEngineService, IDynamicApiController, ITra data = data.FindAll(o => o.fullName.Contains(input.keyword) || o.enCode.Contains(input.keyword)); var pageList = new SqlSugarPagedList() { - list = data.Skip((input.currentPage - 1)* input.pageSize).Take(input.pageSize).ToList(), + list = data.Skip((input.currentPage - 1) * input.pageSize).Take(input.pageSize).ToList(), pagination = new Pagination() { CurrentPage = input.currentPage, @@ -619,7 +619,7 @@ public class FlowEngineService : IFlowEngineService, IDynamicApiController, ITra sortCode = a.SortCode, type = c.Type, visibleType = c.VisibleType, - parentId = SqlFunc.Subqueryable().Where(d => d.EnCode == c.Category && d.DictionaryTypeId== "507f4f5df86b47588138f321e0b0dac7").Select(d => d.Id), + parentId = SqlFunc.Subqueryable().Where(d => d.EnCode == c.Category && d.DictionaryTypeId == "507f4f5df86b47588138f321e0b0dac7").Select(d => d.Id), }).MergeTable().OrderBy(a => a.sortCode).OrderBy(a => a.creatorTime, OrderByType.Desc) .OrderBy(a => a.lastModifyTime, OrderByType.Desc).ToListAsync(); } diff --git a/workflow/Tnb.WorkFlow/Service/FlowFormService.cs b/workflow/Tnb.WorkFlow/Service/FlowFormService.cs index be19f111..c302d640 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowFormService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowFormService.cs @@ -7,18 +7,15 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; -using JNPF.Systems.Entitys.Dto.ModuleForm; using JNPF.Systems.Entitys.Model.DataBase; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.System; using JNPF.VisualDev.Engine.Core; using JNPF.VisualDev.Engine.Model; using JNPF.VisualDev.Interfaces; using JNPF.WorkFlow.Entitys.Dto.FlowEngine; using JNPF.WorkFlow.Entitys.Dto.FlowForm; using JNPF.WorkFlow.Entitys.Entity; -using JNPF.WorkFlow.Interfaces.Repository; using Mapster; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; diff --git a/workflow/Tnb.WorkFlow/Service/FlowLaunchService.cs b/workflow/Tnb.WorkFlow/Service/FlowLaunchService.cs index 7a8e59ac..4ee10a75 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowLaunchService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowLaunchService.cs @@ -80,7 +80,7 @@ public class FlowLaunchService : IDynamicApiController, ITransient if (await _flowTaskRepository.AnyFlowTask(x => flowTaskParamter.flowTaskEntity.Id == x.ParentId && x.DeleteMark == null && x.Suspend == 1)) throw Oops.Oh(ErrorCode.WF0046); if (flowTaskParamter.flowTaskEntity.Status != 1) throw Oops.Oh(ErrorCode.WF0011); - if (flowTaskParamter.flowTaskEntity.ParentId.IsNotEmptyOrNull()&& !flowTaskParamter.flowTaskEntity.ParentId.Equals("0")) + if (flowTaskParamter.flowTaskEntity.ParentId.IsNotEmptyOrNull() && !flowTaskParamter.flowTaskEntity.ParentId.Equals("0")) throw Oops.Oh(ErrorCode.WF0015); await _flowTaskManager.Revoke(flowTaskParamter); } diff --git a/workflow/Tnb.WorkFlow/Service/FlowTaskService.cs b/workflow/Tnb.WorkFlow/Service/FlowTaskService.cs index ce7fdec1..262df2ba 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowTaskService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowTaskService.cs @@ -6,7 +6,6 @@ using JNPF.FriendlyException; using JNPF.WorkFlow.Entitys.Model; using JNPF.WorkFlow.Interfaces.Manager; using JNPF.WorkFlow.Interfaces.Service; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace JNPF.WorkFlow.Service; diff --git a/workflow/Tnb.WorkFlow/Service/FlowTemplateService.cs b/workflow/Tnb.WorkFlow/Service/FlowTemplateService.cs index 9eea97f7..d2dcfe3e 100644 --- a/workflow/Tnb.WorkFlow/Service/FlowTemplateService.cs +++ b/workflow/Tnb.WorkFlow/Service/FlowTemplateService.cs @@ -11,9 +11,7 @@ using JNPF.FriendlyException; using JNPF.LinqBuilder; using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.System; -using JNPF.Systems.Interfaces.Permission; using JNPF.Systems.Interfaces.System; -using JNPF.VisualDev.Entitys; using JNPF.WorkFlow.Entitys.Dto.FlowTemplate; using JNPF.WorkFlow.Entitys.Entity; using JNPF.WorkFlow.Entitys.Model; diff --git a/workflow/Tnb.WorkFlow/Tnb.WorkFlow.csproj b/workflow/Tnb.WorkFlow/Tnb.WorkFlow.csproj index c4d8fc92..5d764794 100644 --- a/workflow/Tnb.WorkFlow/Tnb.WorkFlow.csproj +++ b/workflow/Tnb.WorkFlow/Tnb.WorkFlow.csproj @@ -1,5 +1,4 @@  - net6.0 diff --git a/workflow/Tnb.WorkFlow/WorkFlowForm/LeaveApplyService.cs b/workflow/Tnb.WorkFlow/WorkFlowForm/LeaveApplyService.cs index 2c6f73cf..38b26359 100644 --- a/workflow/Tnb.WorkFlow/WorkFlowForm/LeaveApplyService.cs +++ b/workflow/Tnb.WorkFlow/WorkFlowForm/LeaveApplyService.cs @@ -5,7 +5,6 @@ using JNPF.Common.Core.Manager.Files; using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Models; -using JNPF.Common.Models.WorkFlow; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; diff --git a/workflow/Tnb.WorkFlow/WorkFlowForm/SalesOrderService.cs b/workflow/Tnb.WorkFlow/WorkFlowForm/SalesOrderService.cs index 7422205f..e903a450 100644 --- a/workflow/Tnb.WorkFlow/WorkFlowForm/SalesOrderService.cs +++ b/workflow/Tnb.WorkFlow/WorkFlowForm/SalesOrderService.cs @@ -5,7 +5,6 @@ using JNPF.Common.Core.Manager.Files; using JNPF.Common.Extension; using JNPF.Common.Manager; using JNPF.Common.Models; -using JNPF.Common.Models.WorkFlow; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController;