Browse Source

调整工单维护卡通箱彩盒称重和装箱容量

yhluo 4 months ago
parent
commit
9d548ef2dd

+ 7 - 2
UAS_MES_JH/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -158,10 +158,15 @@ namespace UAS_MES_NEW.Make
                         //    return;
                         //}
                         sql.Clear();
-                        sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,ma_colorcode,pr_colorboxunit,pr_code,ms_sku,pr_colorboxgw,");
+                        /*sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,ma_colorcode,pr_colorboxunit,pr_code,ms_sku,pr_colorboxgw,");
                         sql.Append("pr_colorboxunit,ma_maxcolorboxweight pr_colorboxmaxw,ma_mincolorboxweight pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
                         sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
-                        sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
+                        sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");*/
+
+                        sql.Append($@"SELECT ms_makecode ma_code, ma_qty, ma_salecode, ma_colorcode, pr_colorboxunit, pr_code, ms_sku, pr_colorboxgw, pr_colorboxunit, 
+                                    ma_maxcolorboxweight pr_colorboxmaxw, ma_mincolorboxweight pr_colorboxminw, nvl(ma_checkcolorboxw, '0') pr_checkcolorboxw, 
+                                    nvl(pr_sendchecktype, 'LineCode') pr_sendchecktype FROM makeserial LEFT JOIN make ON ms_makecode = ma_code 
+                                    LEFT JOIN product ON ms_prodcode = pr_code WHERE ms_sncode = '{sncode.Text}' ORDER BY ms_id DESC");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {

+ 22 - 6
UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -126,8 +126,14 @@ namespace UAS_MES_NEW.Packing
         {
             //加载表单数据
             sql.Clear();
-            sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty,pa_colorcode,pa_sku,pa_productcolor,pa_softversion,pa_upc,pa_location,pa_fba,pa_xm from package left join product on pa_prodcode=");
-            sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            /*sql.Append("select pr_code,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_remark,pa_outboxcode,pa_prodcode,pa_salecode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,pa_currentqty,pa_colorcode,pa_sku,pa_productcolor,pa_softversion,pa_upc,pa_location,pa_fba,pa_xm from package left join product on pa_prodcode=");
+            sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");*/
+
+            sql.Append($@"SELECT pr_code, nvl(pr_sendchecktype, 'LineCode') pr_sendchecktype, pa_remark, pa_outboxcode, pa_prodcode, pa_salecode, pa_makecode, 
+                        pa_sccode, nvl(pa_downstatus, 0) pa_downstatus, pa_checkno, pa_status, pr_packrule, nvl(ma_checkcartonw, '0') pr_checkcartonw, 
+                        nvl(ma_outboxinnerqty, 0) pr_outboxinnerqty, pa_packageqty, nvl(pa_standardqty, 0) pa_standardqty, pa_currentqty, pa_colorcode, 
+                        pa_sku, pa_productcolor, pa_softversion, pa_upc, pa_location, pa_fba, pa_xm FROM package LEFT JOIN product ON pa_prodcode = pr_code 
+                        LEFT JOIN make ON pa_makecode = ma_code WHERE pa_outboxcode = '{pa_outboxcode.Text }'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -275,9 +281,15 @@ namespace UAS_MES_NEW.Packing
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code and cr_prodcode = ms_prodcode", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         //获取序列号信息
                         sql.Clear();
-                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,nvl(ms_netcode,' ') ms_netcode,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
+                        /*sql.Append("select nvl(ms_iostatus,0) ms_iostatus,nvl(ms_netcode,' ') ms_netcode,pa_salecode,ms_salecode,ms_outno,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
                         sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
-                        sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                        sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");*/
+
+                        sql.Append($@"SELECT nvl(ms_iostatus, 0) ms_iostatus, nvl(ms_netcode, ' ') ms_netcode, pa_salecode, ms_salecode, ms_outno, 
+                                    ms_makecode, ms_prodcode, nvl(pa_downstatus, 0) pa_downstatus, pa_sccode, pa_checkno, pr_packrule, 
+                                    nvl(ma_outboxinnerqty, 0) pr_outboxinnerqty, nvl(pr_sendchecktype, 'LineCode') pr_sendchecktype 
+                                    FROM makeserial LEFT JOIN product ON ms_prodcode = pr_code LEFT JOIN packagedetail ON pd_barcode = ms_sncode 
+                                    LEFT JOIN package ON pa_id = pd_paid LEFT JOIN make ON ma_code = ms_makecode WHERE ms_id = '{oMsID}'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
                         string ms_prodcode = "";
@@ -832,8 +844,12 @@ namespace UAS_MES_NEW.Packing
                             SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else '" + User.CurrentStepCode + "' end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                             //抽检批次不为空的时候进行移除
                             dh.ExecuteSQLTran(SQLS1.ToArray());
-                            string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
-                            string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + prcode + "'").ToString();
+                            /*string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                            string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + prcode + "'").ToString();*/
+
+                            string prcode = dh.getFieldDataByCondition("packagedetail", "PD_MAKECODE", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                            string standqty = dh.getFieldDataByCondition("make", "ma_outboxinnerqty", "ma_code = '" + prcode + "'").ToString();
+
                             //if (standqty != "")
                             //{
                             //    //置空原箱

+ 21 - 7
UAS_MES_JH/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -174,9 +174,15 @@ namespace UAS_MES_NEW.Packing
             //加载表单数据
             string Err = "";
             sql.Clear();
-            sql.Append("select pa_prodcode,pr_cartonmaxw,pa_salecode,pa_remark,pa_makecode,pr_cartonunit,pr_code,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+            /*sql.Append("select pa_prodcode,pr_cartonmaxw,pa_salecode,pa_remark,pa_makecode,pr_cartonunit,pr_code,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
             sql.Append("pa_status,pr_packrule,pr_detail,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(PR_CHECKCARTONW,'0') PR_CHECKCARTONW,pa_currentqty from package left join ");
-            sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");*/
+            sql.Append($@"SELECT pa_prodcode, pr_cartonmaxw, pa_salecode, pa_remark, pa_makecode, pr_cartonunit, pr_code, 
+                        pr_cartonminw, pr_cartongw, pa_outboxcode, pa_sccode, nvl(pa_downstatus, 0) pa_downstatus, pa_checkno, 
+                        pa_status, pr_packrule, pr_detail, nvl(pr_sendchecktype, 'LineCode') pr_sendchecktype, pa_packageqty, 
+                        nvl(pa_standardqty, 0) pa_standardqty, nvl(ma_outboxinnerqty, 0) pr_outboxinnerqty, nvl(ma_checkcartonw, '0') pr_checkcartonw, 
+                        pa_currentqty FROM package LEFT JOIN product ON pa_prodcode = pr_code LEFT JOIN make ON pa_makecode = ma_code 
+                        WHERE pa_outboxcode = '{pa_outboxcode.Text}'");
             Err = "箱号";
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
@@ -318,9 +324,15 @@ namespace UAS_MES_NEW.Packing
                         }
                         //PR_CHECKCARTONW = dh.getFieldDataByCondition("craftdetail left join craft on cr_id=cd_crid left join makeserial on ms_craftcode =cr_code", "nvl(cd_ifweigh,'0') cd_ifweigh", "ms_sncode='" + sn_code.Text + "' and ms_makecode='" + oMakeCode + "' and cd_stepcode = '" + User.CurrentStepCode + "'").ToString();
                         sql.Clear();
-                        sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
-                        sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
-                        sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                        //sql.Append("select nvl(ms_iostatus,0) ms_iostatus,ms_outno,ms_salecode,ms_makecode,ms_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,");
+                        //sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        //sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+
+                        sql.Append($@"SELECT nvl(ms_iostatus, 0) ms_iostatus, ms_outno, ms_salecode, ms_makecode, ms_prodcode, nvl(pa_downstatus, 0) pa_downstatus, 
+                                      pa_sccode, pa_checkno, pr_packrule, nvl(ma_outboxinnerqty, 0) pr_outboxinnerqty, 
+                                      nvl(pr_sendchecktype, 'LineCode') pr_sendchecktype FROM makeserial LEFT JOIN product ON ms_prodcode = pr_code 
+                                      LEFT JOIN packagedetail ON pd_barcode = ms_sncode LEFT JOIN package ON pa_id = pd_paid LEFT JOIN make ON ms_makecode = ma_code 
+                                      WHERE ms_id = '{oMsID}'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
                         string ms_prodcode = "";
@@ -835,8 +847,10 @@ namespace UAS_MES_NEW.Packing
                                 SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
-                                string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
-                                string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + prcode + "'").ToString();
+                                /*string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                                string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + prcode + "'").ToString();*/
+                                string prcode = dh.getFieldDataByCondition("packagedetail", "PD_MAKECODE", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();
+                                string standqty = dh.getFieldDataByCondition("make", "ma_outboxinnerqty", "ma_code = '" + prcode + "'").ToString();
                                 if (standqty != "")
                                 {
                                     //置空原箱