| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[大岛仓库看板,左上产品待入库列表] |
| | | |
| | | #region[正清和仓库看板,左上产品待入库列表] |
| | | public static ToMessage WareHouseTopLeftData() |
| | | { |
| | | string sql = ""; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[大岛仓库看板,左下产品待发货列表] |
| | | #region[正清和仓库看板,左下产品待发货列表] |
| | | public static ToMessage WareHouseTopBottomData() |
| | | { |
| | | string sql = ""; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[大岛仓库看板,右上成品库、半成品库top5库存排行] |
| | | #region[正清和仓库看板,右上成品库、半成品库top5库存排行] |
| | | public static ToMessage WareHouseRightTopData() |
| | | { |
| | | string sql = ""; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[大岛仓库看板,右下原料库库top5库存排行] |
| | | #region[正清和仓库看板,右下原料库库top5库存排行] |
| | | public static ToMessage WareHouseRightBottomData() |
| | | { |
| | | string sql = ""; |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region[车间看板公告] |
| | | public static ToMessage WkspReportNotice(string shopcode) |
| | | |
| | | #region[正清和车间综合看板,左上生产订单] |
| | | public static ToMessage WorkShopCompreLeftTop(string wkshopcode) |
| | | { |
| | | string sql = ""; |
| | | var sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | Dictionary<object, object> dir = new Dictionary<object, object>(); |
| | | Dictionary<object, object> dir0 = new Dictionary<object, object>(); |
| | | Dictionary<object, object> dir1 = new Dictionary<object, object>(); |
| | | try |
| | | { |
| | | string[] selects = Array.ConvertAll<string, string>(shopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | //获取车间公告信息 |
| | | sql = @"select contents from TSystemAnnouncement |
| | | where wksp_code in @shopcode"; |
| | | var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() }); |
| | | string[] wkshoplist = Array.ConvertAll<string, string>(wkshopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | sql = @"select * from h_v_DDKanBan_WorkShopCompreLeftTop"; |
| | | var data = DapperHelper.selecttable(sql); |
| | | sql = @"select * from h_v_DDKanBan_WorkShopCompreLeftCenter"; |
| | | var data1 = DapperHelper.selecttable(sql); |
| | | for (int i = 0; i < wkshoplist.Length; i++) |
| | | { |
| | | var top0 = data.AsEnumerable() |
| | | .Where(row => row.Field<string>("wkshp_code") == wkshoplist[i].ToString()) // 添加查询条件 |
| | | .Select(group => new |
| | | { |
| | | wkshp_code = group.Field<string>("wkshp_code"), |
| | | plan_qty = group.Field<decimal>("plan_qty"), |
| | | good_qty = group.Field<decimal>("good_qty") |
| | | }).DefaultIfEmpty(new { wkshp_code = wkshoplist[i].ToString(), plan_qty = 0m, good_qty = 0m })//为空时指定默认值 |
| | | .ToList(); |
| | | dir0.Add(wkshoplist[i].ToString(), top0); |
| | | |
| | | var top1 = data1.AsEnumerable() |
| | | .Where(row => row.Field<string>("wkshp_code") == wkshoplist[i].ToString()) // 添加查询条件 |
| | | .Select(group => new |
| | | { |
| | | wkshp_code = group.Field<string>("wkshp_code"), |
| | | plan_qty = group.Field<decimal>("plan_qty"), |
| | | quantity = group.Field<decimal>("quantity") |
| | | }).DefaultIfEmpty(new { wkshp_code = wkshoplist[i].ToString(), plan_qty = 0m,quantity = 0m })//为空时指定默认值 |
| | | .ToList(); |
| | | dir1.Add(wkshoplist[i].ToString(), top1); |
| | | } |
| | | dir.Add("LeftTop", dir0); |
| | | dir.Add("LeftBottom", dir1); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | | mes.data = data; |
| | | mes.data = dir; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[正清和车间综合看板,右上销售订单] |
| | | public static ToMessage WorkShopCompreRightTop() |
| | | { |
| | | var sql = ""; |
| | | Dictionary<object, object> dir = new Dictionary<object, object>(); |
| | | try |
| | | { |
| | | sql = @"select * from h_v_DDKanBan_WorkShopCompreRightTop"; |
| | | var data = DapperHelper.selecttable(sql); |
| | | sql = @"select * from h_v_DDKanBan_WorkShopCompreRightCenter"; |
| | | var data1 = DapperHelper.selecttable(sql); |
| | | dir.Add("RightTop", data); |
| | | dir.Add("RightBottom", data1); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | | mes.data = dir; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[正清和车间综合看板,右下库存] |
| | | public static ToMessage WorkShopCompreRightBottom() |
| | | { |
| | | var sql = ""; |
| | | Dictionary<object, object> dir = new Dictionary<object, object>(); |
| | | try |
| | | { |
| | | sql = @"select * from h_v_DDKanBan_WorkShopCompreRightBottom"; |
| | | var data = DapperHelper.selecttable(sql); |
| | | dir.Add("Y", data.Rows[0]["BaseQuantity"].ToString()); |
| | | dir.Add("B", data.Rows[1]["BaseQuantity"].ToString()); |
| | | dir.Add("C", data.Rows[2]["BaseQuantity"].ToString()); |
| | | mes.code = "200"; |
| | | mes.Message = "查询成功!"; |
| | | mes.data = dir; |
| | | } |
| | | catch (Exception e) |
| | | { |