| | |
| | | using Masuit.Tools.Models; |
| | | using Masuit.Tools; |
| | | using Masuit.Tools.Models; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | |
| | | using NewPdaSqlServer.util; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | | namespace NewPdaSqlServer.service.Warehouse; |
| | |
| | | public class MesInvItemInCDetailsManager : Repository<MesInvItemInCDetails> |
| | | { |
| | | //当前类已经继承了 Repository 增、删、查、改的方法 |
| | | |
| | | |
| | | // public ItemInBaseModel SaveBarCodes(WarehouseQuery entity) |
| | | // { |
| | | // var _strMsg = ""; |
| | | // var _intSum = ""; |
| | | // using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | // { |
| | | // if (entity.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空"); |
| | | // if (entity.sectionCode.IsNullOrEmpty()) throw new Exception("库位编号不允许为空"); |
| | | // if (entity.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空"); |
| | | // if (entity.cgrkType.IsNullOrEmpty()) throw new Exception("采购入库类型不允许为空"); |
| | | |
| | | // using (var cmd = new SqlCommand("[prc_pda_inv_cgrk]", conn)) |
| | | // { |
| | | // try |
| | | // { |
| | | // conn.Open(); |
| | | // cmd.CommandType = CommandType.StoredProcedure; |
| | | // SqlParameter[] parameters = |
| | | // { |
| | | // new("@pi_user", SqlDbType.NVarChar, 100) { Value = entity.userName }, |
| | | // new("@pi_barcode", SqlDbType.NVarChar, 100) { Value = entity.barcode }, |
| | | // new("@pi_cgrkType", SqlDbType.NVarChar, 30) { Value = entity.cgrkType }, |
| | | // new("@po_outMsg", SqlDbType.NVarChar, 300), |
| | | // new("@po_outSum", SqlDbType.NVarChar, 300) |
| | | //}; |
| | | |
| | | // foreach (var parameter in parameters) |
| | | // cmd.Parameters.Add(parameter); |
| | | // cmd.ExecuteNonQuery(); |
| | | // _strMsg = parameters[4].Value.ToString(); |
| | | // _intSum = parameters[5].Value.ToString(); |
| | | |
| | | // var result = Convert.ToInt32(_intSum); |
| | | // if (result <= 0) throw new Exception(_strMsg); |
| | | |
| | | // return _strMsg; |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // throw new Exception(ex.Message); |
| | | // } |
| | | // finally |
| | | // { |
| | | // conn.Close(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | public ItemInBaseModel SaveBarCodes(WarehouseQuery entity) |
| | | { |
| | |
| | | throw new Exception("此条码不属于到货条码,无法用采购入库!"); |
| | | |
| | | var inventory = Db.Queryable<MesInvItemArn>() |
| | | .Where(it => it.BillNo == itemBarcodeDetails.BillNo && it.Fstatus == true ) |
| | | .Where(it => it.BillNo == itemBarcodeDetails.BillNo && it.Fstatus == true) |
| | | .First(); |
| | | |
| | | if (inventory == null) |
| | |
| | | var sql1 = @"SELECT *FROM v_dhmx WHERE dhmxGuid = @dhmxGuid "; |
| | | var dhjymx = Db.Ado.SqlQuery<vDhmx>(sql1, sqlParams).First(); |
| | | //判定检验能否入库 |
| | | if (dhjymx.CanStore!= 1) |
| | | if (dhjymx.CanStore != 1) |
| | | { |
| | | throw new Exception($"该条码对应的收料单检验结果:【{dhjymx.InspectionResult}】,判定结果:【{dhjymx.JudgmentResult}】,处理意见:【{dhjymx.HandlingSuggestion}】,无法入库"); |
| | | } |
| | |
| | | |
| | | result.itemDetail = mesItems; |
| | | |
| | | result.ItemInDetails = db.Queryable<MesInvItemInCItems,MesItems>( |
| | | result.ItemInDetails = db.Queryable<MesInvItemInCItems, MesItems>( |
| | | (a, b) => new JoinQueryInfos( |
| | | JoinType.Left, |
| | | a.ItemId == b.ItemId) |
| | | ) |
| | | .Where(a => a.ItemInId == cId && a.ItemId == itemBarcodeDetails.ItemId) |
| | | .Select<dynamic>((a, b) => new |
| | | .Select<dynamic>((a, b) => new |
| | | { |
| | | ItemNo = b.ItemNo, |
| | | ItemName = b.ItemName, |
| | |
| | | |
| | | var purchaseInventory = getPurchaseInventory(entity); |
| | | |
| | | |
| | | |
| | | //result.ItemInDetails = purchaseInventory.ItemInDetails; |
| | | //result.InvItemInCDetails = purchaseInventory.InvItemInCDetails; |
| | | |