| | |
| | | // } |
| | | // return result; |
| | | // } |
| | | // æå¼è¿æ¥å¹¶å¼å¯äºå¡ |
| | | public (OracleConnection, OracleTransaction) BeginTransaction() |
| | | { |
| | | var connection = new OracleConnection(_connectionString); |
| | | connection.Open(); |
| | | var transaction = connection.BeginTransaction(); |
| | | return (connection, transaction); |
| | | } |
| | | |
| | | // å
³éè¿æ¥ï¼æäº¤æåæ»åç¨ï¼ |
| | | public void CloseConnection(OracleConnection connection) |
| | | { |
| | | if (connection != null && connection.State != ConnectionState.Closed) |
| | | { |
| | | connection.Close(); |
| | | connection.Dispose(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | public string snState { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产æµç»éå· |
| | | /// </summary> |
| | | public string loginId { get; set; } |
| | | /// <summary> |
| | | /// å¤±è´¥é¡¹ç® |
| | | /// </summary> |
| | | public List<CcFailItems> failItems { get; set; } |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 产æµSN失败项æç»è¡¨ |
| | | /// </summary> |
| | | public class CcFailItems |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯é®é¢ |
| | | /// </summary> |
| | | public string DefectIssue { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 忥åå |
| | | /// </summary> |
| | | public string RootCause { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»´ä¿®æ¹æ¡/æ¹æ³ |
| | | /// </summary> |
| | | public string RepairMethod { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯ç©æå¤ç |
| | | /// </summary> |
| | | public string MaterialHandling { get; set; } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtDto |
| | | { |
| | | public MesItemQtFrom from { get; set; } |
| | | |
| | | public List<MesItemQtList> items { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtFrom |
| | | { |
| | | |
| | | public string Type { get; set; } |
| | | /// <summary> |
| | | /// ç³è¯·åå· |
| | | /// </summary> |
| | | public string ApplyNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·æ¥æ |
| | | /// </summary> |
| | | public DateTime? ApplyDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | public DateTime? AuditDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç±»å |
| | | /// </summary> |
| | | public string DocumentType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ç±»å |
| | | /// </summary> |
| | | public string BusinessType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶å人 |
| | | /// </summary> |
| | | public string CreatedBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string WorkOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæä»åº |
| | | /// </summary> |
| | | public string FromWarehouse { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·é¨é¨ |
| | | /// </summary> |
| | | public string ApplyDept { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç±»å |
| | | /// </summary> |
| | | public string StockOutType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼ç |
| | | /// </summary> |
| | | public string DeptCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºæ°é |
| | | /// </summary> |
| | | public decimal Quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸äºº |
| | | /// </summary> |
| | | public string Auditor { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åå· |
| | | /// </summary> |
| | | public string TaskNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºæ¹åï¼éè´§ï¼æ®éï¼ |
| | | /// </summary> |
| | | public string Direction { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主类å |
| | | /// </summary> |
| | | public string OwnerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåå |
| | | /// </summary> |
| | | public string Reason { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼ç |
| | | /// </summary> |
| | | public string CustomerCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢æäºº |
| | | /// </summary> |
| | | public string Receiver { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ |
| | | /// </summary> |
| | | public string Department { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºç®¡å |
| | | /// </summary> |
| | | public string StockKeeper { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºç±»å« |
| | | /// </summary> |
| | | public string SourceType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ® |
| | | /// </summary> |
| | | public string SourceDocument { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产ç¸å
³ |
| | | /// </summary> |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产线æ¥è®¡å |
| | | /// </summary> |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ´»å¨ |
| | | /// </summary> |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产æå |
| | | /// </summary> |
| | | public string FinishedGoods { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éåç»è´¦ |
| | | /// </summary> |
| | | public string ReversePosting { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®°è´¦æé´ |
| | | /// </summary> |
| | | public string AccountingPeriod { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥ |
| | | /// </summary> |
| | | public string Employee { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åéæ |
| | | /// </summary> |
| | | public string FalseReturn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¡¹ç® |
| | | /// </summary> |
| | | public string ProjectCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ |
| | | /// </summary> |
| | | public string TaskCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | public string Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主ç»ç» |
| | | /// </summary> |
| | | public string OwnerOrganization { get; set; } |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtList |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | public string ItemId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®¡åæ°é |
| | | /// </summary> |
| | | public decimal PlannedQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·æ°é |
| | | /// </summary> |
| | | public decimal AppliedQuantity { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨è¯´æ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¡å·(ç©æé¡ºåº) |
| | | /// </summary> |
| | | public int? LineNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产ç¸å
³ |
| | | /// </summary> |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨ç±»å |
| | | /// </summary> |
| | | public string StorageType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主ç»ç» |
| | | /// </summary> |
| | | public string OwnerOrganization { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨å°ç¹ |
| | | /// </summary> |
| | | public string StorageLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼ç |
| | | /// </summary> |
| | | public string CustomerCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³è项ç®ç¼ç |
| | | /// </summary> |
| | | public string ProjectCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èä»»å¡ç¼ç |
| | | /// </summary> |
| | | public string TaskCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产订åå· |
| | | /// </summary> |
| | | public string ProductionOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产线æ¥è®¡åç¼å· |
| | | /// </summary> |
| | | public string DailyPlan { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ´»å¨ |
| | | /// </summary> |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产æåç¼ç |
| | | /// </summary> |
| | | public string FinishedProduct { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 颿ç¨é |
| | | /// </summary> |
| | | public string PickingUsage { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtRKDto |
| | | { |
| | | public MesItemQtRKFrom from { get; set; } |
| | | |
| | | public List<MesItemQtRKList> items { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtRKFrom |
| | | { |
| | | public string Type { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·åå· |
| | | /// </summary> |
| | | public string ApplyNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·æ¥æ |
| | | /// </summary> |
| | | public DateTime? ApplyDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸æ¥æ |
| | | /// </summary> |
| | | public DateTime? AuditDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç±»å |
| | | /// </summary> |
| | | public string DocumentType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºç±»å |
| | | /// </summary> |
| | | public string StockInType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¶å人 |
| | | /// </summary> |
| | | public string CreatedBy { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产工å |
| | | /// </summary> |
| | | public string WorkOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæä»åº |
| | | /// </summary> |
| | | public string FromWarehouse { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·é¨é¨ |
| | | /// </summary> |
| | | public string ApplyDept { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºåå |
| | | /// </summary> |
| | | public string Reason { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼ç |
| | | /// </summary> |
| | | public string DeptCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¡æ ¸äºº |
| | | /// </summary> |
| | | public string Auditor { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åå· |
| | | /// </summary> |
| | | public string TaskNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºæ¹åï¼éè´§ï¼æ®éï¼ |
| | | /// </summary> |
| | | public string Direction { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主类å(ç»ç»ãä¾åºåã客æ·) |
| | | /// </summary> |
| | | public string OwnerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¢æ· |
| | | /// </summary> |
| | | public string CustomerCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºäºº |
| | | /// </summary> |
| | | public string Receiver { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ |
| | | /// </summary> |
| | | public string Department { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºç®¡å |
| | | /// </summary> |
| | | public string StockKeeper { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºç±»å« |
| | | /// </summary> |
| | | public string SourceType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥æºåæ® |
| | | /// </summary> |
| | | public string SourceDocument { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产ç¸å
³ |
| | | /// </summary> |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产线æ¥è®¡å |
| | | /// </summary> |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ´»å¨ |
| | | /// </summary> |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产æå |
| | | /// </summary> |
| | | public string FinishedGoods { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éåç»è´¦ |
| | | /// </summary> |
| | | public string ReversePosting { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®°è´¦æé´ |
| | | /// </summary> |
| | | public string AccountingPeriod { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå·¥ |
| | | /// </summary> |
| | | public string Employee { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åéæ |
| | | /// </summary> |
| | | public string FalseReturn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¡¹ç® |
| | | /// </summary> |
| | | public string ProjectCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ |
| | | /// </summary> |
| | | public string TaskCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | public string Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主ç»ç» |
| | | /// </summary> |
| | | public string OwnerOrganization { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | public class MesItemQtRKList |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | public string ItemId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è®¡åæ°é |
| | | /// </summary> |
| | | public decimal PlannedQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·æ°é |
| | | /// </summary> |
| | | public decimal AppliedQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·²å
¥åºæ°éï¼é»è®¤å¼ï¼0ï¼ |
| | | /// </summary> |
| | | public decimal ReceivedQuantity { get; set; } = 0; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿³¨è¯´æ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¡å·(ç©æé¡ºåº) |
| | | /// </summary> |
| | | public int? LineNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产ç¸å
³ |
| | | /// </summary> |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨ç±»å |
| | | /// </summary> |
| | | public string StorageType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货主ç»ç» |
| | | /// </summary> |
| | | public string OwnerOrganization { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå¨å°ç¹ |
| | | /// </summary> |
| | | public string StorageLocation { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 客æ·ç¼ç |
| | | /// </summary> |
| | | public string CustomerCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³è项ç®ç¼ç |
| | | /// </summary> |
| | | public string ProjectCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èä»»å¡ç¼ç |
| | | /// </summary> |
| | | public string TaskCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产订åå· |
| | | /// </summary> |
| | | public string ProductionOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产线æ¥è®¡åç¼å· |
| | | /// </summary> |
| | | public string DailyPlan { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ´»å¨ |
| | | /// </summary> |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产æåç¼ç |
| | | /// </summary> |
| | | public string FinishedProduct { get; set; } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | /// <summary> |
| | | /// ä¸ç®±ç 表 |
| | | /// </summary> |
| | | public class MesMiddleBox |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ç±»åï¼æä½ï¼Aç»å®ï¼Fè§£ç»ï¼ |
| | | /// </summary> |
| | | public string type { get; set; } |
| | | /// <summary> |
| | | /// ä¸ç®±ç |
| | | /// </summary> |
| | | public string MediumBoxCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»å½å· |
| | | /// </summary> |
| | | public string LoginId { get; set; } |
| | | /// <summary> |
| | | /// snå表 |
| | | /// </summary> |
| | | public List<snList> SnList { get; set; } |
| | | |
| | | public class snList |
| | | { |
| | | /// <summary> |
| | | /// SNå· |
| | | /// </summary> |
| | | public string SnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥ååå· |
| | | /// </summary> |
| | | public string TicketNo { get; set; } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace MES.Service.Dto.service |
| | | { |
| | | /// <summary> |
| | | /// æ æ¿ç»å®è¡¨ |
| | | /// </summary> |
| | | public class MesPalletBinding |
| | | { |
| | | |
| | | /// <summary> |
| | | /// æä½ï¼Aç»å®ï¼Fè§£ç» |
| | | /// </summary> |
| | | public string Type { get; set; } |
| | | /// <summary> |
| | | /// æ æ¿ç |
| | | /// </summary> |
| | | public string StackCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»å½å· |
| | | /// </summary> |
| | | public string LoginId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// snå表 |
| | | /// </summary> |
| | | public List<snList1> SnList { get; set; } |
| | | public class snList1 |
| | | { |
| | | /// <summary> |
| | | /// SNå· |
| | | /// </summary> |
| | | public string SnNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥ååå· |
| | | /// </summary> |
| | | public string TicketNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ç®±ç |
| | | /// </summary> |
| | | public string MediumBoxCode { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.ComponentModel; |
| | | |
| | | namespace MES.Service.Modes |
| | | { |
| | | [SugarTable("MES_ITEM_QT")] |
| | | public class MesItemQt |
| | | { |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | [Description("ID")] |
| | | public decimal Id { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QTCK" )] |
| | | [Description("ç³è¯·åå·")] |
| | | public string Qtck { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT001")] |
| | | [Description("ç³è¯·æ¥æ")] |
| | | public DateTime? Qt001 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT002")] |
| | | [Description("å®¡æ ¸æ¥æ")] |
| | | public DateTime? Qt002 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT003")] |
| | | [Description("åæ®ç±»å")] |
| | | public string Qt003 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT004")] |
| | | [Description("ä¸å¡ç±»å")] |
| | | public string Qt004 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT005")] |
| | | [Description("å¶å人")] |
| | | public string Qt005 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT006")] |
| | | [Description("ç产工å")] |
| | | public string Qt006 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT008")] |
| | | [Description("åæä»åº")] |
| | | public string Qt008 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT009")] |
| | | [Description("ç³è¯·é¨é¨")] |
| | | public string Qt009 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT010")] |
| | | [Description("åºåºç±»å")] |
| | | public string Qt010 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT011")] |
| | | [Description("ä»åºç¼ç ")] |
| | | public string Qt011 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT012")] |
| | | [Description("é¨é¨ç¼ç ")] |
| | | public string Qt012 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT013")] |
| | | [Description("æ°é")] |
| | | public decimal? Qt013 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT014", DefaultValue = "0")] |
| | | [Description("å®ç»æ è¯")] |
| | | public decimal Qt014 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QT015", DefaultValue = "0")] |
| | | [Description("å®¡æ ¸ç¶æ")] |
| | | public decimal Qt015 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QT016")] |
| | | [Description("å®¡æ ¸äºº")] |
| | | public string Qt016 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT017")] |
| | | [Description("ä»»å¡åå·")] |
| | | public string Qt017 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT018")] |
| | | [Description("ä¾åºåç¼ç ")] |
| | | public string Qt018 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT019")] |
| | | [Description("åºåºæ¹å(éè´§ï¼æ®é)")] |
| | | public string Qt019 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT020")] |
| | | [Description("货主类å")] |
| | | public string Qt020 { get; set; } |
| | | [SugarColumn(ColumnName = "CUSTOMER_CODE")] |
| | | [Description("客æ·")] |
| | | public string CustomerCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "REMARK")] |
| | | [Description("åºåºåå ")] |
| | | public string Remark { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT021")] |
| | | [Description("客æ·ç¼ç ")] |
| | | public string Qt021 { get; set; } |
| | | [SugarColumn(ColumnName = "DEPARTMENT")] |
| | | [Description("é¨é¨")] |
| | | public string Department { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STOCK_KEEPER")] |
| | | [Description("åºç®¡å")] |
| | | public string StockKeeper { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SOURCE_TYPE")] |
| | | [Description("æ¥æºç±»å«")] |
| | | public string SourceType { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SOURCE_DOCUMENT")] |
| | | [Description("æ¥æºåæ®")] |
| | | public string SourceDocument { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_RELATED")] |
| | | [Description("ç产ç¸å
³")] |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_LINE")] |
| | | [Description("ç产线æ¥è®¡å")] |
| | | public string ProductionLine { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ACTIVITY")] |
| | | [Description("ç产活å¨")] |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FINISHED_GOODS")] |
| | | [Description("产æå")] |
| | | public string FinishedGoods { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "REVERSE_POSTING")] |
| | | [Description("éåç»è´¦")] |
| | | public string ReversePosting { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "ACCOUNTING_PERIOD")] |
| | | [Description("è®°è´¦æé´")] |
| | | public string AccountingPeriod { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "EMPLOYEE")] |
| | | [Description("åå·¥")] |
| | | public string Employee { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FALSE_RETURN")] |
| | | [Description("åéæ")] |
| | | public string FalseReturn { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PROJECT_CODE")] |
| | | [Description("项ç®")] |
| | | public string ProjectCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "TASK_CODE")] |
| | | [Description("ä»»å¡")] |
| | | public string TaskCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STATUS")] |
| | | [Description("ç¶æ")] |
| | | public string Status { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "OWNER_ORGANIZATION")] |
| | | [Description("货主ç»ç»")] |
| | | public string OwnerOrganization { get; set; } |
| | | [SugarColumn(ColumnName = "RECEIVER")] |
| | | [Description("åºåºäºº")] |
| | | public string Receiver { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | |
| | | namespace MES.Service.Modes |
| | | { |
| | | [SugarTable("MES_ITEM_QT_DATALL")] |
| | | public class MesItemQtDatall |
| | | { |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_QTCKD")] |
| | | [Description("ID")] |
| | | public decimal Id { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "MID")] |
| | | [Description("MID")] |
| | | public decimal Mid { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD001")] |
| | | [Description("å·¥åå·")] |
| | | public string Qd001 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD002")] |
| | | [Description("ç©æç¼å·")] |
| | | public string Qd002 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD003")] |
| | | [Description("ç©æåç§°")] |
| | | public string Qd003 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD004")] |
| | | [Description("è§æ ¼åå·")] |
| | | public string Qd004 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD005")] |
| | | [Description("é¢è²")] |
| | | public string Qd005 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD006")] |
| | | [Description("è®¡åæ°é")] |
| | | public decimal? Qd006 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD007")] |
| | | [Description("ç³è¯·æ°é")] |
| | | public decimal? Qd007 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD008", DefaultValue = "0")] |
| | | [Description("已颿°é")] |
| | | public decimal Qd008 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QD009")] |
| | | [Description("åä½")] |
| | | public string Qd009 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD010")] |
| | | [Description("夿³¨")] |
| | | public string Qd010 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD011", DefaultValue = "0")] |
| | | [Description("å®ç»æ è¯")] |
| | | public decimal Qd011 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QD012")] |
| | | [Description("ç©æå
ç ")] |
| | | public decimal? Qd012 { get; set; } |
| | | |
| | | /* æ°å¢å段 */ |
| | | |
| | | [SugarColumn(ColumnName = "LINE_NUMBER")] |
| | | [Description("è¡å·(ç©æé¡ºåº)")] |
| | | public int? LineNumber { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_RELATED")] |
| | | [Description("ç产ç¸å
³")] |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STORAGE_TYPE")] |
| | | [Description("åå¨ç±»å")] |
| | | public string StorageType { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "OWNER_ORGANIZATION")] |
| | | [Description("货主ç»ç»")] |
| | | public string OwnerOrganization { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STORAGE_LOCATION")] |
| | | [Description("åå¨å°ç¹")] |
| | | public string StorageLocation { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SUPPLIER_CODE")] |
| | | [Description("ä¾åºåç¼ç ")] |
| | | public string SupplierCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "CUSTOMER_CODE")] |
| | | [Description("客æ·ç¼ç ")] |
| | | public string CustomerCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PROJECT_CODE")] |
| | | [Description("å
³è项ç®ç¼ç ")] |
| | | public string ProjectCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "TASK_CODE")] |
| | | [Description("å
³èä»»å¡ç¼ç ")] |
| | | public string TaskCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ORDER")] |
| | | [Description("ç产订åå·")] |
| | | public string ProductionOrder { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "DAILY_PLAN")] |
| | | [Description("ç产线æ¥è®¡åç¼å·")] |
| | | public string DailyPlan { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ACTIVITY")] |
| | | [Description("ç产活å¨")] |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FINISHED_PRODUCT")] |
| | | [Description("产æåç¼ç ")] |
| | | public string FinishedProduct { get; set; } |
| | | [SugarColumn(ColumnName = "PICKING_USAGE")] |
| | | [Description("颿ç¨é")] |
| | | public string PickingUsage { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.ComponentModel; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | |
| | | [SugarTable("MES_ITEM_QTRK")] |
| | | public class MesItemQtrk |
| | | { |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] |
| | | [Description("ID")] |
| | | public decimal Id { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QTCK")] |
| | | [Description("ç³è¯·åå·")] |
| | | public string Qtck { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT001")] |
| | | [Description("ç³è¯·æ¥æ")] |
| | | public DateTime? Qt001 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT002")] |
| | | [Description("å®¡æ ¸æ¥æ")] |
| | | public DateTime? Qt002 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT003")] |
| | | [Description("åæ®ç±»å")] |
| | | public string Qt003 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT004")] |
| | | [Description("å
¥åºç±»å")] |
| | | public string Qt004 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT005")] |
| | | [Description("å¶å人")] |
| | | public string Qt005 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT006")] |
| | | [Description("ç产工å")] |
| | | public string Qt006 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT008")] |
| | | [Description("åæä»åº")] |
| | | public string Qt008 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT009")] |
| | | [Description("ç³è¯·é¨é¨")] |
| | | public string Qt009 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT010", Length = 300)] |
| | | [Description("å
¥åºåå ")] |
| | | public string Qt010 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT011")] |
| | | [Description("ä»åºç¼ç ")] |
| | | public string Qt011 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT012")] |
| | | [Description("é¨é¨ç¼ç ")] |
| | | public string Qt012 { get; set; } |
| | | |
| | | |
| | | [SugarColumn(ColumnName = "QT014", DefaultValue = "0")] |
| | | [Description("å®ç»æ è¯")] |
| | | public decimal Qt014 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QT015", DefaultValue = "0")] |
| | | [Description("å®¡æ ¸ç¶æ")] |
| | | public decimal Qt015 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QT016")] |
| | | [Description("å®¡æ ¸äºº")] |
| | | public string Qt016 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT017")] |
| | | [Description("ä»»å¡åå·")] |
| | | public string Qt017 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT018", Length = 50)] |
| | | [Description("ä¾åºåç¼ç ")] |
| | | public string Qt018 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT019", Length = 50)] |
| | | [Description("å
¥åºæ¹å(éè´§ï¼æ®é)")] |
| | | public string Qt019 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QT020", Length = 50)] |
| | | [Description("货主类å")] |
| | | public string Qt020 { get; set; } |
| | | [SugarColumn(ColumnName = "CUSTOMER_CODE")] |
| | | [Description("客æ·")] |
| | | public string CustomerCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "RECEIVER")] |
| | | [Description("å
¥åºäºº")] |
| | | public string Receiver { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "DEPARTMENT")] |
| | | [Description("é¨é¨")] |
| | | public string Department { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STOCK_KEEPER")] |
| | | [Description("åºç®¡å")] |
| | | public string StockKeeper { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SOURCE_TYPE")] |
| | | [Description("æ¥æºç±»å«")] |
| | | public string SourceType { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SOURCE_DOCUMENT")] |
| | | [Description("æ¥æºåæ®")] |
| | | public string SourceDocument { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_RELATED")] |
| | | [Description("ç产ç¸å
³")] |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_LINE")] |
| | | [Description("ç产线æ¥è®¡å")] |
| | | public string ProductionLine { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ACTIVITY")] |
| | | [Description("ç产活å¨")] |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FINISHED_GOODS")] |
| | | [Description("产æå")] |
| | | public string FinishedGoods { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "REVERSE_POSTING")] |
| | | [Description("éåç»è´¦")] |
| | | public string ReversePosting { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "ACCOUNTING_PERIOD")] |
| | | [Description("è®°è´¦æé´")] |
| | | public string AccountingPeriod { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "EMPLOYEE")] |
| | | [Description("åå·¥")] |
| | | public string Employee { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FALSE_RETURN")] |
| | | [Description("åéæ")] |
| | | public string FalseReturn { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PROJECT_CODE")] |
| | | [Description("项ç®")] |
| | | public string ProjectCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "TASK_CODE")] |
| | | [Description("ä»»å¡")] |
| | | public string TaskCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STATUS")] |
| | | [Description("ç¶æ")] |
| | | public string Status { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "OWNER_ORGANIZATION")] |
| | | [Description("货主ç»ç»")] |
| | | public string OwnerOrganization { get; set; } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | |
| | | namespace MES.Service.Modes; |
| | | |
| | | [SugarTable("MES_ITEM_QTRR_DETAIL")] |
| | | public class MesItemQtrrDetail |
| | | { |
| | | [SugarColumn(ColumnName = "ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_QTRKD")] |
| | | [Description("ID")] |
| | | public decimal Id { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "MID")] |
| | | [Description("MID")] |
| | | public decimal Mid { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD001")] |
| | | [Description("å·¥åå·")] |
| | | public string Qd001 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD002")] |
| | | [Description("ç©æç¼å·")] |
| | | public string Qd002 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD003")] |
| | | [Description("ç©æåç§°")] |
| | | public string Qd003 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD004")] |
| | | [Description("è§æ ¼åå·")] |
| | | public string Qd004 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD005")] |
| | | [Description("é¢è²")] |
| | | public string Qd005 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD006")] |
| | | [Description("è®¡åæ°é")] |
| | | public decimal? Qd006 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD007")] |
| | | [Description("ç³è¯·æ°é")] |
| | | public decimal? Qd007 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD008", DefaultValue = "0")] |
| | | [Description("å·²å
¥æ°é")] |
| | | public decimal Qd008 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QD009", Length = 30)] |
| | | [Description("åä½")] |
| | | public string Qd009 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD010", Length = 500)] |
| | | [Description("夿³¨")] |
| | | public string Qd010 { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "QD011", DefaultValue = "0")] |
| | | [Description("å®ç»æ è¯")] |
| | | public decimal Qd011 { get; set; } = 0; |
| | | |
| | | [SugarColumn(ColumnName = "QD012")] |
| | | [Description("ç©æå
ç ")] |
| | | public decimal? Qd012 { get; set; } |
| | | |
| | | /* æ°å¢å段 */ |
| | | |
| | | [SugarColumn(ColumnName = "LINE_NUMBER")] |
| | | [Description("è¡å·(ç©æé¡ºåº)")] |
| | | public int? LineNumber { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_RELATED")] |
| | | [Description("ç产ç¸å
³")] |
| | | public string ProductionRelated { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STORAGE_TYPE")] |
| | | [Description("åå¨ç±»å")] |
| | | public string StorageType { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "OWNER_ORGANIZATION")] |
| | | [Description("货主ç»ç»")] |
| | | public string OwnerOrganization { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "STORAGE_LOCATION")] |
| | | [Description("åå¨å°ç¹")] |
| | | public string StorageLocation { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "SUPPLIER_CODE")] |
| | | [Description("ä¾åºåç¼ç ")] |
| | | public string SupplierCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "CUSTOMER_CODE")] |
| | | [Description("客æ·ç¼ç ")] |
| | | public string CustomerCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PROJECT_CODE")] |
| | | [Description("å
³è项ç®ç¼ç ")] |
| | | public string ProjectCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "TASK_CODE")] |
| | | [Description("å
³èä»»å¡ç¼ç ")] |
| | | public string TaskCode { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ORDER")] |
| | | [Description("ç产订åå·")] |
| | | public string ProductionOrder { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "DAILY_PLAN")] |
| | | [Description("ç产线æ¥è®¡åç¼å·")] |
| | | public string DailyPlan { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "PRODUCTION_ACTIVITY")] |
| | | [Description("ç产活å¨")] |
| | | public string ProductionActivity { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "FINISHED_PRODUCT")] |
| | | [Description("产æåç¼ç ")] |
| | | public string FinishedProduct { get; set; } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace MES.Service.service.Warehouse |
| | | { |
| | | public class MesItemQtManager:Repository<MesItemQt> |
| | | { |
| | | public bool MiscellaneousIssues(MesItemQtDto mesItemQtDto) |
| | | { |
| | | var itemQtFrom = mesItemQtDto.from; |
| | | var itemQtLists = mesItemQtDto.items; |
| | | |
| | | // æ ¹æ®AsnNoåMesNo对æç»è¿è¡åç» |
| | | //var groupedItems = itemOutLists |
| | | // .GroupBy(item => new { item.AsnNo, item.MesNo, item.SqNo }) |
| | | // .ToList(); |
| | | |
| | | bool result = true; |
| | | //foreach (var group in itemQtRKLists) |
| | | //{ |
| | | //if (group.Key.AsnNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("AsnNoä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | //if (group.Key.MesNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("å
¥åºååå·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | //if (group.Key.SqNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´§ç³è¯·åè¡å·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | // å建ä¸ä¸ªä¸´æ¶çitemOutFrom对象ï¼ä½¿ç¨åç»çKeyä½ä¸ºä¸»è¦å±æ§ |
| | | //var tempItemOutFrom = new ItemOutFrom |
| | | //{ |
| | | // AsnNo = group.Key.AsnNo, |
| | | // MesNo = group.Key.MesNo, |
| | | // SqNo = group.Key.SqNo, |
| | | // // ç»§æ¿åå§itemOutFromçå
¶ä»å±æ§ |
| | | // RtnNo = itemOutFrom.RtnNo, |
| | | // Type = itemOutFrom.Type, |
| | | // CreateBy = itemOutFrom.CreateBy, |
| | | // FMRMODE = itemOutFrom.FMRMODE, |
| | | // DepotId = itemOutFrom.DepotId, |
| | | // SupperId = itemOutFrom.SupperId |
| | | //}; |
| | | |
| | | // æ ¹æ®Typeæ§è¡ä¸åçé»è¾ |
| | | switch (itemQtFrom.Type) |
| | | { |
| | | case "1": |
| | | { |
| | | var mesInvItemOuts = Db.Queryable<MesItemQt>() |
| | | .Where(s => s.Qtck == itemQtFrom.ApplyNumber |
| | | |
| | | ) |
| | | .Count(); |
| | | |
| | | if (mesInvItemOuts > 0) |
| | | { |
| | | throw new NotImplementedException( |
| | | itemQtFrom.ApplyNumber + |
| | | "çæåç³è¯·åå·²ç»åå¨"); |
| | | } |
| | | |
| | | // 为å½ååç»ä¿åæ°æ® |
| | | var groupResult = Save(itemQtFrom, itemQtLists); |
| | | if (!groupResult) |
| | | { |
| | | result = false; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case "4": |
| | | var removeResult = Remove(itemQtFrom); |
| | | if (!removeResult) |
| | | { |
| | | result = false; |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | result = false; |
| | | break; |
| | | } |
| | | //} |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | private bool Save(MesItemQtFrom from, List<MesItemQtList> items) |
| | | { |
| | | //var mesInvItemIns = Db.Queryable<MesInvItemIns>() |
| | | // .Where(s => s.BillTypeId == 100 |
| | | // && s.TransctionNo == "101" |
| | | // && s.BillNo == from.MesNo |
| | | // ).First(); |
| | | |
| | | //if (mesInvItemIns == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´å
¥åºä¸åå¨"); |
| | | //} |
| | | |
| | | |
| | | string SuppNo = ""; |
| | | if (from.SupplierCode != "" && from.SupplierCode != null) |
| | | { |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_SUPPLIER" |
| | | && s.U9Id == from.SupplierCode).First(); |
| | | |
| | | if (mesLinkU9 == null) |
| | | { |
| | | throw new NotImplementedException("ä¾åºåIDä¸å卿æªåæ¥äºU9"); |
| | | } |
| | | |
| | | var mesSupplier = Db.Queryable<MesSupplier>() |
| | | .Where(s => s.Id == Decimal.Parse(mesLinkU9.MesId)) |
| | | .First(); |
| | | if (mesSupplier == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.SupplierCode + |
| | | "]ä¾åºåä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | SuppNo = mesSupplier.SuppNo; |
| | | } |
| | | var mesDepots = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId == Decimal.Parse(from.FromWarehouse)).First(); |
| | | |
| | | if (mesDepots == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.FromWarehouse + |
| | | "]ä»åºä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | |
| | | var sysDepartment = Db.Queryable<SysDepartment>() |
| | | .Where(s => s.Departmentid == Decimal.Parse(from.ApplyDept)).First(); |
| | | |
| | | if (sysDepartment == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.ApplyDept + |
| | | "]é¨é¨ä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | |
| | | |
| | | var nextSequenceValue = |
| | | Db.Ado.SqlQuery<decimal>("SELECT SEQ_QTCK.NEXTVAL FROM DUAL") |
| | | .First(); |
| | | |
| | | // var billCode = |
| | | // Db.Ado.SqlQuery<string>( |
| | | // "SELECT GETBILLCODE1('1000', '1000', 'TLSQ') FROM DUAL") |
| | | // .First(); |
| | | //var billCode = from.RtnNo; |
| | | |
| | | // å建æåç³è¯·åè®°å½ |
| | | var MesItemQtrk = new MesItemQt |
| | | { |
| | | Id = nextSequenceValue, |
| | | Qtck = from.ApplyNumber, |
| | | Qt001 = from.Equals(null) ? DateTime.Now : from.ApplyDate, |
| | | Qt002 = from.Equals(null) ? DateTime.Now : from.AuditDate, |
| | | Qt003 = from.DocumentType, |
| | | Qt004 = from.StockOutType, |
| | | Qt005 = from.CreatedBy, |
| | | Qt006 = from.WorkOrder, |
| | | Qt009 = sysDepartment.Departmentname, |
| | | Qt012 = sysDepartment.Departmentcode, |
| | | Qt010 = from.Reason, |
| | | Qt011 = mesDepots.DepotCode, |
| | | Qt008 = mesDepots.DepotName, |
| | | |
| | | Qt015 = 1, |
| | | Qt016 = from.Auditor, |
| | | Qt017 = from.TaskNumber, |
| | | Qt018 = SuppNo, |
| | | Qt019 = from.Direction, |
| | | Qt020 = from.OwnerType, |
| | | CustomerCode = from.CustomerCode, |
| | | Receiver = from.Receiver, |
| | | Department = from.Department, |
| | | StockKeeper = from.StockKeeper, |
| | | SourceType = from.SourceType, |
| | | SourceDocument = from.SourceDocument, |
| | | ProductionRelated = from.ProductionRelated, |
| | | ProductionLine = from.ProductionLine, |
| | | ProductionActivity = from.ProductionActivity, |
| | | FinishedGoods = from.FinishedGoods, |
| | | ReversePosting = from.ReversePosting, |
| | | AccountingPeriod = from.AccountingPeriod, |
| | | Employee = from.Employee, |
| | | FalseReturn = from.FalseReturn, |
| | | ProjectCode = from.ProjectCode, |
| | | TaskCode = from.TaskCode, |
| | | Status = from.Status, |
| | | OwnerOrganization = from.OwnerOrganization |
| | | |
| | | |
| | | }; |
| | | |
| | | // å建æåç³è¯·åè¡è®°å½ |
| | | var mesItemQtDetail = new List<MesItemQtDatall>(); |
| | | |
| | | foreach (var ItemQtRKList in items) |
| | | { |
| | | // æ£æ¥å¿
è¦å段æ¯å¦ä¸ºç©º |
| | | //if (string.IsNullOrEmpty(itemOutList.SrcDocNo)) |
| | | //{ |
| | | // throw new NotImplementedException("éè´è®¢åå·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | |
| | | |
| | | //var mesRohInData = Db.Queryable<MesRohInData>() |
| | | // .Where(s => s.BillNo == itemOutList.SrcDocNo |
| | | // && s.OrderLineId == itemOutList.SrcDocLineNo) |
| | | // .First(); |
| | | |
| | | //if (mesRohInData == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´è®¢åä¸åå¨"); |
| | | //} |
| | | |
| | | //var deliveryDetail = Db.Queryable<DeliveryDetail>() |
| | | // .Where(a => a.Zzasn == from.AsnNo |
| | | // && Int32.Parse(a.ZzitemId) == |
| | | // Int32.Parse(itemOutList.AsnLineNo)) |
| | | // .Count(); |
| | | |
| | | //if (deliveryDetail <= 0) |
| | | //{ |
| | | // throw new NotImplementedException("[" + from.AsnNo + "]çæç»è¡[" + |
| | | // itemOutList.AsnLineNo + |
| | | // "]ä¸åå¨"); |
| | | //} |
| | | |
| | | var itemIdLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_ITEMS" |
| | | && s.U9Id == ItemQtRKList.ItemId).First(); |
| | | |
| | | if (itemIdLinkU9 == null) |
| | | { |
| | | throw new NotImplementedException("ç©æIDä¸å卿æªåæ¥äºU9"); |
| | | } |
| | | |
| | | var mesItems = Db.Queryable<MesItems>() |
| | | .Where(s => s.Id == Decimal.Parse(itemIdLinkU9.MesId)) |
| | | .First(); |
| | | |
| | | if (mesItems == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.ItemId + |
| | | "]ç©æä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | var mesDepot = ""; |
| | | if (ItemQtRKList.StorageLocation != null && ItemQtRKList.StorageLocation != null) |
| | | { |
| | | mesDepots = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId == Decimal.Parse(ItemQtRKList.StorageLocation)).First(); |
| | | if (mesDepots == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.StorageLocation + |
| | | "]ä»åºä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | mesDepot = mesDepots.DepotCode; |
| | | } |
| | | string supplierCode = ""; |
| | | if (ItemQtRKList.SupplierCode != null && ItemQtRKList.SupplierCode != "") |
| | | { |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_SUPPLIER" |
| | | && s.U9Id == ItemQtRKList.SupplierCode).First(); |
| | | |
| | | if (mesLinkU9 == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.SupplierCode + |
| | | "]ä¾åºåä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | var mesSupplier = Db.Queryable<MesSupplier>() |
| | | .Where(s => s.Id == Decimal.Parse(mesLinkU9.MesId)) |
| | | .First(); |
| | | if (mesSupplier == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.SupplierCode + |
| | | "]ä¾åºåä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | supplierCode = mesSupplier.SuppNo; |
| | | } |
| | | |
| | | |
| | | //var mesInvItemInCItems = Db.Queryable<MesInvItemInCItems>() |
| | | // .Where(s => s.ItemInId == mesInvItemIns.Id |
| | | // && s.ItemNo == mesItems.ItemNo |
| | | // && s.Ebeln == itemOutList.SrcDocNo |
| | | // && s.EbelnLineNo == |
| | | // Decimal.Parse(itemOutList.SrcDocLineNo) |
| | | // && s.SuppNo == mesSupplier.SuppNo |
| | | // && Convert.ToInt32(s.ZzitemId) == |
| | | // Convert.ToInt32(itemOutList.AsnLineNo)).First(); |
| | | |
| | | //if (mesInvItemInCItems == null) |
| | | //{ |
| | | // throw new NotImplementedException("没æå¯¹åºçå
¥åºæç»"); |
| | | //} |
| | | |
| | | |
| | | // ç¡®ä¿CbillNoä¸ä¸ºç©º |
| | | if (ItemQtRKList.AppliedQuantity <= 0 || ItemQtRKList.AppliedQuantity == null) |
| | | { |
| | | throw new NotImplementedException("ç³è¯·æ°éä¸è½ä¸º0æNULLå¼ï¼"); |
| | | } |
| | | |
| | | mesItemQtDetail.Add(new MesItemQtDatall |
| | | { |
| | | Mid = nextSequenceValue, |
| | | Qd002 = mesItems.ItemNo, |
| | | Qd003 = mesItems.ItemName, |
| | | Qd004 = mesItems.ItemModel, |
| | | Qd005 = mesItems.ColorName, |
| | | Qd006 = ItemQtRKList.PlannedQuantity, |
| | | Qd007 = ItemQtRKList.AppliedQuantity, |
| | | Qd008 = 0, // å·²å
¥æ°éé»è®¤ä¸º0 |
| | | Qd009 = mesItems.ItemUnit, |
| | | Qd010 = ItemQtRKList.Remark, |
| | | Qd012 = mesItems.Id, // ç©æå
ç |
| | | LineNumber = ItemQtRKList.LineNumber, |
| | | ProductionRelated = ItemQtRKList.ProductionRelated, |
| | | StorageType = ItemQtRKList.StorageType, |
| | | OwnerOrganization = ItemQtRKList.OwnerOrganization, |
| | | StorageLocation = mesDepot, |
| | | SupplierCode = supplierCode, |
| | | CustomerCode = ItemQtRKList.CustomerCode, |
| | | ProjectCode = ItemQtRKList.ProjectCode, |
| | | TaskCode = ItemQtRKList.TaskCode, |
| | | ProductionOrder = ItemQtRKList.ProductionOrder, |
| | | DailyPlan = ItemQtRKList.DailyPlan, |
| | | ProductionActivity = ItemQtRKList.ProductionActivity, |
| | | FinishedProduct = ItemQtRKList.FinishedProduct, |
| | | PickingUsage= ItemQtRKList.PickingUsage |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | var outItemCommand = Db.Insertable(mesItemQtDetail) |
| | | .PageSize(1).IgnoreColumnsNull().ExecuteCommand(); |
| | | if (outItemCommand <= 0) |
| | | { |
| | | throw new Exception("å建æååå表失败"); |
| | | } |
| | | |
| | | // æå
¥éè´éæåè®°å½ |
| | | var insertResult = Db.Insertable(MesItemQtrk).IgnoreColumns(true) |
| | | .ExecuteCommand(); |
| | | if (insertResult <= 0) |
| | | { |
| | | throw new Exception("å建æåå失败"); |
| | | } |
| | | |
| | | return outItemCommand + insertResult >= 2; |
| | | } |
| | | |
| | | private bool Remove(MesItemQtFrom from) |
| | | { |
| | | // æ¥æ¾è¦å é¤çæåå |
| | | var mesItemQtrk = Db.Queryable<MesItemQt>() |
| | | .Where(s => s.Qtck == from.ApplyNumber |
| | | ).ToList(); |
| | | |
| | | if (mesItemQtrk == null || mesItemQtrk.Count == 0) |
| | | { |
| | | throw new NotImplementedException("æ¾ä¸å°å¯¹åºçæåå: " + from.ApplyNumber); |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦æå·²å®¡æ ¸çåæ®ï¼å¦æåå¨å·²å®¡æ ¸(Status=1)åä¸å
许å é¤ |
| | | //if (mesInvItemOuts.Any(item => item.Status == 1)) |
| | | //{ |
| | | // throw new NotImplementedException("åå¨å·²å®¡æ ¸çéè´éæåï¼ä¸å
许å é¤"); |
| | | //} |
| | | |
| | | // å 餿æç¸å
³åæ® |
| | | foreach (var itemRK in mesItemQtrk) |
| | | { |
| | | // æ¥æ¾è¦å é¤çæååæç» |
| | | var mesInvItemOutItems = Db.Queryable<MesItemQtDatall>() |
| | | .Where(s => s.Mid == itemRK.Id) |
| | | .ToList(); |
| | | |
| | | if (mesInvItemOutItems == null || mesInvItemOutItems.Count == 0) |
| | | { |
| | | throw new NotImplementedException( |
| | | $"æ¾ä¸å°æåå[{from.ApplyNumber}]对åºçæç»"); |
| | | } |
| | | |
| | | // å 餿ååæç» |
| | | var deleteItemsResult = Db.Deleteable<MesItemQtDatall>() |
| | | .Where(s => s.Mid == itemRK.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | if (deleteItemsResult <= 0) |
| | | { |
| | | throw new Exception($"æ¾ä¸å°æåå[ {from.ApplyNumber}]æç»ï¼å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // å 餿åå |
| | | var deleteResult = Db.Deleteable<MesItemQt>() |
| | | .Where(s => s.Id == itemRK.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | if (deleteResult <= 0) |
| | | { |
| | | throw new Exception($"å 餿åå[{from.ApplyNumber}]失败"); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Masuit.Tools; |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace MES.Service.service.Warehouse |
| | | { |
| | | public class MesItemQtrkManager : Repository<MesItemQtrk> |
| | | { |
| | | public bool MiscellaneousReceipts(MesItemQtRKDto mesItemQtRKDto) |
| | | { |
| | | var itemQtRKFrom = mesItemQtRKDto.from; |
| | | var itemQtRKLists = mesItemQtRKDto.items; |
| | | |
| | | // æ ¹æ®AsnNoåMesNo对æç»è¿è¡åç» |
| | | //var groupedItems = itemOutLists |
| | | // .GroupBy(item => new { item.AsnNo, item.MesNo, item.SqNo }) |
| | | // .ToList(); |
| | | |
| | | bool result = true; |
| | | //foreach (var group in itemQtRKLists) |
| | | //{ |
| | | //if (group.Key.AsnNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("AsnNoä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | //if (group.Key.MesNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("å
¥åºååå·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | //if (group.Key.SqNo == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´§ç³è¯·åè¡å·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | // å建ä¸ä¸ªä¸´æ¶çitemOutFrom对象ï¼ä½¿ç¨åç»çKeyä½ä¸ºä¸»è¦å±æ§ |
| | | //var tempItemOutFrom = new ItemOutFrom |
| | | //{ |
| | | // AsnNo = group.Key.AsnNo, |
| | | // MesNo = group.Key.MesNo, |
| | | // SqNo = group.Key.SqNo, |
| | | // // ç»§æ¿åå§itemOutFromçå
¶ä»å±æ§ |
| | | // RtnNo = itemOutFrom.RtnNo, |
| | | // Type = itemOutFrom.Type, |
| | | // CreateBy = itemOutFrom.CreateBy, |
| | | // FMRMODE = itemOutFrom.FMRMODE, |
| | | // DepotId = itemOutFrom.DepotId, |
| | | // SupperId = itemOutFrom.SupperId |
| | | //}; |
| | | |
| | | // æ ¹æ®Typeæ§è¡ä¸åçé»è¾ |
| | | switch (itemQtRKFrom.Type) |
| | | { |
| | | case "1": |
| | | { |
| | | var mesInvItemOuts = Db.Queryable<MesItemQtrk>() |
| | | .Where(s => s.Qtck == itemQtRKFrom.ApplyNumber |
| | | |
| | | ) |
| | | .Count(); |
| | | |
| | | if (mesInvItemOuts > 0) |
| | | { |
| | | throw new NotImplementedException( |
| | | itemQtRKFrom.ApplyNumber + |
| | | "çææ¶ç³è¯·åå·²ç»åå¨"); |
| | | } |
| | | |
| | | // 为å½ååç»ä¿åæ°æ® |
| | | var groupResult = Save(itemQtRKFrom, itemQtRKLists); |
| | | if (!groupResult) |
| | | { |
| | | result = false; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | case "4": |
| | | var removeResult = Remove(itemQtRKFrom); |
| | | if (!removeResult) |
| | | { |
| | | result = false; |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | result = false; |
| | | break; |
| | | } |
| | | //} |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | private bool Save(MesItemQtRKFrom from, List<MesItemQtRKList> items) |
| | | { |
| | | //var mesInvItemIns = Db.Queryable<MesInvItemIns>() |
| | | // .Where(s => s.BillTypeId == 100 |
| | | // && s.TransctionNo == "101" |
| | | // && s.BillNo == from.MesNo |
| | | // ).First(); |
| | | |
| | | //if (mesInvItemIns == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´å
¥åºä¸åå¨"); |
| | | //} |
| | | |
| | | |
| | | string SuppNo = ""; |
| | | if (from.SupplierCode!="" && from.SupplierCode!=null) |
| | | { |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_SUPPLIER" |
| | | && s.U9Id == from.SupplierCode).First(); |
| | | |
| | | if (mesLinkU9 == null) |
| | | { |
| | | throw new NotImplementedException("ä¾åºåIDä¸å卿æªåæ¥äºU9"); |
| | | } |
| | | |
| | | var mesSupplier = Db.Queryable<MesSupplier>() |
| | | .Where(s => s.Id == Decimal.Parse(mesLinkU9.MesId)) |
| | | .First(); |
| | | if (mesSupplier == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.SupplierCode + |
| | | "]ä¾åºåä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | SuppNo= mesSupplier.SuppNo; |
| | | } |
| | | var mesDepots = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId == Decimal.Parse(from.FromWarehouse)).First(); |
| | | |
| | | if (mesDepots == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.FromWarehouse + |
| | | "]ä»åºä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | |
| | | var sysDepartment = Db.Queryable<SysDepartment>() |
| | | .Where(s => s.Departmentid == Decimal.Parse(from.ApplyDept)).First(); |
| | | |
| | | if (sysDepartment == null) |
| | | { |
| | | throw new NotImplementedException("[" + from.ApplyDept + |
| | | "]é¨é¨ä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | |
| | | |
| | | var nextSequenceValue = |
| | | Db.Ado.SqlQuery<decimal>("SELECT SEQ_QTRK.NEXTVAL FROM DUAL") |
| | | .First(); |
| | | |
| | | // var billCode = |
| | | // Db.Ado.SqlQuery<string>( |
| | | // "SELECT GETBILLCODE1('1000', '1000', 'TLSQ') FROM DUAL") |
| | | // .First(); |
| | | //var billCode = from.RtnNo; |
| | | |
| | | // åå»ºææ¶ç³è¯·åè®°å½ |
| | | var MesItemQtrk = new MesItemQtrk |
| | | { |
| | | Id = nextSequenceValue, |
| | | Qtck= from.ApplyNumber, |
| | | Qt001= from.Equals(null) ? DateTime.Now : from.ApplyDate, |
| | | Qt002= from.Equals(null) ? DateTime.Now : from.AuditDate, |
| | | Qt003= from.DocumentType, |
| | | Qt004= from.StockInType, |
| | | Qt005= from.CreatedBy, |
| | | Qt006= from.WorkOrder, |
| | | Qt009= sysDepartment.Departmentname, |
| | | Qt012 = sysDepartment.Departmentcode, |
| | | Qt010 = from.Reason, |
| | | Qt011= mesDepots.DepotCode, |
| | | Qt008 = mesDepots.DepotName, |
| | | |
| | | Qt015= 1, |
| | | Qt016= from.Auditor, |
| | | Qt017= from.TaskNumber, |
| | | Qt018= SuppNo, |
| | | Qt019= from.Direction, |
| | | Qt020= from.OwnerType, |
| | | CustomerCode= from.CustomerCode, |
| | | Receiver= from.Receiver, |
| | | Department = from.Department, |
| | | StockKeeper=from.StockKeeper, |
| | | SourceType = from.SourceType, |
| | | SourceDocument = from.SourceDocument, |
| | | ProductionRelated = from.ProductionRelated, |
| | | ProductionLine = from.ProductionLine, |
| | | ProductionActivity = from.ProductionActivity, |
| | | FinishedGoods = from.FinishedGoods, |
| | | ReversePosting = from.ReversePosting, |
| | | AccountingPeriod= from.AccountingPeriod, |
| | | Employee= from.Employee, |
| | | FalseReturn = from.FalseReturn, |
| | | ProjectCode = from.ProjectCode, |
| | | TaskCode = from.TaskCode, |
| | | Status=from.Status, |
| | | OwnerOrganization= from.OwnerOrganization |
| | | |
| | | |
| | | }; |
| | | |
| | | // åå»ºææ¶ç³è¯·åè¡è®°å½ |
| | | var mesItemQtrrDetail = new List<MesItemQtrrDetail>(); |
| | | |
| | | foreach (var ItemQtRKList in items) |
| | | { |
| | | // æ£æ¥å¿
è¦å段æ¯å¦ä¸ºç©º |
| | | //if (string.IsNullOrEmpty(itemOutList.SrcDocNo)) |
| | | //{ |
| | | // throw new NotImplementedException("éè´è®¢åå·ä¸è½ä¸ºç©º"); |
| | | //} |
| | | |
| | | |
| | | |
| | | //var mesRohInData = Db.Queryable<MesRohInData>() |
| | | // .Where(s => s.BillNo == itemOutList.SrcDocNo |
| | | // && s.OrderLineId == itemOutList.SrcDocLineNo) |
| | | // .First(); |
| | | |
| | | //if (mesRohInData == null) |
| | | //{ |
| | | // throw new NotImplementedException("éè´è®¢åä¸åå¨"); |
| | | //} |
| | | |
| | | //var deliveryDetail = Db.Queryable<DeliveryDetail>() |
| | | // .Where(a => a.Zzasn == from.AsnNo |
| | | // && Int32.Parse(a.ZzitemId) == |
| | | // Int32.Parse(itemOutList.AsnLineNo)) |
| | | // .Count(); |
| | | |
| | | //if (deliveryDetail <= 0) |
| | | //{ |
| | | // throw new NotImplementedException("[" + from.AsnNo + "]çæç»è¡[" + |
| | | // itemOutList.AsnLineNo + |
| | | // "]ä¸åå¨"); |
| | | //} |
| | | |
| | | var itemIdLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_ITEMS" |
| | | && s.U9Id == ItemQtRKList.ItemId).First(); |
| | | |
| | | if (itemIdLinkU9 == null) |
| | | { |
| | | throw new NotImplementedException("ç©æIDä¸å卿æªåæ¥äºU9"); |
| | | } |
| | | |
| | | var mesItems = Db.Queryable<MesItems>() |
| | | .Where(s => s.Id == Decimal.Parse(itemIdLinkU9.MesId)) |
| | | .First(); |
| | | |
| | | if (mesItems == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.ItemId + |
| | | "]ç©æä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | var mesDepot = ""; |
| | | if (ItemQtRKList.StorageLocation != null && ItemQtRKList.StorageLocation!=null) |
| | | { |
| | | mesDepots = Db.Queryable<MesDepots>() |
| | | .Where(s => s.DepotId == Decimal.Parse(ItemQtRKList.StorageLocation)).First(); |
| | | if (mesDepots == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.StorageLocation + |
| | | "]ä»åºä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | mesDepot = mesDepots.DepotCode; |
| | | } |
| | | string supplierCode = ""; |
| | | if (ItemQtRKList.SupplierCode!=null && ItemQtRKList.SupplierCode != "") |
| | | { |
| | | var mesLinkU9 = Db.Queryable<MesLinkU9>() |
| | | .Where(s => s.TableType == "MES_SUPPLIER" |
| | | && s.U9Id == ItemQtRKList.SupplierCode).First(); |
| | | |
| | | var mesSupplier = Db.Queryable<MesSupplier>() |
| | | .Where(s => s.Id == Decimal.Parse(mesLinkU9.MesId)) |
| | | .First(); |
| | | if (mesSupplier == null) |
| | | { |
| | | throw new NotImplementedException("[" + ItemQtRKList.SupplierCode + |
| | | "]ä¾åºåä¸åå¨ï¼è¯·åæ¥ç»MES"); |
| | | } |
| | | supplierCode = mesSupplier.SuppNo; |
| | | } |
| | | |
| | | |
| | | //var mesInvItemInCItems = Db.Queryable<MesInvItemInCItems>() |
| | | // .Where(s => s.ItemInId == mesInvItemIns.Id |
| | | // && s.ItemNo == mesItems.ItemNo |
| | | // && s.Ebeln == itemOutList.SrcDocNo |
| | | // && s.EbelnLineNo == |
| | | // Decimal.Parse(itemOutList.SrcDocLineNo) |
| | | // && s.SuppNo == mesSupplier.SuppNo |
| | | // && Convert.ToInt32(s.ZzitemId) == |
| | | // Convert.ToInt32(itemOutList.AsnLineNo)).First(); |
| | | |
| | | //if (mesInvItemInCItems == null) |
| | | //{ |
| | | // throw new NotImplementedException("没æå¯¹åºçå
¥åºæç»"); |
| | | //} |
| | | |
| | | |
| | | // ç¡®ä¿CbillNoä¸ä¸ºç©º |
| | | if (ItemQtRKList.AppliedQuantity<=0 || ItemQtRKList.AppliedQuantity==null) |
| | | { |
| | | throw new NotImplementedException("ç³è¯·æ°éä¸è½ä¸º0æNULLå¼ï¼"); |
| | | } |
| | | |
| | | mesItemQtrrDetail.Add(new MesItemQtrrDetail |
| | | { |
| | | Mid = nextSequenceValue, |
| | | Qd002= mesItems.ItemNo, |
| | | Qd003= mesItems.ItemName, |
| | | Qd004= mesItems.ItemModel, |
| | | Qd005= mesItems.ColorName, |
| | | Qd006= ItemQtRKList.PlannedQuantity, |
| | | Qd007= ItemQtRKList.AppliedQuantity, |
| | | Qd008=0, // å·²å
¥æ°éé»è®¤ä¸º0 |
| | | Qd009= mesItems.ItemUnit, |
| | | Qd010= ItemQtRKList.Remark, |
| | | Qd012= mesItems.Id, // ç©æå
ç |
| | | LineNumber= ItemQtRKList.LineNumber, |
| | | ProductionRelated= ItemQtRKList.ProductionRelated, |
| | | StorageType= ItemQtRKList.StorageType, |
| | | OwnerOrganization = ItemQtRKList.OwnerOrganization, |
| | | StorageLocation= mesDepot, |
| | | SupplierCode= supplierCode, |
| | | CustomerCode = ItemQtRKList.CustomerCode, |
| | | ProjectCode = ItemQtRKList.ProjectCode, |
| | | TaskCode = ItemQtRKList.TaskCode, |
| | | ProductionOrder = ItemQtRKList.ProductionOrder, |
| | | DailyPlan = ItemQtRKList.DailyPlan, |
| | | ProductionActivity = ItemQtRKList.ProductionActivity, |
| | | FinishedProduct = ItemQtRKList.FinishedProduct |
| | | |
| | | }); |
| | | } |
| | | |
| | | var outItemCommand = Db.Insertable(mesItemQtrrDetail) |
| | | .PageSize(1).IgnoreColumnsNull().ExecuteCommand(); |
| | | if (outItemCommand <= 0) |
| | | { |
| | | throw new Exception("åå»ºææ¶åå表失败"); |
| | | } |
| | | |
| | | // æå
¥éè´éæåè®°å½ |
| | | var insertResult = Db.Insertable(MesItemQtrk).IgnoreColumns(true) |
| | | .ExecuteCommand(); |
| | | if (insertResult <= 0) |
| | | { |
| | | throw new Exception("åå»ºææ¶å失败"); |
| | | } |
| | | |
| | | return outItemCommand + insertResult >= 2; |
| | | } |
| | | |
| | | private bool Remove(MesItemQtRKFrom from) |
| | | { |
| | | // æ¥æ¾è¦å é¤çææ¶å |
| | | var mesItemQtrk = Db.Queryable<MesItemQtrk>() |
| | | .Where(s => s.Qtck == from.ApplyNumber |
| | | ).ToList(); |
| | | |
| | | if (mesItemQtrk == null || mesItemQtrk.Count == 0) |
| | | { |
| | | throw new NotImplementedException("æ¾ä¸å°å¯¹åºçææ¶å: " + from.ApplyNumber); |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦æå·²å®¡æ ¸çåæ®ï¼å¦æåå¨å·²å®¡æ ¸(Status=1)åä¸å
许å é¤ |
| | | //if (mesInvItemOuts.Any(item => item.Status == 1)) |
| | | //{ |
| | | // throw new NotImplementedException("åå¨å·²å®¡æ ¸çéè´éæåï¼ä¸å
许å é¤"); |
| | | //} |
| | | |
| | | // å 餿æç¸å
³åæ® |
| | | foreach (var itemRK in mesItemQtrk) |
| | | { |
| | | // æ¥æ¾è¦å é¤çææ¶åæç» |
| | | var mesInvItemOutItems = Db.Queryable<MesItemQtrrDetail>() |
| | | .Where(s => s.Mid == itemRK.Id) |
| | | .ToList(); |
| | | |
| | | if (mesInvItemOutItems == null || mesInvItemOutItems.Count == 0) |
| | | { |
| | | throw new NotImplementedException( |
| | | $"æ¾ä¸å°ææ¶å[{from.ApplyNumber}]对åºçæç»"); |
| | | } |
| | | |
| | | // å 餿æ¶åæç» |
| | | var deleteItemsResult = Db.Deleteable<MesItemQtrrDetail>() |
| | | .Where(s => s.Mid == itemRK.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | if (deleteItemsResult <= 0) |
| | | { |
| | | throw new Exception($"æ¾ä¸å°ææ¶å[ {from.ApplyNumber}]æç»ï¼å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | // å 餿æ¶å |
| | | var deleteResult = Db.Deleteable<MesItemQtrk>() |
| | | .Where(s => s.Id == itemRK.Id) |
| | | .ExecuteCommand(); |
| | | |
| | | if (deleteResult <= 0) |
| | | { |
| | | throw new Exception($"å 餿æ¶å[{from.ApplyNumber}]失败"); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | |
| | | using MES.Service.DB; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service.BasicData; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Data; |
| | | |
| | | namespace MES.Service.service.Warehouse |
| | | { |
| | |
| | | { |
| | | OracleSQLHelper SQLHelper = new(); |
| | | //æ¥å·¥åä¿¡æ¯ |
| | | var sql1 = @"select DAA001 tickeNo,s.ITEM_NO itemNo,s.ITEM_NAME itemName,s.ITEM_MODEL itemModel,DAA008 plannedNum from MESLINE_LIKE_CCLOGIN A |
| | | join MES_LINE b on A.LINEID=b.ID |
| | | left join WOMDAA C on C.DAA015=B.LINE_NO |
| | | left join mes_items s on s.id = C.daa002 |
| | | where LOGINID='" + id + "' and DAA018='å·²å¼å·¥' order by DAA016 asc"; |
| | | //var sql1 = @"select DAA001 tickeNo,s.ITEM_NO itemNo,s.ITEM_NAME itemName,s.ITEM_MODEL itemModel,DAA008 plannedNum from MESLINE_LIKE_CCLOGIN A |
| | | // join MES_LINE b on A.LINEID=b.ID |
| | | // left join WOMDAA C on C.DAA015=B.LINE_NO |
| | | // left join mes_items s on s.id = C.daa002 |
| | | // where LOGINID='" + id + "' and DAA018='å·²å¼å·¥' order by DAA016 asc"; |
| | | |
| | | //æ¹ä¸ºæç«ä½å·åæ¥äº§çº¿ï¼åéè¿äº§çº¿æ¥åºå·¥åä¿¡æ¯ |
| | | //var sql1 = @"select DAA001 tickeNo,s.ITEM_NO itemNo,s.ITEM_NAME itemName,s.ITEM_MODEL itemModel,DAA008 plannedNum from MESLINE_LIKE_CCLOGIN A |
| | |
| | | // join MES_LINE b on A.LINEID=b.ID |
| | | // left join WOMDAA C on C.DAA015=B.LINE_NO |
| | | // left join mes_items s on s.id = C.daa002 |
| | | // where WORKSNO='" + id+ "' and DAA018='å·²å¼å·¥' order by DAA016 asc"; |
| | | // where WORKSNO='" + id + "' and DAA018='å·²å¼å·¥' order by DAA016 asc"; |
| | | |
| | | |
| | | //åç´æ¥å
³è线ä½ç产æµç»å½å·æ°æ®ï¼å»åè·åå·¥å |
| | | var sql1 = "select DAA001 tickeNo,s.ITEM_NO itemNo,s.ITEM_NAME itemName,s.ITEM_MODEL itemModel,DAA008 plannedNum from " + |
| | | "MESLINE_LIKE_CCLOGIN_WORKS A1" + |
| | | " join MES_LINE b on A1.LOGINID=b.ID" + |
| | | " left join WOMDAA C on C.DAA015=B.LINE_NO" + |
| | | " left join mes_items s on s.id = C.daa002" + |
| | | " where WORKSNO='" + id + "' and DAA018='å·²å¼å·¥' order by DAA016 asc"; |
| | | return SQLHelper.ExecuteQuery(sql1); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | //public bool AddAsnInfo(AsnInfo asnInfo) |
| | | //{ |
| | | // OracleSQLHelper SQLHelper = new(); |
| | | // //è®°å½äº§æµè¿ç«ä¿¡æ¯ |
| | | // var sql1 = @"INSERT INTO MES_SN_STATUS_DETAILS (ID,TICKET_NO,SN_NO,WORKSTATION_NO,SN_STATE,LOGIN_ID) VALUES (SEQ_MES_SN_STATUS_DETAILS_ID.NEXTVAL,'" + asnInfo.tickeNo+ "','"+ asnInfo.snNo+ "','"+ asnInfo.workstationNo+ "','"+ asnInfo.snState+ "','"+asnInfo.loginId+"')"; |
| | | // bool result = true; |
| | | // int i= SQLHelper.ExecuteNonQuery(sql1); |
| | | // //ä¸»è¡¨ä¿¡æ¯æå
¥æåï¼ç»§ç»æå
¥é¡¹ç® |
| | | // if (i > 0) { |
| | | // //å¤æé¡¹ç®æ¯å¦ä¸ºç©ºï¼ä¸ºç©ºä¸æå
¥ |
| | | // if (asnInfo.failItems.Count>0) |
| | | // { |
| | | // //æå
¥é»è¾ |
| | | |
| | | // } |
| | | // else |
| | | // { |
| | | // result = true; |
| | | // } |
| | | |
| | | |
| | | // } else { result = false; } |
| | | |
| | | // return result; |
| | | //} |
| | | public bool AddAsnInfo(AsnInfo asnInfo) |
| | | { |
| | | OracleSQLHelper SQLHelper = new(); |
| | | //è®°å½äº§æµè¿ç«ä¿¡æ¯ |
| | | var sql1 = @"INSERT INTO MES_SN_STATUS_DETAILS (ID,TICKET_NO,SN_NO,WORKSTATION_NO,SN_STATE) VALUES (SEQ_MES_SN_STATUS_DETAILS_ID.NEXTVAL,'"+ asnInfo.tickeNo+ "','"+ asnInfo.snNo+ "','"+ asnInfo.workstationNo+ "','"+ asnInfo.snState+ "')"; |
| | | var sqlHelper = new OracleSQLHelper(); |
| | | bool result = true; |
| | | int i= SQLHelper.ExecuteNonQuery(sql1); |
| | | if (i > 0) {result = true;} else { result = false; } |
| | | |
| | | // |
| | | var (connection, transaction) = sqlHelper.BeginTransaction(); |
| | | |
| | | try |
| | | { |
| | | // 主表æå
¥ |
| | | var sql1 = $@"INSERT INTO MES_SN_STATUS_DETAILS |
| | | (ID, TICKET_NO, SN_NO, WORKSTATION_NO, SN_STATE, LOGIN_ID) |
| | | VALUES (SEQ_MES_SN_STATUS_DETAILS_ID.NEXTVAL, |
| | | '{asnInfo.tickeNo}', |
| | | '{asnInfo.snNo}', |
| | | '{asnInfo.workstationNo}', |
| | | '{asnInfo.snState}', |
| | | '{asnInfo.loginId}')"; |
| | | |
| | | int i = sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql1); |
| | | |
| | | if (i > 0 && asnInfo.failItems?.Count > 0) |
| | | { |
| | | foreach (var item in asnInfo.failItems) |
| | | { |
| | | var sql2 = $@"INSERT INTO CC_FAIL_ITEMS |
| | | (ID, MID, DEFECT_ISSUE, ROOT_CAUSE, REPAIR_METHOD, MATERIAL_HANDLING, CREATE_DATE, CREATED_BY) |
| | | VALUES (SEQ_CC_FAIL_ITEMS.NEXTVAL, |
| | | SEQ_MES_SN_STATUS_DETAILS_ID.CURRVAL, |
| | | '{item.DefectIssue}', |
| | | '{item.RootCause}', |
| | | '{item.RepairMethod}', |
| | | '{item.MaterialHandling}', |
| | | SYSDATE, |
| | | '{asnInfo.loginId}')"; |
| | | |
| | | sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql2); |
| | | } |
| | | } |
| | | |
| | | // å
¨é¨æåæäº¤ |
| | | transaction.Commit(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | transaction.Rollback(); |
| | | result = false; |
| | | throw; // å»ºè®®è®°å½æ¥å¿ |
| | | } |
| | | finally |
| | | { |
| | | sqlHelper.CloseConnection(connection); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置ä¸ç®±ç |
| | | /// </summary> |
| | | /// <param name="mesMiddleBox"></param> |
| | | /// <returns></returns> |
| | | public string[] SetMediumBoxCode(MesMiddleBox mesMiddleBox) |
| | | { |
| | | var sqlHelper = new OracleSQLHelper(); |
| | | string[] msg= new string[2]; |
| | | msg[0] = "true"; |
| | | // |
| | | var (connection, transaction) = sqlHelper.BeginTransaction(); |
| | | |
| | | try |
| | | { |
| | | if (mesMiddleBox.type.ToUpper() =="A") { |
| | | if (mesMiddleBox.SnList.Count > 0) |
| | | { |
| | | string sql1 = "select count(*) count from MES_MIDDLE_BOX where MEDIUMBOXCODE='"+ mesMiddleBox.MediumBoxCode + "'"; |
| | | DataTable data= sqlHelper.ExecuteQuery(sql1); |
| | | if (data.Rows[0]["COUNT"].ToString() != "0") { |
| | | msg[0] = "false"; |
| | | msg[1] = "该ä¸ç®±ç å·²ç»ç»å®SNæ°æ®ï¼å¦é忬¡ç»å®è¯·å
è§£ç»ï¼ä¸ç®±ç ï¼" + mesMiddleBox.MediumBoxCode; |
| | | transaction.Rollback(); |
| | | |
| | | return msg; |
| | | } |
| | | foreach (var item in mesMiddleBox.SnList) |
| | | { |
| | | var sql2 = $@"INSERT INTO MES_MIDDLE_BOX |
| | | ( |
| | | ID, |
| | | MEDIUMBOXCODE, |
| | | LOGIN_ID, |
| | | SN_NO, |
| | | TICKET_NO, |
| | | CREATE_DATE, |
| | | CREATED_BY |
| | | ) |
| | | VALUES |
| | | ( |
| | | SEQ_MES_MIDDLE_BOX_ID.NEXTVAL, -- åºåçæä¸»é® |
| | | '{mesMiddleBox.MediumBoxCode.ToString()}', -- ä¸ç®±ç |
| | | '{mesMiddleBox.LoginId}', -- ç»å½å· |
| | | '{item.SnNo}', -- SNå· |
| | | '{item.TicketNo}', -- å·¥ååå· |
| | | SYSDATE, -- å建æ¶é´ |
| | | '{mesMiddleBox.LoginId}' -- å建人 |
| | | ) |
| | | "; |
| | | |
| | | sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql2); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | msg[0] = "false"; |
| | | } |
| | | } else if(mesMiddleBox.type.ToUpper() == "F") { |
| | | //è§£ç»ï¼æ ¹æ®ä¸ç®±ç å
¨é¨å é¤ |
| | | var sql2 = $@"delete MES_MIDDLE_BOX where MEDIUMBOXCODE='{mesMiddleBox.MediumBoxCode}'"; |
| | | |
| | | sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql2); |
| | | } |
| | | else |
| | | { |
| | | msg[1] = "SNæç»ä¸ºç©ºï¼è¯·ç¡®è®¤ï¼"; |
| | | msg[0] = "false"; |
| | | } |
| | | |
| | | |
| | | // å
¨é¨æåæäº¤ |
| | | transaction.Commit(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | transaction.Rollback(); |
| | | msg[0] = "false"; |
| | | msg[1] = ex.Message; |
| | | throw; // å»ºè®®è®°å½æ¥å¿ |
| | | } |
| | | finally |
| | | { |
| | | sqlHelper.CloseConnection(connection); |
| | | } |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | public string[] SetStackCode(MesPalletBinding mesPalletBinding) |
| | | { |
| | | var sqlHelper = new OracleSQLHelper(); |
| | | string[] msg = new string[2]; |
| | | msg[0] = "true"; |
| | | // |
| | | var (connection, transaction) = sqlHelper.BeginTransaction(); |
| | | |
| | | try |
| | | { |
| | | //ç»å® |
| | | if (mesPalletBinding.Type.ToUpper() == "A") { |
| | | if (mesPalletBinding.SnList.Count > 0) |
| | | { |
| | | string sql1 = "select count(*) count from MES_PALLET_BINDING where STACKCODE='" + mesPalletBinding.StackCode + "'"; |
| | | DataTable data = sqlHelper.ExecuteQuery(sql1); |
| | | if (data.Rows[0]["COUNT"].ToString() != "0") |
| | | { |
| | | msg[0] = "false"; |
| | | msg[1] = "è¯¥æ æ¿ç å·²ç»ç»å®SNæ°æ®ï¼å¦é忬¡ç»å®è¯·å
è§£ç»ï¼æ æ¿ç ï¼" + mesPalletBinding.StackCode; |
| | | transaction.Rollback(); |
| | | |
| | | return msg; |
| | | } |
| | | foreach (var item in mesPalletBinding.SnList) |
| | | { |
| | | var sql2 = $@"INSERT INTO MES_PALLET_BINDING |
| | | ( |
| | | ID, |
| | | STACKCODE, |
| | | LOGIN_ID, |
| | | SN_NO, |
| | | TICKET_NO, |
| | | MEDIUMBOXCODE, |
| | | CREATE_DATE, |
| | | CREATED_BY |
| | | ) |
| | | VALUES |
| | | ( |
| | | SEQ_MES_PALLET_BINDING_ID.NEXTVAL, -- åºåçæä¸»é® |
| | | '{mesPalletBinding.StackCode}', -- æ æ¿ç |
| | | '{mesPalletBinding.LoginId}', -- ç»å½å· |
| | | '{item.SnNo}', -- SNå· |
| | | '{item.TicketNo}', -- å·¥ååå· |
| | | '{item.MediumBoxCode}', -- ä¸ç®±ç |
| | | SYSDATE, -- å建æ¶é´ |
| | | '{mesPalletBinding.LoginId}' -- å建人 |
| | | ) |
| | | |
| | | "; |
| | | |
| | | sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql2); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | msg[1] = "SNæç»ä¸ºç©ºï¼è¯·ç¡®è®¤ï¼"; |
| | | msg[0] = "false"; |
| | | } |
| | | } |
| | | //è§£ç» |
| | | else if(mesPalletBinding.Type.ToUpper() == "F") |
| | | { |
| | | //è§£ç»ï¼æ ¹æ®ä¸ç®±ç å
¨é¨å é¤ |
| | | var sql2 = $@"delete MES_PALLET_BINDING where STACKCODE='" + mesPalletBinding.StackCode + "'"; |
| | | |
| | | sqlHelper.ExecuteNonQueryWithTransaction(connection, transaction, sql2); |
| | | } |
| | | |
| | | |
| | | // å
¨é¨æåæäº¤ |
| | | transaction.Commit(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | transaction.Rollback(); |
| | | msg[0] = "false"; |
| | | msg[1] = ex.Message; |
| | | throw; // å»ºè®®è®°å½æ¥å¿ |
| | | } |
| | | finally |
| | | { |
| | | sqlHelper.CloseConnection(connection); |
| | | } |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.BasicData; |
| | | using MES.Service.service.Warehouse; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Dynamic; |
| | | |
| | | // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 |
| | | |
| | | namespace MESApplication.Controllers.Warehouse |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class MesItemQtController : ControllerBase |
| | | { |
| | | private readonly MesItemQtManager m = new(); |
| | | |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MesItemQt"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesItemQt/"; |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»åºåºç³è¯·åï¼æåï¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("MiscellaneousIssues")] |
| | | public ResponseResult MiscellaneousIssues(MesItemQtDto oItemOut) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "MiscellaneousIssues"; |
| | | entity.Method = METHOD; |
| | | entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(oItemOut); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var result = m.MiscellaneousIssues(oItemOut); |
| | | resultInfos.tbBillList = result; |
| | | |
| | | entity.Result = 0; |
| | | if (result) 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] MesItemQt 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] MesItemQt 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] MesItemQt 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 MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.Warehouse; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Dynamic; |
| | | |
| | | namespace MESApplication.Controllers.Warehouse |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class MesItemQtrkController : ControllerBase |
| | | { |
| | | private readonly MesItemQtrkManager m = new(); |
| | | |
| | | private readonly MessageCenterManager _manager = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "MesItemQtrk"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/MesItemQtrk/"; |
| | | |
| | | /// <summary> |
| | | /// å
¶ä»å
¥åºç³è¯·åï¼ææ¶ï¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("MiscellaneousReceipts")] |
| | | public ResponseResult MiscellaneousReceipts(MesItemQtRKDto mesItemQtRKDto) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "MiscellaneousReceipts"; |
| | | entity.Method = METHOD; |
| | | entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(mesItemQtRKDto); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var result = m.MiscellaneousReceipts(mesItemQtRKDto); |
| | | resultInfos.tbBillList = result; |
| | | |
| | | entity.Result = 0; |
| | | if (result) 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] MesItemQtrk 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] MesItemQtrk 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] MesItemQtrk 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 MES.Service.Dto.service; |
| | | using AngleSharp.Text; |
| | | using MES.Service.Dto.service; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.service.Warehouse; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | ///设置ä¸ç®±ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("SetMediumBoxCode")] |
| | | public ResponseResult SetMediumBoxCode(MesMiddleBox MesMiddleBox) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SetMediumBoxCode"; |
| | | entity.Method = METHOD; |
| | | entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(MesMiddleBox); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var result = m.SetMediumBoxCode(MesMiddleBox); |
| | | resultInfos.tbBillList = result; |
| | | |
| | | entity.Result = 0; |
| | | if (result[0].ToBoolean()) entity.Result = 1; |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | if (result[0].ToBoolean()) |
| | | { |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | else { |
| | | return new ResponseResult |
| | | { |
| | | status = 1, |
| | | message = result[1], |
| | | 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("SetStackCode")] |
| | | public ResponseResult SetStackCode(MesPalletBinding mesPalletBinding) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SetStackCode"; |
| | | entity.Method = METHOD; |
| | | entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(mesPalletBinding); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var result = m.SetStackCode(mesPalletBinding); |
| | | resultInfos.tbBillList = result; |
| | | |
| | | entity.Result = 0; |
| | | if (result[0].ToBoolean()) entity.Result = 1; |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | if (result[0].ToBoolean()) |
| | | { |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new ResponseResult |
| | | { |
| | | status = 1, |
| | | message = result[1], |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | entity.DealWith = 0; |
| | | entity.ResultData = ex.Message; |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |