callm пре 1 недеља
родитељ
комит
fe714b76ee

+ 17 - 18
UAS_MES_YDCY/FunctionCode/Warehouse/Warehouse_FinishedProductOutSumNEW.cs

@@ -265,7 +265,7 @@ namespace UAS_MES_NEW.Warehouse
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 BaseUtil.FillDgvWithDataTable(Prodiodetail, dt);
             }
-            if (CombineCust.Checked)
+            else if (CombineCust.Checked)
             {
                 sql.Clear();
                 sql.Append("select wm_concat(pd_custpodetno||'|'||pd_custpo||'|'||pd_outqty)pd_outinfo,pd_custprod,min(pd_custpo)pd_custpo,min(pd_custpodetno)pd_custpodetno,max(pd_pdno)pd_pdno,max(pd_id)pd_id,wm_concat(pd_prodcode)pd_prodcode,sum(nvl(pd_cartons,0))pd_cartons,sum(pd_outqty)pd_outqty,max(pr_detail)pr_detail,max(pr_spec)pr_spec from prodiodetail left join prodinout ");
@@ -380,7 +380,7 @@ namespace UAS_MES_NEW.Warehouse
                                     return;
                                 }
                             }
-                            if (CombineCust.Checked)
+                            else if (CombineCust.Checked)
                             {
                                 sql.Clear();
                                 sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_custprodcode='" + dtms.Rows[0]["ma_custprodcode"] + "'),0)ungetqty from");
@@ -441,7 +441,7 @@ namespace UAS_MES_NEW.Warehouse
                                 return;
                             }
                             RefreshWeight(pa_prodcode, input.Text);
-                    
+
                             //更新箱号对应的出货单号
                             dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
                             //.UpdateByCondition("makeserial", "ms_outno='" + pi_inoutno.Text + "'", "ms_id in (select max(ms_id)  from makeserial where ms_sncode in (select v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "') and ms_outno is null GROUP BY ms_sncode)");
@@ -565,7 +565,7 @@ namespace UAS_MES_NEW.Warehouse
                                     return;
                                 }
                             }
-                            if (CombineCust.Checked)
+                            else if (CombineCust.Checked)
                             {
                                 sql.Clear();
                                 sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "'),0)ungetqty from");
@@ -664,7 +664,7 @@ namespace UAS_MES_NEW.Warehouse
                                     dh.ExecuteSql("update package set pa_mothercode='" + pa_outboxcode.Text + "' where pa_outboxcode='" + input.Text + "'", "update");
                                 }
                                 RefreshWeight(pa_prodcode, input.Text);
-                              
+
                                 //更新箱号对应的出货单号
                                 //dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
                                 List<string> v_barcode = new List<string>();
@@ -750,7 +750,7 @@ namespace UAS_MES_NEW.Warehouse
                                     dh.ExecuteSql("update package set pa_mothercode='" + pa_outboxcode.Text + "' where pa_outboxcode='" + input.Text + "'", "update");
                                 }
                                 RefreshWeight(pa_prodcode, input.Text);
-                              
+
                                 //更新箱号对应的出货单号
                                 dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
                                 List<string> v_barcode = new List<string>();
@@ -761,7 +761,7 @@ namespace UAS_MES_NEW.Warehouse
                                 List<string> pd_custprod = new List<string>();
                                 DataTable datatable = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode,ms_prodcode from MES_PACKAGE_VIEW  left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode where v_outboxcode = '" + input.Text + "'", "select");
 
