VueWebCoreApi/DLL/DAL/WorkOrderDAL.cs
@@ -130,7 +130,7 @@
        #endregion
        #region[ERP订单下达]
        public static ToMessage MarkSaveErpOrder(string erporderid, string sbid, string erpordercode, string saleordercode, string partcode,string deptcode, string wkshopcode, string warehousecode, string erpqty, string markqty, string ordernum, string relse_qty, string saleOrderDeliveryDate, string paystartdate, string payenddate, string clerkuser, User us)
        public static ToMessage MarkSaveErpOrder(string erporderid, string sbid, string erpordercode, string saleordercode, string partcode, string deptcode, string wkshopcode, string warehousecode, string erpqty, string markqty, string ordernum, string relse_qty, string saleOrderDeliveryDate, string paystartdate, string payenddate, string clerkuser, User us)
        {
            var sql = "";
            List<object> list = new List<object>();
@@ -212,7 +212,7 @@
                                wo_code = wo,
                                wotype = "PO",
                                status = "NEW",
                                dept_code=deptcode,
                                dept_code = deptcode,
                                wkshp_code = wkshopcode,
                                plan_qty = cdqty,
                                stck_code = warehousecode,
@@ -330,7 +330,7 @@
                                wo_code = wo,
                                wotype = "PO",
                                status = "NEW",
                                dept_code=model.deptcode,
                                dept_code = model.deptcode,
                                wkshp_code = model.wkshopcode,
                                plan_qty = decimal.Parse(model.erpqty),  //订单数量
                                stck_code = model.warehousecode,
@@ -1573,12 +1573,15 @@
                }
                //根据条件查询工单工序任务(自制工序)
                sql = @"select A.id,A.status,B.dept_code,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend,
                        S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date
                        S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date,
                        E.sbid,B.m_po,E.saleOrderCode,E.saleOrderDetailId,E.unitid,E.unitcode,E.unitname,K.code as stockcode,k.name as stockname
                        from TK_Wrk_Step A
                        left join TK_Wrk_Man B on A.wo_code=B.wo_code
                        left join TMateriel_Info M on B.materiel_code=M.partcode
                        left join TStep S on A.step_code=S.stepcode
                        left join TOrganization T on B.wkshp_code=T.torg_code
                        left join TKimp_Ewo E on B.sourceid=E.id and B.m_po=E.wo
                        left join TSecStck K on M.idwarehouse=K.code
                        where A.status in('ALLO','START') and S.flwtype='Z'  " + search;
                var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total);
                mes.code = "200";
@@ -1677,12 +1680,15 @@
                sql = @"select A.id,A.status,B.dept_code,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend,
                        S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty,
                        (select isnull(sum(fqty),0) as fqty   from TK_Wrk_OutRecord where wo_code=A.wo_code and step_code=A.step_code and style='F') as fqty,
                        A.laborbad_qty,A.materielbad_qty,A.plan_startdate,A.plan_enddate,B.lm_date
                        A.laborbad_qty,A.materielbad_qty,A.plan_startdate,A.plan_enddate,B.lm_date,
                        E.sbid,B.m_po,E.saleOrderCode,E.saleOrderDetailId,E.unitid,E.unitcode,E.unitname,K.code as stockcode,k.name as stockname
                        from TK_Wrk_Step A
                        left join TK_Wrk_Man B on A.wo_code=B.wo_code
                        left join TMateriel_Info M on B.materiel_code=M.partcode
                        left join TStep S on A.step_code=S.stepcode
                        left join TOrganization T on B.wkshp_code=T.torg_code
                        left join TKimp_Ewo E on B.sourceid=E.id and B.m_po=E.wo
                        left join TSecStck K on M.idwarehouse=K.code
                        where A.status in('ALLO','START') and S.flwtype='W'  " + search;
                var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total);
                mes.code = "200";
@@ -1927,7 +1933,7 @@
                        else //不按序收发料
                        {
                            mes = ScanStartReport.NoWXEncodingSeach(SelectType, wocode, stepcode);
                        }
                        }
                        break;
                    default:
                        break;
@@ -3386,7 +3392,7 @@
                                    }
                                }
                            }
                        }
                        }
                    }
                }
                else //不按序
