| | |
| | | { |
| | | protected static SqlSugarScope Db = new(new ConnectionConfig |
| | | { |
| | | DbType = DbType.Oracle, |
| | | DbType = DbType.SqlServer, |
| | | ConnectionString = AppsettingsUtility.Settings.DataBaseConn, |
| | | IsAutoCloseConnection = true |
| | | }, |
| | |
| | | db.Aop.OnLogExecuting = (sql, pars) => |
| | | { |
| | | Console.WriteLine( |
| | | UtilMethods.GetSqlString(DbType.Oracle, sql, pars)); |
| | | UtilMethods.GetSqlString(DbType.SqlServer, sql, pars)); |
| | | }; |
| | | }); |
| | | |
| | |
| | | throw; // éæ°æåºå¼å¸¸ |
| | | } |
| | | } |
| | | |
| | | public object CommonPage(QueryParameters pars, int pageIndex, int pagesize) |
| | | { |
| | | var tolCount = 0; |
| | | var sugarParamters = pars.Parameters.Select(it => |
| | | (IConditionalModel)new ConditionalModel |
| | | { |
| | | ConditionalType = it.ConditionalType, |
| | | FieldName = it.FieldName, |
| | | FieldValue = it.FieldValue |
| | | }).ToList(); |
| | | var query = Db.Queryable<T>(); |
| | | if (pars.OrderBys != null) |
| | | foreach (var item in pars.OrderBys) |
| | | query.OrderBy(item.ToSqlFilter()); |
| | | var result = query.Where(sugarParamters) |
| | | .ToPageList(pageIndex, pagesize, ref tolCount); |
| | | return new |
| | | { |
| | | count = tolCount, |
| | | data = result |
| | | }; |
| | | } |
| | | |
| | | public object CommonPage<ViewModel>(ISugarQueryable<ViewModel> query, |
| | | QueryParameters pars, int pageIndex, int pagesize) |
| | | { |
| | | var tolCount = 0; |
| | | var sugarParamters = pars.Parameters.Select(it => |
| | | (IConditionalModel)new ConditionalModel |
| | | { |
| | | ConditionalType = it.ConditionalType, |
| | | FieldName = it.FieldName, |
| | | FieldValue = it.FieldValue |
| | | }).ToList(); |
| | | if (pars.OrderBys != null) |
| | | foreach (var item in pars.OrderBys) |
| | | query.OrderBy(item.ToSqlFilter()); |
| | | var result = query.Where(sugarParamters) |
| | | .ToPageList(pageIndex, pagesize, ref tolCount); |
| | | return new |
| | | { |
| | | count = tolCount, |
| | | data = result |
| | | }; |
| | | } |
| | | } |
| | | |
| | | public class QueryParameters |
| | | { |
| | | public List<QueryParameter> Parameters { get; set; } |
| | | public List<string> OrderBys { get; set; } |
| | | } |
| | | |
| | | public class QueryParameter |
| | | { |
| | | public string FieldName { get; set; } |
| | | public string FieldValue { get; set; } |
| | | public ConditionalType ConditionalType { get; set; } |
| | | } |
| | |
| | | { |
| | | protected static SqlSugarScope Db = new(new ConnectionConfig |
| | | { |
| | | DbType = DbType.Oracle, |
| | | DbType = DbType.SqlServer, |
| | | ConnectionString = AppsettingsUtility.Settings.DataBaseConn, |
| | | IsAutoCloseConnection = true |
| | | }, |
| | |
| | | db.Aop.OnLogExecuting = (sql, pars) => |
| | | { |
| | | Console.WriteLine( |
| | | UtilMethods.GetSqlString(DbType.Oracle, sql, pars)); |
| | | UtilMethods.GetSqlString(DbType.SqlServer, sql, pars)); |
| | | }; |
| | | }); |
| | | |
| | |
| | | public string? FNumber { get; set; } |
| | | public string? FShortName { get; set; } |
| | | public string? FName { get; set; } |
| | | public string? Fcontact { get; set; } |
| | | public string? FTContact { get; set; } |
| | | public string? Fmobilephone { get; set; } |
| | | public string? Fseller { get; set; } |
| | | public string? FForbidStatus { get; set; } |
| | |
| | | public class ErpItems |
| | | { |
| | | public string Id { get; set; } |
| | | public string? Type { get; set; } |
| | | public string? FNumber { get; set; } |
| | | public string? FName { get; set; } |
| | | public string? FSpecification { get; set; } |
| | | public string? FBaseUnitId { get; set; } |
| | | public double? FSafeStock { get; set; } |
| | | public double? FMaxStock { get; set; } |
| | | public double? FMinPackCount { get; set; } |
| | | public string? FSafeStock { get; set; } |
| | | public string? FMaxStock { get; set; } |
| | | public string? FMinPackCount { get; set; } |
| | | public string? FStockId { get; set; } |
| | | |
| | | public string? FTypeID { get; set; } |
| | | public string? FMaterialGroup { get; set; } |
| | | public string? FDescription { get; set; } |
| | | public decimal? FFinishReceiptOverRate { get; set; } |
| | | public string? FFinishReceiptOverRate { get; set; } |
| | | public string? FIssueType { get; set; } |
| | | public int? FIsBatchManage { get; set; } |
| | | public string? FIsBatchManage { get; set; } |
| | | public string? FPurchaserId { get; set; } |
| | | public string? FPurchaseUnitId { get; set; } |
| | | public string? FStoreUnitID { get; set; } |
| | |
| | | public string? FForbidStatus { get; set; } |
| | | public string? FErpClsID { get; set; } |
| | | public string? FWorkShopId { get; set; } |
| | | |
| | | public string? FPRODUCEUNITID { get; set; } |
| | | public string? FSUBCONUNITID { get; set; } |
| | | |
| | | public string? Type { get; set; } |
| | | public string? FCreateOrgId { get; set; } |
| | | public string? FUseOrgId { get; set; } |
| | | public string? FLOSSPERCENT { get; set; } |
| | | public string? FMnemonicCode { get; set; } |
| | | public string? FExpPeriod { get; set; } |
| | | public string? FColor { get; set; } |
| | | } |
| | |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Masuit.Tools.Core" Version="2024.3.4"/> |
| | | <PackageReference Include="SqlSugarCore" Version="5.1.4.158"/> |
| | | <PackageReference Include="SqlSugarCore" Version="5.1.4.169"/> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Dto\service\" /> |
| | | <Folder Include="Modes\" /> |
| | | <Folder Include="service\BasicData\" /> |
| | | <Folder Include="Dto\service\"/> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarTable("MES_CUSTOMER")] |
| | | public class MesCustomer |
| | | { |
| | | /// <summary> |
| | | /// é»è®¤å¼: (newid()) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)] |
| | | public Guid Guid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "id")] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "cust_no")] |
| | | public string? CustNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°åº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "land")] |
| | | public string? Land { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "cust_name")] |
| | | public string? CustName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç®ç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "cust_sname")] |
| | | public string? CustSname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "stras")] |
| | | public string? Stras { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµè¯ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "telf1")] |
| | | public string? Telf1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼ ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "telfx")] |
| | | public string? Telfx { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è系人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "anred")] |
| | | public string? Anred { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_date")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_by")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåä¿®æ¹æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_date")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåä¿®æ¹äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_by")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark")] |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "company")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "factory")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¯å¦å
±ç®¡(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_c")] |
| | | public int? ItemC { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¯å¦ååSAPæ¥å£(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_sap")] |
| | | public int? ItemSap { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ¹æ¬¡ç®¡ç(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lot_flag")] |
| | | public int? LotFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WMSæ¯å¦åéæ°æ®ï¼1å·²åéï¼å
¶ä»åæªåé |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "iscommit")] |
| | | public int? Iscommit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fforbidstatus")] |
| | | public string? Fforbidstatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fseller")] |
| | | public string? Fseller { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_org")] |
| | | public int? CreateOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "use_org")] |
| | | public int? UseOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段3 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark3")] |
| | | public string? Remark3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段4 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark4")] |
| | | public string? Remark4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段5 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark5")] |
| | | public string? Remark5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DATA_TYPE")] |
| | | public string? DataType { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ä»åºä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarTable("MES_DEPOTS")] |
| | | public class MesDepots |
| | | { |
| | | /// <summary> |
| | | /// ID(SEQ_INV_ID) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_ID", IsPrimaryKey = true)] |
| | | public decimal DepotId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å«ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_CODE")] |
| | | public string? DepotCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å«åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_NAME")] |
| | | public string? DepotName { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»åºè´è´£äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_BY")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOTTYPE")] |
| | | public string? Depottype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FACTORY")] |
| | | public string? Factory { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "COMPANY")] |
| | | public string? Company { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸è¯åä» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IS_NG")] |
| | | public string? IsNg { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»ä½ç»ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ZUID")] |
| | | public string? Zuid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
è®¸å³æ¶åºåè´åºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IS_FKC")] |
| | | public string? IsFkc { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 使ç¨çµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åµå»ºçµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»å |
| | | /// </summary> |
| | | [SugarTable("MES_ITEM_TYPE")] |
| | | public class MesItemType |
| | | { |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)] |
| | | public Guid Guid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "id")] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç±»åç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "tcode")] |
| | | public string? Tcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç±»ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "tname")] |
| | | public string? Tname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark")] |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_by")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_date")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_by")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_date")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "company")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "factory")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// IQCåç±» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "iqc_type")] |
| | | public string? IqcType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// IQCåç±»åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "iqc_type_name")] |
| | | public string? IqcTypeName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸çº§åç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "pgroup")] |
| | | public string? Pgroup { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "description")] |
| | | public string? Description { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ç©æä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarTable("MES_ITEMS")] |
| | | public class MesItems |
| | | { |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)] |
| | | public Guid Guid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "id")] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "factory")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "company")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç = ERPç©æç¼å·||é¢è²ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_no")] |
| | | public string? ItemNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_name")] |
| | | public string? ItemName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç®ç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_sname")] |
| | | public string? ItemSname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§æ ¼åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_model")] |
| | | public string? ItemModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææè¿° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_description")] |
| | | public string? ItemDescription { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_unit")] |
| | | public string? ItemUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_type")] |
| | | public string? ItemType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_version")] |
| | | public string? ItemVersion { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "cust_no")] |
| | | public string? CustNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_by")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_date")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_by")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_date")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½åºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lowlimit")] |
| | | public double? Lowlimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¤§åºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "highlimit")] |
| | | public double? Highlimit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå°å
è£
æ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "prd_pack")] |
| | | public double? PrdPack { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订ååä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "orderunit")] |
| | | public string? Orderunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "saleunit")] |
| | | public string? Saleunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¿åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "storeunit")] |
| | | public string? Storeunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "e_item_id")] |
| | | public long? EItemId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPæå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "erp_item_no")] |
| | | public string? ErpItemNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é»è®¤ä»åº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "depot_code")] |
| | | public string? DepotCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç±»ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ppbom00019124")] |
| | | public string? Ppbom00019124 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remarks")] |
| | | public string? Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fpurchaserid")] |
| | | public string? Fpurchaserid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fforbidstatus")] |
| | | public string? Fforbidstatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fmaterialgroup")] |
| | | public string? Fmaterialgroup { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®å·¥è¶
æ¶æ¯ä¾ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ffinishreceiptoverrate")] |
| | | public decimal? Ffinishreceiptoverrate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹å¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fissuetype")] |
| | | public string? Fissuetype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ç¨æ¹å·ç®¡ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fisbatchmanage")] |
| | | public int? Fisbatchmanage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fpurchaseunitid")] |
| | | public decimal Fpurchaseunitid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_org")] |
| | | public int? CreateOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "use_org")] |
| | | public int? UseOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æèç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "loss_percent")] |
| | | public string? LossPercent { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å©è®°ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "mnemonic_code")] |
| | | public string? MnemonicCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿è´¨æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "exp_period")] |
| | | public string? ExpPeriod { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§è½¦é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "production_workshop")] |
| | | public string? ProductionWorkshop { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æå±æ§ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "material_properti")] |
| | | public string? MaterialProperti { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "produce_unit")] |
| | | public string? ProduceUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å§å¤åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "subcon_unit")] |
| | | public string? SubconUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾ç1 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "bz06")] |
| | | public string? Bz06 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾ç2 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "bz07")] |
| | | public string? Bz07 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾ç3 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "bz08")] |
| | | public string? Bz08 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾ç4 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "bz09")] |
| | | public string? Bz09 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾ç5 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "bz10")] |
| | | public string? Bz10 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// QCåç»ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "qc_teamid")] |
| | | public string? QcTeamid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_id")] |
| | | public int? ItemId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢è² |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "color_name")] |
| | | public string? ColorName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨çµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åµå»ºçµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// å²ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarTable("MES_POSITION")] |
| | | public class MesPosition |
| | | { |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å²ä½ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "POSITION_ID")] |
| | | public string? PositionId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å²ä½åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "POSITION_NAME")] |
| | | public string? PositionName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å²ä½æè¿° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "POSITION_DESCRIPTION")] |
| | | public string? PositionDescription { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå±é¨é¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT")] |
| | | public string? Department { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ºç«æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATION_DATE")] |
| | | public DateTime? CreationDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DISABLED_BY")] |
| | | public string? DisabledBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DISABLED_DATE")] |
| | | public DateTime? DisabledDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ A å¯ç¨ Bç¦ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FFORBIDSTATUS")] |
| | | public string? Fforbidstatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨çµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSUBSIDIARY")] |
| | | public string? FUseOrgId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åµå»ºçµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FUMBRELLA")] |
| | | public string? FCreateOrgId { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éè´è®¢å表 |
| | | /// </summary> |
| | | [SugarTable("MES_ROH_IN")] |
| | | public class MesRohIn |
| | | { |
| | | /// <summary> |
| | | /// SEQ_BASEINFO_ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_BASEINFO_ID", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BILL_NO")] |
| | | public string? BillNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOCUMENT_STATUS")] |
| | | public string? DocumentStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOCUMENT_TYPE")] |
| | | public string? DocumentType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUSINESS_TYPE")] |
| | | public string? BusinessType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_DATE")] |
| | | public DateTime? PurchaseDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SUPPLIER")] |
| | | public string? Supplier { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³éç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CLOSE_STATUS")] |
| | | public string? CloseStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_ORG")] |
| | | public string? PurchaseOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´é¨é¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_DEPT")] |
| | | public string? PurchaseDept { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_GROUP")] |
| | | public string? PurchaseGroup { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°ééªæ¶ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "QTY_ACCEPTANCE")] |
| | | public string? QtyAcceptance { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASER")] |
| | | public string? Purchaser { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ç»ç®æ¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SETTLEMENT_PARTY")] |
| | | public string? SettlementParty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æ¬¾æ¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PAYMENT_PARTY")] |
| | | public string? PaymentParty { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string? Remarks { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä½åºç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CANCELLATION_STATUS")] |
| | | public string? CancellationStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä½åºäºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CANCELLATION_PERSON")] |
| | | public string? CancellationPerson { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä½åºæ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CANCELLATION_DATE")] |
| | | public DateTime? CancellationDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_BY")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPå®¡æ ¸äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_CHECK_BY")] |
| | | public string? ErpCheckBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPå®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_CHECK_DATE")] |
| | | public string? ErpCheckDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPçIDå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "EBELN_K3ID")] |
| | | public decimal? EbelnK3id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ´åå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "changereason")] |
| | | public string? Changereason { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°è´§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FPREARRIVALDATE")] |
| | | public DateTime? FPREARRIVALDATE { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FRECEIVEORGID")] |
| | | public string? FRECEIVEORGID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå°æ¬¡æ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark1")] |
| | | public string? remark1 { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éè´è®¢åæç»è¡¨ |
| | | /// </summary> |
| | | [SugarTable("MES_ROH_IN_DATA")] |
| | | public class MesRohInData |
| | | { |
| | | /// <summary> |
| | | /// éè´åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BILL_NO")] |
| | | public string? BillNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_ORDER_ID")] |
| | | public string? SalesOrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´è®¢åè¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_LINE_ID")] |
| | | public string? OrderLineId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ITEM_ID")] |
| | | public string? ItemId { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// éè´åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_UNIT")] |
| | | public string? PurchaseUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASE_QTY")] |
| | | public decimal? PurchaseQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºååä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "INVENTORY_UNIT")] |
| | | public string? InventoryUnit { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// äº¤è´§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DELIVERY_DATE")] |
| | | public DateTime? DeliveryDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ©äº¤è´§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "EARLIEST_DELIVERY_DATE")] |
| | | public DateTime? EarliestDeliveryDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææäº¤è´§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LATEST_DELIVERY_DATE")] |
| | | public DateTime? LatestDeliveryDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éæ±ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_ORG")] |
| | | public string? DemandOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RECEIVING_ORG")] |
| | | public string? ReceivingOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ç®ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SETTLEMENT_ORG")] |
| | | public string? SettlementOrg { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦èµ å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IS_GIFT")] |
| | | public string? IsGift { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string? Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç©æç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SUPPLIER_ITEM_CODE")] |
| | | public string? SupplierItemCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç©æåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SUPPLIER_ITEM_NAME")] |
| | | public string? SupplierItemName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å§å¤è®¢åç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "OUTSOURCING_ORDER_ID")] |
| | | public string? OutsourcingOrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BATCH_NUMBER")] |
| | | public string? BatchNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡å
³é A:æ£å¸¸ï¼B:ä¸å¡ç»æ¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUSINESS_CLOSE")] |
| | | public string? BusinessClose { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡å»ç» A:æ£å¸¸ï¼B:ä¸å¡ç»æ¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUSINESS_FREEZE")] |
| | | public string? BusinessFreeze { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ç»äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FREEZER")] |
| | | public string? Freezer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ç»æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FREEZE_TIME")] |
| | | public DateTime? FreezeTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ç»æ¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUSINESS_TERMINATE")] |
| | | public string? BusinessTerminate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»æ¢äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TERMINATOR")] |
| | | public string? Terminator { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»æ¢æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TERMINATE_TIME")] |
| | | public DateTime? TerminateTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç´¯è®¡æ¶ææ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TOTAL_RECEIVED_QTY")] |
| | | public decimal? TotalReceivedQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å©ä½æ¶ææ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMAINING_RECEIVED_QTY")] |
| | | public decimal? RemainingReceivedQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 累计å
¥åºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TOTAL_STORED_QTY")] |
| | | public decimal? TotalStoredQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å©ä½å
¥åºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMAINING_STORED_QTY")] |
| | | public decimal? RemainingStoredQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç´¯è®¡éææ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TOTAL_RETURNED_QTY")] |
| | | public decimal? TotalReturnedQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æå¯éæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RETURNABLE_RECEIVED_QTY")] |
| | | public decimal? ReturnableReceivedQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåå¯éæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RETURNABLE_STORED_QTY")] |
| | | public decimal? ReturnableStoredQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºåç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SOURCE_DOCUMENT_TYPE")] |
| | | public string? SourceDocumentType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SOURCE_DOCUMENT_ID")] |
| | | public string? SourceDocumentId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éæ±è·è¸ªå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_TRACKING_ID")] |
| | | public string? DemandTrackingId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 计åè·è¸ªå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PLAN_TRACKING_ID")] |
| | | public string? PlanTrackingId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ´æ å¿ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CHANGE_FLAG")] |
| | | public string? ChangeFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éæ±æ¥æº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_SOURCE")] |
| | | public string? DemandSource { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 鿱忮ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_DOCUMENT_ID")] |
| | | public string? DemandDocumentId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 鿱忮è¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_DOCUMENT_LINE_ID")] |
| | | public string? DemandDocumentLineId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPçIDå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "EBELN_K3ID")] |
| | | public decimal? EbelnK3id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// SEQ_BASEINFO_ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_BASEINFO_ID", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERP头ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public decimal? ErpId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´è®¢åè¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "purchase_order_line_number")] |
| | | public string? PurchaseOrderLineNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éæ±ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND")] |
| | | public string? Demand { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RECEIVING")] |
| | | public string? Receiving { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ç®ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SETTLEMENT")] |
| | | public string? Settlement { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éæ±é¨é¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEMAND_DEPARTMENT")] |
| | | public string? DemandDepartment { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æé¨é¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RECEIVING_DEPARTMENT")] |
| | | public string? ReceivingDepartment { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢è®¡å°è´§æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FPREARRIVALDATE")] |
| | | public DateTime? FPREARRIVALDATE { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·è´§å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK1")] |
| | | public string? Remark1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
è£
åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK2")] |
| | | public string? Remark2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主产å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK3")] |
| | | public string? Remark3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// SMT夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK4")] |
| | | public string? Remark4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åè¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FDEMANDBILLNO_LINE")] |
| | | public string? FdemandbillnoLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµæ°æååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ELECTRICAL_PRODUCT_MODEL")] |
| | | public string? ElectricalProductModel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµæ°æååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ELECTRICAL_PRODUCT_NAME")] |
| | | public string? ElectricalProductName { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// å工信æ¯è¡¨ |
| | | /// </summary> |
| | | [SugarTable("MES_STAFF")] |
| | | public class MesStaff |
| | | { |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "STAFF_NO")] |
| | | public string StaffNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥å§å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "STAFF_NAME")] |
| | | public string StaffName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT_NO")] |
| | | public string DepartmentNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT_NAME")] |
| | | public string DepartmentName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å²ä½ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "POSITION_CODE")] |
| | | public string PositionCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å²ä½åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "POSITION_NAME")] |
| | | public string PositionName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææºå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PHONE_NUMBER")] |
| | | public string PhoneNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å²å¼å§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "START_DATE")] |
| | | public DateTime? StartDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段1 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK1")] |
| | | public string Remark1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段2 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK2")] |
| | | public string Remark2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段3 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK3")] |
| | | public string Remark3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段4 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK4")] |
| | | public string Remark4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段5 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARK5")] |
| | | public string Remark5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_BY")] |
| | | public string CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] |
| | | public string LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "MEMO")] |
| | | public string Memo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产线 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LINE_NO")] |
| | | public string LineNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产åå·¥æ è¯ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "WORK_MK")] |
| | | public decimal? WorkMk { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FFORBID_STATUS")] |
| | | public string FforbidStatus { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨çµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åµå»ºçµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarTable("MES_SUPPLIER")] |
| | | public class MesSupplier |
| | | { |
| | | /// <summary> |
| | | /// é»è®¤å¼: (newid()) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)] |
| | | public Guid Guid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "id")] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "supp_no")] |
| | | public string? SuppNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "supp_name")] |
| | | public string? SuppName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç®ç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "supp_sname")] |
| | | public string? SuppSname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°åº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "land1")] |
| | | public string? Land1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å°å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "stras")] |
| | | public string? Stras { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµè¯ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "telf1")] |
| | | public string? Telf1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼ ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "telfx")] |
| | | public string? Telfx { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®°å½å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_by")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_date")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿æ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_by")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿æ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lastupdate_date")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark")] |
| | | public string? Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®ç (æå°æ¡ç ç¨) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fscode")] |
| | | public string? Fscode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "company")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "factory")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¯å¦å
±ç®¡(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_c")] |
| | | public int? ItemC { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¯å¦ååSAPæ¥å£(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "item_sap")] |
| | | public int? ItemSap { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ¹æ¬¡ç®¡ç(æ¯ï¼å¦) |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lot_flag")] |
| | | public int? LotFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è系人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "lxr")] |
| | | public string? Lxr { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´è´£äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fstaffid")] |
| | | public string? Fstaffid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "fforbidstatus")] |
| | | public string? Fforbidstatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段3 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark3")] |
| | | public string? Remark3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段4 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark4")] |
| | | public string? Remark4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èªå®ä¹å段5 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "remark5")] |
| | | public string? Remark5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建ç»ç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éç¨åä½è½¬æ¢è¡¨ |
| | | /// </summary> |
| | | [SugarTable("MES_UNIT")] |
| | | public class MesUnit |
| | | { |
| | | /// <summary> |
| | | /// BASEINFO |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "OLDUNIT")] |
| | | public string? Oldunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®çåä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "NEWUNIT")] |
| | | public string? Newunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå使°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "OLDQTY")] |
| | | public decimal? Oldqty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®çå使°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "NEWQTY")] |
| | | public decimal? Newqty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_BY")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "COMPANY")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FACTORY")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FNUMBER")] |
| | | public string? Fnumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FNAME")] |
| | | public string? Fname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå±ç»å« |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FUNITGROUPID")] |
| | | public string? Funitgroupid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¢ç®åæ¯ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FCONVERTDENOMINATOR")] |
| | | public double? Fconvertdenominator { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½ååä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FCURRENTUNITID")] |
| | | public string? Fcurrentunitid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¢ç®åå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FCONVERTNUMERATOR")] |
| | | public double? Fconvertnumerator { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºååä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FBASEUNIT")] |
| | | public string? Fbaseunit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èå
¥ç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FROUNDTYPE")] |
| | | public string? Froundtype { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 精度 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FPRECISION")] |
| | | public decimal? Fprecision { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FDESCRIPTION")] |
| | | public string? Fdescription { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FFORBIDSTATUS")] |
| | | public string? Fforbidstatus { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarTable("MESSAGE_CENTER")] |
| | | public class MessageCenter |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// é»è®¤å¼: (newid()) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "guid", IsPrimaryKey = true)] |
| | | public Guid Guid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 表å/è§å¾å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "table_name")] |
| | | public string? TableName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±å°å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "url")] |
| | | public string? Url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¯·æ±æ¹å¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "method")] |
| | | public string? Method { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æå 0表示失败 1 表示æå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "result")] |
| | | public int? Result { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿åçJSON |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "result_data")] |
| | | public string? ResultData { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ 0è¡¨ç¤ºæªæ¨é 1 表示已æ¨é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "status")] |
| | | public int? Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_by")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "create_date")] |
| | | public string? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡æ é¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "title")] |
| | | public string? Title { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 页é¢åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "page_name")] |
| | | public string? PageName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å¤çï¼0表示æªå¤ç 1表示已å¤ç |
| | | /// é»è®¤å¼: ((0)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "deal_with")] |
| | | public int? DealWith { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡id |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "pid")] |
| | | public int? Pid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§è¡é¡ºåº |
| | | /// é»è®¤å¼: ((1)) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "seq")] |
| | | public int? Seq { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 页é¢è·¯å¾ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "route")] |
| | | public string? Route { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "data")] |
| | | public string? Data { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°ç±»å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "content_type")] |
| | | public string? ContentType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ¯æ¶æ¯ 0为æ¨é失败 1ä¸ºæ¶æ¯ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "is_message")] |
| | | public int? IsMessage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "update_date")] |
| | | public string? UpdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "update_by")] |
| | | public string? UpdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// MESåå¨è¿ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "prc_mame")] |
| | | public string? PrcMame { get; set; } |
| | | |
| | | |
| | | [SugarColumn(IsIgnore = true)] public int? isShow { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public decimal? Count { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ç»ç» |
| | | ///</summary> |
| | | [SugarTable("ORGANIZE")] |
| | | public class Organize |
| | | { |
| | | /// <summary> |
| | | /// ç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FNUMBER")] |
| | | public string Fnumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åç§° |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FNAME")] |
| | | public string Fname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | ///</summary> |
| | | // [SugarColumn(ColumnName="ID" )] |
| | | [SugarColumn(IsPrimaryKey = true)] |
| | | public string Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨ç¶æ A å¯ç¨ Bç¦ç¨ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "Fforbidstatus")] |
| | | public string Fforbidstatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "TYPE")] |
| | | public string Type { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ç»æè¿° |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FDESCRIPTION")] |
| | | public string FDescription { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸çº§ç»ç» |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FPARENTID")] |
| | | public string? FParentID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ºç«æ¥æ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FCREATEDATE")] |
| | | public DateTime? FCreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨äºº |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FFORBIDORID")] |
| | | public string? FFORBIDORID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¦ç¨æ¶é´ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "FFORBIDDATE")] |
| | | public DateTime? FFORBIDDATE { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢å表 |
| | | /// </summary> |
| | | [SugarTable("SALES_ORDER")] |
| | | public class SalesOrder |
| | | { |
| | | /// <summary> |
| | | /// SEQ_salesåºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订ååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_ID")] |
| | | public string OrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订ååå« |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_TYPE")] |
| | | public string OrderType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè®¢æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_DATE")] |
| | | public DateTime? OrderDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®çæ¬ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOCUMENT_VERSION")] |
| | | public long? DocumentVersion { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOCUMENT_DATE")] |
| | | public DateTime? DocumentDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FACTORY_ID")] |
| | | public string FactoryId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç®ç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FACTORY_NAME")] |
| | | public string FactoryName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUSTOMER_ID")] |
| | | public string CustomerId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç®ç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUSTOMER_NAME")] |
| | | public string CustomerName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·åå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUSTOMER_ORDER_ID")] |
| | | public string CustomerOrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT_ID")] |
| | | public string DepartmentId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ»æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "TOTAL_QUANTITY")] |
| | | public decimal? TotalQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// erpå®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "APPROVAL_DATE")] |
| | | public DateTime? ApprovalDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// erpå®¡æ ¸è
|
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "APPROVER")] |
| | | public string Approver { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åæç»è¡¨ |
| | | /// </summary> |
| | | [SugarTable("SALES_ORDER_DETAIL")] |
| | | public class SalesOrderDetail |
| | | { |
| | | /// <summary> |
| | | /// SEQ_salesåºå |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订ååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_ID")] |
| | | public string OrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LINE_NUMBER")] |
| | | public long? LineNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_CODE")] |
| | | public string ProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_NAME")] |
| | | public string ProductName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_SPEC")] |
| | | public string ProductSpec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢äº¤è´§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SCHEDULED_DELIVERY_DATE")] |
| | | public DateTime? ScheduledDeliveryDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®¢åæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_QUANTITY")] |
| | | public decimal? OrderQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT")] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT_PRICE")] |
| | | public decimal? UnitPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "AMOUNT")] |
| | | public decimal? Amount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·äº§åç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUSTOMER_PRODUCT_CODE")] |
| | | public string CustomerProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·²äº¤è´§æ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DELIVERED_QUANTITY")] |
| | | public decimal? DeliveredQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "IS_CLOSED")] |
| | | public string IsClosed { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERP头ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_HEAD_ID")] |
| | | public string ErpHeadId { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®éè´§éç¥å表 |
| | | /// </summary> |
| | | [SugarTable("SALES_RETURN_NOTICE")] |
| | | public class SalesReturnNotice |
| | | { |
| | | /// <summary> |
| | | /// SEQ_sales |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶å人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATED_BY")] |
| | | public string CreatedBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOCUMENT_ID")] |
| | | public string DocumentId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸äººåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "APPROVED_BY")] |
| | | public string ApprovedBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶å/å®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATED_OR_APPROVED_DATE")] |
| | | public DateTime? CreatedOrApprovedDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT_CODE")] |
| | | public string DepartmentCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENT_NAME")] |
| | | public string DepartmentName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´è´§åä½ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASER_CODE")] |
| | | public string PurchaserCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´è´§åä½åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PURCHASER_NAME")] |
| | | public string PurchaserName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡å代ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALESPERSON_CODE")] |
| | | public string SalespersonCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALESPERSON_NAME")] |
| | | public string SalespersonName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®éè´§éç¥åæç»è¡¨ |
| | | /// </summary> |
| | | [SugarTable("SALES_RETURN_NOTICE_DETAIL")] |
| | | public class SalesReturnNoticeDetail |
| | | { |
| | | /// <summary> |
| | | /// SEQ_sales |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®è¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LINE_NUMBER")] |
| | | public long? LineNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å代ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_CODE")] |
| | | public string ProductCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_NAME")] |
| | | public string ProductName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PRODUCT_SPEC")] |
| | | public string ProductSpec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "AMOUNT")] |
| | | public decimal? Amount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT_PRICE")] |
| | | public decimal? UnitPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "QUANTITY")] |
| | | public decimal? Quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "OUT_QUANTITY")] |
| | | public decimal? OutQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BATCH_NUMBER")] |
| | | public string BatchNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´§æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RETURN_QUANTITY")] |
| | | public decimal? ReturnQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè´§æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DELIVERY_QUANTITY")] |
| | | public decimal? DeliveryQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢ååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_ORDER_ID")] |
| | | public string SalesOrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢ååå½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_ORDER_ENTRY")] |
| | | public string SalesOrderEntry { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_ORDER_DETAIL_ID")] |
| | | public string SalesOrderDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬åä»· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_UNIT_PRICE")] |
| | | public decimal? BaseUnitPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬å使°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_UNIT_QUANTITY")] |
| | | public decimal? BaseUnitQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "WAREHOUSE_CODE")] |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "WAREHOUSE_NAME")] |
| | | public string WarehouseName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬åä½åºåºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_UNIT_OUT_QUANTITY")] |
| | | public decimal? BaseUnitOutQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT")] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERP头ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_HEAD_ID")] |
| | | public string ErpHeadId { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®åè´§éç¥åæç»è¡¨ |
| | | /// </summary> |
| | | [SugarTable("SHIPMENT_DETAIL")] |
| | | public class ShipmentDetail |
| | | { |
| | | /// <summary> |
| | | /// SEQ_sales |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERP头ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_HEAD_ID")] |
| | | public string ErpHeadId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®è¡å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LINE_NO")] |
| | | public long? LineNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å代ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PROD_CODE")] |
| | | public string ProdCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PROD_NAME")] |
| | | public string ProdName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "PROD_SPEC")] |
| | | public string ProdSpec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éé¢ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "AMOUNT")] |
| | | public double? Amount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT_PRICE")] |
| | | public double? UnitPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "QUANTITY")] |
| | | public double? Quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "OUT_QTY")] |
| | | public double? OutQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BATCH_NO")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´§æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "RETURN_QTY")] |
| | | public double? ReturnQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè´§æ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SHIP_QTY")] |
| | | public double? ShipQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REMARKS")] |
| | | public string Remarks { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢ååå· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_NO")] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢ååå½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_ENTRY")] |
| | | public string OrderEntry { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ORDER_ID")] |
| | | public string OrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬åä»· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_PRICE")] |
| | | public double? BasePrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬å使°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_QTY")] |
| | | public double? BaseQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "WAREHOUSE_CODE")] |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "WAREHOUSE_NAME")] |
| | | public string WarehouseName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬åä½åºåºæ°é |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BASE_OUT_QTY")] |
| | | public double? BaseOutQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIT")] |
| | | public string Unit { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// éå®åè´§éç¥å表 |
| | | /// </summary> |
| | | [SugarTable("SHIPMENT_NOTICE")] |
| | | public class ShipmentNotice |
| | | { |
| | | /// <summary> |
| | | /// SEQ_sales |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_sales", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶å人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATOR")] |
| | | public string Creator { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DOC_ID")] |
| | | public string DocId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸äººåç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "APPROVER")] |
| | | public string Approver { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶åæ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "APPROVE_DATE")] |
| | | public DateTime? ApproveDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPT_CODE")] |
| | | public string DeptCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPT_NAME")] |
| | | public string DeptName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´è´§åä½ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUYER_CODE")] |
| | | public string BuyerCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´è´§åä½åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "BUYER_NAME")] |
| | | public string BuyerName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡å代ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_CODE")] |
| | | public string SalesCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "SALES_NAME")] |
| | | public string SalesName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 忮ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "UNIQUE_ID")] |
| | | public string UniqueId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ä»£ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUST_CODE")] |
| | | public string CustCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CUST_NAME")] |
| | | public string CustName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè¡¨å¤æ³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LIST_NOTE")] |
| | | public string ListNote { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®å代ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REP_CODE")] |
| | | public string RepCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®ååç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "REP_NAME")] |
| | | public string RepName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ERPID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERP_ID")] |
| | | public string ErpId { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ |
| | | /// </summary> |
| | | [SugarTable("SYS_DEPARTMENT")] |
| | | public class SysDepartment |
| | | { |
| | | /// <summary> |
| | | /// å
¬å¸ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "COMPANY")] |
| | | public string? Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FACTORY")] |
| | | public string? Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENTID")] |
| | | public decimal? Departmentid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENTCODE")] |
| | | public string? Departmentcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPARTMENTNAME")] |
| | | public string? Departmentname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨å±æ§ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPEXTR1")] |
| | | public string? Depextr1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPEXTR2")] |
| | | public string? Depextr2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WIPä»åº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPEXTR3")] |
| | | public string? Depextr3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPEXTR4")] |
| | | public string? Depextr4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_BY")] |
| | | public string? CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºæ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåä¿®æ¹äºº |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] |
| | | public string? LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåä¿®æ¹æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸çº§é¨é¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FParentID")] |
| | | public string? FParentID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 使ç¨çµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "FSubsidiary")] |
| | | public string? FSubsidiary { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åµå»ºçµç¹ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Fumbrella")] |
| | | public string? Fumbrella { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.ComponentModel.DataAnnotations.Schema; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Table("SYS_USER")] |
| | | [SugarTable("SYS_USER")] //ç¨äºSqlSugar |
| | | public class SysUser |
| | | { |
| | | /// <summary> |
| | | /// BASEINFO |
| | | /// </summary> |
| | | [Key] |
| | | [Column("FID")] |
| | | [StringLength(20, ErrorMessage = "Fidé¿åº¦ä¸è½è¶
åº20")] |
| | | [SugarColumn(IsPrimaryKey = true, OracleSequenceName = "BASEINFO", |
| | | ColumnName = "FID")] //ç¨äºSqlSugar |
| | | public string Fid { get; set; } |
| | | |
| | | |
| | | [StringLength(20, ErrorMessage = "Sidé¿åº¦ä¸è½è¶
åº20")] |
| | | [SugarColumn(ColumnName = "SID")] //ç¨äºSqlSugar |
| | | public decimal Sid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶ç©ææ¯å¦è¿è¡æ£æ¥ |
| | | /// </summary> |
| | | [Column("CHECK_FLAG")] |
| | | [SugarColumn(ColumnName = "CHECK_FLAG")] //ç¨äºSqlSugar |
| | | public decimal? CheckFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("COMPANY")] |
| | | [SugarColumn(ColumnName = "COMPANY")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "Companyé¿åº¦ä¸è½è¶
åº20")] |
| | | public string Company { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("CREATE_BY")] |
| | | [SugarColumn(ColumnName = "CREATE_BY")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "CreateByé¿åº¦ä¸è½è¶
åº20")] |
| | | public string CreateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("CREATE_DATE")] |
| | | [SugarColumn(ColumnName = "CREATE_DATE")] //ç¨äºSqlSugar |
| | | public DateTime? CreateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æå é¤ç¹æ |
| | | /// </summary> |
| | | [Column("DEL_FLAG")] |
| | | [SugarColumn(ColumnName = "DEL_FLAG")] //ç¨äºSqlSugar |
| | | public decimal? DelFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ |
| | | /// </summary> |
| | | [Column("DEPARTMENTID")] |
| | | [SugarColumn(ColumnName = "DEPARTMENTID")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "é¨é¨é¿åº¦ä¸è½è¶
åº20")] |
| | | public string Departmentid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("DEV")] |
| | | [SugarColumn(ColumnName = "DEV")] //ç¨äºSqlSugar |
| | | public decimal? Dev { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIEL10")] |
| | | [SugarColumn(ColumnName = "EXP_FIEL10")] //ç¨äºSqlSugar |
| | | [StringLength(50, ErrorMessage = "ExpFiel10é¿åº¦ä¸è½è¶
åº50")] |
| | | public string ExpFiel10 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIEL11")] |
| | | [SugarColumn(ColumnName = "EXP_FIEL11")] //ç¨äºSqlSugar |
| | | [StringLength(50, ErrorMessage = "ExpFiel11é¿åº¦ä¸è½è¶
åº50")] |
| | | public string ExpFiel11 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIEL12")] |
| | | [SugarColumn(ColumnName = "EXP_FIEL12")] //ç¨äºSqlSugar |
| | | public decimal? ExpFiel12 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çæ¬¡ |
| | | /// </summary> |
| | | [Column("EXP_FIELD1")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD1")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "çæ¬¡é¿åº¦ä¸è½è¶
åº20")] |
| | | public string ExpField1 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çº¿ä½ |
| | | /// </summary> |
| | | [Column("EXP_FIELD2")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD2")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "线ä½é¿åº¦ä¸è½è¶
åº20")] |
| | | public string ExpField2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç
§ç |
| | | /// </summary> |
| | | [Column("EXP_FIELD3")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD3")] //ç¨äºSqlSugar |
| | | public byte[] ExpField3 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èç³»æ¹å¼ |
| | | /// </summary> |
| | | [Column("EXP_FIELD4")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD4")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "èç³»æ¹å¼é¿åº¦ä¸è½è¶
åº20")] |
| | | public string ExpField4 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾çå |
| | | /// </summary> |
| | | [Column("EXP_FIELD5")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD5")] //ç¨äºSqlSugar |
| | | [StringLength(200, ErrorMessage = "å¾çåé¿åº¦ä¸è½è¶
åº200")] |
| | | public string ExpField5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIELD6")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD6")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "ExpField6é¿åº¦ä¸è½è¶
åº20")] |
| | | public string ExpField6 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车é´ç¼ç |
| | | /// </summary> |
| | | [Column("EXP_FIELD7")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD7")] //ç¨äºSqlSugar |
| | | [StringLength(50, ErrorMessage = "车é´ç¼ç é¿åº¦ä¸è½è¶
åº50")] |
| | | public string ExpField7 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIELD8")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD8")] //ç¨äºSqlSugar |
| | | [StringLength(50, ErrorMessage = "ExpField8é¿åº¦ä¸è½è¶
åº50")] |
| | | public string ExpField8 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("EXP_FIELD9")] |
| | | [SugarColumn(ColumnName = "EXP_FIELD9")] //ç¨äºSqlSugar |
| | | [StringLength(50, ErrorMessage = "ExpField9é¿åº¦ä¸è½è¶
åº50")] |
| | | public string ExpField9 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [Column("FACTORY")] |
| | | [SugarColumn(ColumnName = "FACTORY")] //ç¨äºSqlSugar |
| | | [StringLength(1000, ErrorMessage = "å·¥åé¿åº¦ä¸è½è¶
åº1000")] |
| | | public string Factory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FBRANCH")] |
| | | [SugarColumn(ColumnName = "FBRANCH")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "Fbranché¿åº¦ä¸è½è¶
åº20")] |
| | | public string Fbranch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FCODE")] |
| | | [SugarColumn(ColumnName = "FCODE")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "Fcodeé¿åº¦ä¸è½è¶
åº20")] |
| | | public string Fcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ |
| | | /// </summary> |
| | | [Column("FCOMPANY")] |
| | | [SugarColumn(ColumnName = "FCOMPANY")] //ç¨äºSqlSugar |
| | | [StringLength(1000, ErrorMessage = "å
¬å¸é¿åº¦ä¸è½è¶
åº1000")] |
| | | public string Fcompany { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [Column("FFACTORY")] |
| | | [SugarColumn(ColumnName = "FFACTORY")] //ç¨äºSqlSugar |
| | | [StringLength(1000, ErrorMessage = "å·¥åé¿åº¦ä¸è½è¶
åº1000")] |
| | | public string Ffactory { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 馿¬¡ç»é |
| | | /// </summary> |
| | | [Column("FIRST_LOGIN")] |
| | | [SugarColumn(ColumnName = "FIRST_LOGIN")] //ç¨äºSqlSugar |
| | | public decimal? FirstLogin { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FLOGIN_NAME")] |
| | | [SugarColumn(ColumnName = "FLOGIN_NAME")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "FloginNameé¿åº¦ä¸è½è¶
åº20")] |
| | | public string FloginName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FNAME")] |
| | | [SugarColumn(ColumnName = "FNAME")] //ç¨äºSqlSugar |
| | | [StringLength(40, ErrorMessage = "Fnameé¿åº¦ä¸è½è¶
åº40")] |
| | | public string Fname { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FPASSWORD")] |
| | | [SugarColumn(ColumnName = "FPASSWORD")] //ç¨äºSqlSugar |
| | | [StringLength(100, ErrorMessage = "Fpasswordé¿åº¦ä¸è½è¶
åº100")] |
| | | public string Fpassword { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FPLANT")] |
| | | [SugarColumn(ColumnName = "FPLANT")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "Fplanté¿åº¦ä¸è½è¶
åº20")] |
| | | public string Fplant { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FREADONLY")] |
| | | [SugarColumn(ColumnName = "FREADONLY")] //ç¨äºSqlSugar |
| | | [StringLength(20, ErrorMessage = "Freadonlyé¿åº¦ä¸è½è¶
åº20")] |
| | | public string Freadonly { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("FSYSTEM")] |
| | | [SugarColumn(ColumnName = "FSYSTEM")] //ç¨äºSqlSugar |
| | | [StringLength(10, ErrorMessage = "Fsystemé¿åº¦ä¸è½è¶
åº10")] |
| | | public string Fsystem { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºéé人å |
| | | /// </summary> |
| | | [Column("ISACQ")] |
| | | [SugarColumn(ColumnName = "ISACQ")] //ç¨äºSqlSugar |
| | | public decimal? Isacq { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 1为离èï¼0为æ£å¸¸åå·¥ |
| | | /// </summary> |
| | | [Column("ISDEPARTURE")] |
| | | [SugarColumn(ColumnName = "ISDEPARTURE")] //ç¨äºSqlSugar |
| | | public decimal? Isdeparture { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºç®¡ç人å |
| | | /// </summary> |
| | | [Column("ISMANAGER")] |
| | | [SugarColumn(ColumnName = "ISMANAGER")] //ç¨äºSqlSugar |
| | | public decimal? Ismanager { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("LASTLOGIN")] |
| | | [SugarColumn(ColumnName = "LASTLOGIN")] //ç¨äºSqlSugar |
| | | public DateTime? Lastlogin { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°äºº |
| | | /// </summary> |
| | | [Column("LASTUPDATE_BY")] |
| | | [SugarColumn(ColumnName = "LASTUPDATE_BY")] //ç¨äºSqlSugar |
| | | [StringLength(30, ErrorMessage = "æåæ´æ°äººé¿åº¦ä¸è½è¶
åº30")] |
| | | public string LastupdateBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ´æ°æ¥æ |
| | | /// </summary> |
| | | [Column("LASTUPDATE_DATE")] |
| | | [SugarColumn(ColumnName = "LASTUPDATE_DATE")] //ç¨äºSqlSugar |
| | | public DateTime? LastupdateDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 1为å¼åç¨æ·ï¼0为ä¸è¬æä½ç¨æ· |
| | | /// </summary> |
| | | [Column("LEVER")] |
| | | [SugarColumn(ColumnName = "LEVER")] //ç¨äºSqlSugar |
| | | public decimal? Lever { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æææ |
| | | /// </summary> |
| | | [Column("PERIOD_VALIDITY")] |
| | | [SugarColumn(ColumnName = "PERIOD_VALIDITY")] //ç¨äºSqlSugar |
| | | public DateTime? PeriodValidity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("PRD")] |
| | | [SugarColumn(ColumnName = "PRD")] //ç¨äºSqlSugar |
| | | public decimal? Prd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("PSW_EDIT_TIME")] |
| | | [SugarColumn(ColumnName = "PSW_EDIT_TIME")] //ç¨äºSqlSugar |
| | | public DateTime? PswEditTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´¨éæ¨¡åé¦ä»¶ç¡®è®¤-åå åæè´£ä»»äºº |
| | | /// </summary> |
| | | [Column("QM_USER")] |
| | | [SugarColumn(ColumnName = "QM_USER")] //ç¨äºSqlSugar |
| | | public decimal? QmUser { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è§è² |
| | | /// </summary> |
| | | [Column("ROLEID")] |
| | | [SugarColumn(ColumnName = "ROLEID")] //ç¨äºSqlSugar |
| | | public decimal? Roleid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦ä¸ºä¸´æ¶ç¨æ· |
| | | /// </summary> |
| | | [Column("STATUS")] |
| | | [SugarColumn(ColumnName = "STATUS")] //ç¨äºSqlSugar |
| | | public decimal? Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [Column("TET")] |
| | | [SugarColumn(ColumnName = "TET")] //ç¨äºSqlSugar |
| | | public decimal? Tet { get; set; } |
| | | |
| | | [SugarColumn(IsIgnore = true)] public string? Type { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesCustomerManager : Repository<MesCustomer> |
| | | { |
| | | public bool Save(ErpCustomer customer) |
| | | { |
| | | var entity = GetSysDepartment(customer); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (customer.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateCustomerStatus(db, entity.Id, "A")) |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateCustomerStatus(db, entity.Id, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertCustomer(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteCustomer(db, entity.Id)) |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{customer.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpCustomer> customers) |
| | | { |
| | | var list = customers.Select(GetSysDepartment).ToList(); |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var customerGroup in groupBy) |
| | | switch (customerGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateCustomerStatusBatch(db, customerGroup.Value, |
| | | "A")) |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateCustomerStatusBatch(db, customerGroup.Value, |
| | | "B")) |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertCustomerBatch(db, customerGroup.Value)) |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteCustomerBatch(db, customerGroup.Value)) |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, customerGroup.Value)) |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{customerGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | private bool UpdateCustomerStatus(SqlSugarScope db, decimal customerId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesCustomer>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == customerId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertCustomer(SqlSugarScope db, MesCustomer entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteCustomer(SqlSugarScope db, decimal customerId) |
| | | { |
| | | var deleteById = db.Deleteable<MesCustomer>().In(customerId) |
| | | .ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private MesCustomer GetSysDepartment(ErpCustomer customer) |
| | | { |
| | | //ERPå³è¼¸çæ¥å£æ¸æè½æçºMESæ¸æåº«åæ®µ |
| | | |
| | | return new MesCustomer |
| | | { |
| | | Id = Convert.ToDecimal(customer.Id), |
| | | CustNo = customer.FNumber, |
| | | CustSname = customer.FShortName, |
| | | CustName = customer.FName, |
| | | Anred = customer.FTContact, |
| | | Telf1 = customer.Fmobilephone, |
| | | Fseller = customer.Fseller, |
| | | Fforbidstatus = customer.FForbidStatus, |
| | | Remark = customer.FDescription, |
| | | FSubsidiary = customer.FUseOrgId, |
| | | Fumbrella = customer.FCreateOrgId, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000", |
| | | DataType = customer.FDocumentStatus |
| | | }; |
| | | } |
| | | |
| | | private bool UpdateCustomerStatusBatch(SqlSugarScope db, |
| | | List<MesCustomer> customerList, string status) |
| | | { |
| | | var ids = customerList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesCustomer>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertCustomerBatch(SqlSugarScope db, |
| | | List<MesCustomer> customerList) |
| | | { |
| | | var insertRange = db.Insertable(customerList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteCustomerBatch(SqlSugarScope db, |
| | | List<MesCustomer> customerList) |
| | | { |
| | | var ids = customerList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<MesCustomer>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesCustomer entity) |
| | | { |
| | | db.Deleteable<MesCustomer>().Where(s => s.Id == entity.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, |
| | | List<MesCustomer> customerList) |
| | | { |
| | | foreach (var entity in customerList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Castle.Core.Resource; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesDepotsManager : Repository<MesDepots> |
| | | { |
| | | // Save æ¹æ³ç¨äºä¿åå个ä»åºè®°å½ï¼æ ¹æ®ç±»åæ§è¡ä¸åçæä½ |
| | | public bool Save(ErpDepots depots) |
| | | { |
| | | var entity = GetMesDepots(depots); // å° ErpDepots 转æ¢ä¸º MesDepots |
| | | return UseTransaction(db => |
| | | { |
| | | switch (depots.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateDepotStatus(db, entity.DepotId, "A")) return 1; |
| | | |
| | | break; |
| | | case "1": |
| | | if (UpdateDepotStatus(db, entity.DepotId, "B")) return 1; |
| | | |
| | | break; |
| | | case "2": |
| | | if (InsertDepot(db, entity)) return 1; |
| | | |
| | | break; |
| | | case "3": |
| | | if (DeleteDepot(db, entity.DepotId)) return 1; |
| | | |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) return 1; |
| | | |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{depots.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ´æ°ä»åºç¶æçæ¹æ³ |
| | | private bool UpdateDepotStatus(SqlSugarScope db, decimal depotId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesDepots>() |
| | | .SetColumns(s => s.IsNg == status) |
| | | .Where(s => s.DepotId == depotId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥æ°ä»åºçæ¹æ³ |
| | | private bool InsertDepot(SqlSugarScope db, MesDepots entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // å é¤ä»åºçæ¹æ³ |
| | | private bool DeleteDepot(SqlSugarScope db, decimal depotId) |
| | | { |
| | | var deleteById = db.Deleteable<MesDepots>().In(depotId) |
| | | .ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("åå®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥ææ´æ°ä»åºçæ¹æ³ |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesDepots entity) |
| | | { |
| | | var exists = db.Queryable<MesDepots>() |
| | | .Any(e => e.DepotId == entity.DepotId); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | if (update > 0) |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // å° ErpDepots 对象转æ¢ä¸º MesDepots å¯¹è±¡çæ¹æ³ |
| | | private MesDepots GetMesDepots(ErpDepots depots) |
| | | { |
| | | return new MesDepots |
| | | { |
| | | DepotCode = depots.FNumber, |
| | | DepotName = depots.FName, |
| | | DepotId = Convert.ToDecimal(depots.Id), |
| | | IsFkc = depots.FAllowMinusQty, |
| | | CreateBy = depots.FPrincipal, |
| | | Depottype = depots.FStockProperty, |
| | | IsNg = depots.FForbidStatus, |
| | | Zuid = depots.FGroup, |
| | | FSubsidiary = depots.FUseOrgId, |
| | | Fumbrella = depots.FCreateOrgId, |
| | | |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | // SaveList æ¹æ³ç¨äºä¿åå¤ä¸ªä»åºè®°å½ï¼æ ¹æ®ç±»åæ¹éæ§è¡ä¸åçæä½ |
| | | public bool SaveList(List<ErpDepots> erpDepots) |
| | | { |
| | | var list = new List<MesDepots>(); |
| | | erpDepots.ForEach(s => |
| | | { |
| | | var entity = GetMesDepots(s); // å° ErpDepots 转æ¢ä¸º MesDepots |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var depotsGroup in groupBy) |
| | | switch (depotsGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateDepotStatusBatch(db, depotsGroup.Value, |
| | | "A")) // æ¹éå¯ç¨ä»åº |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateDepotStatusBatch(db, depotsGroup.Value, |
| | | "B")) // æ¹éç¦ç¨ä»åº |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertDepotBatch(db, |
| | | depotsGroup.Value)) // æ¹éæå
¥ä»åº |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteDepotBatch(db, |
| | | depotsGroup.Value)) // æ¹éå é¤ä»åº |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, |
| | | depotsGroup.Value)) // æ¹éæå
¥ææ´æ°ä»åº |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{depotsGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ¹éæ´æ°ä»åºç¶æçæ¹æ³ |
| | | private bool UpdateDepotStatusBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList, string status) |
| | | { |
| | | var ids = depotList.Select(it => it.DepotId).ToArray(); |
| | | var result = db.Updateable<MesDepots>() |
| | | .SetColumns(s => s.IsNg == status) |
| | | .Where(s => ids.Contains(s.DepotId)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥ä»åºçæ¹æ³ |
| | | private bool InsertDepotBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList) |
| | | { |
| | | var insertRange = db.Insertable(depotList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éå é¤ä»åºçæ¹æ³ |
| | | private bool DeleteDepotBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList) |
| | | { |
| | | var ids = depotList.Select(it => it.DepotId).ToArray(); |
| | | var deleteByIds = |
| | | db.Deleteable<MesDepots>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("åå®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥ææ´æ°ä»åºçæ¹æ³ |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, |
| | | List<MesDepots> depotList) |
| | | { |
| | | foreach (var entity in depotList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Castle.Core.Resource; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesItemTypeManager : Repository<MesItemType> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | public bool Save(ErpItemType customer) |
| | | { |
| | | var entity = GetMesItemType(customer); |
| | | |
| | | try |
| | | { |
| | | switch (customer.Type) |
| | | { |
| | | case "0": |
| | | return InsertItemType(entity); |
| | | case "1": |
| | | return DeleteItemType(entity.Id); |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{customer.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new ApplicationException($"æä½å¤±è´¥: {ex.Message}", ex); |
| | | } |
| | | } |
| | | |
| | | private bool InsertItemType(MesItemType entity) |
| | | { |
| | | var insert = base.Insert(entity); |
| | | if (insert) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItemType(decimal id) |
| | | { |
| | | var deleteById = base.DeleteById(id); |
| | | if (deleteById) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private MesItemType GetMesItemType(ErpItemType department) |
| | | { |
| | | return new MesItemType |
| | | { |
| | | Id = Convert.ToDecimal(department.Id), |
| | | Pgroup = department.FPARENTID, |
| | | Tcode = department.FNumber, |
| | | Tname = department.FName, |
| | | Description = department.FDescription, |
| | | //FSubsidiary = department.FSubsidiary, |
| | | //Fumbrella = department.Fumbrella, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpItemType> departments) |
| | | { |
| | | var list = new List<MesItemType>(); |
| | | departments.ForEach(s => |
| | | { |
| | | var entity = GetMesItemType(s); |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | var result = new List<bool>(); |
| | | |
| | | foreach (var itemTypeGroup in groupBy) |
| | | try |
| | | { |
| | | switch (itemTypeGroup.Key) |
| | | { |
| | | case "0": |
| | | result.Add(InsertItemTypeBatch(itemTypeGroup.Value)); |
| | | break; |
| | | case "1": |
| | | result.Add(DeleteItemTypeBatch(itemTypeGroup.Value)); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{itemTypeGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new ApplicationException($"æ¹éæä½å¤±è´¥: {ex.Message}", ex); |
| | | } |
| | | |
| | | if (result.All(b => b)) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æ¥å£æ§è¡å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertItemTypeBatch(List<MesItemType> itemTypeList) |
| | | { |
| | | var insertRange = base.InsertRange(itemTypeList); |
| | | if (insertRange) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItemTypeBatch(List<MesItemType> itemTypeList) |
| | | { |
| | | var ids = itemTypeList.Select(it => it.Id).ToArray(); |
| | | |
| | | var deleteByIds = Db.Deleteable<MesItemType>() |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesItemsManager : Repository<MesItems> |
| | | { |
| | | public bool Save(ErpItems item) |
| | | { |
| | | var entity = GetMesItems(item); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (item.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateItemStatus(db, entity.Id, "A")) |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateItemStatus(db, entity.Id, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertItem(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteItem(db, entity.Id)) |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{item.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpItems> items) |
| | | { |
| | | var list = items.Select(GetMesItems).ToList(); |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var itemGroup in groupBy) |
| | | switch (itemGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateItemStatusBatch(db, itemGroup.Value, "A")) |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateItemStatusBatch(db, itemGroup.Value, "B")) |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{itemGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | private bool UpdateItemStatus(SqlSugarScope db, decimal itemId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesItems>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == itemId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertItem(SqlSugarScope db, MesItems entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItem(SqlSugarScope db, decimal itemId) |
| | | { |
| | | var deleteById = db.Deleteable<MesItems>().In(itemId).ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private MesItems GetMesItems(ErpItems item) |
| | | { |
| | | return new MesItems |
| | | { |
| | | Id = Convert.ToDecimal(item.Id), |
| | | Type = item.Type, |
| | | ItemNo = item.FNumber, |
| | | ItemName = item.FName, |
| | | ItemModel = item.FSpecification, |
| | | ItemUnit = item.FBaseUnitId, |
| | | Lowlimit = Convert.ToDouble(item.FSafeStock), |
| | | Highlimit = Convert.ToDouble(item.FMaxStock), |
| | | PrdPack = Convert.ToDouble(item.FMinPackCount), |
| | | DepotCode = item.FStockId, |
| | | Fmaterialgroup = item.FMaterialGroup, |
| | | Remarks = item.FDescription, |
| | | Ffinishreceiptoverrate = |
| | | Convert.ToDecimal(item.FFinishReceiptOverRate), |
| | | Fissuetype = item.FIssueType, |
| | | Fisbatchmanage = Convert.ToInt32(item.FIsBatchManage), |
| | | Fpurchaserid = item.FPurchaserId, |
| | | Fpurchaseunitid = Convert.ToDecimal(item.FPurchaseUnitId), |
| | | Storeunit = item.FStoreUnitID, |
| | | Saleunit = item.FSaleUnitId, |
| | | Fforbidstatus = item.FForbidStatus, |
| | | MaterialProperti = item.FErpClsID, |
| | | ProductionWorkshop = item.FWorkShopId, |
| | | ProduceUnit = item.FPRODUCEUNITID, |
| | | SubconUnit = item.FSUBCONUNITID, |
| | | FSubsidiary = item.FUseOrgId, |
| | | Fumbrella = item.FCreateOrgId, |
| | | LastupdateDate = DateTime.Now, |
| | | CreateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | private bool UpdateItemStatusBatch(SqlSugarScope db, |
| | | List<MesItems> itemList, string status) |
| | | { |
| | | var ids = itemList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesItems>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertItemBatch(SqlSugarScope db, List<MesItems> itemList) |
| | | { |
| | | var insertRange = db.Insertable(itemList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItemBatch(SqlSugarScope db, List<MesItems> itemList) |
| | | { |
| | | var ids = itemList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<MesItems>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesItems entity) |
| | | { |
| | | db.Deleteable<MesItems>().Where(s => s.Id == entity.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | return insert > 0; |
| | | } |
| | | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, List<MesItems> itemList) |
| | | { |
| | | foreach (var entity in itemList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Castle.Core.Resource; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesPositionManager : Repository<MesPosition> |
| | | { |
| | | // å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | // Save æ¹æ³ç¨äºä¿åå个å²ä½è®°å½ï¼æ ¹æ®ç±»åæ§è¡ä¸åçæä½ |
| | | public bool Save(ErpPosition unit) |
| | | { |
| | | var entity = GetMesPosition(unit); // å° ErpPosition 转æ¢ä¸º MesPosition |
| | | return UseTransaction(db => |
| | | { |
| | | switch (unit.Type) |
| | | { |
| | | case "0": |
| | | if (UpdatePositionStatus(db, entity.Id, "A")) // å¯ç¨å²ä½ |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdatePositionStatus(db, entity.Id, "B")) // ç¦ç¨å²ä½ |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertOrUpdatePosition(db, entity)) // æå
¥ææ´æ°å²ä½ |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeletePosition(db, entity.Id)) // å é¤å²ä½ |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdatePosition(db, entity)) // æå
¥ææ´æ°å²ä½ |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{unit.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ´æ°å²ä½ç¶æçæ¹æ³ |
| | | private bool UpdatePositionStatus(SqlSugarScope db, decimal positionId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesPosition>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == positionId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥ææ´æ°å²ä½çæ¹æ³ |
| | | private bool InsertOrUpdatePosition(SqlSugarScope db, MesPosition entity) |
| | | { |
| | | var exists = db.Queryable<MesPosition>().Any(e => e.Id == entity.Id); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | if (update > 0) |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // å é¤å²ä½çæ¹æ³ |
| | | private bool DeletePosition(SqlSugarScope db, decimal positionId) |
| | | { |
| | | var deleteById = db.Deleteable<MesPosition>().In(positionId) |
| | | .ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // å° ErpPosition 对象转æ¢ä¸º MesPosition å¯¹è±¡çæ¹æ³ |
| | | private MesPosition GetMesPosition(ErpPosition position) |
| | | { |
| | | return new MesPosition |
| | | { |
| | | Id = Convert.ToDecimal(position.Id), |
| | | PositionId = position.FNumber, |
| | | PositionName = position.FName, |
| | | PositionDescription = position.FDESCRIPTIONS, |
| | | Department = position.FDept, |
| | | Fforbidstatus = position.FForbidStatus, |
| | | FUseOrgId = position.FUseOrgId, |
| | | FCreateOrgId = position.FCreateOrgId, |
| | | CreationDate = position.FCreateDate != null |
| | | ? DateTime.ParseExact(position.FCreateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | DisabledBy = position.FForbidderId, |
| | | DisabledDate = position.FForbidDate != null |
| | | ? DateTime.ParseExact(position.FForbidDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null |
| | | }; |
| | | } |
| | | |
| | | // SaveList æ¹æ³ç¨äºä¿åå¤ä¸ªå²ä½è®°å½ï¼æ ¹æ®ç±»åæ¹éæ§è¡ä¸åçæä½ |
| | | public bool SaveList(List<ErpPosition> positions) |
| | | { |
| | | var list = new List<MesPosition>(); |
| | | positions.ForEach(s => |
| | | { |
| | | var entity = GetMesPosition(s); // å° ErpPosition 转æ¢ä¸º MesPosition |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var positionGroup in groupBy) |
| | | switch (positionGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdatePositionStatusBatch(db, positionGroup.Value, |
| | | "A")) // æ¹éå¯ç¨å²ä½ |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdatePositionStatusBatch(db, positionGroup.Value, |
| | | "B")) // æ¹éç¦ç¨å²ä½ |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertPositionBatch(db, |
| | | positionGroup.Value)) // æ¹éæå
¥å²ä½ |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeletePositionBatch(db, |
| | | positionGroup.Value)) // æ¹éå é¤å²ä½ |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdatePositionBatch(db, |
| | | positionGroup.Value)) // æ¹éæå
¥ææ´æ°å²ä½ |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{positionGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ¹éæ´æ°å²ä½ç¶æçæ¹æ³ |
| | | private bool UpdatePositionStatusBatch(SqlSugarScope db, |
| | | List<MesPosition> positionList, string status) |
| | | { |
| | | var ids = positionList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesPosition>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥å²ä½çæ¹æ³ |
| | | private bool InsertPositionBatch(SqlSugarScope db, |
| | | List<MesPosition> positionList) |
| | | { |
| | | var insertRange = db.Insertable(positionList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éå é¤å²ä½çæ¹æ³ |
| | | private bool DeletePositionBatch(SqlSugarScope db, |
| | | List<MesPosition> positionList) |
| | | { |
| | | var ids = positionList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<MesPosition>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥ææ´æ°å²ä½çæ¹æ³ |
| | | private bool InsertOrUpdatePositionBatch(SqlSugarScope db, |
| | | List<MesPosition> positionList) |
| | | { |
| | | foreach (var entity in positionList) |
| | | if (!InsertOrUpdatePosition(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesRohInDataManager : Repository<MesRohInData> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ MesRohInDataManager.cs |
| | | |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = |
| | | base.GetPageList(it => 1 == 1, p, |
| | | it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel |
| | | { |
| | | FieldName = typeof(MesRohInData).GetProperties()[0].Name, |
| | | ConditionalType = ConditionalType.Equal, FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); |
| | | |
| | | AsQueryable().Where(x => 1 == 1) |
| | | .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new MesRohInData(); //æµè¯åæ° |
| | | var insertArray = new[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new MesRohInData(); //æµè¯åæ° |
| | | var updateArray = new[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new MesRohInData() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new MesRohInData(); //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2) |
| | | .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesRohInManager : Repository<MesRohIn> |
| | | { |
| | | private readonly MesRohInDataManager rohInDataManager = new(); |
| | | |
| | | // Save æ¹æ³ç¨äºä¿åå个 RohIn è®°å½ï¼æ ¹æ®ç±»åæ§è¡ä¸åçæä½ |
| | | public bool Save(RohIn rohIn) |
| | | { |
| | | var rohInErpRohIn = rohIn.ErpRohIn; |
| | | var mesRohIn = GetMesRohIn(rohInErpRohIn); |
| | | var mesRohInDatas = GetMesRohInDatas(rohIn.ErpRohinDatas, rohInErpRohIn.Type); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (rohInErpRohIn.Type) |
| | | { |
| | | case "2": |
| | | case "4": |
| | | case "5": |
| | | return SaveOrUpdateData(db, mesRohIn, mesRohInDatas) ? 1 : 0; |
| | | case "3": |
| | | return UpdateData(db, mesRohIn, mesRohInDatas) ? 1 : 0; |
| | | default: |
| | | throw new NotImplementedException( |
| | | $"type没æ{rohInErpRohIn.Type}è¿ä¸ªç±»å"); |
| | | } |
| | | }) > 0; |
| | | } |
| | | |
| | | // æå
¥æ°æ®çæ¹æ³ |
| | | private bool InsertData(SqlSugarScope db, MesRohIn mesRohIn, |
| | | List<MesRohInData> mesRohInDatas, string FBILLTYPE) |
| | | { |
| | | switch (FBILLTYPE) |
| | | { |
| | | case "A": |
| | | { |
| | | var decimals = mesRohInDatas.Select(s => s.Id).ToArray(); |
| | | |
| | | if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id); |
| | | |
| | | if (decimals.Length > 0) |
| | | db.Deleteable<MesRohInData>().In(decimals).ExecuteCommand(); |
| | | |
| | | var insert = base.Insert(mesRohIn); |
| | | var insertRange = |
| | | rohInDataManager.InsertRange(mesRohInDatas); |
| | | |
| | | if (insert && insertRange) return true; |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | case "B": |
| | | { |
| | | var decimals = mesRohInDatas.Select(s => s.Id).ToArray(); |
| | | if (base.DeleteById(mesRohIn.Id) && db |
| | | .Deleteable<MesRohInData>().In(decimals) |
| | | .ExecuteCommand() > 0) |
| | | { |
| | | var insert = base.Insert(mesRohIn); |
| | | var insertRange = |
| | | rohInDataManager.InsertRange(mesRohInDatas); |
| | | |
| | | if (insert && insertRange) return true; |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | throw new NotImplementedException("éè´è®¢åç±»åé误"); |
| | | } |
| | | |
| | | // æ´æ°æ°æ®çæ¹æ³ |
| | | private bool UpdateData(SqlSugarScope db, MesRohIn mesRohIn, |
| | | List<MesRohInData> mesRohInDatas) |
| | | { |
| | | var decimals = mesRohInDatas.Select(s => s.Id).ToArray(); |
| | | var update = base.DeleteById(mesRohIn.Id); |
| | | var insertOrUpdate = db |
| | | .Deleteable<MesRohInData>().In(decimals) |
| | | .ExecuteCommand() > 0; |
| | | |
| | | if (update && insertOrUpdate) return true; |
| | | throw new NotImplementedException("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥ææ´æ°æ°æ®çæ¹æ³ |
| | | private bool SaveOrUpdateData(SqlSugarScope db, MesRohIn mesRohIn, |
| | | List<MesRohInData> mesRohInDatas) |
| | | { |
| | | if (mesRohIn.Id != null) base.DeleteById(mesRohIn.Id); |
| | | |
| | | if (mesRohInDatas.Count > 0) |
| | | db.Deleteable<MesRohInData>() |
| | | .Where(s => s.ErpId == mesRohIn.EbelnK3id).ExecuteCommand(); |
| | | |
| | | var orUpdate = base.Insert(mesRohIn); |
| | | var baOrUpdate = rohInDataManager.InsertRange(mesRohInDatas); |
| | | if (orUpdate && baOrUpdate) return true; |
| | | throw new NotImplementedException("æå
¥ææ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éä¿åè®°å½çæ¹æ³ |
| | | public bool SaveList(List<RohIn> rohIns) |
| | | { |
| | | var result = rohIns.Select(Save).ToList(); |
| | | return result.All(b => b); |
| | | } |
| | | |
| | | // å° ErpRohIn 对象转æ¢ä¸º MesRohIn å¯¹è±¡çæ¹æ³ |
| | | public MesRohIn GetMesRohIn(ErpRohIn rohIn) |
| | | { |
| | | var eid = Convert.ToDecimal(rohIn.id); |
| | | var mesRohIn = new MesRohIn(); |
| | | |
| | | var single = base.GetSingle(it => it.EbelnK3id == eid); |
| | | if (single != null) mesRohIn.Id = single.Id; |
| | | |
| | | mesRohIn.EbelnK3id = eid; |
| | | mesRohIn.BillNo = rohIn.FBillNo; |
| | | mesRohIn.DocumentStatus = rohIn.FDocumentStatus; |
| | | mesRohIn.DocumentType = rohIn.FBillTypeID; |
| | | mesRohIn.BusinessType = rohIn.FBusinessType; |
| | | |
| | | if (rohIn.FDate != null) |
| | | mesRohIn.PurchaseDate = DateTime.ParseExact(rohIn.FDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | mesRohIn.Supplier = rohIn.FSupplierId; |
| | | mesRohIn.CloseStatus = rohIn.FCloseStatus; |
| | | mesRohIn.PurchaseOrg = rohIn.FPurchaseOrgId; |
| | | mesRohIn.PurchaseDept = rohIn.FPurchaseDeptId; |
| | | mesRohIn.PurchaseGroup = rohIn.FPurchaserGroupId; |
| | | mesRohIn.QtyAcceptance = rohIn.Facctype; |
| | | mesRohIn.Purchaser = rohIn.FPurchaserId; |
| | | //mesRohIn.QualityReq = rohIn.F_UNW_Remarks_zlyq; |
| | | mesRohIn.SettlementParty = rohIn.FSettleId; |
| | | mesRohIn.PaymentParty = rohIn.FChargeId; |
| | | // mesRohIn.Email = rohIn.FProviderEMail; |
| | | // mesRohIn.TransportMethod = rohIn.F_UNW_Text_ysfs; |
| | | mesRohIn.Remarks = rohIn.F_XIFG_Text_qtr1; |
| | | // mesRohIn.FixtureMoldProcurement = rohIn.F_UNW_Combo_zjmj; |
| | | mesRohIn.CancellationStatus = rohIn.FCancelStatus; |
| | | mesRohIn.CancellationPerson = rohIn.FCancellerId; |
| | | |
| | | if (rohIn.FCancelDate != null) |
| | | mesRohIn.CancellationDate = |
| | | DateTime.ParseExact(rohIn.FCancelDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | mesRohIn.CreateBy = rohIn.FCreatorId; |
| | | |
| | | if (rohIn.FCreateDate != null) |
| | | mesRohIn.CreateDate = DateTime.ParseExact(rohIn.FCreateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | mesRohIn.LastupdateBy = rohIn.FModifierId; |
| | | |
| | | if (rohIn.FModifyDate != null) |
| | | mesRohIn.LastupdateDate = DateTime.ParseExact(rohIn.FModifyDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | mesRohIn.ErpCheckBy = rohIn.FApproverId; |
| | | mesRohIn.ErpCheckDate = rohIn.FApproveDate; |
| | | mesRohIn.Changereason = rohIn.FCHANGEREASON; |
| | | mesRohIn.FPREARRIVALDATE = rohIn.FPREARRIVALDATE != null |
| | | ? DateTime.ParseExact(rohIn.FPREARRIVALDATE, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null; |
| | | |
| | | mesRohIn.FRECEIVEORGID = rohIn.FRECEIVEORGID; |
| | | |
| | | mesRohIn.remark1 = rohIn.F_XIFG_PrintTimes_qtr; |
| | | |
| | | return mesRohIn; |
| | | } |
| | | |
| | | // å° ErpRohinData 对象转æ¢ä¸º MesRohInData å¯¹è±¡çæ¹æ³ |
| | | public List<MesRohInData> GetMesRohInDatas( |
| | | List<ErpRohinData> erpRohinDatas, string type) |
| | | { |
| | | return erpRohinDatas.Select(s => |
| | | { |
| | | var entity = new MesRohInData |
| | | { |
| | | EbelnK3id = Convert.ToDecimal(s.id), |
| | | ErpId = Convert.ToDecimal(s.Eid), |
| | | BillNo = s.FBillNo, |
| | | SalesOrderId = s.F_XIFG_Text_k79, |
| | | OrderLineId = s.FSEQ, |
| | | ItemId = s.FMaterialId, |
| | | PurchaseUnit = s.FUnitId, |
| | | PurchaseQty = Convert.ToDecimal(s.FQty), |
| | | InventoryUnit = s.FStockUnitID, |
| | | DeliveryDate = s.FDeliveryDate != null |
| | | ? DateTime.ParseExact(s.FDeliveryDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | EarliestDeliveryDate = s.FDeliveryEarlyDate != null |
| | | ? DateTime.ParseExact(s.FDeliveryEarlyDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | LatestDeliveryDate = s.FDeliveryLastDate != null |
| | | ? DateTime.ParseExact(s.FDeliveryLastDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | IsGift = s.FGiveAway, |
| | | Remarks = s.Fnote, |
| | | SupplierItemCode = s.FSupMatId, |
| | | SupplierItemName = s.FSupMatName, |
| | | OutsourcingOrderId = s.FSUBREQBILLNO, |
| | | BatchNumber = s.FLot, |
| | | BusinessClose = s.FMRPCloseStatus, |
| | | BusinessFreeze = s.FMRPFreezeStatus, |
| | | Freezer = s.FFreezerId, |
| | | FreezeTime = s.FFreezeDate != null |
| | | ? DateTime.ParseExact(s.FFreezeDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | BusinessTerminate = s.FMRPTerminateStatus, |
| | | Terminator = s.FTerminaterId, |
| | | TerminateTime = s.FTerminateDate != null |
| | | ? DateTime.ParseExact(s.FTerminateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | TotalReceivedQty = Convert.ToDecimal(s.FReceiveQty), //ç´¯è®¡æ¶ææ° |
| | | RemainingReceivedQty = |
| | | Convert.ToDecimal(s.FRemainReceiveQty), |
| | | TotalStoredQty = Convert.ToDecimal(s.FStockInQty), //累计å
¥åºæ° |
| | | RemainingStoredQty = Convert.ToDecimal(s.FRemainStockINQty), |
| | | TotalReturnedQty = Convert.ToDecimal(s.FMrbQty), |
| | | ReturnableReceivedQty = Convert.ToDecimal(s.FCHECKRETQTY), //æ¶æå¯éæ° |
| | | ReturnableStoredQty = Convert.ToDecimal(s.FSTOCKRETQTY), //åºåå¯éæ° |
| | | SourceDocumentType = s.FSrcBillTypeId, |
| | | SourceDocumentId = s.FSrcBillNo, |
| | | DemandTrackingId = s.FReqTraceNo, |
| | | PlanTrackingId = s.FMtoNo, |
| | | ChangeFlag = s.FChangeFlag, |
| | | DemandSource = s.FDEMANDTYPE, |
| | | DemandDocumentId = s.FDEMANDBILLNO, |
| | | DemandDocumentLineId = s.FDEMANDBILLENTRYSEQ, |
| | | DemandOrg = s.FRequireOrgId, |
| | | ReceivingOrg = s.FReceiveOrgId, |
| | | SettlementOrg = s.FEntrySettleOrgId, |
| | | PurchaseOrderLineNumber = s.FSEQ, |
| | | Demand = s.FRequireOrgId, |
| | | Receiving = s.FReceiveOrgId, |
| | | Settlement = s.FSETTLEORGID, |
| | | DemandDepartment = s.FRequireDeptId, |
| | | ReceivingDepartment = s.FReceiveDeptId, |
| | | FPREARRIVALDATE = s.FPREARRIVALDATE != null |
| | | ? DateTime.ParseExact(s.FPREARRIVALDATE, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | Remark1 = s.F_XIFG_Text_ne1, |
| | | Remark2 = s.F_XIFG_Text_6oq, |
| | | Remark3 = s.F_XIFG_Base_c1c, |
| | | Remark4 = s.F_XIFG_Text_qtr4, |
| | | FdemandbillnoLine = s.FdemandbillnoLine, |
| | | ElectricalProductModel = s.ElectricalProductModel, |
| | | ElectricalProductName = s.ElectricalProductName |
| | | }; |
| | | |
| | | var single = rohInDataManager.GetSingle(it => |
| | | it.EbelnK3id == entity.EbelnK3id); |
| | | if (single != null) entity.Id = single.Id; |
| | | |
| | | return entity; |
| | | }).ToList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Castle.Core.Resource; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesStaffManager : Repository<MesStaff> |
| | | { |
| | | // Save æ¹æ³ç¨äºä¿åå个å工记å½ï¼æ ¹æ®ç±»åæ§è¡ä¸åçæä½ |
| | | public bool Save(ErpStaff unit) |
| | | { |
| | | var entity = GetMesStaff(unit); // å° ErpStaff 转æ¢ä¸º MesStaff |
| | | var sysUser = GetUser(unit); // è·å SysUser å®ä¾ |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (unit.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateStaffStatus(db, entity.Id, "A")) // å¯ç¨åå·¥ |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateStaffStatus(db, entity.Id, "B")) // ç¦ç¨åå·¥ |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | case "4": |
| | | if (InsertOrUpdateStaff(db, sysUser, entity)) // æå
¥ææ´æ°åå·¥ |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteStaff(db, sysUser, entity.Id)) // å é¤åå·¥ |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{unit.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ´æ°åå·¥ç¶æçæ¹æ³ |
| | | private bool UpdateStaffStatus(SqlSugarScope db, decimal staffId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesStaff>() |
| | | .SetColumns(s => s.FforbidStatus == status) |
| | | .Where(s => s.Id == staffId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥ææ´æ°åå·¥çæ¹æ³ |
| | | private bool InsertOrUpdateStaff(SqlSugarScope db, SysUser sysUser, |
| | | MesStaff entity) |
| | | { |
| | | var exists = db.Queryable<SysUser>().Any(u => u.Sid == sysUser.Sid); |
| | | if (exists) |
| | | { |
| | | var updateUser = db.Updateable<SysUser>() |
| | | .SetColumns(s => s.Fcode == sysUser.Fcode) |
| | | .SetColumns(s => s.Fname == sysUser.Fname) |
| | | .Where(s => s.Sid == sysUser.Sid) |
| | | .ExecuteCommand(); |
| | | if (updateUser > 0) |
| | | { |
| | | var updateStaff = db.Updateable(entity).ExecuteCommand(); |
| | | if (updateStaff > 0) |
| | | return true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var insertUser = db.Insertable(sysUser).ExecuteCommand(); |
| | | if (insertUser > 0) |
| | | { |
| | | var insertStaff = db.Insertable(entity).ExecuteCommand(); |
| | | if (insertStaff > 0) |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // å é¤åå·¥çæ¹æ³ |
| | | private bool DeleteStaff(SqlSugarScope db, SysUser sysUser, decimal staffId) |
| | | { |
| | | var deleteUser = db.Deleteable<SysUser>() |
| | | .Where(s => s.Sid == sysUser.Sid).ExecuteCommand(); |
| | | if (deleteUser > 0) |
| | | { |
| | | var deleteStaff = |
| | | db.Deleteable<MesStaff>().In(staffId).ExecuteCommand(); |
| | | if (deleteStaff > 0) |
| | | return true; |
| | | } |
| | | |
| | | throw new NotImplementedException("åå®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // å° ErpStaff 对象转æ¢ä¸º MesStaff å¯¹è±¡çæ¹æ³ |
| | | private MesStaff GetMesStaff(ErpStaff staff) |
| | | { |
| | | var entity = new MesStaff |
| | | { |
| | | Id = Convert.ToDecimal(staff.Id), |
| | | StaffNo = staff.FStaffNumber, |
| | | StaffName = staff.FName, |
| | | DepartmentName = staff.FPostDept, |
| | | PositionName = staff.FPost, |
| | | PhoneNumber = staff.FMobile, |
| | | Remark = staff.FDescription, |
| | | FforbidStatus = staff.FForbidStatus, |
| | | FSubsidiary = staff.FUSEORGID, |
| | | Fumbrella = staff.FCREATEORGID, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now |
| | | }; |
| | | |
| | | if (staff.FStaffStartDate != null) |
| | | entity.StartDate = DateTime.ParseExact(staff.FStaffStartDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | // å° ErpStaff 对象转æ¢ä¸º SysUser å¯¹è±¡çæ¹æ³ |
| | | private SysUser GetUser(ErpStaff staff) |
| | | { |
| | | return new SysUser |
| | | { |
| | | Sid = Convert.ToDecimal(staff.Id), |
| | | Fcode = staff.FStaffNumber, |
| | | Fname = staff.FName, |
| | | Fpassword = "8+()./,", // åå§å¯ç |
| | | Fsystem = "宿³¢å©ç¹è", |
| | | Lever = 0, |
| | | Fcompany = "1000", |
| | | Ffactory = "1000", |
| | | DelFlag = 0, |
| | | Ismanager = 0, |
| | | Isacq = 0, |
| | | ExpField9 = "1020", |
| | | QmUser = 0, |
| | | Status = 0, |
| | | Isdeparture = 0, |
| | | CheckFlag = 0, |
| | | ExpFiel12 = 0, |
| | | Dev = 0, |
| | | Tet = 0, |
| | | Prd = 1 |
| | | }; |
| | | } |
| | | |
| | | // SaveList æ¹æ³ç¨äºä¿åå¤ä¸ªå工记å½ï¼æ ¹æ®ç±»åæ¹éæ§è¡ä¸åçæä½ |
| | | public bool SaveList(List<ErpStaff> departments) |
| | | { |
| | | var list = new List<MesStaff>(); |
| | | var userList = new List<SysUser>(); |
| | | |
| | | departments.ForEach(s => |
| | | { |
| | | var entity = GetMesStaff(s); |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | |
| | | var sysUser = GetUser(s); |
| | | sysUser.Type = s.Type; |
| | | userList.Add(sysUser); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var staffGroup in groupBy) |
| | | switch (staffGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateStaffStatusBatch(db, staffGroup.Value, |
| | | "A")) // æ¹éå¯ç¨åå·¥ |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateStaffStatusBatch(db, staffGroup.Value, |
| | | "B")) // æ¹éç¦ç¨åå·¥ |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertStaffBatch(db, userList, |
| | | staffGroup.Value)) // æ¹éæå
¥åå·¥ |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteStaffBatch(db, userList, |
| | | staffGroup.Value)) // æ¹éå é¤åå·¥ |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, userList, |
| | | staffGroup.Value)) // æ¹éæå
¥ææ´æ°åå·¥ |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{staffGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ¹éæ´æ°åå·¥ç¶æçæ¹æ³ |
| | | private bool UpdateStaffStatusBatch(SqlSugarScope db, |
| | | List<MesStaff> staffList, string status) |
| | | { |
| | | var ids = staffList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesStaff>() |
| | | .SetColumns(s => s.FforbidStatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥åå·¥çæ¹æ³ |
| | | private bool InsertStaffBatch(SqlSugarScope db, List<SysUser> userList, |
| | | List<MesStaff> staffList) |
| | | { |
| | | var userInsert = userList.FindAll(s => s.Type == "INSERT"); |
| | | var executeCommand = db.Insertable(userInsert).ExecuteCommand(); |
| | | if (executeCommand > 0) |
| | | if (db.Insertable(staffList).ExecuteCommand() > 0) |
| | | return true; |
| | | |
| | | throw new ArgumentNullException("å®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éå é¤åå·¥çæ¹æ³ |
| | | private bool DeleteStaffBatch(SqlSugarScope db, List<SysUser> userList, |
| | | List<MesStaff> staffList) |
| | | { |
| | | var sid = userList.FindAll(s => s.Type == "DELETE").Select(s => s.Sid) |
| | | .ToArray(); |
| | | var result = db.Deleteable<SysUser>() |
| | | .Where(s => sid.Contains(s.Sid)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | { |
| | | var ids = staffList.Select(it => it.Id).ToArray(); |
| | | if (db.Deleteable<MesStaff>().In(ids).ExecuteCommand() > 0) |
| | | return true; |
| | | } |
| | | |
| | | throw new ArgumentNullException("åå®¡æ ¸å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥ææ´æ°åå·¥çæ¹æ³ |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, List<SysUser> userList, |
| | | List<MesStaff> staffList) |
| | | { |
| | | foreach (var sysUser in userList) |
| | | { |
| | | var entity = staffList.First(s => s.Id == sysUser.Sid); |
| | | if (!InsertOrUpdateStaff(db, sysUser, entity)) return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesSupplierManager : Repository<MesSupplier> |
| | | { |
| | | public bool Save(ErpSupplier unit) |
| | | { |
| | | var entity = GetMesSupplier(unit); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (unit.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateSupplierStatus(db, entity.Id, "A")) |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateSupplierStatus(db, entity.Id, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertSupplier(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteSupplier(entity.Id)) |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{unit.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpSupplier> suppliers) |
| | | { |
| | | var list = suppliers.Select(GetMesSupplier).ToList(); |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var supplierGroup in groupBy) |
| | | switch (supplierGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateSupplierStatusBatch(db, supplierGroup.Value, |
| | | "A")) |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateSupplierStatusBatch(db, supplierGroup.Value, |
| | | "B")) |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertSupplierBatch(db, supplierGroup.Value)) |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteSupplierBatch(db, supplierGroup.Value)) |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, supplierGroup.Value)) |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{supplierGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | private bool UpdateSupplierStatus(SqlSugarScope db, decimal supplierId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesSupplier>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == supplierId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertSupplier(SqlSugarScope db, MesSupplier entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteSupplier(decimal supplierId) |
| | | { |
| | | if (base.DeleteById(supplierId)) return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private MesSupplier GetMesSupplier(ErpSupplier supplier) |
| | | { |
| | | return new MesSupplier |
| | | { |
| | | Id = Convert.ToDecimal(supplier.Id), |
| | | SuppNo = supplier.FNumber, |
| | | SuppSname = supplier.FShortName, |
| | | SuppName = supplier.FName, |
| | | Lxr = supplier.FContact, |
| | | Telf1 = supplier.FTel, |
| | | Fstaffid = supplier.FStaffId, |
| | | Fforbidstatus = supplier.FForbidStatus, |
| | | Type = supplier.Type, |
| | | Remark = supplier.FDescription, |
| | | FSubsidiary = supplier.FUseOrgId, |
| | | Fumbrella = supplier.FCreateOrgId, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | private bool UpdateSupplierStatusBatch(SqlSugarScope db, |
| | | List<MesSupplier> supplierList, string status) |
| | | { |
| | | var ids = supplierList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesSupplier>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertSupplierBatch(SqlSugarScope db, |
| | | List<MesSupplier> supplierList) |
| | | { |
| | | var insertRange = db.Insertable(supplierList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteSupplierBatch(SqlSugarScope db, |
| | | List<MesSupplier> supplierList) |
| | | { |
| | | var ids = supplierList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<MesSupplier>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesSupplier entity) |
| | | { |
| | | db.Deleteable<MesSupplier>().Where(s => s.Id == entity.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, |
| | | List<MesSupplier> supplierList) |
| | | { |
| | | foreach (var entity in supplierList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class MesUnitManager : Repository<MesUnit> |
| | | { |
| | | public bool Save(ErpUnit unit) |
| | | { |
| | | var entity = GetMesUnit(unit); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (unit.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateUnitStatus(db, entity.Id, "A")) |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateUnitStatus(db, entity.Id, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertUnit(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteUnit(db, entity.Id)) |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{unit.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpUnit> units) |
| | | { |
| | | var list = units.Select(GetMesUnit).ToList(); |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var unitGroup in groupBy) |
| | | switch (unitGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateUnitStatusBatch(db, unitGroup.Value, "A")) |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateUnitStatusBatch(db, unitGroup.Value, "B")) |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertUnitBatch(db, unitGroup.Value)) |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteUnitBatch(db, unitGroup.Value)) |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, unitGroup.Value)) |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{unitGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | private bool UpdateUnitStatus(SqlSugarScope db, decimal unitId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<MesUnit>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == unitId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertUnit(SqlSugarScope db, MesUnit entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteUnit(SqlSugarScope db, decimal unitId) |
| | | { |
| | | var deleteById = db.Deleteable<MesUnit>().In(unitId).ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private MesUnit GetMesUnit(ErpUnit unit) |
| | | { |
| | | return new MesUnit |
| | | { |
| | | Id = Convert.ToDecimal(unit.Id), |
| | | Fnumber = unit.FNumber, |
| | | Fname = unit.FName, |
| | | Funitgroupid = unit.FUnitGroupId, |
| | | Fconvertdenominator = unit.FConvertDenominator, |
| | | Fcurrentunitid = unit.FCurrentUnitId, |
| | | Fconvertnumerator = unit.FConvertNumerator, |
| | | Fbaseunit = unit.FBaseUnit, |
| | | Froundtype = unit.FRoundType, |
| | | Fprecision = unit.FPrecision, |
| | | Fdescription = unit.FDescription, |
| | | Fforbidstatus = unit.FForbidStatus, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | private bool UpdateUnitStatusBatch(SqlSugarScope db, List<MesUnit> unitList, |
| | | string status) |
| | | { |
| | | var ids = unitList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<MesUnit>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertUnitBatch(SqlSugarScope db, List<MesUnit> unitList) |
| | | { |
| | | var insertRange = db.Insertable(unitList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteUnitBatch(SqlSugarScope db, List<MesUnit> unitList) |
| | | { |
| | | var ids = unitList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<MesUnit>().In(ids).ExecuteCommand(); |
| | | return deleteByIds > 0; |
| | | } |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, MesUnit entity) |
| | | { |
| | | var exists = db.Queryable<MesUnit>().Any(e => e.Id == entity.Id); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | if (update > 0) |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, List<MesUnit> unitList) |
| | | { |
| | | foreach (var entity in unitList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using MES.Service.Dto.webApi; |
| | | using System.Xml.Linq; |
| | | |
| | | namespace MES.Service.service; |
| | | |
| | | public class OrganizeManager : Repository<Organize> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | //Mesorganization |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ OrganizeManager.cs |
| | | public bool Save(ErpOrganize item) |
| | | { |
| | | var entity = GetOrganize(item); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (item.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateOrganizetatus(db, entity.Id, "A")) |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateOrganizetatus(db, entity.Id, "B")) |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertItem(db, entity)) |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteItem(db, Convert.ToDecimal(entity.Id))) |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdate(db, entity)) |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{item.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | public bool SaveList(List<ErpOrganize> Organize) |
| | | { |
| | | var list = Organize.Select(GetOrganize).ToList(); |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var itemGroup in groupBy) |
| | | switch (itemGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateOrganizetatusBatch(db, itemGroup.Value, "A")) |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateOrganizetatusBatch(db, itemGroup.Value, "B")) |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteItemBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateBatch(db, itemGroup.Value)) |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{itemGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | private bool UpdateOrganizetatus(SqlSugarScope db, string itemId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<Organize>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => s.Id == itemId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertItem(SqlSugarScope db, Organize entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItem(SqlSugarScope db, decimal itemId) |
| | | { |
| | | var deleteById = db.Deleteable<Organize>().In(itemId).ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private Organize GetOrganize(ErpOrganize Organize) |
| | | { |
| | | return new Organize |
| | | { |
| | | Id = Organize.Id, |
| | | Fnumber = Organize.FNumber, |
| | | Fname = Organize.FName, |
| | | Type = Organize.Type, |
| | | FDescription = Organize.FDescription, |
| | | FParentID = Organize.FParentID, |
| | | FCreateDate = Organize.FCreateDate != null |
| | | ? DateTime.ParseExact(Organize.FCreateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null, |
| | | FFORBIDORID = Organize.FFORBIDORID, |
| | | FFORBIDDATE = Organize.FFORBIDDATE != null |
| | | ? DateTime.ParseExact(Organize.FFORBIDDATE, |
| | | "yyyy-MM-dd HH:mm:ss", null) |
| | | : null |
| | | }; |
| | | } |
| | | |
| | | private bool UpdateOrganizetatusBatch(SqlSugarScope db, |
| | | List<Organize> itemList, string status) |
| | | { |
| | | var ids = itemList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<Organize>() |
| | | .SetColumns(s => s.Fforbidstatus == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertItemBatch(SqlSugarScope db, List<Organize> itemList) |
| | | { |
| | | var insertRange = db.Insertable(itemList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | private bool DeleteItemBatch(SqlSugarScope db, List<Organize> itemList) |
| | | { |
| | | var ids = itemList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = db.Deleteable<Organize>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | private bool InsertOrUpdate(SqlSugarScope db, Organize entity) |
| | | { |
| | | var exists = db.Queryable<Organize>().Any(e => e.Id == entity.Id); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | if (update > 0) |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private bool InsertOrUpdateBatch(SqlSugarScope db, List<Organize> itemList) |
| | | { |
| | | foreach (var entity in itemList) |
| | | if (!InsertOrUpdate(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel() { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = base.GetPageList(it => 1 == 1, p, it => SqlFunc.GetRandom(), OrderByType.Asc); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | List<IConditionalModel> conModels = new(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel() |
| | | { |
| | | FieldName = typeof(Organize).GetProperties()[0].Name, ConditionalType = ConditionalType.Equal, |
| | | FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom(), OrderByType.Asc); |
| | | |
| | | AsQueryable().Where(x => 1 == 1).ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new Organize() { }; //æµè¯åæ° |
| | | var insertArray = new Organize[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new Organize() { }; //æµè¯åæ° |
| | | var updateArray = new Organize[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new Organize() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new Organize() { }; //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new int[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2).ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class SalesOrderDetailManager : Repository<SalesOrderDetail> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ SalesOrderDetailManager.cs |
| | | |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = |
| | | base.GetPageList(it => 1 == 1, p, |
| | | it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel |
| | | { |
| | | FieldName = typeof(SalesOrderDetail).GetProperties()[0].Name, |
| | | ConditionalType = ConditionalType.Equal, FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); |
| | | |
| | | AsQueryable().Where(x => 1 == 1) |
| | | .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new SalesOrderDetail(); //æµè¯åæ° |
| | | var insertArray = new[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new SalesOrderDetail(); //æµè¯åæ° |
| | | var updateArray = new[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new SalesOrderDetail() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new SalesOrderDetail(); //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2) |
| | | .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class SalesOrderManager : Repository<SalesOrder> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ SalesOrderManager.cs |
| | | |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = |
| | | base.GetPageList(it => 1 == 1, p, |
| | | it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel |
| | | { |
| | | FieldName = typeof(SalesOrder).GetProperties()[0].Name, |
| | | ConditionalType = ConditionalType.Equal, FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); |
| | | |
| | | AsQueryable().Where(x => 1 == 1) |
| | | .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new SalesOrder(); //æµè¯åæ° |
| | | var insertArray = new[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new SalesOrder(); //æµè¯åæ° |
| | | var updateArray = new[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new SalesOrder() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new SalesOrder(); //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2) |
| | | .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class |
| | | SalesReturnNoticeDetailManager : Repository<SalesReturnNoticeDetail> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ SalesReturnNoticeDetailManager.cs |
| | | |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = |
| | | base.GetPageList(it => 1 == 1, p, |
| | | it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel |
| | | { |
| | | FieldName = typeof(SalesReturnNoticeDetail).GetProperties()[0].Name, |
| | | ConditionalType = ConditionalType.Equal, FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); |
| | | |
| | | AsQueryable().Where(x => 1 == 1) |
| | | .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new SalesReturnNoticeDetail(); //æµè¯åæ° |
| | | var insertArray = new[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new SalesReturnNoticeDetail(); //æµè¯åæ° |
| | | var updateArray = new[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new SalesReturnNoticeDetail() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new SalesReturnNoticeDetail(); //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2) |
| | | .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class SalesReturnNoticeManager : Repository<SalesReturnNotice> |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class ShipmentDetailManager : Repository<ShipmentDetail> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ ShipmentDetailManager.cs |
| | | |
| | | |
| | | #region æå¦æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ |
| | | /// </summary> |
| | | public void Study() |
| | | { |
| | | /*********æ¥è¯¢*********/ |
| | | |
| | | var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ |
| | | var data2 = base.GetList(); //æ¥è¯¢ææ |
| | | var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ |
| | | //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,妿è¶
è¿ä¸æ¡ä¼æ¥é |
| | | |
| | | var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ |
| | | var data5 = base.GetPageList(it => 1 == 1, p); |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var data6 = |
| | | base.GetPageList(it => 1 == 1, p, |
| | | it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount); //è¿åæ»æ° |
| | | |
| | | var conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel |
| | | { |
| | | FieldName = typeof(ShipmentDetail).GetProperties()[0].Name, |
| | | ConditionalType = ConditionalType.Equal, FieldValue = "1" |
| | | }); //id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); |
| | | |
| | | AsQueryable().Where(x => 1 == 1) |
| | | .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new ShipmentDetail(); //æµè¯åæ° |
| | | var insertArray = new[] { insertData }; |
| | | base.Insert(insertData); //æå
¥ |
| | | base.InsertRange(insertArray); //æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData); //æå
¥è¿åèªå¢å |
| | | AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new ShipmentDetail(); //æµè¯åæ° |
| | | var updateArray = new[] { updateData }; //æµè¯åæ° |
| | | base.Update(updateData); //æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray); //æ¹éæ´æ° |
| | | //base.Update(it => new ShipmentDetail() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new ShipmentDetail(); //æµè¯åæ° |
| | | base.Delete(deldata); //æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ |
| | | AsDeleteable().Where(it => 1 == 2) |
| | | .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | |
| | | #endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class ShipmentNoticeManager : Repository<ShipmentNotice> |
| | | { |
| | | private readonly ShipmentDetailManager shipmentDetailManager = new(); |
| | | |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | public bool Save(ErpShipment shipment) |
| | | { |
| | | var shipmentNotice = GetShipmentNotice(shipment.ShipmentNotice); |
| | | |
| | | var shipmentDetails = GetShipmentDetails(shipment.ShipmentDetails); |
| | | |
| | | return false; |
| | | } |
| | | |
| | | private ShipmentNotice GetShipmentNotice(ErpShipmentNotice notice) |
| | | { |
| | | var entity = new ShipmentNotice(); |
| | | |
| | | entity.Creator = notice.FCreatorId; |
| | | entity.DocId = notice.FBillNo; |
| | | entity.Approver = notice.FApproverID; |
| | | |
| | | if (notice.FCreateDate != null) |
| | | entity.CreateDate = DateTime.ParseExact(notice.FCreateDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | if (notice.FApproveDate != null) |
| | | entity.ApproveDate = DateTime.ParseExact(notice.FApproveDate, |
| | | "yyyy-MM-dd HH:mm:ss", null); |
| | | |
| | | entity.DeptCode = notice.FSaleDeptId; |
| | | entity.CustCode = notice.FCustomerID; |
| | | entity.ListNote = notice.FNote; |
| | | entity.RepCode = notice.FSalesManID; |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | private List<ShipmentDetail> GetShipmentDetails( |
| | | List<ErpShipmentDetail> shipmentDetails) |
| | | { |
| | | return shipmentDetails.Select(s => |
| | | { |
| | | var entity = new ShipmentDetail |
| | | { |
| | | ErpId = s.ErpId, |
| | | ErpHeadId = s.ErpHeadId, |
| | | ProdCode = s.FMaterialID, |
| | | ProdName = s.FMaterialName, |
| | | Amount = Convert.ToDouble(s.FAmount), |
| | | UnitPrice = Convert.ToDouble(s.FPrice), |
| | | Quantity = Convert.ToDouble(s.FQty), |
| | | BatchNo = s.FLot, |
| | | Remarks = s.FNoteEntry, |
| | | OrderNo = s.F_UNW_Text_xsddh, |
| | | OrderId = s.FSOEntryId, |
| | | BasePrice = Convert.ToDouble(s.FPrice), |
| | | WarehouseCode = s.FStockID, |
| | | Unit = s.FBaseUnitID |
| | | }; |
| | | return entity; |
| | | }).ToList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Castle.Core.Resource; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.BasicData; |
| | | |
| | | public class SysDepartmentManager : Repository<SysDepartment> |
| | | { |
| | | // å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | // Save æ¹æ³ç¨äºä¿åå个é¨é¨è®°å½ï¼æ ¹æ®ç±»åæ§è¡ä¸åçæä½ |
| | | public bool Save(ErpDepartment department) |
| | | { |
| | | var entity = |
| | | GetSysDepartment(department); // å° ErpDepartment 转æ¢ä¸º SysDepartment |
| | | |
| | | return UseTransaction(db => |
| | | { |
| | | switch (department.Type) |
| | | { |
| | | case "0": |
| | | if (UpdateDepartmentStatus(db, entity.Id, "A")) // å¯ç¨é¨é¨ |
| | | return 1; |
| | | break; |
| | | case "1": |
| | | if (UpdateDepartmentStatus(db, entity.Id, "B")) // ç¦ç¨é¨é¨ |
| | | return 1; |
| | | break; |
| | | case "2": |
| | | if (InsertDepartment(db, entity)) // æå
¥æ°é¨é¨ |
| | | return 1; |
| | | break; |
| | | case "3": |
| | | if (DeleteDepartment(db, entity.Id)) // å é¤é¨é¨ |
| | | return 1; |
| | | break; |
| | | case "4": |
| | | if (InsertOrUpdateDepartment(db, entity)) // æå
¥ææ´æ°é¨é¨ |
| | | return 1; |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{department.Type}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | throw new NotImplementedException("æä½å¤±è´¥"); |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ´æ°é¨é¨ç¶æçæ¹æ³ |
| | | private bool UpdateDepartmentStatus(SqlSugarScope db, decimal departmentId, |
| | | string status) |
| | | { |
| | | var result = db.Updateable<SysDepartment>() |
| | | .SetColumns(s => s.Depextr4 == status) |
| | | .Where(s => s.Id == departmentId).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥æ°é¨é¨çæ¹æ³ |
| | | private bool InsertDepartment(SqlSugarScope db, SysDepartment entity) |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | // å é¤é¨é¨çæ¹æ³ |
| | | private bool DeleteDepartment(SqlSugarScope db, decimal departmentId) |
| | | { |
| | | var deleteById = db.Deleteable<SysDepartment>().In(departmentId) |
| | | .ExecuteCommand(); |
| | | if (deleteById > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // æå
¥ææ´æ°é¨é¨çæ¹æ³ |
| | | private bool InsertOrUpdateDepartment(SqlSugarScope db, |
| | | SysDepartment entity) |
| | | { |
| | | var exists = db.Queryable<SysDepartment>().Any(e => e.Id == entity.Id); |
| | | if (exists) |
| | | { |
| | | var update = db.Updateable(entity).ExecuteCommand(); |
| | | if (update > 0) |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | var insert = db.Insertable(entity).ExecuteCommand(); |
| | | if (insert > 0) |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // å° ErpDepartment 对象转æ¢ä¸º SysDepartment å¯¹è±¡çæ¹æ³ |
| | | private SysDepartment GetSysDepartment(ErpDepartment department) |
| | | { |
| | | return new SysDepartment |
| | | { |
| | | Departmentcode = department.FNumber, |
| | | Departmentname = department.FName, |
| | | Departmentid = Convert.ToDecimal(department.Id), |
| | | Id = Convert.ToDecimal(department.Id), |
| | | Depextr1 = department.FDeptProperty, |
| | | Depextr2 = department.FGroup, |
| | | Depextr3 = department.FWIPStockID, |
| | | Depextr4 = department.FForbidStatus, |
| | | FParentID = department.FParentID, |
| | | FSubsidiary = department.FUseOrgId, |
| | | Fumbrella = department.FCreateOrgId, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateDate = DateTime.Now, |
| | | Company = "1000", |
| | | Factory = "1000" |
| | | }; |
| | | } |
| | | |
| | | // SaveList æ¹æ³ç¨äºä¿åå¤ä¸ªé¨é¨è®°å½ï¼æ ¹æ®ç±»åæ¹éæ§è¡ä¸åçæä½ |
| | | public bool SaveList(List<ErpDepartment> departments) |
| | | { |
| | | var list = new List<SysDepartment>(); |
| | | departments.ForEach(s => |
| | | { |
| | | var entity = |
| | | GetSysDepartment(s); // å° ErpDepartment 转æ¢ä¸º SysDepartment |
| | | entity.Type = s.Type; |
| | | list.Add(entity); |
| | | }); |
| | | |
| | | var groupBy = list.GroupBy(s => s.Type) |
| | | .ToDictionary(g => g.Key, g => g.ToList()); |
| | | return UseTransaction(db => |
| | | { |
| | | foreach (var departmentGroup in groupBy) |
| | | switch (departmentGroup.Key) |
| | | { |
| | | case "0": |
| | | if (!UpdateDepartmentStatusBatch(db, |
| | | departmentGroup.Value, "A")) // æ¹éå¯ç¨é¨é¨ |
| | | throw new NotImplementedException("å¯ç¨å¤±è´¥"); |
| | | break; |
| | | case "1": |
| | | if (!UpdateDepartmentStatusBatch(db, |
| | | departmentGroup.Value, "B")) // æ¹éç¦ç¨é¨é¨ |
| | | throw new NotImplementedException("ç¦ç¨å¤±è´¥"); |
| | | break; |
| | | case "2": |
| | | if (!InsertDepartmentBatch(db, |
| | | departmentGroup.Value)) // æ¹éæå
¥é¨é¨ |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | break; |
| | | case "3": |
| | | if (!DeleteDepartmentBatch(db, |
| | | departmentGroup.Value)) // æ¹éå é¤é¨é¨ |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | break; |
| | | case "4": |
| | | if (!InsertOrUpdateDepartmentBatch(db, |
| | | departmentGroup.Value)) // æ¹éæå
¥ææ´æ°é¨é¨ |
| | | throw new NotImplementedException("åæ¥å¤±è´¥"); |
| | | break; |
| | | default: |
| | | throw new ArgumentNullException( |
| | | $"type没æ{departmentGroup.Key}è¿ä¸ªç±»åçåæ°"); |
| | | } |
| | | |
| | | return 1; |
| | | }) > 0; |
| | | } |
| | | |
| | | // æ¹éæ´æ°é¨é¨ç¶æçæ¹æ³ |
| | | private bool UpdateDepartmentStatusBatch(SqlSugarScope db, |
| | | List<SysDepartment> departmentList, string status) |
| | | { |
| | | var ids = departmentList.Select(it => it.Id).ToArray(); |
| | | var result = db.Updateable<SysDepartment>() |
| | | .SetColumns(s => s.Depextr4 == status) |
| | | .Where(s => ids.Contains(s.Id)).ExecuteCommand(); |
| | | |
| | | if (result > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException(status == "A" ? "å¯ç¨å¤±è´¥" : "ç¦ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥é¨é¨çæ¹æ³ |
| | | private bool InsertDepartmentBatch(SqlSugarScope db, |
| | | List<SysDepartment> departmentList) |
| | | { |
| | | var insertRange = db.Insertable(departmentList).ExecuteCommand(); |
| | | if (insertRange > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éå é¤é¨é¨çæ¹æ³ |
| | | private bool DeleteDepartmentBatch(SqlSugarScope db, |
| | | List<SysDepartment> departmentList) |
| | | { |
| | | var ids = departmentList.Select(it => it.Id).ToArray(); |
| | | var deleteByIds = |
| | | db.Deleteable<SysDepartment>().In(ids).ExecuteCommand(); |
| | | if (deleteByIds > 0) |
| | | return true; |
| | | |
| | | throw new NotImplementedException("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // æ¹éæå
¥ææ´æ°é¨é¨çæ¹æ³ |
| | | private bool InsertOrUpdateDepartmentBatch(SqlSugarScope db, |
| | | List<SysDepartment> departmentList) |
| | | { |
| | | foreach (var entity in departmentList) |
| | | if (!InsertOrUpdateDepartment(db, entity)) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service; |
| | | |
| | | public class MessageCenterManager : Repository<MessageCenter> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | public List<MessageCenter> GetPushFailedPage(MessageCenter query) |
| | | { |
| | | return Context.Queryable<MessageCenter>() |
| | | .Where(it => |
| | | it.Result == 0 && it.Status == 1 && |
| | | it.Seq == 1 && it.Title != null) |
| | | .WhereIF(query.isShow == 1, it => it.DealWith == 0) |
| | | .OrderByDescending(it => it.CreateDate) |
| | | .ToPageList(1, 20); |
| | | } |
| | | |
| | | public int save(MessageCenter entity) |
| | | { |
| | | entity.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | entity.Method = "POST"; |
| | | return Db.Insertable(entity).ExecuteReturnIdentity(); |
| | | } |
| | | |
| | | public bool SetError(MessageCenter entity) |
| | | { |
| | | entity.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | entity.Method = "POST"; |
| | | entity.Result = 0; |
| | | entity.DealWith = 0; |
| | | entity.Status = 1; |
| | | return base.Insert(entity); |
| | | } |
| | | |
| | | //è·åæææ²¡ææåçè¯·æ± |
| | | public List<MessageCenter> ErrorMsg() |
| | | { |
| | | return Context.Queryable<MessageCenter>() |
| | | .GroupBy(a => new |
| | | { |
| | | a.TableName, a.Pid, a.Title, a.PageName |
| | | }) |
| | | .Where(a => |
| | | a.DealWith == 0 && a.Status == 0 && a.Result == 0 && |
| | | a.Title == null) |
| | | .Select<MessageCenter>(a => new MessageCenter |
| | | { |
| | | TableName = a.TableName, |
| | | Pid = a.Pid, |
| | | Title = a.Title, |
| | | PageName = a.PageName, |
| | | Count = SqlFunc.AggregateCount(a.Guid) |
| | | }).ToList(); |
| | | } |
| | | //æ ¹æ®å ç§æ
嵿´æ° ä¿æé¡µé¢idæ¯åºå®ç |
| | | |
| | | |
| | | //åå°éæ°åé |
| | | public int ResetUpdate(MessageCenter entity) |
| | | { |
| | | return UseTransaction(db => |
| | | { |
| | | return db.Updateable<MessageCenter>() |
| | | .SetColumns(a => a.Data == entity.Data) |
| | | .SetColumns(a => a.Result == entity.Result) |
| | | .SetColumns(a => a.ResultData == entity.ResultData) |
| | | .SetColumns(a => a.Status == entity.Status) |
| | | .SetColumns(a => a.DealWith == entity.DealWith) |
| | | .Where(a => a.Guid == entity.Guid) |
| | | .ExecuteCommand(); |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesCustomerController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesCustomerManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_CUSTOMER"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesCustomer/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpCustomer unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpCustomer> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesCustomer data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesCustomer data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesCustomer data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesDepotsController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesDepotsManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_DEPOTS"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesDepots/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpDepots unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpDepots> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesDepots data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesDepots data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesDepots data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesItemTypeController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly MesItemTypeManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_ITEM_TYPE"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesItemType/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpItemType unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpItemType> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesItemType data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesItemType data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesItemType data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesItemsController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesItemsManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_ITEMS"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesItems/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpItems unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpItems> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesItems data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesItems data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesItems data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesPositionController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly MesPositionManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | private readonly string TableName = "MES_POSITION"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesPosition/"; |
| | | |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpPosition unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpPosition> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesPosition data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesPosition data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesPosition data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesRohInController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesRohInManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_ROHIN"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesRohIn/"; |
| | | |
| | | // |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(RohIn rohIn) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(rohIn); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(rohIn); |
| | | |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<RohIn> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesRohIn data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesRohIn data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesRohIn data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesRohInDataController : ControllerBase |
| | | { |
| | | private readonly MesRohInDataManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesRohInData data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesRohInData data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesRohInData data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesStaffController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly MesStaffManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | private readonly string TableName = "MES_STAFF"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesStaff/"; |
| | | |
| | | [HttpPost("SaveStaff")] |
| | | public ResponseResult SaveStaff(ErpStaff staff) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveStaff"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(staff); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(staff); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveStaffList")] |
| | | public ResponseResult SaveStaffList(List<ErpStaff> staffs) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveStaffList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(staffs); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var saveList = m.SaveList(staffs); |
| | | resultInfos.tbBillList = saveList; |
| | | |
| | | |
| | | entity.Result = 0; |
| | | if (saveList) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesStaff data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesStaff data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesStaff data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesSupplierController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesSupplierManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_SUPPLIER"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesSupplier/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpSupplier unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpSupplier> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesSupplier data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesSupplier data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesSupplier data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesUnitController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly MesUnitManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MES_UNIT"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesUnit/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpUnit unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpUnit> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] MesUnit data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] MesUnit data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] MesUnit data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Logging; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.util; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.service.BasicData; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class OrganizeController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly OrganizeManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "Organize"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/Organize/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpOrganize unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpOrganize> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | // private OrganizeManager m = new OrganizeManager(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] Organize data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] Organize data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] Organize data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class SalesOrderController : ControllerBase |
| | | { |
| | | private readonly SalesOrderManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] SalesOrder data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] SalesOrder data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] SalesOrder data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class SalesOrderDetailController : ControllerBase |
| | | { |
| | | private readonly SalesOrderDetailManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] SalesOrderDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] SalesOrderDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] SalesOrderDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class SalesReturnNoticeController : ControllerBase |
| | | { |
| | | private readonly SalesReturnNoticeManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] SalesReturnNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity( |
| | | [FromBody] SalesReturnNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] SalesReturnNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class SalesReturnNoticeDetailController : ControllerBase |
| | | { |
| | | private readonly SalesReturnNoticeDetailManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] SalesReturnNoticeDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity( |
| | | [FromBody] SalesReturnNoticeDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] SalesReturnNoticeDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class ShipmentDetailController : ControllerBase |
| | | { |
| | | private readonly ShipmentDetailManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] ShipmentDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] ShipmentDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] ShipmentDetail data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class ShipmentNoticeController : ControllerBase |
| | | { |
| | | private readonly ShipmentNoticeManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] ShipmentNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] ShipmentNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] ShipmentNotice data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers.BasicData; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class SysDepartmentController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly SysDepartmentManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | private readonly string TableName = "SYS_DEPARTMENT"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/SysDepartment/"; |
| | | |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpDepartment unit) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(unit); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(unit); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpDepartment> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] SysDepartment data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] SysDepartment data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] SysDepartment data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk.Web"> |
| | | <Project Sdk="Microsoft.NET.Sdk.Web"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net8.0</TargetFramework> |
| | | <Nullable>enable</Nullable> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <InvariantGlobalization>true</InvariantGlobalization> |
| | | <GenerateDocumentationFile>True</GenerateDocumentationFile> |
| | | </PropertyGroup> |
| | | |
| | |
| | | <PrivateAssets>all</PrivateAssets> |
| | | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
| | | </PackageReference> |
| | | <PackageReference Include="Oracle.EntityFrameworkCore" Version="8.21.121"/> |
| | | <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\MES.Service\MES.Service.csproj"/> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Controllers\BasicData\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | "AppSettings": { |
| | | "TestErpUrl": "http://192.168.0.208:8066/WebService1.asmx/MesToErpinfoTest", |
| | | "ProductionErpUrl": "http://192.168.0.208:8066/WebService1.asmx/MesToErpinfoTest", |
| | | "DataBaseConn": "Data Source=192.168.1.146;Initial Catalog=GS_MES;User ID=sa;Password =qixi123" |
| | | "DataBaseConn": "Data Source=192.168.1.146;Initial Catalog=GS_MES;User ID=sa;Password =qixi123;Encrypt=True;TrustServerCertificate=True;" |
| | | } |
| | | } |