yl
2022-08-02 fce9a89fb5ad93277b95c699e892af1bb28aba88
VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
@@ -81,14 +81,13 @@
                        {
                            line.lineworkcont=data.Rows[0]["CONT"].ToString(); //产线总单量
                            line.children = new List<TreeOne>();
                            //查询产线下工单信息
                            sql = @"select distinct  E.saleOrderCode,P.wo_code,P.plan_qty,M.partcode,M.partname,M.partspec,T.name as uomname  from TFlw_Rteqp  A
                                    inner join TFlw_Rtdt B on A.step_code=B.step_code
                                    inner join TK_Wrk_Man P on B.rout_code=P.route_code
                            //查询产线下已开工的加工单信息
                            sql = @"select distinct E.saleOrderCode,A.wo_code,P.plan_qty,M.partcode,M.partname,M.partspec,T.name as uomname   from TK_Wrk_Record A
                                    inner join TK_Wrk_Man P on A.wo_code=P.wo_code
                                    left join TMateriel_Info M on P.materiel_code=M.partcode
                                    left join TUom T on M.uom_code=T.code 
                                    left join TKimp_Ewo E on P.m_po=E.wo
                                    where P.status<>'CLOSED' and P.status<>'NEW'  and P.is_delete<>'1' and A.eqp_code=@linecode";
                                    where P.status<>'CLOSED' and P.status<>'NEW' and A.eqp_code=@linecode and A.style='S' and A.step_seq='1'";
                            dynamicParams.Add("@linecode", json[i].code);
                            var data0 = DapperHelper.selectdata(sql, dynamicParams);
                            if (data0.Rows.Count > 0)
@@ -114,7 +113,7 @@
                                    lineone.children = new List<TreeTwo>();
                                    //查新工单下工序信息
                                    sql = @"select A.seq,T.stepcode,T.stepname,A.plan_qty,A.good_qty,A.ng_qty
                                    sql = @"select A.seq,T.stepcode,T.stepname,A.plan_qty,A.good_qty,A.ng_qty,A.status
                                            from TK_Wrk_Step A
                                            left join TStep T on A.step_code=T.stepcode
                                            where A.wo_code=@wo_code";
@@ -128,6 +127,7 @@
                                        string planqty = data1.Rows[k]["PLAN_QTY"].ToString();//任务数量
                                        string good_qty = data1.Rows[k]["GOOD_QTY"].ToString();//报工数量
                                        string ng_qty = data1.Rows[k]["NG_QTY"].ToString();//不良数量
                                        string status = data1.Rows[k]["STATUS"].ToString();//状态
                                        TreeTwo linetwo = new TreeTwo();
                                        linetwo.stepseq = stepseq;
                                        linetwo.stepcode = stepcode;
@@ -135,6 +135,7 @@
                                        linetwo.planqty = planqty;
                                        linetwo.goodqty = good_qty;
                                        linetwo.ngqty = ng_qty;
                                        linetwo.status = status;
                                        lineone.children.Add(linetwo);
                                    }
                                }
@@ -145,7 +146,8 @@
                                mes.code = "300";
                                mes.Message = "当前产线下无在生产任务!";
                                mes.data = null;
                                return mes;
                                list.Add(line);
                                continue;
                            }
                        }
                        else 
@@ -153,7 +155,9 @@
                            mes.code = "300";
                            mes.Message = "当前产线下无在生产任务!";
                            mes.data = null;
                            return mes;
                            list.Add(line);
                            continue;
                        }
                    }
                }
@@ -211,7 +215,7 @@
        }
        #endregion
        #region[大岛车间综合看板,右上top排行接口]
        #region[大岛车间综合看板,右上top排行接口,当日]
        public static ToMessage LineSearchTopRightData()
        {
            string sql = "";
@@ -223,12 +227,12 @@
                           select M.partname,A.good_qty  from TK_Wrk_Record A
                           inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code
                           inner join TMateriel_Info M on A.materiel_code=M.partcode
                           where A.style='B' and S.isend='Y'
                           where A.style='B' and S.isend='Y' and datediff(day,GETDATE(),A.lm_date)=0
                           union all
                           select M.partname,A.sqty as good_qty  from TK_Wrk_OutRecord A
                           inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code
                           inner join TMateriel_Info M on A.materiel_code=M.partcode
                           where A.style='S' and S.isend='Y'
                           where A.style='S' and S.isend='Y' and datediff(day,GETDATE(),A.lm_date)=0
                           ) as A group by A.partname order by good_qty desc";
                var data = DapperHelper.selecttable(sql);
                mes.code = "200";
@@ -246,7 +250,7 @@
        }
        #endregion
        #region[大岛车间综合看板,右下top排行接口]
        #region[大岛车间综合看板,右下top排行接口,当前时间往前一周]
        public static ToMessage LineSearchBottomRightData()
        {
            string sql = "";
@@ -254,7 +258,7 @@
            try
            {
                //获取报工不良top5信息
                sql = @"select isnull(COUNT(checkitem_name),0) cont,checkitem_name  from TStepCheckRecordSub
                sql = @"select isnull(COUNT(checkitem_name),0) cont,checkitem_name  from TStepCheckRecordSub where DateDiff(dd,lm_date,getdate())<=7
                        group by checkitem_name order by cont desc";
                var data = DapperHelper.selecttable(sql);
                mes.code = "200";