Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/StandardPda
# Conflicts:
# MES.Service/bin/Debug/net8.0/MES.Service.dll
# MES.Service/bin/Debug/net8.0/MES.Service.pdb
# MESApplication/bin/Debug/net8.0/MES.Service.dll
# MESApplication/bin/Debug/net8.0/MES.Service.pdb
# MESApplication/bin/Debug/net8.0/MESApplication.dll
# MESApplication/bin/Debug/net8.0/MESApplication.exe
# MESApplication/bin/Debug/net8.0/MESApplication.pdb
| | |
| | | |
| | | public class Repository<T> : SimpleClient<T> where T : class, new() |
| | | { |
| | | public static SqlSugarScope Db = new(new ConnectionConfig |
| | | protected static SqlSugarScope Db = new(new ConnectionConfig |
| | | { |
| | | DbType = DbType.Oracle, |
| | | ConnectionString = AppsettingsUtility.Settings.DataBaseConn, |
| | |
| | | if (context == null) Context = Db; |
| | | } |
| | | |
| | | public int UseTransaction(Func<SqlSugarScope, int> action) |
| | | protected int UseTransaction(Func<SqlSugarScope, int> action) |
| | | { |
| | | try |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.DB; |
| | | |
| | | public class RepositoryNoEntity |
| | | { |
| | | protected static SqlSugarScope Db = new(new ConnectionConfig |
| | | { |
| | | DbType = DbType.Oracle, |
| | | ConnectionString = AppsettingsUtility.Settings.DataBaseConn, |
| | | IsAutoCloseConnection = true |
| | | }, |
| | | db => |
| | | { |
| | | db.Aop.OnLogExecuting = (sql, pars) => |
| | | { |
| | | Console.WriteLine( |
| | | UtilMethods.GetSqlString(DbType.Oracle, sql, pars)); |
| | | }; |
| | | }); |
| | | |
| | | |
| | | protected int UseTransaction(Func<SqlSugarScope, int> action) |
| | | { |
| | | try |
| | | { |
| | | Db.Ado.BeginTran(); // å¼å§äºå¡ |
| | | var affectedRows = action.Invoke(Db); // æ§è¡ä¼ å
¥çæä½å¹¶è·ååå½±åçè¡æ° |
| | | Db.Ado.CommitTran(); // æäº¤äºå¡ |
| | | return affectedRows; // è¿ååå½±åçè¡æ° |
| | | } |
| | | catch (Exception) |
| | | { |
| | | Db.Ado.RollbackTran(); // åæ»äºå¡ |
| | | throw; // éæ°æåºå¼å¸¸ |
| | | } |
| | | } |
| | | } |
| | |
| | | public List<MesInvItemInCDetails>? InvItemInCDetails { get; set; } |
| | | |
| | | public List<MesInvItemInCItems>? ItemInDetails { get; set; } |
| | | |
| | | public List<MesInvItemStocks>? ItemStocks { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | /// <summary> |
| | | /// ä»ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarTable("MES_DEPOT_SECTIONS")] |
| | | public class MesDepotSections |
| | | { |
| | | /// <summary> |
| | | /// ID(SEQ_INV_ID)ï¼ERPIDï¼ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_SECTION_ID", IsPrimaryKey = true)] |
| | | public decimal DepotSectionId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_SECTION_CODE")] |
| | | public string DepotSectionCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½åç§° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_SECTION_NAME")] |
| | | public string DepotSectionName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_ID")] |
| | | public decimal? DepotId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä¸é½å¥æ ¡éª(0:å¦,1:æ¯) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "COMPLETENESS_FLAG")] |
| | | public short? CompletenessFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DESCRIPTION")] |
| | | public string Description { 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> |
| | | /// 塿¿æ° |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "KB_QTY")] |
| | | public decimal? KbQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»ä½ç»ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ZUID")] |
| | | public decimal? Zuid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»ä½å
¨å |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "DEPOT_SECTION_NAMET")] |
| | | public string DepotSectionNamet { get; set; } |
| | | |
| | | /// <summary> |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ERPID")] |
| | | public decimal? Erpid { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å«ç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string? DepotCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å«åç§° |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string? DepotName { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using SqlSugar; |
| | | namespace MES.Service.Modes |
| | | { |
| | | /// <summary> |
| | | /// åºå交æè®°å½è¡¨ |
| | | ///</summary> |
| | | [SugarTable("MES_INV_BUSINESS2")] |
| | | public class MesInvBusiness2 |
| | | { |
| | | /// <summary> |
| | | /// ID(seq_inv_id) |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="ID",OracleSequenceName = "SEQ_ID",IsPrimaryKey = true )] |
| | | public decimal Id { get; set; } |
| | | /// <summary> |
| | | /// ç¶æ|0-æªäº¤æ1-已交æ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="STATUS" )] |
| | | public decimal? Status { get; set; } |
| | | /// <summary> |
| | | /// åæ®ç±»åID |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="BILL_TYPE_ID" )] |
| | | public decimal? BillTypeId { get; set; } |
| | | /// <summary> |
| | | /// äºå¡ç±»åç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="TRANSACTION_CODE" )] |
| | | public string TransactionCode { get; set; } |
| | | /// <summary> |
| | | /// 交æç±»å|1-å
¥åº0-转åº-1åºåº |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="BUSINESS_TYPE" )] |
| | | public decimal? BusinessType { get; set; } |
| | | /// <summary> |
| | | /// 忮ID |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="BILL_ID" )] |
| | | public decimal? BillId { get; set; } |
| | | /// <summary> |
| | | /// åæ®ç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="BILL_NO" )] |
| | | public string BillNo { get; set; } |
| | | /// <summary> |
| | | /// ç产订åå· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="TASK_NO" )] |
| | | public string TaskNo { get; set; } |
| | | /// <summary> |
| | | /// 客æ·ç¼å· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="CUSTOMER_NO" )] |
| | | public string CustomerNo { get; set; } |
| | | /// <summary> |
| | | /// åæ®è¡ID |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="BILL_LINE_ID" )] |
| | | public decimal? BillLineId { get; set; } |
| | | /// <summary> |
| | | /// ç©ææ¡ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="ITEM_BARCODE" )] |
| | | public string ItemBarcode { get; set; } |
| | | /// <summary> |
| | | /// æ¬å¸ç©æç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="ITEM_NO" )] |
| | | public string ItemNo { get; set; } |
| | | /// <summary> |
| | | /// 客æ·ç©æç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="C_ITEM_CODE" )] |
| | | public string CItemCode { get; set; } |
| | | /// <summary> |
| | | /// åå®¶æ¹æ¬¡ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="LOT_NO" )] |
| | | public string LotNo { get; set; } |
| | | /// <summary> |
| | | /// æ¯å¦ç¯ä¿(0:å¦,1:æ¯) |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="EP_FLAG" )] |
| | | public short? EpFlag { get; set; } |
| | | /// <summary> |
| | | /// æ°é |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="QUANTITY" )] |
| | | public decimal? Quantity { get; set; } |
| | | /// <summary> |
| | | /// æºååºCODE |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FROM_INV_DEPOTS_CODE" )] |
| | | public string FromInvDepotsCode { get; set; } |
| | | /// <summary> |
| | | /// æºè´§ä½CODE |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FROM_INV_DEPOT_SECTIONS_CODE" )] |
| | | public string FromInvDepotSectionsCode { get; set; } |
| | | /// <summary> |
| | | /// ç®çååºCODE |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="TO_INV_DEPOTS_CODE" )] |
| | | public string ToInvDepotsCode { get; set; } |
| | | /// <summary> |
| | | /// ç®çè´§ä½CODE |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="TO_INV_DEPOT_SECTIONS_CODE" )] |
| | | public string ToInvDepotSectionsCode { get; set; } |
| | | /// <summary> |
| | | /// 交æå¼å¸¸ä¿¡æ¯ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="DESCRIPTION" )] |
| | | public string Description { 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="ULLAGE_STAT_FLAG" )] |
| | | public short? UllageStatFlag { 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="ITEM_BARCODE2" )] |
| | | public string ItemBarcode2 { get; set; } |
| | | /// <summary> |
| | | /// 塿¿æ¡ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="ITEM_BARCODE3" )] |
| | | public string ItemBarcode3 { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡åå· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="WORK_NO" )] |
| | | public string WorkNo { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡åè¡å· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="WORK_LINE" )] |
| | | public decimal? WorkLine { get; set; } |
| | | /// <summary> |
| | | /// ä¾åºå |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="SUPP_NO" )] |
| | | public string SuppNo { get; set; } |
| | | /// <summary> |
| | | /// ç产线 |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="LINE_NO" )] |
| | | public string LineNo { get; set; } |
| | | /// <summary> |
| | | /// éè´è®¢åid |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="EBELN_K3ID" )] |
| | | public decimal? EbelnK3id { get; set; } |
| | | /// <summary> |
| | | /// éè´è®¢åè¡id |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="LINE_K3ID" )] |
| | | public decimal? LineK3id { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// SEQ_OUT |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | [SugarColumn(ColumnName = "ID",OracleSequenceName = "SEQ_INV_ID", IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// ID(SEQ_INV_ID) |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_INV_ID", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | public class MesInvItemStocks |
| | | { |
| | | /// <summary> |
| | | /// SEQ_ME_ID |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_ME_ID", |
| | | IsPrimaryKey = true)] |
| | | public decimal Id { get; set; } |
| | | |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using SqlSugar; |
| | | namespace MES.Service.Modes |
| | | { |
| | | /// <summary> |
| | | /// æ¥ææ£éªä»è¡¨ |
| | | ///</summary> |
| | | [SugarTable("MES_QA_ITEMS_DETECT_DETAIL5")] |
| | | public class MesQaItemsDetectDetail5 |
| | | { |
| | | /// <summary> |
| | | /// |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="ID" ,IsPrimaryKey = true )] |
| | | public decimal Id { get; set; } |
| | | /// <summary> |
| | | /// æ åå¼ç±»å |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FTEXT_TYPE" )] |
| | | public string FtextType { get; set; } |
| | | /// <summary> |
| | | /// æ åå¼ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FSTAND" )] |
| | | public decimal? Fstand { get; set; } |
| | | /// <summary> |
| | | /// ä¸å
¬å·® |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FUP_ALLOW" )] |
| | | public string FupAllow { get; set; } |
| | | /// <summary> |
| | | /// ä¸å
¬å·® |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FDOWN_ALLOW" )] |
| | | public string FdownAllow { get; set; } |
| | | /// <summary> |
| | | /// æ£éªæ°´å |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="SAMPLE_SIZE_NO" )] |
| | | public string SampleSizeNo { get; set; } |
| | | /// <summary> |
| | | /// æ£éªæ°´å¹³ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FCHECK_LEVEL" )] |
| | | public string FcheckLevel { get; set; } |
| | | /// <summary> |
| | | /// ææ¶æ°´å¹³ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FAC_LEVEL" )] |
| | | public string FacLevel { get; set; } |
| | | /// <summary> |
| | | /// æ£éªé¡¹ç® |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FCHECK_ITEM" )] |
| | | public string FcheckItem { get; set; } |
| | | /// <summary> |
| | | /// è§æ ¼è¦æ± |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FSPEC_REQU" )] |
| | | public string FspecRequ { get; set; } |
| | | /// <summary> |
| | | /// æ½æ£æ°é |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="CHECK_QYT" )] |
| | | public decimal? CheckQyt { get; set; } |
| | | /// <summary> |
| | | /// æ£éªç»æ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FCHECK_RESU" )] |
| | | public string FcheckResu { get; set; } |
| | | /// <summary> |
| | | /// ACæ°é |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FAC_QTY" )] |
| | | public decimal? FacQty { get; set; } |
| | | /// <summary> |
| | | /// REæ°é |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FRE_QTY" )] |
| | | public decimal? FreQty { get; set; } |
| | | /// <summary> |
| | | /// ä¸åæ ¼æ° |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FNG_QTY" )] |
| | | public decimal? FngQty { get; set; } |
| | | /// <summary> |
| | | /// ä¸è¯ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FNG_RATE" )] |
| | | public decimal? FngRate { get; set; } |
| | | /// <summary> |
| | | /// å·²å½å
¥æ°é |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FENTER_QTY" )] |
| | | public decimal? FenterQty { get; set; } |
| | | /// <summary> |
| | | /// |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="RELEASE_NO" )] |
| | | public string ReleaseNo { 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="FCHECK_ITEM_DESC" )] |
| | | public string FcheckItemDesc { get; set; } |
| | | /// <summary> |
| | | /// å·¥åºå· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="PROC_NO" )] |
| | | public string ProcNo { get; set; } |
| | | /// <summary> |
| | | /// å·¥ä½ä¸å¿ç¼ç |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="WORKSHOP_CENTER_CODE" )] |
| | | public string WorkshopCenterCode { get; set; } |
| | | /// <summary> |
| | | /// åä½ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FUNIT" )] |
| | | public string Funit { get; set; } |
| | | /// <summary> |
| | | /// ç¹å®ä¿®æ¹ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="GIVEN_MODIFY" )] |
| | | public short? GivenModify { get; set; } |
| | | /// <summary> |
| | | /// æ£éªå·¥å
· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="FCHECK_TOOL" )] |
| | | public string FcheckTool { get; set; } |
| | | /// <summary> |
| | | /// æ´æ°äºº |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="LASTUPDATE_BY" )] |
| | | public string LastupdateBy { get; set; } |
| | | /// <summary> |
| | | /// æ´æ°æ¶é´ |
| | | ///</summary> |
| | | [SugarColumn(ColumnName="LASTUPDATE_DATE" )] |
| | | public DateTime? LastupdateDate { get; set; } |
| | | } |
| | | } |
| | |
| | | Lever = 0, |
| | | Fcompany = "1000", |
| | | Ffactory = "1000", |
| | | DelFlag = 0 |
| | | DelFlag = 0, |
| | | Ismanager = 0, |
| | | Isacq = 0, |
| | | ExpField9 = "1020", |
| | | QmUser = 0, |
| | | Status = 0, |
| | | Isdeparture = 0, |
| | | CheckFlag = 0, |
| | | ExpFiel12 = 0, |
| | | }; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | |
| | | namespace MES.Service.service.QC |
| | | { |
| | | public class MesQaItemsDetectDetail5Manager : Repository<MesQaItemsDetectDetail5> |
| | | { |
| | | |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ MesQaItemsDetectDetail5Manager.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(), OrderByType.Asc);// å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount);//è¿åæ»æ° |
| | | |
| | | List<IConditionalModel> conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel() { FieldName= typeof(MesQaItemsDetectDetail5).GetProperties()[0].Name, ConditionalType = ConditionalType.Equal, FieldValue = "1" });//id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom(), OrderByType.Asc); |
| | | |
| | | base.AsQueryable().Where(x => 1 == 1).ToList();//æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new MesQaItemsDetectDetail5() { };//æµè¯åæ° |
| | | var insertArray = new MesQaItemsDetectDetail5[] { insertData }; |
| | | base.Insert(insertData);//æå
¥ |
| | | base.InsertRange(insertArray);//æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData);//æå
¥è¿åèªå¢å |
| | | base.AsInsertable(insertData).ExecuteCommand();//æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new MesQaItemsDetectDetail5() { };//æµè¯åæ° |
| | | var updateArray = new MesQaItemsDetectDetail5[] { updateData };//æµè¯åæ° |
| | | base.Update(updateData);//æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray);//æ¹éæ´æ° |
| | | //base.Update(it => new MesQaItemsDetectDetail5() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | base.AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new MesQaItemsDetectDetail5() { };//æµè¯åæ° |
| | | base.Delete(deldata);//æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1);//æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new int[] { 1,2});//æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it=>1==2);//æ ¹æ®æ¡ä»¶å é¤ |
| | | base.AsDeleteable().Where(it=>1==2).ExecuteCommand();//转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.Warehouse; |
| | | |
| | | public class MesDepotSectionsManager : Repository<MesDepotSections> |
| | | { |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | public string GetSectionName(WarehouseQuery query) |
| | | { |
| | | var sectionName = Db.Queryable<MesDepotSections, MesDepots>((a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, a.DepotId == b.DepotId)) |
| | | .Where((a, b) => a.DepotSectionCode == query.sectionCode) |
| | | .Select((a, b) => a.DepotSectionName).Single(); |
| | | |
| | | if (sectionName == null) |
| | | { |
| | | throw new Exception("åºä½ç¼ç " + query.sectionCode + " ä¸åå¨ï¼è¯·ç¡®è®¤ï¼"); |
| | | } |
| | | |
| | | return sectionName; |
| | | } |
| | | |
| | | public MesDepotSections ScanInDepotSectionsName(WarehouseQuery query) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(query.sectionCode)) |
| | | { |
| | | throw new Exception("请æ«åºä½æ¡ç !"); |
| | | } |
| | | |
| | | var mesDepotSections = Db.Queryable<MesDepotSections, MesDepots>( |
| | | (a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, a.DepotId == b.DepotId)) |
| | | .Where((a, b) => a.DepotSectionCode == query.sectionCode) |
| | | .Select((a, b) => new MesDepotSections |
| | | { |
| | | DepotSectionName = a.DepotSectionName, |
| | | DepotCode = b.DepotCode, |
| | | DepotName = b.DepotName |
| | | }).First(); |
| | | |
| | | if (mesDepotSections == null) |
| | | { |
| | | throw new Exception("åºä½ç¼ç " + query.sectionCode + " ä¸åå¨ï¼è¯·ç¡®è®¤!"); |
| | | } |
| | | |
| | | return mesDepotSections; |
| | | } |
| | | |
| | | public MesInvItemStocks ScanEditBarcode(WarehouseQuery entity) |
| | | { |
| | | if (string.IsNullOrEmpty(entity.sectionCode)) |
| | | { |
| | | throw new Exception("请æ«åºä½æ¡ç !"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using MES.Service.DB; |
| | | using MES.Service.Modes; |
| | | |
| | | namespace MES.Service.service.Warehouse |
| | | { |
| | | public class MesInvBusiness2Manager : Repository<MesInvBusiness2> |
| | | { |
| | | |
| | | //å½å类已ç»ç»§æ¿äº Repository å¢ãå ãæ¥ãæ¹çæ¹æ³ |
| | | |
| | | //è¿éé¢åç代ç ä¸ä¼ç»è¦ç,妿è¦éæ°çæè¯·å é¤ MesInvBusiness2Manager.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(), OrderByType.Asc);// å页æ¥è¯¢å æåº |
| | | Console.Write(p.TotalCount);//è¿åæ»æ° |
| | | |
| | | List<IConditionalModel> conModels = new List<IConditionalModel>(); //ç»è£
æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº |
| | | conModels.Add(new ConditionalModel() { FieldName= typeof(MesInvBusiness2).GetProperties()[0].Name, ConditionalType = ConditionalType.Equal, FieldValue = "1" });//id=1 |
| | | var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom(), OrderByType.Asc); |
| | | |
| | | base.AsQueryable().Where(x => 1 == 1).ToList();//æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ |
| | | |
| | | |
| | | |
| | | /*********æå
¥*********/ |
| | | var insertData = new MesInvBusiness2() { };//æµè¯åæ° |
| | | var insertArray = new MesInvBusiness2[] { insertData }; |
| | | base.Insert(insertData);//æå
¥ |
| | | base.InsertRange(insertArray);//æ¹éæå
¥ |
| | | var id = base.InsertReturnIdentity(insertData);//æå
¥è¿åèªå¢å |
| | | base.AsInsertable(insertData).ExecuteCommand();//æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå
¥ |
| | | |
| | | |
| | | |
| | | /*********æ´æ°*********/ |
| | | var updateData = new MesInvBusiness2() { };//æµè¯åæ° |
| | | var updateArray = new MesInvBusiness2[] { updateData };//æµè¯åæ° |
| | | base.Update(updateData);//æ ¹æ®å®ä½æ´æ° |
| | | base.UpdateRange(updateArray);//æ¹éæ´æ° |
| | | //base.Update(it => new MesInvBusiness2() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å
¶å®å䏿´æ°ï¼æ¡ä»¶id=1 |
| | | base.AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå
¥ |
| | | |
| | | |
| | | |
| | | /*********å é¤*********/ |
| | | var deldata = new MesInvBusiness2() { };//æµè¯åæ° |
| | | base.Delete(deldata);//æ ¹æ®å®ä½å é¤ |
| | | base.DeleteById(1);//æ ¹æ®ä¸»é®å é¤ |
| | | base.DeleteById(new int[] { 1,2});//æ ¹æ®ä¸»é®æ°ç»å é¤ |
| | | base.Delete(it=>1==2);//æ ¹æ®æ¡ä»¶å é¤ |
| | | base.AsDeleteable().Where(it=>1==2).ExecuteCommand();//转æDeleteableå®ç°å¤æçæä½ |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | // æ¥è¯¢ |
| | | var result = Db |
| | | .Queryable<MesQaItemsDetect01, MesInvItemArn, MesInvItemArnDetail, |
| | | MesItems, MesUnit>( |
| | | (a, d, b, c, t) => new object[] |
| | | MesItems, MesUnit,MesQaItemsDetectDetail5>( |
| | | (a, d, b, c, t,z) => new object[] |
| | | { |
| | | JoinType.Inner, d.BillNo == a.LotNo, |
| | | JoinType.Inner, d.Id == b.Mid && b.ItemNo == a.ItemNo, |
| | | JoinType.Inner, |
| | | a.ItemNo == c.ItemNo && a.Company == c.Company && |
| | | a.Factory == c.Factory, |
| | | JoinType.Inner, c.Fpurchaseunitid == t.Id |
| | | JoinType.Inner, c.Fpurchaseunitid == t.Id, |
| | | JoinType.Inner, z.ReleaseNo == a.ReleaseNo |
| | | }) |
| | | .Where((a, d, b, c, t) => a.FngHandle == "éè´§" && |
| | | .Where((a, d, b, c, t,z) => a.FngHandle == "éè´§" && |
| | | z.FcheckResu == "ä¸åæ ¼" && |
| | | query.ItemArnDetailIds.Contains(b.Id)) |
| | | .Select((a, d, b, c, t) => new Material |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.service.Warehouse; |
| | | |
| | | public class OpeningReceiptServer : RepositoryNoEntity |
| | | { |
| | | private const string Factory = "1000"; |
| | | |
| | | private const string Company = "1000"; |
| | | |
| | | private const int billTypeId = 100; |
| | | |
| | | private const int transactionNo = 601; |
| | | |
| | | public MesInvItemBarcodes ScanInBarcodeQC(WarehouseQuery query) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(query.sectionCode)) |
| | | { |
| | | throw new Exception("请æ«åºä½æ¡ç ï¼"); |
| | | } |
| | | |
| | | var depotCode = GetDepotCode(query.sectionCode); |
| | | if (depotCode == null) |
| | | { |
| | | throw new Exception($"002[åºä½ç¼ç {query.sectionCode} ä¸åå¨ï¼è¯·ç¡®è®¤ï¼"); |
| | | } |
| | | |
| | | var checkBarcodeAlreadyReceived = |
| | | CheckBarcodeAlreadyReceived(query.barcode); |
| | | |
| | | if (checkBarcodeAlreadyReceived > 0) |
| | | { |
| | | throw new Exception("æ¡ç é夿«æï¼è¯·æ ¸å¯¹ï¼"); |
| | | } |
| | | |
| | | if (CheckBarcodeInStock(query.barcode) > 0) |
| | | { |
| | | throw new Exception("æ¡ç å·²å¨åºåä¸ï¼è¯·æ ¸å¯¹ï¼"); |
| | | } |
| | | |
| | | var barcodeInfo = GetBarcodeInfo(query.barcode); |
| | | if (barcodeInfo == null || barcodeInfo.ComeFlg != 0) |
| | | { |
| | | throw new Exception("æ¡ç 䏿¯æåæ¡ç ï¼æ æ³ç¨æåå
¥åºï¼"); |
| | | } |
| | | |
| | | var inventoryItemInId = GetOrCreateInventoryItemInId(barcodeInfo, |
| | | depotCode, query.userName, out string billNo); |
| | | |
| | | UseTransaction(db => |
| | | { |
| | | // Insert records |
| | | InsertInventoryDetails(inventoryItemInId, billNo, barcodeInfo, |
| | | depotCode, query.sectionCode, query.userName); |
| | | InsertBusinessRecord(barcodeInfo, depotCode, query.sectionCode, |
| | | billNo, |
| | | query.userName); |
| | | InsertStockRecord(barcodeInfo, depotCode, query.sectionCode, |
| | | query.userName); |
| | | return 1; |
| | | }); |
| | | |
| | | return barcodeInfo; |
| | | } |
| | | |
| | | public PurchaseInventory GetForm(WarehouseQuery query) |
| | | { |
| | | var mesInvItemBarcodes = Db.Queryable<MesInvItemBarcodes>() |
| | | .Where(s => s.ItemBarcode == query.barcode).Count(); |
| | | |
| | | if (mesInvItemBarcodes <= 0) |
| | | { |
| | | throw new Exception("æ¡ç ä¸åå¨"); |
| | | } |
| | | |
| | | var mesInvItemInCDetails = Db.Queryable<MesInvItemInCDetails>() |
| | | .Where(s => s.ItemBarcode == query.barcode).Single(); |
| | | |
| | | PurchaseInventory entity = new PurchaseInventory |
| | | { |
| | | ItemIns = GetMesInvItemIns(mesInvItemInCDetails.ItemInId), |
| | | InvItemInCDetails = |
| | | GetMesInvItemInCDetailsList(mesInvItemInCDetails.ItemInId), |
| | | ItemStocks = Db.Queryable<MesInvItemStocks>() |
| | | .Where(s => s.ItemBarcode == query.barcode).ToList() |
| | | }; |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | public MesInvItemIns GetMesInvItemIns(decimal id) |
| | | { |
| | | return Db.Queryable<MesInvItemIns>() |
| | | .Where(s => s.Id == id).Single(); |
| | | } |
| | | |
| | | public List<MesInvItemInCDetails> GetMesInvItemInCDetailsList(decimal id) |
| | | { |
| | | return Db.Queryable<MesInvItemInCDetails, MesUnit>((a, b) => |
| | | new JoinQueryInfos(JoinType.Inner, a.Unit == b.Id.ToString())) |
| | | .Where((a, b) => a.ItemInId == id) |
| | | .Select((a, b) => new MesInvItemInCDetails |
| | | { |
| | | ItemBarcode = a.ItemBarcode, |
| | | ItemNo = a.ItemNo, |
| | | ItemSname = a.ItemSname, |
| | | DepotSectionCode = a.DepotSectionCode, |
| | | Quantity = a.Quantity, |
| | | Unit = b.Fname, |
| | | Remark = a.Remark |
| | | }) |
| | | .ToList(); |
| | | } |
| | | |
| | | private void InsertInventoryDetails(decimal itemInId, string billNo, |
| | | MesInvItemBarcodes barcodeInfo, string depotCode, string sectionCode, |
| | | string user) |
| | | { |
| | | // Insert inventory details record |
| | | var executeCommand = Db.Insertable(new MesInvItemInCDetails |
| | | { |
| | | ItemInId = itemInId, |
| | | BillNo = billNo, |
| | | ItemBarcode = barcodeInfo.ItemBarcode, |
| | | Quantity = barcodeInfo.Quantity, |
| | | BarcodeFlag = 1, |
| | | EpFlag = 1, |
| | | WorkType = 1, |
| | | ItemNo = barcodeInfo.ItemNo, |
| | | LotNo = barcodeInfo.LotNo, |
| | | SuppNo = barcodeInfo.SuppNo, |
| | | DepotCode = depotCode, |
| | | DepotSectionCode = sectionCode, |
| | | ItemSname = barcodeInfo.ItemSname, |
| | | Unit = barcodeInfo.Unit, |
| | | CreateBy = user, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateBy = user, |
| | | LastupdateDate = DateTime.Now, |
| | | Remark = barcodeInfo.Memo, |
| | | Factory = Factory, |
| | | Company = Company, |
| | | Ebeln = barcodeInfo.Mblnr, |
| | | EbelnLineNo = barcodeInfo.Zeile, |
| | | WorkNo = barcodeInfo.WorkNo, |
| | | WorkLine = barcodeInfo.WorkLine, |
| | | CbillNo = barcodeInfo.BillNo, |
| | | UrgentFlag = barcodeInfo.UrgentFlag, |
| | | BoardStyle = barcodeInfo.BoardStyle, |
| | | TaskNo = barcodeInfo.TaskNo |
| | | }).ExecuteCommand(); |
| | | |
| | | if (executeCommand <= 0) |
| | | { |
| | | throw new Exception("åå
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | private decimal GetOrCreateInventoryItemInId(MesInvItemBarcodes barcodeInfo, |
| | | string depotCode, string userName, out string billNo) |
| | | { |
| | | var inventory = Db.Queryable<MesInvItemIns>() |
| | | .Where(d => d.InsDate >= DateTime.Today && |
| | | d.InsDate < DateTime.Today.AddDays(1) && |
| | | d.Sapstatus == 0 && |
| | | d.Status == 0 && |
| | | d.TransctionNo == transactionNo.ToString() && |
| | | d.CbillNo == barcodeInfo.BillNo && |
| | | d.SuppNo == barcodeInfo.SuppNo && |
| | | d.DepotsCode == depotCode) |
| | | .First(); |
| | | if (inventory != null) |
| | | { |
| | | billNo = inventory.BillNo; |
| | | return inventory.Id; |
| | | } |
| | | |
| | | var sql = |
| | | $"SELECT getbillcode1('{Factory}','{Company}','QCRK') FROM DUAL;"; |
| | | billNo = Db.Ado.SqlQuerySingle<string>(sql); |
| | | |
| | | var executeReturnIdentity = Db.Insertable(new MesInvItemIns |
| | | { |
| | | BillNo = billNo, |
| | | BillTypeId = billTypeId, |
| | | InsDate = DateTime.Now, |
| | | DepotsCode = depotCode, |
| | | TransctionNo = transactionNo.ToString(), |
| | | SuppNo = barcodeInfo.SuppNo, |
| | | CreateBy = userName, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateBy = userName, |
| | | LastupdateDate = DateTime.Now, |
| | | Factory = Factory, |
| | | Company = Company, |
| | | UrgentFlag = barcodeInfo.UrgentFlag, |
| | | CbillNo = barcodeInfo.BillNo, |
| | | Fstatus = 0 |
| | | }).ExecuteReturnIdentity(); |
| | | |
| | | return executeReturnIdentity; |
| | | } |
| | | |
| | | private MesInvItemBarcodes GetBarcodeInfo(string itemBarcode) |
| | | { |
| | | // Get barcode information |
| | | return Db.Queryable<MesInvItemBarcodes>() |
| | | .First(b => b.ItemBarcode == itemBarcode); |
| | | } |
| | | |
| | | private int CheckBarcodeInStock(string itemBarcode) |
| | | { |
| | | // Check if the barcode is in stock |
| | | return Db.Queryable<MesInvItemStocks>() |
| | | .Where(stock => stock.ItemBarcode == itemBarcode).Count(); |
| | | } |
| | | |
| | | |
| | | private int CheckBarcodeAlreadyReceived(string itemBarcode) |
| | | { |
| | | // Check if the barcode is already received |
| | | return Db.Queryable<MesInvItemIns, MesInvItemInCDetails>( |
| | | (ins, details) => new JoinQueryInfos(JoinType.Inner, |
| | | ins.Id == details.ItemInId)) |
| | | .Where((ins, details) => details.ItemBarcode == itemBarcode) |
| | | .Count(); |
| | | } |
| | | |
| | | private string GetDepotCode(string sectionCode) |
| | | { |
| | | // This would be your query to get depot code based on section code |
| | | return Db.Queryable<MesDepotSections, MesDepots>((d, t) => |
| | | new JoinQueryInfos(JoinType.Inner, d.Zuid.ToString() == t.Zuid)) |
| | | .Where((d, t) => d.DepotSectionCode == sectionCode) |
| | | .Select<string>((d, t) => t.DepotCode) |
| | | .First(); |
| | | } |
| | | |
| | | |
| | | private void InsertStockRecord(MesInvItemBarcodes barcodeInfo, |
| | | string depotCode, |
| | | string sectionCode, string user) |
| | | { |
| | | var executeCommand = Db.Insertable(new MesInvItemStocks |
| | | { |
| | | TaskNo = barcodeInfo.TaskNo, |
| | | ItemBarcode = barcodeInfo.ItemBarcode, |
| | | ItemNo = barcodeInfo.ItemNo, |
| | | LotNo = barcodeInfo.LotNo, |
| | | Quantity = barcodeInfo.Quantity, |
| | | EpFlag = barcodeInfo.EpFlag, |
| | | DepotsCode = depotCode, |
| | | DepotSectionsCode = sectionCode, |
| | | CheckDate = barcodeInfo.CreateDate, |
| | | IndepDate = barcodeInfo.CreateDate, |
| | | Factory = Factory, |
| | | Company = Company, |
| | | BoardStyle = barcodeInfo.BoardStyle, |
| | | WorkNo = barcodeInfo.WorkNo, |
| | | WorkLine = barcodeInfo.WorkLine, |
| | | SuppNo = barcodeInfo.SuppNo |
| | | }).ExecuteCommand(); |
| | | |
| | | if (executeCommand <= 0) |
| | | { |
| | | throw new Exception("åå
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | private void InsertBusinessRecord(MesInvItemBarcodes barcodeInfo, |
| | | string depotCode, string sectionCode, string billNo, string user) |
| | | { |
| | | // Insert business record |
| | | var executeCommand = Db.Insertable(new MesInvBusiness2 |
| | | { |
| | | Status = 1, |
| | | BillTypeId = billTypeId, |
| | | TransactionCode = "601", |
| | | BusinessType = 1, |
| | | ItemBarcode = barcodeInfo.ItemBarcode, |
| | | ItemNo = barcodeInfo.ItemNo, |
| | | LotNo = barcodeInfo.LotNo, |
| | | EpFlag = 1, |
| | | Quantity = barcodeInfo.Quantity, |
| | | ToInvDepotsCode = depotCode, |
| | | ToInvDepotSectionsCode = sectionCode, |
| | | CreateBy = user, |
| | | CreateDate = DateTime.Now, |
| | | LastupdateBy = user, |
| | | LastupdateDate = DateTime.Now, |
| | | Factory = Factory, |
| | | Company = Company, |
| | | TaskNo = barcodeInfo.TaskNo, |
| | | BillNo = billNo, |
| | | WorkNo = barcodeInfo.WorkNo, |
| | | WorkLine = barcodeInfo.WorkLine, |
| | | SuppNo = barcodeInfo.SuppNo |
| | | }).ExecuteCommand(); |
| | | |
| | | if (executeCommand <= 0) |
| | | { |
| | | throw new Exception("åå
¥å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.Warehouse; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.Warehouse; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesDepotSectionsController : ControllerBase |
| | | { |
| | | private readonly MesDepotSectionsManager m = new(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | //GetSectionName |
| | | [HttpPost("GetSectionName")] |
| | | public ResponseResult GetSectionName(WarehouseQuery query) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetSectionName(query); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | 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] MesDepotSections 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] MesDepotSections 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] MesDepotSections 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.service.Warehouse; |
| | | using MES.Service.util; |
| | | |
| | | namespace MESApplication.Controllers.Warehouse |
| | | { |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class MesInvBusiness2Controller : ControllerBase |
| | | { |
| | | |
| | | private MesInvBusiness2Manager m = new MesInvBusiness2Manager(); |
| | | |
| | | |
| | | /***è¿å
¥æ¨¡ç管çå¯ä»¥ä¿®æ¹æ¨¡ç***/ |
| | | |
| | | /// <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] MesInvBusiness2 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] MesInvBusiness2 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] MesInvBusiness2 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.service; |
| | | using MES.Service.service.Warehouse; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | |
| | | namespace MESApplication.Controllers.Warehouse; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class OpeningReceiptController : ControllerBase |
| | | { |
| | | private readonly OpeningReceiptServer m = new(); |
| | | |
| | | [HttpPost("ScanInBarcodeQC")] |
| | | public ResponseResult ScanInBarcodeQC(WarehouseQuery query) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.ScanInBarcodeQC(query); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("GetForm")] |
| | | public ResponseResult GetForm(WarehouseQuery query) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetForm(query); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |