| | |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using Masuit.Tools; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | |
| | | |
| | | public ProductionPickDto ScanCode(WarehouseQuery query) |
| | | { |
| | | string _strMsg = ""; |
| | | string _intSum = ""; |
| | | var _strMsg = ""; |
| | | var _intSum = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd =new SqlCommand("[prc_pda_SCLL]", conn)) |
| | | if (query.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空"); |
| | | if (query.daa001.IsNullOrEmpty()) throw new Exception("领料单号不允许为空"); |
| | | if (query.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空"); |
| | | |
| | | using (var cmd = new SqlCommand("[prc_pda_SCLL]", conn)) |
| | | { |
| | | try |
| | | { |
| | |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | _strMsg = parameters[0].Value.ToString(); |
| | | _strMsg = parameters[0].Value.ToString(); |
| | | _intSum = parameters[1].Value.ToString(); |
| | | |
| | | |
| | | var barcodeNum = parameters[2].Value.ToString(); |
| | | var splitNum = parameters[3].Value.ToString(); |
| | | |
| | | var result = Convert.ToInt32(_intSum); |
| | | if (result <= 0) |
| | | { |
| | | throw new Exception(_strMsg); |
| | | } |
| | | |
| | | if (result <= 0) throw new Exception(_strMsg); |
| | | |
| | | var dto = new ProductionPickDto |
| | | { |
| | | daa001 = query.daa001, |
| | |
| | | }; |
| | | |
| | | return dto; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | //prC_pda_SCLL_CF |
| | | public ProductionPickDto ScanCodeCF(WarehouseQuery query) |
| | | { |
| | | string _strMsg = ""; |
| | | string _intSum = ""; |
| | | if (query.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空"); |
| | | if (query.daa001.IsNullOrEmpty()) throw new Exception("领料单号不允许为空"); |
| | | if (query.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空"); |
| | | |
| | | if (query.Num is null or 0) throw new Exception("条码拆分数不允许为空或者为0"); |
| | | |
| | | var _strMsg = ""; |
| | | var _intSum = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd =new SqlCommand("[prc_pda_SCLL_CF]", conn)) |
| | | using (var cmd = new SqlCommand("[prc_pda_SCLL_CF]", conn)) |
| | | { |
| | | try |
| | | { |
| | |
| | | new("@c_User", query.userName), |
| | | new("@p_biLL_no", query.daa001), |
| | | new("@p_item_barcode", query.barcode), |
| | | new("@num", query.num), |
| | | new("@num", query.Num) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | _strMsg = parameters[0].Value.ToString(); |
| | | _strMsg = parameters[0].Value.ToString(); |
| | | _intSum = parameters[1].Value.ToString(); |
| | | |
| | | |
| | | |
| | | var result = Convert.ToInt32(_intSum); |
| | | if (result <= 0) |
| | | { |
| | | throw new Exception(_strMsg); |
| | | } |
| | | |
| | | if (result <= 0) throw new Exception(_strMsg); |
| | | |
| | | var dto = new ProductionPickDto |
| | | { |
| | | daa001 = query.daa001, |
| | |
| | | }; |
| | | |
| | | return dto; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | .Where((a, i) => a.Daa001 == query.daa001) |
| | | .Select((a, i) => new |
| | | { |
| | | a.Daa001,a.CaaGuid |
| | | a.Daa001, a.CaaGuid |
| | | }).First(); |
| | | |
| | | if (womdaa?.Daa001 == null) throw new Exception("工单号不存在"); |
| | |
| | | |
| | | var mesInvItemOutCDetailsList = Db |
| | | .Queryable<MesInvItemOutCDetails, MesItems, MesDepots> |
| | | ((a, b, c) => |
| | | new JoinQueryInfos( |
| | | JoinType.Inner,a.ItemId == b.Id, |
| | | JoinType.Inner,c.DepotId == a.DepotId |
| | | )) |
| | | ((a, b, c) => |
| | | new JoinQueryInfos( |
| | | JoinType.Inner, a.ItemId == b.Id, |
| | | JoinType.Inner, c.DepotId == a.DepotId |
| | | )) |
| | | .Where((a, b, c) => a.WorkNo == query.daa001) |
| | | .Select((a, b, c)=> new MesInvItemOutCDetails |
| | | .Select((a, b, c) => new MesInvItemOutCDetails |
| | | { |
| | | ItemName = b.ItemName, |
| | | ItemNo = b.ItemNo, |
| | |
| | | DepotId = a.DepotId, |
| | | WorkNo = a.WorkNo, |
| | | DepotName = c.DepotName, |
| | | Quantity = a.Quantity, |
| | | Quantity = a.Quantity |
| | | }) |
| | | .ToList(); |
| | | |
| | | var womcaa = Db.Queryable<Womcaa>().Where(s=>s.Guid == womdaa.CaaGuid).First(); |
| | | var womcaa = Db.Queryable<Womcaa>().Where(s => s.Guid == womdaa.CaaGuid) |
| | | .First(); |
| | | |
| | | var dto = new ProductionPickDto |
| | | { |