-                                DataTable Cust = (DataTable)dh.ExecuteSql("select pd_outqty-nvl(pim_outqty,0)pd_outqty,pd_custprod,pd_custpodetno,PD_CUSTPO from  prodiodetail left join prodinout on pd_piid=pi_id left join (select pim_inoutno,PIM_CUSTPO, PIM_CUSTDETNO,count(1)pim_outqty from prodiomac where  pim_inoutno='" + pi_inoutno.Text+ "' group by pim_inoutno,PIM_CUSTPO, PIM_CUSTDETNO)on pim_inoutno=pi_inoutno and PIM_CUSTPO=PD_CUSTPO and PIM_CUSTDETNO=pd_custpodetno where pi_inoutno='"+pi_inoutno.Text+ "' and pd_custprod='" + dtms.Rows[0]["ma_custprodcode"] + "'  and pd_outqty-nvl(pim_outqty,0)>0 order by pd_pdno", "select");
+                                DataTable Cust = (DataTable)dh.ExecuteSql("select pd_outqty-nvl(pim_outqty,0)pd_outqty,pd_custprod,pd_custpodetno,PD_CUSTPO from  prodiodetail left join prodinout on pd_piid=pi_id left join (select pim_inoutno,PIM_CUSTPO, PIM_CUSTDETNO,count(1)pim_outqty from prodiomac where  pim_inoutno='" + pi_inoutno.Text + "' group by pim_inoutno,PIM_CUSTPO, PIM_CUSTDETNO)on pim_inoutno=pi_inoutno and PIM_CUSTPO=PD_CUSTPO and PIM_CUSTDETNO=pd_custpodetno where pi_inoutno='" + pi_inoutno.Text + "' and pd_custprod='" + dtms.Rows[0]["ma_custprodcode"] + "'  and pd_outqty-nvl(pim_outqty,0)>0 order by pd_pdno", "select");
                                 if (!checkinsertprodiomac("箱号", input.Text))
                                     return;
                                 List<int> custQtys = new List<int>();
@@ -837,11 +837,11 @@ namespace UAS_MES_NEW.Warehouse
                             OperateResult.AppendText("出货单" + pi_inoutno.Text + "已经出库不允许取消备货\n", Color.Red);
                             return;
                         }
-                        else if (dta.Rows[0]["pi_pdastatus"].ToString() == "未备货")
-                        {
-                            OperateResult.AppendText("出货单" + pi_inoutno.Text + "尚未备货,无法取消\n", Color.Red);
-                            return;
-                        }
+                        //else if (dta.Rows[0]["pi_pdastatus"].ToString() == "未备货")
+                        //{
+                        //    OperateResult.AppendText("出货单" + pi_inoutno.Text + "尚未备货,无法取消\n", Color.Red);
+                        //    return;
+                        //}
                         if (palletBtn.Checked)
                         {
                             sql.Clear();
@@ -1069,11 +1069,11 @@ namespace UAS_MES_NEW.Warehouse
                     OperateResult.AppendText("出货单" + pi_inoutno.Text + "已经出库,不允许取消明细\n", Color.Red);
                     return;
                 }
-                else if (dt.Rows[0]["pi_pdastatus"].ToString() == "未备货")
-                {
-                    OperateResult.AppendText("出货单" + pi_inoutno.Text + "尚未备货,无法取消明细\n", Color.Red);
-                    return;
-                }
+                //else if (dt.Rows[0]["pi_pdastatus"].ToString() == "未备货")
+                //{
+                //    OperateResult.AppendText("出货单" + pi_inoutno.Text + "尚未备货,无法取消明细\n", Color.Red);
+                //    return;
+                //}
                 List<String> ExeSQL = new List<string>();
                 ExeSQL.Add("update makeserial set ms_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode ) and ms_status=2");
                 ExeSQL.Add("update package set pa_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
@@ -1107,7 +1107,6 @@ namespace UAS_MES_NEW.Warehouse
                     OperateResult.AppendText("请输入栈板进行采集\n", Color.Black, input);
                 }
             }
-            Console.WriteLine(CombineCust.Checked);
         }
 
         private void InOutDetailDGV_DataSourceChanged(object sender, EventArgs e)

+ 2 - 2
UAS_MES_YDCY/PublicMethod/Print.cs

@@ -245,7 +245,7 @@ namespace UAS_MES_NEW.PublicMethod
             FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
-            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,nvl(lp_ifnull,0)lp_ifnull from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,nvl(lp_ifnull,0)lp_ifnull from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "' order by to_number(LP_DETNO)", "select");
             StringBuilder sb = new StringBuilder();
             if (!PrintFile.Exists)
             {
@@ -376,7 +376,7 @@ namespace UAS_MES_NEW.PublicMethod
             FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径
             //查询模板对应的取值SQL和参数名称
-            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_id='" + LaID + "' order by to_number(LP_DETNO)", "select");
             StringBuilder sb = new StringBuilder();
             if (!PrintFile.Exists)
             {