yl
2023-03-21 635fc964ea4b1efbd8340040b50bffa2c9b84187
VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
@@ -67,7 +67,7 @@
                                    left join (
                                      select wo_code,sum(good_qty) as good_qty,sum(ng_qty) as ng_qty,sum(bad_qty) as bad_qty  from TK_Wrk_Step where isend='Y' group by wo_code
                                    ) S on P.wo_code=S.wo_code
                                    where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1'
                                    where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1' and A.lm_date>dateadd(month,-1,getdate())
                                    ) as AA where AA.plan_qty>(AA.good_qty+aa.bad_qty+AA.ng_qty)";
                    var data0 = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() });
                
@@ -166,7 +166,7 @@
                         inner join TKimp_Ewo E on A.m_po=E.wo and A.sourceid=E.id
                         left  join TMateriel_Info M on A.materiel_code=M.partcode
                         left  join TUom U on M.uom_code=U.code
                         where A.status<>'CLOSED' and A.wkshp_code in @shopcode and A.is_delete<>'1' and B.isend='Y'
                         where A.status<>'CLOSED' and A.wkshp_code in @shopcode and A.is_delete<>'1' and B.isend='Y' and A.lm_date>dateadd(month,-1,getdate())
                         and A.plan_qty>(B.good_qty+B.ng_qty+B.bad_qty)
                         )as A ";
                var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() });
@@ -437,42 +437,6 @@
                sql = @"select contents  from TSystemAnnouncement
                       where wksp_code in @shopcode";
                var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() });
                mes.code = "200";
                mes.Message = "查询成功!";
                mes.data = data;
            }
            catch (Exception e)
            {
                mes.code = "300";
                mes.count = 0;
                mes.Message = e.Message;
                mes.data = null;
            }
            return mes;
        }
        #endregion
        #region[富尔达车间生产数字化看板,产线数据]
        public static ToMessage WkshpLineData(string lineCode)
        {
            string sql = "";
            string search = "";
            var dynamicParams = new DynamicParameters();
            try
            {
                //获取产线销售订单报工信息,报工数量>0  且工单状态为非关闭状态  且工序为末道工序 (--and (S.good_qty+S.ng_qty+S.bad_qty)<S.plan_qty)
                sql = @"select A.saleOrderCode,A.materiel_code,M.partname,
                        isnull(sum(S.good_qty),0) as good_qty
                        from TKimp_Ewo A
                        inner join TK_Wrk_Man B on A.wo=B.m_po
                        inner join TK_Wrk_Step S on B.wo_code=S.wo_code
                        inner join TFlw_Rteqp R on S.step_code=R.step_code
                        left  join TMateriel_Info M on A.materiel_code=M.partcode
                        where S.good_qty>0  and S.isend='Y' and R.eqp_code=@lineCode and B.status<>'CLOSED'
                        group by A.saleOrderCode,A.materiel_code,M.partname";
                dynamicParams.Add("@lineCode", lineCode);
                var data = DapperHelper.selectdata(sql, dynamicParams);
                mes.code = "200";
                mes.Message = "查询成功!";
                mes.data = data;