Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
dc515dd9ce

+ 13 - 0
UAS-MES/CustomControl/TextBoxWithIcon/EnterTextBox.cs

@@ -17,6 +17,19 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         /// </summary>
         string AllPower1;
 
+        public override string Text
+        {
+            get
+            {
+                return base.Text.Trim();
+            }
+
+            set
+            {
+                base.Text = value;
+            }
+        }
+
         public string AllPower
         {
             get { return AllPower1; }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -537,7 +537,7 @@ namespace UAS_MES.Make
                             }
                             List<string> SQLS2 = new List<string>();
                             ////置空原箱
-                            SQLS2.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                            SQLS2.Add("update package set pa_checkno='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
                             pa_status.Text = "0";
                             //删除箱的明细
                             SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -620,7 +620,7 @@ namespace UAS_MES.Make
                             }
                             List<string> SQLS2 = new List<string>();
                             ////置空原箱
-                            SQLS2.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                            SQLS2.Add("update package pa_checkno='',set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
                             pa_status.Text = "0";
                             //删除箱的明细
                             SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");

+ 31 - 6
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -134,7 +134,7 @@ namespace UAS_MES.Make
                     return;
                 }
                 sql.Clear();
-                sql.Append("select ms_status,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
+                sql.Append("select ms_status,ms_outboxcode,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
                 sql.Append("on ms_makecode=ma_code where ms_sncode = '" + GetSNCode.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
@@ -142,6 +142,13 @@ namespace UAS_MES.Make
                     string ms_status = dt.Rows[0]["ms_status"].ToString();
                     ifrework = dt.Rows[0]["ms_ifrework"].ToString();
                     reworkstatus = dt.Rows[0]["ms_reworkstatus"].ToString();
+                    if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
+                    {
+                        OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "已装箱,请先进行拆箱\n", Color.Red);
+                        BaseUtil.CleanForm(this);
+                        BadCodeTree.Nodes.Clear();
+                        return;
+                    }
                     //如果不是返修序列号执行原来的步骤
                     if (ifrework == "0")
                     {
@@ -211,12 +218,26 @@ namespace UAS_MES.Make
                             sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
                             sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
                             sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "') or cm_sncode='" + firstsn + "') ");
-                            sql.Append("and cm_craftcode='" + cr_code.Text + "' group by cm_craftcode,cm_stepcode,cm_soncode having ");
+                            sql.Append("and cm_craftcode='" + cr_code.Text + "'and nvl(cm_lastdeco,0)<>0 group by cm_craftcode,cm_stepcode,cm_soncode having ");
                             sql.Append("sum(case when cm_status=-1 then 0 else 1 end)=0 order by cm_indate");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
-                                cd_stepcode.Text = dt.Rows[0]["cm_stepcode"].ToString();
+                                cd_stepcode.Text = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
+                            }
+                            else
+                            {
+                                sql.Clear();
+                                sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
+                                sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
+                                sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "') or cm_sncode='" + firstsn + "') ");
+                                sql.Append("and cm_craftcode='" + cr_code.Text + "' group by cm_craftcode,cm_stepcode,cm_soncode having ");
+                                sql.Append("sum(case when cm_status=-1 then 0 else 1 end)=0 order by cm_indate");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows.Count > 0)
+                                {
+                                    cd_stepcode.Text = dt.Rows[0]["cm_stepcode"].ToString();
+                                }
                             }
                             //如果ms_stepcode和扣料工序均没有查到返修的工序
                             if (cd_stepcode.Text == "")