@@ -3394,10 +3400,10 @@
                    //控制逻辑:当前工序报工调整-> (本道工序当前调整合格数+本道工序非当前报工合格总数)<下道工序报工总数(合格+不良+报废)   ==不能小于下道报工总数
                    list.Clear();
                    //判断当前工序是自制工序还是外协工序
                    if (json[0].flw_type.ToString() == "Z")
                    if (json[0].flw_type.ToString() == "Z")
                    {
                       //查询当前报工工序非此次报工:总报工数量、总不良数量、总工废数量、总料废数量
                        //查询当前报工工序非此次报工:总报工数量、总不良数量、总工废数量、总料废数量
                        sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(laborbad_qty),0) as laborbad_qty,isnull(sum(materielbad_qty),0) as materielbad_qty   
                                from TK_Wrk_Record where wo_code=@wo_code and style='B' and id<>@id and step_code=@step_code";
                        dynamicParams.Add("@wo_code", json[0].wo_code);
@@ -3419,7 +3425,7 @@
                            return mes;
                        }
                    }
                    if (json[0].flw_type.ToString() == "W")
                    if (json[0].flw_type.ToString() == "W")
                    {
                        //获取当前工序、供应商对应的总发料数量
                        sql = @"select isnull(sum(fqty),0) as fqty
@@ -3441,7 +3447,7 @@
                        decimal notthis_ngqty = decimal.Parse(dt.Rows[0]["ng_qty"].ToString());  //当前末道工序非本次报工总数
                        decimal notthis_laborbad_qty = decimal.Parse(dt.Rows[0]["laborbad_qty"].ToString());  //当前末道工序非本次报工工废总数
                        decimal notthis_materielbad_qty = decimal.Parse(dt.Rows[0]["materielbad_qty"].ToString());  //当前末道工序非本次报工料废总数
                       //获取当前末道工序收料总数量:本次修改收料数量+本次修改不良数量+本次修改工废数量+本次修改报工料废数量+当前工序非本次收料总数+当前工序非本次不良总数+当前工序非本次工废总数+当前工序非本次料废总数
                                                                                                                    //获取当前末道工序收料总数量:本次修改收料数量+本次修改不良数量+本次修改工废数量+本次修改报工料废数量+当前工序非本次收料总数+当前工序非本次不良总数+当前工序非本次工废总数+当前工序非本次料废总数
                        decimal updatereportsumqty = this_reportqty + this_ngqty + this_laborbadqty + this_materielbadqty + notthis_reportqty + notthis_ngqty + notthis_laborbad_qty + notthis_materielbad_qty;
                        //判断当前工序供应商收料总数>当前工序供应商对应发料数量
                        if (updatereportsumqty > decimal.Parse(dt_0.Rows[0]["fqty"].ToString()))
@@ -3489,7 +3495,7 @@
                            str = sql,
                            parm = new
                            {
                                step_price=decimal.Parse(json[0].unprice),
                                step_price = decimal.Parse(json[0].unprice),
                                good_qty = decimal.Parse(json[0].report_dvalue),
                                ng_qty = this_ng_dvalue,
                                laborbad_qty = this_laborbad_dvalue,
@@ -3592,7 +3598,7 @@
                            str = sql,
                            parm = new
                            {
                                step_price=decimal.Parse(json[0].unprice),
                                step_price = decimal.Parse(json[0].unprice),
                                good_qty = decimal.Parse(json[0].report_dvalue),
                                ng_qty = this_ng_dvalue,
                                laborbad_qty = this_laborbad_dvalue,
@@ -4022,31 +4028,31 @@
                // --------------查询指定数据--------------
                var total = 0; //总条数
                var sql = @"select *   from(
                            select A.inbarcode,E.saleOrderid,isnull(E.saleOrderCode,'') as saleOrderCode,E.saleOrderDetailId,E.woid as mpoid,M.m_po,E.sbid,M.id as wo_id,A.wo_code,E.materiel_id,P.partcode,P.partname,P.partspec,E.unitid,E.unitcode,E.unitname,
                            A.step_code,T.stepname,M.wkshp_code,O.torg_name as wkshp_name,K.code as stockcode,k.name as stockname,
                            E.saleOrderqty,E.qty,M.plan_qty,A.good_qty,isnull(A.inhouseqty,0) as inhouseqty,A.good_qty-isnull(A.inhouseqty,0) as stinhouseqty,M.lm_date,A.style
                            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 TK_Wrk_Man M on S.wo_code=M.wo_code
                            inner join TMateriel_Info P on M.materiel_code=P.partcode
                            left join TKimp_Ewo E on M.m_po=E.wo and M.sourceid= E.id
                            left join TSecStck K on P.idwarehouse=K.code
                            left join TStep T on A.step_code=T.stepcode
                            left join TOrganization O on M.wkshp_code=O.torg_code
                            where A.style='B' and A.inbarcode<>'' and S.isend='Y' and A.good_qty>0
                            union all
                            select A.inbarcode,E.saleOrderid,isnull(E.saleOrderCode,'') as saleOrderCode,E.saleOrderDetailId,E.woid as mpoid,M.m_po,E.sbid,M.id as wo_id,A.wo_code,E.materiel_id,P.partcode,P.partname,P.partspec,E.unitid,E.unitcode,E.unitname,
                            A.step_code,T.stepname,M.wkshp_code,O.torg_name as wkshp_name,K.code as stockcode,k.name as stockname,
                            E.saleOrderqty,E.qty,M.plan_qty,A.sqty as sqty,isnull(A.inhouseqty,0) as inhouseqty,A.sqty-isnull(A.inhouseqty,0) as stinhouseqty,M.lm_date,A.style
                            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 TK_Wrk_Man M on S.wo_code=M.wo_code
                            inner join TMateriel_Info P on M.materiel_code=P.partcode
                            left join TKimp_Ewo E on M.m_po=E.wo and M.sourceid= E.id
                            left join TSecStck K on P.idwarehouse=K.code
                            left join TStep T on A.step_code=T.stepcode
                            left join TOrganization O on M.wkshp_code=O.torg_code
                            where A.style='S' and A.inbarcode<>'' and S.isend='Y' and A.sqty>0
                              select A.inbarcode,E.saleOrderid,isnull(E.saleOrderCode,'') as saleOrderCode,E.saleOrderDetailId,E.woid as mpoid,M.m_po,E.sbid,M.id as wo_id,A.wo_code,E.materiel_id,P.partcode,P.partname,P.partspec,E.unitid,E.unitcode,E.unitname,
                              A.step_code,T.stepname,M.wkshp_code,O.torg_name as wkshp_name,COALESCE(K.noid, E.stck_id) as stockid,COALESCE(K.code, E.stck_code) as stockcode,k.name as stockname,E.dept_id,E.dept_code,
                              E.saleOrderqty,E.qty,M.plan_qty,A.good_qty,isnull(A.inhouseqty,0) as inhouseqty,A.good_qty-isnull(A.inhouseqty,0) as stinhouseqty,M.lm_date,A.style,E.voucherdate
                              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 TK_Wrk_Man M on S.wo_code=M.wo_code
                              inner join TMateriel_Info P on M.materiel_code=P.partcode
                              left join TKimp_Ewo E on M.m_po=E.wo and M.sourceid= E.id
                              left join TSecStck K on COALESCE(P.idwarehouse, E.stck_code)=K.code
                              left join TStep T on A.step_code=T.stepcode
                              left join TOrganization O on M.wkshp_code=O.torg_code
                              where A.style='B' and A.inbarcode<>'' and S.isend='Y' and A.good_qty>0
                              union all
                              select A.inbarcode,E.saleOrderid,isnull(E.saleOrderCode,'') as saleOrderCode,E.saleOrderDetailId,E.woid as mpoid,M.m_po,E.sbid,M.id as wo_id,A.wo_code,E.materiel_id,P.partcode,P.partname,P.partspec,E.unitid,E.unitcode,E.unitname,
                              A.step_code,T.stepname,M.wkshp_code,O.torg_name as wkshp_name,COALESCE(K.noid, E.stck_id) as stockid,COALESCE(K.code, E.stck_code) as stockcode,k.name as stockname,E.dept_id,E.dept_code,
                              E.saleOrderqty,E.qty,M.plan_qty,A.sqty as sqty,isnull(A.inhouseqty,0) as inhouseqty,A.sqty-isnull(A.inhouseqty,0) as stinhouseqty,M.lm_date,A.style,E.voucherdate
                              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 TK_Wrk_Man M on S.wo_code=M.wo_code
                              inner join TMateriel_Info P on M.materiel_code=P.partcode
                              left join TKimp_Ewo E on M.m_po=E.wo and M.sourceid= E.id
                              left join TSecStck K on COALESCE(P.idwarehouse, E.stck_code)=K.code
                              left join TStep T on A.step_code=T.stepcode
                              left join TOrganization O on M.wkshp_code=O.torg_code
                              where A.style='S' and A.inbarcode<>'' and S.isend='Y' and A.sqty>0
                            ) as AA  where AA.good_qty>AA.inhouseqty " + search;
                var data = DapperHelper.selectdata(sql, dynamicParams);
                mes.code = "200";
@@ -4085,8 +4091,229 @@
        }
        #endregion
        #region[通易T8生产入库提交]
        #region[生产入库获取部门信息]
        public static ToMessage DeptSelectData()
        {
            var sql = "";
            var dynamicParams = new DynamicParameters();
            string search = "";
            try
            {
                sql = @"select * from h_v_TFDepent";
                var data = DapperHelper.selectdata(sql, dynamicParams);
                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[通易T8生产入库提交-代码版]
        public static ToMessage ProductInHouseOrderSeave(InReptModel data, User us)
        {
            var sql = "";
            List<object> list = new List<object>();
            var dynamicParams = new DynamicParameters();
            try
            {
                list.Clear();
                //查询入库单是否已存在
                sql = @"select *  from srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in1] where sheet_no=@hbillno";
                dynamicParams.Add("@hbillno", data.TableData[0].Rows[0]["hbillno"].ToString());
                var data0 = DapperHelper.selectdata(sql, dynamicParams);
                if (data0.Rows.Count > 0)
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.message = "入库单号已存在!";
                    mes.data = null;
                    return mes;
                }
                //写入入库单主表(MES)
                sql = @"insert into TK_WMS_Inwh_Main(docu_typecode,hbillno,hbdate,deptno,storehouse_code,status,remark,create_user,create_date)
                        values(@docu_typecode,@hbillno,@hbdate,@deptno,@storehouse_code,@status,@remark,@create_user,@create_date)";
                list.Add(new
                {
                    str = sql,
                    parm = new
                    {
                        docu_typecode = "WI",
                        hbillno = data.TableData[0].Rows[0]["hbillno"].ToString(),
                        hbdate = data.TableData[0].Rows[0]["hbdate"].ToString(),
                        deptno = data.TableData[0].Rows[0]["deptno"].ToString(),
                        storehouse_code = data.TableData[0].Rows[0]["storehouse_code"].ToString(),
                        status = data.TableData[0].Rows[0]["status"].ToString(),
                        remark = data.TableData[0].Rows[0]["remark"].ToString(),
                        create_user = data.TableData[0].Rows[0]["create_user"].ToString(),
                        create_date = data.TableData[0].Rows[0]["create_date"].ToString()
                    }
                });
                //写入入库单主表(T8)
                sql = @"insert into srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in1](sheet_type,sheet_no,sheet_sta,sheet_date,dept_no,st_no,sheet_amt,check_sta,create_date,create_user,add_flag)
                        values(@sheet_type,@sheet_no,@sheet_sta,@sheet_date,@dept_no,@st_no,@sheet_amt,@check_sta,@create_date,@create_user,@add_flag)";
                list.Add(new
                {
                    str = sql,
                    parm = new
                    {
                        sheet_type = "WI",
                        sheet_no = data.TableData[0].Rows[0]["hbillno"].ToString(),
                        sheet_sta = data.TableData[0].Rows[0]["status"].ToString(),
                        sheet_date = data.TableData[0].Rows[0]["hbdate"].ToString(),
                        dept_no = data.TableData[0].Rows[0]["deptno"].ToString(),
                        st_no = data.TableData[0].Rows[0]["storehouse_code"].ToString(),
                        sheet_amt = "0",
                        check_sta = "0",
                        create_date = data.TableData[0].Rows[0]["create_date"].ToString(),
                        create_user = data.TableData[0].Rows[0]["create_user"].ToString(),
                        add_flag = "1"
                    }
                });
                for (int i = 0; i < data.TableData[1].Rows.Count; i++)
                {
                    if (data.TableData[1].Rows[i]["style"].ToString() == "B")
                    {
                        //条件满足时执行的操作(回写报工记录主表的入库数量)
                        sql = @"update TK_Wrk_Record set inhouseqty=inhouseqty+@qty where inbarcode=@inbarcode";
                        list.Add(new
                        {
                            str = sql,
                            parm = new
                            {
                                qty = data.TableData[1].Rows[i]["qty"].ToString(),
                                inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString()
                            }
                        });
                    }
                    if (data.TableData[1].Rows[i]["style"].ToString() == "S")
                    {
                        //条件满足时执行的操作(回写外协收料记录主表的入库数量)
                        sql = @"update TK_Wrk_OutRecord set inhouseqty=inhouseqty+@qty where inbarcode=@inbarcode";
                        list.Add(new
                        {
                            str = sql,
                            parm = new
                            {
                                qty = data.TableData[1].Rows[i]["qty"].ToString(),
                                inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString()
                            }
                        });
                    }
                    //回写工单工序表末道工序已入库数量
                    sql = @"update TK_Wrk_Step set inhouseqty=inhouseqty+@qty where wo_code=@wocode and step_code=@stepcode and isend='Y'";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            qty = data.TableData[1].Rows[i]["qty"].ToString(),
                            wocode = data.TableData[1].Rows[i]["wocode"].ToString(),
                            stepcode = data.TableData[1].Rows[i]["stepcode"].ToString()
                        }
                    });
                    //写入入库单子表(MES)
                    sql = @"insert into TK_WMS_Inwh_Sub (hbillno,rownumber,inbarcode,mo_id,mo_no,wocode,partcode,unitcode,unit_rate,stockcode,qty,price,saleid,salecode,status,style)
                        values(@hbillno,@rownumber,@inbarcode,@mo_id,@mo_no,@wocode,@partcode,@unitcode,@unit_rate,@stockcode,@qty,@price,@saleid,@salecode,@status,@style)";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            hbillno = data.TableData[1].Rows[i]["hbillno"].ToString(),
                            rownumber = data.TableData[1].Rows[i]["rownumber"].ToString(),
                            inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString(),
                            mo_id = data.TableData[1].Rows[i]["mo_id"].ToString(),
                            mo_no = data.TableData[1].Rows[i]["mo_no"].ToString(),
                            wocode = data.TableData[1].Rows[i]["wocode"].ToString(),
                            partcode = data.TableData[1].Rows[i]["partcode"].ToString(),
                            unitcode = data.TableData[1].Rows[i]["unitcode"].ToString(),
                            unit_rate = data.TableData[1].Rows[i]["unit_rate"].ToString(),
                            stockcode = data.TableData[1].Rows[i]["stockcode"].ToString(),
                            qty = data.TableData[1].Rows[i]["qty"].ToString(),
                            price = data.TableData[1].Rows[i]["price"].ToString(),
                            saleid = data.TableData[1].Rows[i]["saleid"].ToString(),
                            salecode = data.TableData[1].Rows[i]["salecode"].ToString(),
                            status = data.TableData[1].Rows[i]["status"].ToString(),
                            style = data.TableData[1].Rows[i]["style"].ToString()
                        }
                    });
                    //写入入库单子表(T8)
                    sql = @"insert into srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in2] (sheet_no,sheet_id,goods_no,unit_no,unit_rate,st_no,sheet_qty,mo_no,mo_id,sheet_pri,ord_no,ord_id,sheet_sta,add_flag)
                        values(@sheet_no,@sheet_id,@goods_no,@unit_no,@unit_rate,@st_no,@sheet_qty,@mo_no,@mo_id,@sheet_pri,@ord_no,@ord_id,@sheet_sta,@add_flag)";
                    list.Add(new
                    {
                        str = sql,
                        parm = new
                        {
                            sheet_no = data.TableData[1].Rows[i]["hbillno"].ToString(),
                            sheet_id = data.TableData[1].Rows[i]["rownumber"].ToString(),
                            goods_no = data.TableData[1].Rows[i]["partcode"].ToString(),
                            unit_no = data.TableData[1].Rows[i]["unitcode"].ToString(),
                            unit_rate = "1",
                            st_no = data.TableData[1].Rows[i]["stockcode"].ToString(),
                            sheet_qty = data.TableData[1].Rows[i]["qty"].ToString(),
                            mo_no = data.TableData[1].Rows[i]["mo_no"].ToString(),
                            mo_id = data.TableData[1].Rows[i]["mo_id"].ToString(),
                            sheet_pri = "1",
                            ord_no = data.TableData[1].Rows[i]["salecode"].ToString(),
                            ord_id = data.TableData[1].Rows[i]["saleid"].ToString(),
                            sheet_sta = data.TableData[1].Rows[i]["status"].ToString(),
                            add_flag = "1"
                        }
                    });
                }
                //更新入库单流水号
                sql = @" update TCodeRules set value = @incbit, incbit = LEN(CAST(@incbit AS VARCHAR))  where menucode = @rightcode";
                list.Add(new
                {
                    str = sql,
                    parm = new
                    {
                        incbit = data.incbit,
                        rightcode = data.rightcode
                    }
                });
                bool aa = DapperHelper.DoTransaction(list);
                if (aa)
                {
                    //写入操作记录表
                    LogHelper.DbOperateLog(us.usercode, "入库单保存", "入库单号:" + data.TableData[0].Rows[0]["hbillno"].ToString(), us.usertype);
                    mes.code = "200";
                    mes.count = 0;
                    mes.message = "操作成功!";
                    mes.data = null;
                }
                else
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.message = "操作失败!";
                    mes.data = null;
                }
            }
            catch (Exception e)
            {
                mes.code = "300";
                mes.count = 0;
                mes.message = e.Message;
                mes.data = null;
            }
            return mes;
        }
        #endregion
        #region[通易T8生产入库提交-存储过程版(适用同一台服务器,同一个数据库)]
        public static ToMessage ProductInHouseOrderSpSeave(InReptModel data, User us)
        {
            var sql = "";
            var dynamicParams = new DynamicParameters();
@@ -4131,5 +4358,52 @@
            return mes;
        }
        #endregion
        #region[畅捷通T+生产入库提交-存储过程版(适用同一台服务器,同一个数据库)]
        public static ToMessage TProductInHouseOrderSpSeave(InReptModel data, User us)
        {
            var sql = "";
            var dynamicParams = new DynamicParameters();
            try
            {
                //存储过程名
                sql = @"h_p_IFCLD_TCloudInProductOrder";
                dynamicParams.Add("@RecordMin", dbType: DbType.Object, value: data.TableData[0]);
                dynamicParams.Add("@RecordSub", dbType: DbType.Object, value: data.TableData[1]);
                dynamicParams.Add("@rightcode", data.rightcode);
                dynamicParams.Add("@incbit", data.incbit);
                dynamicParams.Add("@username", us.usercode);
                // 添加输出参数
                dynamicParams.Add("@StatusCode", dbType: DbType.Int32, direction: ParameterDirection.Output);
                dynamicParams.Add("@Message", dbType: DbType.String, size: 255, direction: ParameterDirection.Output);
                bool a = DapperHelper.IsProcedure(sql, dynamicParams);
                // 获取输出参数的值
                var statusCode = dynamicParams.Get<int>("@StatusCode");
                var message = dynamicParams.Get<string>("@Message");
                if (a)
                {
                    mes.code = statusCode.ToString();
                    mes.count = 0;
                    mes.message = message;
                    mes.data = null;
                }
                else
                {
                    mes.code = statusCode.ToString();
                    mes.count = 0;
                    mes.message = message;
                    mes.data = null;
                }
            }
            catch (Exception e)
            {
                mes.code = "300";
                mes.count = 0;
                mes.message = e.Message;
                mes.data = null;
            }
            return mes;
        }
        #endregion
    }
}