yangle
2023-06-25 6585cda35b87eb1a3a05a948faf7dc5d08ef8ff7
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -686,6 +686,16 @@
                //
                //DataSet ds1 = oCN.RunProcReturn("select * from  h_v_TOERPProcduct_LastProc where HLastProc = '是' and  hbillno='" + BillNo.ToString() + "'", "h_v_TOERPProcduct_LastProc");
                DataSet ds1 = oCN.RunProcReturn("exec h_p_TOERPProcduct_LastProc '" + BillNo + "'", "h_p_TOERPProcduct_LastProc");
                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未找到对应的本地或金蝶云生产汇报单记录;1.未查询到对应的生产汇报单;2.请确保当前工序是末道工序3.汇报单对应的入库数量已满 请在金蝶云查看入库记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataRow dr1 = ds1.Tables[0].Rows[0];
                if (double.Parse(dr1[0].ToString()) <= 0)
                {
@@ -702,6 +712,19 @@
                {
                    if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺")
                    {
                        //判断金蝶云是否已经有入库的数据
                        ds = oCN.RunProcReturn($@"select * from AIS20220308151944..T_PRD_INSTOCK where FBILLNO='{BillNo}'", "T_PRD_INSTOCK");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "当前出站单号已入库,请不要重新入库!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //判断金蝶云生产汇报单 数量 是否 大于 末道出站数量
                        ds = oCN.RunProcReturn($@"select sum(FFinishQty)-sum(FSTOCKINQUASELQTY)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}') 
                        from  AIS20220308151944..T_PRD_MORPT rpt3 
@@ -722,7 +745,7 @@
                JObject model = new JObject();
@@ -1422,7 +1445,7 @@
                return objJsonResult;
            }
        }