@@ -447,6 +468,7 @@ namespace UAS_MES.Make
                 else
                 {
                     dt = dh.getFieldsDataByCondition("makeserial", new string[] { "nvl(ms_ifrework,0) ms_ifrework", "ms_paststep" }, "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
+                    List<string> SQLS = new List<string>();
                     if (dt.Rows.Count > 0)
                     {
                         string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
@@ -458,11 +480,14 @@ namespace UAS_MES.Make
                             return;
                         }
                         if (ms_ifrework == "0")
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep || case when instr(','||ms_paststep||',','" + User.CurrentStepCode + "')=0 then ','||'" + User.CurrentStepCode + "' end , ms_nextstepcode ='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_id='" + msid + "'");
+                            SQLS.Add("update makeserial set ms_checkno='',ms_paststep = ms_paststep || case when instr(','||ms_paststep||',','" + User.CurrentStepCode + "')=0 then ','||'" + User.CurrentStepCode + "' end , ms_nextstepcode ='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1 where ms_id='" + msid + "'");
                         else
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep || case when instr(','||ms_paststep||',','" + User.CurrentStepCode + "')=0 then ','||'" + User.CurrentStepCode + "' end , ms_nextstepcode ='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1", "ms_id='" + msid + "'");
+                            SQLS.Add("update makeserial set ms_checkno='',ms_paststep = ms_paststep || case when instr(','||ms_paststep||',','" + User.CurrentStepCode + "')=0 then ','||'" + User.CurrentStepCode + "' end , ms_nextstepcode ='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1 where ms_id='" + msid + "'");
                     }
-                    dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
+                    SQLS.Add("update makebad set mb_status=-1 where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
+                    //取消最近拆解部件
+                    SQLS.Add("update craftmaterial set cm_lastdeco=0 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode.Text + "' and nvl(cm_lastdeco,0)<>0");
+                    dh.ExecuteSQLTran(SQLS.ToArray());
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
                     OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -564,7 +564,7 @@ namespace UAS_MES.Make
                             }
                             List<string> SQLS2 = new List<string>();
                             ////置空原箱
-                            SQLS2.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                            SQLS2.Add("update package pa_checkno='',set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
                             pa_status.Text = "0";
                             //删除箱的明细
                             SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");

+ 1 - 1
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -208,7 +208,7 @@ namespace UAS_MES.Packing
             //查询重量设置采样个数
             try
             {
-                samplesCount = int.Parse(dh.GetConfig("重量设置采样个数", "MESSetting").ToString());
+                samplesCount = int.Parse(dh.GetConfig("prodWeightSetting", "MESSetting").ToString());
             }
             catch (Exception ess)
             {

+ 1 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -693,7 +693,7 @@ namespace UAS_MES.PublicMethod
                 return false;
         }
 
-        public static String GetNextStep(string iCraftCode, string iPrCode, string iStepCode)
+        public static String GetNextStep(string iCraftCode, string iStepCode, string iPrCode)
         {
             sql.Clear();
             sql.Append("select cd_nextstepcode from craft left join craftdetail on cr_id =cd_crid where ");

+ 20 - 2
UAS-MES/UAS-MES.csproj

@@ -38,11 +38,11 @@
     <ProductName>优软MES系统</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>优软MES系统</SuiteName>
-    <MinimumRequiredVersion>1.0.0.414</MinimumRequiredVersion>
+    <MinimumRequiredVersion>1.0.0.421</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>415</ApplicationRevision>
+    <ApplicationRevision>422</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -587,6 +587,12 @@
     <Compile Include="FunctionCode\Packing\Packing_CartonTransfer.Designer.cs">
       <DependentUpon>Packing_CartonTransfer.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Packing\Packing_ProdWeightSet.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Packing\Packing_ProdWeightSet.Designer.cs">
+      <DependentUpon>Packing_ProdWeightSet.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_MendLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -605,6 +611,12 @@
     <Compile Include="FunctionCode\Warehouse\Warehouse_ProdDetail.Designer.cs">
       <DependentUpon>Warehouse_ProdDetail.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Warehouse\Warehouse_ProductMakeIn.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Warehouse\Warehouse_ProductMakeIn.Designer.cs">
+      <DependentUpon>Warehouse_ProductMakeIn.cs</DependentUpon>
+    </Compile>
     <Compile Include="Login.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1126,12 +1138,18 @@
     <EmbeddedResource Include="FunctionCode\Packing\Packing_CartonTransfer.resx">
       <DependentUpon>Packing_CartonTransfer.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Packing\Packing_ProdWeightSet.resx">
+      <DependentUpon>Packing_ProdWeightSet.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_MendLabel.resx">
       <DependentUpon>Special_MendLabel.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Warehouse\Warehouse_NewPiInOut.resx">
       <DependentUpon>Warehouse_NewPiInOut.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Warehouse\Warehouse_ProductMakeIn.resx">
+      <DependentUpon>Warehouse_ProductMakeIn.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Login.resx">
       <DependentUpon>Login.cs</DependentUpon>
     </EmbeddedResource>