1
wtt
14 小时以前 d98cb58162e87d1df5d8c60f946f6928130912b1
WebAPI/Controllers/LMESController.cs
@@ -871,19 +871,8 @@
                    if (hSourceID == "0" || hMoldID == "0")
                    {
                        continue;
                    }
                    string sReturn = "";
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
                    {
                         if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                         {
                            oCN.RunProc("update Sc_ProcessExchangeBillMain set HMakeDate = GETDATE(),HRemark3='已派工',HMaker='" + msg4 + "' where HInterID = " + hSourceInterID);
                            LogService.Write("自动生成工作联系单...");
                            //自动生成工作联系单
                            ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772, "h_p_OA_WorkLinkBill_Create");
                         }
                    }
                    }
                    //更新流转卡子表生产资源
                    oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + hSourceID + " where HInterID=" + hSourceInterID + " and HEntryID=" + hSourceEntryID);
                    // 插入生产状态临时表
                    string SQL = $"exec h_p_Sc_ICMOBillStatus_Tmp_PGPL {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}";
@@ -891,6 +880,19 @@
                    //插入工序流转卡派工单
                    string SQL1 = $"exec h_p_Sc_ProcExchSendWorkBill_PG {hSourceInterID},{hSourceEntryID},{hSourceID},{hMoldID}";
                    oCN.RunProc(SQL1);
                    string sReturn = "";
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
                    {
                        if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                        {
                            oCN.RunProc("update Sc_ProcessExchangeBillMain set HMakeDate = GETDATE(),HRemark3='已派工',HMaker='" + msg4 + "' where HInterID = " + hSourceInterID);
                            LogService.Write("自动生成工作联系单...");
                            //自动生成工作联系单
                            ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + hSourceInterID + "," + 3772, "h_p_OA_WorkLinkBill_Create");
                        }
                    }
                    // 7. 提交事务
                    oCN.Commit();
@@ -900,7 +902,7 @@
                        LogService.Write("执行消息推送..." + HInterID);
                        // 触发消息推送
                        new Sc_MESTransFerWorkBillController().AuditOA_WorkLinkBill(HInterID, 0, msg4);
                        Service.GeTuiService.PubishSingle(HInterID);
                    }
                }
@@ -2248,6 +2250,74 @@
            return GetObjectJson(ds);
        }
        /// <summary>
        /// 返回工序流转卡列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("LEMS/MES_Sc_ProcessExchangeBillList_Json")]
        [HttpGet]
        public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>()
;                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBillQuery", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //获取系统参数
                string Ret = "";
                if (oSystemParameter.ShowBill(ref Ret))
                {
                    //判断客户为龙山汽配
                    if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配")
                    {
                        //获取需要拼接的字符串
                        string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "生产订单列表");
                        sWhere += sql_splice;
                    }
                }
                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by 制单日期 desc,单据号 desc", "h_v_Sc_ProcessExchangeBillQuery");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                //objJsonResult.code = "1";
                //objJsonResult.count = 1;
                //objJsonResult.Message = "Sucess!";
                //objJsonResult.data = ds.Tables[0];
                //objJsonResult.list = a;
                //return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
            return GetObjectJson(ds);
        }
        #region 生产订单列表-分页
        [Route("LEMS/MES_IF_ICMOBillList_Json_byPage")]