| | |
| | | |
| | | public class MesItemQtrkManager : Repository<MesItemQtrk> |
| | | { |
| | | public List<string> GetQtckList() |
| | | public dynamic GetQtckList(dynamic RequestInfo) |
| | | { |
| | | //return Db.Queryable<MesItemQtrk>() |
| | | // .Where(x => (x.Qt015 ?? 0) == 1 && (x.Qt014 ?? 0) == 0) |
| | | // .Select(x => x.Qtck) |
| | | // .ToList(); |
| | | var orgId = RequestInfo.OrgId; |
| | | |
| | | const string sql = @"SELECT qtck |
| | | FROM MES_ITEM_QTRK |
| | | WHERE QT015 = 1 AND QT028 = 1 AND QT032 = 1 |
| | | AND QT014 = 0 "; |
| | | if (orgId == null) |
| | | throw new Exception("组织不存在!"); |
| | | |
| | | return Db.Ado.SqlQuery<string>(sql); |
| | | // 获取未完成的退料单号列表 |
| | | var parameters = new[] |
| | | { |
| | | new SugarParameter("@pi_orgId", orgId), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | }; |
| | | try |
| | | { |
| | | // 返回单号字符串列表 |
| | | var blDetails = Db.Ado.SqlQuery<string>( |
| | | "EXEC prc_pda_qtrk_list @pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters); |
| | | return blDetails; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | public ProductionPickDto GetQtckDetailList(WarehouseQuery query) |
| | | public dynamic GetQtckDetailList(dynamic query, dynamic RequestInfo) |
| | | { |
| | | // 关联查询物料表、物料明细表和物料基础信息表 |
| | | if (string.IsNullOrEmpty(query.billNo)) throw new Exception("申请单号为空"); |
| | | var orgId = RequestInfo.OrgId; |
| | | |
| | | var mesInvItemOuts = base.GetSingle(it => it.Qtck == query.billNo); |
| | | if (mesInvItemOuts == null) throw new Exception("其他入库申请单不存在"); |
| | | if (orgId == null) |
| | | throw new Exception("组织不存在!"); |
| | | |
| | | var sql = @"SELECT c.item_no ItemNo,c.item_name ItemName,c.item_model ItemModel, |
| | | ISNULL(A.qd007,0) FQty,ISNULL(A.qd008,0) SQty,ISNULL(A.qd007,0) - ISNULL(A.qd008,0) DSQty |
| | | FROM MES_ITEM_QTRR_DETAIL A |
| | | LEFT JOIN MES_ITEM_QTRK B ON A.qtrkGuid = B.guid |
| | | LEFT JOIN MES_ITEMS C ON A.itemId = C.item_id |
| | | WHERE B.qtck = @billNo AND QT015 = 1 AND QT028 = 1 AND QT032 = 1 "; |
| | | //AND QT014 = 0 |
| | | |
| | | var sqlParams = new List<SugarParameter> { |
| | | new("@billNo", query.billNo) |
| | | var parameters = new[] |
| | | { |
| | | new SugarParameter("@billNo",query.billNo), |
| | | new SugarParameter("@pi_orgId", orgId), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | }; |
| | | |
| | | var womdabs = Db.Ado.SqlQuery<ItemDetailModel>(sql, sqlParams); |
| | | |
| | | if (womdabs.Count < 1) |
| | | throw new Exception($"该其他入库申请单 {query.billNo} 未全部审核或已完结,请确认!"); |
| | | |
| | | var DS_list = womdabs.Where(s => s.DSQty > 0).ToList(); |
| | | |
| | | var YS_list = womdabs.Where(s => s.SQty > 0).ToList(); |
| | | |
| | | var dto = new ProductionPickDto |
| | | try |
| | | { |
| | | //daa001 = womdaa.Daa001, |
| | | //PlanNo = womcaa.Caa020, |
| | | items = DS_list, |
| | | Ysitems = YS_list |
| | | }; |
| | | |
| | | return dto; |
| | | List<dynamic>? blDetails = Db.Ado.SqlQuery<dynamic>( |
| | | "EXEC prc_pda_qtrk_detailList @billNo,@pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters); |
| | | var items = blDetails.Where(x => x.DSQty > 0).ToList(); // 待扫物料 |
| | | var ysitems = blDetails.Where(x => x.SQty > 0).ToList(); // 已扫物料 |
| | | return new |
| | | { |
| | | items = items, |
| | | ysitems = ysitems |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // 保留原有异常处理逻辑 |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | public dynamic ScanInDepotsQT(WarehouseQuery query) |