zzr99
2022-01-21 fa930a0008d9c3fa3fcd5e0bac6d8fe812059479
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESBeginStepWorkBillController.cs
@@ -1,11 +1,15 @@
using Newtonsoft.Json.Linq;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using Pub_Class;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using WebAPI.Models;
@@ -103,7 +107,7 @@
        {
            DBUtility.ClsPub.CurUserName = UserName;
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -190,7 +194,7 @@
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, true, CurUserName))
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -374,7 +378,7 @@
            string refSav = sArray[2].ToString();
            DBUtility.ClsPub.CurUserName = UserName;
            //保存权限
            if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
            if (!DBUtility.ClsPub.Security_Log_second("MES_MESBeginWorkBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -603,14 +607,14 @@
                                         ,b.HSourceInterID,b.HSourceEntryID,b.HSourceBillNo,b.HSourceBillType
                                         from Sc_ProcessReportMain a 
                                         inner join Sc_ProcessReportSub b on a.HInterID=B.HInterID
                                         inner join (select max(HProcNo) HProcNo,HBillNo,HProcID,HSourceInterID,HSourceEntryID,HSourceBillNo
                                         from Sc_ProcessPlanSub group by HBillNo,HProcID,HSourceInterID,HSourceEntryID,HSourceBillNo)
                                         pr on b.HSourceBillNo=pr.HSourceBillNo and b.HSourceInterID=pr.HSourceInterID and b.HSourceEntryID=pr.HSourceEntryID
                                         inner join (select max(HProcNo) HProcNo,max(HProcID) HProcID
                                         from Sc_ProcessPlanSub group by HBillNo,HSourceBillNo)
                                         pr on b.HProcID=pr.HProcID
                                         left join Gy_Process p on b.HProcID=p.HItemID
                                         left join Gy_Material m on a.HMaterID=m.hitemid
                                         left join Gy_Source s on b.HSourceID=s.HItemID
                                         left join Gy_Group g on a.HGroupID=g.HItemID
                                         left join Gy_Employee e on b.HEmpID=e.HItemID "+sWhere+"  and HRelationInterID='0'");
                                         left join Gy_Employee e on b.HEmpID=e.HItemID " + sWhere+"  and HRelationInterID='0'");
            return new SQLHelper.ClsCN().RunProcReturn(sql, "Sc_ICMOBillWorkQtyStatus_Tmp");
        }
        #endregion
@@ -627,7 +631,7 @@
        {
            try
            {
                ds = new SQLHelper.ClsCN().RunProcReturn("select isnull(sum(HQty),0) HQty,isnull(sum(HBadQty),0) HBadQty,isnull(sum(HWasterQty),0) HWasterQty   from Sc_ProcessReportSub with (nolock)" + sWhere, "Sc_ProcessReportSub");
                ds = new SQLHelper.ClsCN().RunProcReturn("select isnull(sum(HQty),0) HQty,isnull(sum(HBadCount),0) HBadQty,isnull(sum(HWasterQty),0) HWasterQty   from Sc_ProcessReportSub with (nolock)" + sWhere, "Sc_ProcessReportSub");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
@@ -761,6 +765,16 @@
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HRelationQty = 0;     //关联数量
                    oItemSub.HProcPlanBillNo = ""; //工序计划单
                    oItemSub.HSeOrderBillNo = "";
                    oItemSub.HRemark = "报工台工序汇报";
                    oItemSub.HOtherItem1 = "";
                    oItemSub.HOtherItem2 = "";
                    oItemSub.HOtherItem3 = "";
                    oItemSub.HOtherItem4 = "";
                    oItemSub.HOtherItem5 = "";
                    oItemSub.HPackType = "";
                    oItemSub.HBatchNo="";
                    //oItemSub.HRelationMoney = 0;   //关联金额
                    //oItemSub.HRepairID = 0;       //维修项目
                    //oItemSub.HRepairExplanation ="";   //维修要求
@@ -845,7 +859,7 @@
            {
                string StrMessage = "";
                //审核权限
                if (!WebClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName, ref StrMessage))
                if (!WebClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName, ref StrMessage))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -1005,7 +1019,7 @@
        #region æŠ¥å·¥å¹³å°æŠ¥æ£€ç”³è¯·ä¿å­˜
        [Route("Sc_MESBeginStepWorkBill/SaveGetMESProductReportBillList")]
        [HttpGet]
        public object SaveGetMESProductReportBillList(string ScMaxWork, string HSourceBillType, string workcode, int HSourceID, int HICMOInterID, int HICMOEntryID, string HMaker, string Czybm)
        public object SaveGetMESProductReportBillList(string ScMaxWork, string HSourceBillType, string workcode, int HSourceID, int HICMOInterID, int HICMOEntryID, string HMaker, string Czybm,string HProcID)
        {
            ListModels oListModels = new ListModels();
            try
@@ -1074,7 +1088,7 @@
                model.HMainSourceEntryID = HICMOEntryID;
                //oWebs.Timeout = 30000;
                bool flag = oWebs.set_SaveICMOProductReportBill_Layui(model, workcode, HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
                bool flag = oWebs.set_SaveICMOProductReportBill_LayuiYqn(model, workcode, HSourceID, sHSourceType, HProcID, ref DBUtility.ClsPub.sErrInfo);
                if (flag)
                {
                    //oCN.Commit();