callm il y a 4 jours
Parent
commit
6656d592de

+ 3 - 3
UAS_MES_JC/FunctionCode/Special/Special_Reset.cs

@@ -68,13 +68,13 @@ namespace UAS_MES_NEW.Special
             sql.Clear();
             sql.Clear();
             sql.Append("select cm_barcode from craftmaterial ");
             sql.Append("select cm_barcode from craftmaterial ");
             sql.Append("where cm_status=0 and cm_sncode = '" + sncode + "' and cm_makecode='" + makecode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
             sql.Append("where cm_status=0 and cm_sncode = '" + sncode + "' and cm_makecode='" + makecode + "' and cm_stepcode in (select cd_stepcode from craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id where ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_detno >=" + cd_stepno.Text + " )");
-            dt=(DataTable)dh.ExecuteSql(sql.GetString(), "update");
+            dt=(DataTable)dh.ExecuteSql(sql.GetString(), "select");
             for (int i = 0; i < dt.Rows.Count; i++)
             for (int i = 0; i < dt.Rows.Count; i++)
             {
             {
                 DataTable dt1 = (DataTable)dh.ExecuteSql("select ms_wccode,ms_id from makeserial where ms_sncode='" + dt.Rows[0]["cm_barcode"].ToString() +"'", "select");
                 DataTable dt1 = (DataTable)dh.ExecuteSql("select ms_wccode,ms_id from makeserial where ms_sncode='" + dt.Rows[0]["cm_barcode"].ToString() +"'", "select");
                 if (dt1.Rows.Count > 0) {
                 if (dt1.Rows.Count > 0) {
-                    string wccode = dt.Rows[0]["ms_wccode"].ToString();
-                    string ms_id = dt.Rows[0]["ms_id"].ToString();
+                    string wccode = dt1.Rows[0]["ms_wccode"].ToString();
+                    string ms_id = dt1.Rows[0]["ms_id"].ToString();
                     if (wccode == "单板")
                     if (wccode == "单板")
                     {
                     {
                         //更新子件序列号为待维修                               
                         //更新子件序列号为待维修                               

+ 1 - 1
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckMidBox.cs

@@ -282,7 +282,7 @@ namespace UAS_MES_NEW.Make
                                 if (weight_count == 50)
                                 if (weight_count == 50)
                                 {
                                 {
                                     double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
                                     double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
-                                    double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "' and ms_outboxcode is not null").ToString());
+                                    double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "'").ToString());
                                     dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code=v_ms_prodcode", "update");
                                     dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code=v_ms_prodcode", "update");
                                 }
                                 }
                                 sql.Clear();
                                 sql.Clear();

+ 8 - 8
UAS_MES_YDCY/FunctionCode/Make/Make_SNLabelCheckMidBoxNoWeight.cs

@@ -260,13 +260,13 @@ namespace UAS_MES_NEW.Make
 
 
 
 
                                 //如果称重到了50个,则重量信息重新自动设置到产品信息
                                 //如果称重到了50个,则重量信息重新自动设置到产品信息
-                                int weight_count = dh.getRowCount("makeserial", " ms_makecode='" + ma_code.Text + "' and ms_midboxweight is not null");
-                                if (weight_count == 50)
-                                {
-                                    double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
-                                    double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "' and ms_outboxcode is not null").ToString());
-                                    dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code=v_ms_prodcode", "update");
-                                }
+                                //int weight_count = dh.getRowCount("makeserial", " ms_makecode='" + ma_code.Text + "' and ms_midboxweight is not null");
+                                //if (weight_count == 50)
+                                //{
+                                //    double pr_miderror = double.Parse(dh.getFieldDataByCondition("product", "nvl(pr_miderror,0)", "pr_code='" + ma_prodcode.Text + "'").ToString());
+                                //    double avgweight = double.Parse(dh.getFieldDataByCondition("makeserial", "sum(ms_midboxweight)/50", " ms_makecode='" + ma_code.Text + "' and ms_outboxcode is not null").ToString());
+                                //    dh.ExecuteSql("update product set PR_MIDBOXMINWEIGHT=(" + avgweight + "-" + pr_miderror + "), PR_MIDBOXMAXWEIGHT=(" + avgweight + "+" + pr_miderror + ") where pr_code=v_ms_prodcode", "update");
+                                //}
                                 sql.Clear();
                                 sql.Clear();
                                 sql.Append("insert into labelchecklog(LCL_ID, LCL_SN, LCL_LABELTYPE, lcl_prefix,lcl_length, LCL_LABELVALUE, LCL_STEPCODE, LCL_SOURCECODE," +
                                 sql.Append("insert into labelchecklog(LCL_ID, LCL_SN, LCL_LABELTYPE, lcl_prefix,lcl_length, LCL_LABELVALUE, LCL_STEPCODE, LCL_SOURCECODE," +
                                     " LCL_INMAN, LCL_DATE)" +
                                     " LCL_INMAN, LCL_DATE)" +
@@ -373,7 +373,7 @@ namespace UAS_MES_NEW.Make
                 sn_code.Text = code.Text;
                 sn_code.Text = code.Text;
                 code.Str = "";
                 code.Str = "";
                 sql.Clear();
                 sql.Clear();
-                sql.Append("select PR_MIDBOXMINWEIGHT, PR_MIDBOXMAXWEIGHT,ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_spec,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+                sql.Append("select nvl(PR_MIDBOXMINWEIGHT,0)PR_MIDBOXMINWEIGHT, nvl(PR_MIDBOXMAXWEIGHT,0)PR_MIDBOXMAXWEIGHT,ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_bomversion,ma_qty,ma_code,pr_spec,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
                 sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
                 sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
                 sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
                 sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");