Ejemplo n.º 1
0
        public JObject GetPmExecUnitByCode(string iExecCode)
        {
            try
            {
                #region 参数检测
                iExecCode.NotAllowNullOrEmpty("抽样单位编码");
                #endregion

                var PmCaryInfo = _dal.GetPmExecUnitByCode(iExecCode);
                if (PmCaryInfo != null)
                {
                    //return result;//自定义返回
                    return(JObject.Parse(JsonConvert.SerializeObject(PmCaryInfo)));//全部返回
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                SerilogServer.WriteErrorLog("GetPmExecUnitByCode", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="iCodeNum"></param>
        /// <returns></returns>
        public JObject GetPmPlanByCode(string iPalnCodeNum)
        {
            try
            {
                #region 参数检测
                iPalnCodeNum.NotAllowNullOrEmpty("任务编号");
                int StringLength = iPalnCodeNum.Length;
                (iPalnCodeNum.Length <= 4).ThrowException("任务编号格式不正确");

                #endregion

                var mPmPlanInfo = _dal.GetPmPlanByCode(iPalnCodeNum);
                if (mPmPlanInfo != null)
                {
                    return(JObject.Parse(JsonConvert.SerializeObject(mPmPlanInfo)));//全部返回
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                SerilogServer.WriteErrorLog("GetPmPlanByCode", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public JObject GetPmPlanSubByCode(string iCodeNum)
        {
            try
            {
                #region 参数检测
                iCodeNum.NotAllowNullOrEmpty("抽查批次号");
                int StringLength = iCodeNum.Length;
                (iCodeNum.Length <= 4).ThrowException("抽查批次号格式不正确");
                string mCode = iCodeNum.Substring(0, StringLength - 4).ToUpper();
                string mNum  = iCodeNum.Substring(StringLength - 4);
                #endregion

                var mPmPlanSubInfo = _dal.GetPmPlanSubByCode(mCode, mNum);
                if (mPmPlanSubInfo != null)
                {
                    //var result = new JObject() {
                    //{"ID",mPmPlanSubInfo.ID},
                    //{"PLAN_CODE",mPmPlanSubInfo.PLAN_CODE},
                    //{"LOT_NUM",mPmPlanSubInfo.LOT_NUM}
                    // };
                    //return result;//自定义返回
                    return(JObject.Parse(JsonConvert.SerializeObject(mPmPlanSubInfo)));//全部返回
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                SerilogServer.WriteErrorLog("GetPmPlanSubByCode", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 获得最大值
 /// </summary>
 /// <returns></returns>
 public string GetMaxClientCode()
 {
     try
     {
         return(this.Db.Queryable <RASCLIENTS>().Max(t => (SqlFunc.Substring(t.RASCLIENTID, 2, t.RASCLIENTID.Length - 2))));
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetMaxClientCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 5
0
 public ORDERS GetOrdersByNo(string iOrdNo)
 {
     try
     {
         return(this.Db.Queryable <ORDERS>().Where(t => t.ORDNO == iOrdNo).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetOrdersByNo", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 根据生产单位编码ID 获得生产企业信息
 /// </summary>
 /// <param name="iProCode">生产单位编码</param>
 /// <returns></returns>
 public PM_PRODUCE_UNIT GetPmProduceUnitByCode(string iProCode)
 {
     try
     {
         return(this.Db.Queryable <PM_PRODUCE_UNIT>().Where(t => t.PRO_CODE == iProCode).First());
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("getPmProduceUnitByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 根据参数组合进行查询
 /// </summary>
 /// <param name="iCode"></param>
 /// <param name="iNum"></param>
 /// <returns></returns>
 public PM_PLAN_SUB GetPmPlanSubByCode(string iCode, string iNum)
 {
     try
     {
         return(this.Db.Queryable <PM_PLAN_SUB>().Where(t => t.PLAN_CODE == iCode && t.LOT_NUM == iNum).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmPlanSubByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 8
0
 public PM_PRODUCE_UNIT GetPmProduceUnitById(int iProId)
 {
     try
     {
         return(this.Db.Queryable <PM_PRODUCE_UNIT>().Where(t => t.ID == iProId).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmProduceUnit", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 9
0
 public PM_EXEC_UINT GetPmExecUintById(int iExecId)
 {
     try
     {
         return(this.Db.Queryable <PM_EXEC_UINT>().Where(t => t.ID == iExecId).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmCary", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 10
0
 public PM_EC_PLATFORM GetPmEcPlatFormById(int iEcId)
 {
     try
     {
         return(this.Db.Queryable <PM_EC_PLATFORM>().Where(t => t.EC_ID == iEcId).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmEcPlatForm", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 11
0
 public PM_CARY GetPmCaryById(int iCaryId)
 {
     try
     {
         return(this.Db.Queryable <PM_CARY>().Where(t => t.ID == iCaryId).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmCary", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 根据客户名查找客户
 /// </summary>
 /// <param name="clientName"></param>
 /// <returns></returns>
 public RASCLIENTS GetRaseClientsByName(string clientName)
 {
     try
     {
         return(this.Db.Queryable <RASCLIENTS>().Where(t => t.COMPANYNAME == clientName).First());
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetRaseClientsByName", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 20200803 By Gavin
 /// 查找LIMS的任务
 /// </summary>
 /// <param name="iPlanCode">计划编号</param>
 /// <returns></returns>
 public ADD_SUPERVISEPLAN GetSupervisePlanByCode(string iPlanCode)
 {
     try
     {
         return(this.Db.Queryable <ADD_SUPERVISEPLAN>().Where(t => t.SAMPLINGBASIS.Contains(iPlanCode)).First());
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetSupervisePlanByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 根据 抽样单位编码 获得 抽样单位信息
 /// </summary>
 /// <param name="iExecCode">抽样单位编码</param>
 /// <returns></returns>
 public PM_EXEC_UINT GetPmExecUnitByCode(string iExecCode)
 {
     try
     {
         return this.Db.Queryable<PM_EXEC_UINT>().Where(t => t.EXEC_CODE == iExecCode).First();
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("getPmExecUnitByCode", ex.Message, ex);   
         throw ex;
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 根据任务编号获得任务实体
 /// </summary>
 /// <param name="iCode">任务编号</param>
 /// <returns></returns>
 public PM_PLAN GetPmPlanByCode(string iPalnCode)
 {
     try
     {
         return(this.Db.Queryable <PM_PLAN>().Where(t => t.PLAN_CODE == iPalnCode).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmPlanByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// 20200803 By Gavin
 /// 获得部门表
 /// </summary>
 /// <param name="dept"></param>
 /// <returns></returns>
 public DEPARTMENTS GetDepartmentsByCode(string dept)
 {
     try
     {
         return this.Db.Queryable<DEPARTMENTS>().Where(t => t.DEPT == dept).First();
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetSupervisePlanByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 17
0
 public FOLDERS GeyFolderByNo(string iFolderNo)
 {
     try
     {
         return(this.Db.Queryable <FOLDERS>().Where(t => t.FOLDERNO == iFolderNo).First());
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GeyFolderByNo", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 根据受检单位编号 获得 受检单位信息
 /// </summary>
 /// <param name="caryCode">受检单位信息</param>
 public PM_CARY GetPmCaryByCode(string iCaryCode)
 {
     try
     {
         return(this.Db.Queryable <PM_CARY>().Where(t => t.CARY_CODE == iCaryCode).First());
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPmCaryByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 20200803 By Gavin
 /// ╗ых├олл─
 /// </summary>
 /// <param name="Divisioncode"></param>
 /// <returns></returns>
 public DIVISIONS GetDivisionsByCode(string Divisioncode)
 {
     try
     {
         return(this.Db.Queryable <DIVISIONS>().Where(t => t.DIVISIONCODE == Divisioncode).First());
     }
     catch (System.Exception ex)
     {
         SerilogServer.WriteErrorLog("GetSupervisePlanByCode", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 20
0
 public int SaveFolders(FOLDERS model)
 {
     try
     {
         var insert  = this.Db.Insertable(model);
         int mResult = insert.ExecuteReturnIdentity();
         return(mResult);
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("SaveFolders", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 21
0
 public FOLDERS GetMaxFolder()
 {
     try
     {
         lock (obj) {
             //return this.Db.Queryable<FOLDERS>().Max(t => t.FOLDERNO);
             return(this.Db.Queryable <FOLDERS>().OrderBy(t => t.FOLDERNO, OrderByType.Desc).First());
         }
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetMaxFolder", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 22
0
 public PREORDERS GetMaxPreOrders()
 {
     try
     {
         lock (obj)
         {
             return(this.Db.Queryable <PREORDERS>().OrderBy(t => t.PREORDNO, OrderByType.Desc).First());
         }
     }
     catch (Exception ex)
     {
         SerilogServer.WriteErrorLog("GetPreOrdersByNo", ex.Message, ex);
         throw ex;
     }
 }
Ejemplo n.º 23
0
        /// <summary>
        /// 根据客户名称查询
        /// </summary>
        /// <param name="clientName"></param>
        /// <returns></returns>
        public JObject GetRaseClientsByName(string clientName)
        {
            try
            {
                clientName.NotAllowNullOrEmpty("客户名称");

                var client = _dal.GetRaseClientsByName(clientName);
                if (client != null)
                {
                    return(JObject.Parse(JsonConvert.SerializeObject(client)));
                }
                else
                {
                    return(null);
                }
            }
            catch (System.Exception ex)
            {
                SerilogServer.WriteErrorLog("GetRaseClientsByName", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 24
0
        public JObject GetPmProduceUnitByCode(string iProCode)
        {
            try
            {
                iProCode.NotAllowNullOrEmpty("Éú²úµ¥Î»±àÂë");

                var pmProductUnitEntity = _dal.GetPmProduceUnitByCode(iProCode);
                if (pmProductUnitEntity != null)
                {
                    return(JObject.Parse(JsonConvert.SerializeObject(pmProductUnitEntity)));
                }
                else
                {
                    return(null);
                }
            }
            catch (System.Exception ex)
            {
                SerilogServer.WriteErrorLog("GetPmProduceUnitByCode", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 25
0
        public bool SaveInspectAcceptance(int iUserId, InputInsepectAcceptanceModel model)
        {
            try
            {
                model.PmPlanSubInfo.NotAllowNull("抽检信息");

                #region 获取用户信息
                var mUserInfo = _SysUserInfoServices.QueryById(iUserId).Result;//用户信息
                #endregion


                _UnitOfWork.BeginTran();

                #region 查询或保存企业
                // CHECK_TYPE : 1:现场抽样(生产) 2:市场买样 3:电商买样 4:其他来源
                //生产单位
                RASCLIENTS mScdwInfor = null;
                if (model.PmPlanSubInfo.CHECK_TYPE == "1")
                {
                    mScdwInfor = this.SaveRaseClient(model.PmProduceUnit.PRO_NAME, model.PmProduceUnit.PRO_ADDR, model.PmProduceUnit.PRO_TEL, mUserInfo.uRealName, model.Department.DEPTNAME, model.PmProduceUnit.PRO_BUS_LICENCE, model.Department.DEPT);
                }
                //受检单位
                RASCLIENTS mSjdwInfor = null;
                if (model.PmPlanSubInfo.CHECK_TYPE == "2")
                {
                    mSjdwInfor = this.SaveRaseClient(model.PmCaryInfo.CARY_NAME, model.PmCaryInfo.CARY_ADDR, model.PmCaryInfo.CARY_TEL, mUserInfo.uRealName, model.Department.DEPTNAME, model.PmCaryInfo.UNIFIED_SOCIAL_CREDIT_CODE, model.Department.DEPT);
                }
                else if (model.PmPlanSubInfo.CHECK_TYPE == "3")
                {
                    //网店信息
                    mSjdwInfor = this.SaveRaseClient(model.PmEcPlatFormInfo.ONLINE_STORE_NAME, model.PmEcPlatFormInfo.ONLINE_STORE_ADDR, model.PmEcPlatFormInfo.ONLINE_STORE_CONTACT, mUserInfo.uRealName, model.Department.DEPTNAME, "", model.Department.DEPT);
                }
                #endregion

                #region 1. 受理单
                FOLDERS folders = new FOLDERS();
                folders.FOLDERNO              = this.CreateFolderNo();//生成规则
                folders.DEPT                  = model.Department.DEPT;
                folders.REMARKS               = model.PmPlanSubInfo.REMARKS;
                folders.ORIGSTS               = "N";
                folders.FLDSTS                = "Draft";
                folders.DISPSTS               = "新建";
                folders.SAMPLECLASSFORCCC     = "3C样品种类名称";
                folders.CODEOFINSPECTIONORG   = "承检机构代码";
                folders.DETECTIONFORSPOTCHECK = model.SupervisePlanInfo.TASKCLASS;
                folders.TESTORGREGFORM        = model.Department.DEPTNAME;
                folders.TESTPLACE             = model.Department.LOCATION;
                folders.TESTTYPE              = "01";
                folders.PLANNO                = model.SupervisePlanInfo.PLANNO;
                folders.TASKSOURCE            = model.SupervisePlanInfo.TASKSOURCE;
                folders.TESTTASKNOFORCCC      = "委托单位协议编号";
                //生产单位
                folders.COMPANYNOOFPRODUCTIONORG    = mScdwInfor == null ? null : mScdwInfor.RASCLIENTID;
                folders.ADDRESSOFPRODUCTIONORG      = mScdwInfor == null ? null : mScdwInfor.ADDRESS;
                folders.PHONEOFPRODUCTIONORG        = mScdwInfor == null ? null : mScdwInfor.PHONE;
                folders.NAMEOFPRODUCTIONORG         = mScdwInfor == null ? null : mScdwInfor.COMPNAME;
                folders.PRODUCTIONOFBUSINESSLICENSE = mScdwInfor == null ? null : mScdwInfor.STAXCODE;
                //受检单位
                folders.ADDRESSOFORGBETESTED = mSjdwInfor == null? null: mSjdwInfor.ADRESS;
                folders.PHONEOFORGBETESTED   = mSjdwInfor == null ? null : mSjdwInfor.PHONE;
                folders.NAMEOFORGBETESTED    = mSjdwInfor == null ? null : mSjdwInfor.COMPNAME;
                folders.ACCEPTER             = mUserInfo.uRealName;
                folders.ACCEPTDATE           = DateTime.Now;
                //委托单位
                folders.NAMEOFENTRUSTORG    = model.SupervisePlanInfo.TASKSOURCE;
                folders.SAMPLESOURCEREGFORM = "抽样";
                folders.DIVISIONCODE        = model.Division.DIVISIONCODE;
                folders.PAYSTS        = "N";
                folders.LOGDATE       = DateTime.Now;
                folders.ISSUBCONTRACT = "不同意";
                folders.ISSUPPLIER    = "N";
                folders.CREATER       = mUserInfo.uLoginName;
                folders.EVALUATIONREQ = "评价";

                var IsFolderExist = _FoldersDal.GeyFolderByNo(folders.FOLDERNO) != null ? true : false;
                if (!IsFolderExist)
                {
                    _FoldersDal.SaveFolders(folders);
                }
                else
                {
                    return(false);
                }
                #endregion

                #region 2. 样品单
                PREORDERS preoders = new PREORDERS();
                preoders.PREORDNO               = this.CreatPreOrderNo("");//获取部门编号信息
                preoders.FOLDERNO               = folders.FOLDERNO;
                preoders.STATUS                 = "Draft";
                preoders.DISPSTS                = "新建";
                preoders.REMARKS                = model.PmPlanSubInfo.REMARKS;
                preoders.TESTCOSTSFORSAMPLE     = 0;
                preoders.TAKEREPORTMETHOD       = "自取";
                preoders.RECEIVEDATE            = DateTime.Today;
                preoders.STORAGEMETHOD          = "常温";
                preoders.TREATMENTFORSAMPLE     = "销毁";
                preoders.ARRIVDATEFORSAMPLE     = DateTime.Today;
                preoders.SPECMODEL              = model.PmPlanSubInfo.GOODS_SCALE;
                preoders.SAMPLENAME             = model.PmPlanSubInfo.GOODS_NAME;
                preoders.TOTALQUANTITY          = model.PmPlanSubInfo.GOODS_CHECK_NUM;
                preoders.SAMPLESTATE            = "封样完好、符合检验要求";
                preoders.REQUIREDCOMPLETIONDATE = DateTime.Today.AddDays(7);
                preoders.DEPT                          = model.Department.DEPT;
                preoders.DIVISIONCODE                  = model.Division.DIVISIONCODE;
                preoders.ISRETURNSAMPLE                = "N";
                preoders.ISEMERGENCY                   = "0";
                preoders.PAYSTS                        = "未缴费";
                preoders.LOGDATE                       = DateTime.Now;
                preoders.ISMAKESAMPLE                  = "N";
                preoders.ISADD_G                       = "N";
                preoders.INVOICEISSUEMETHOD            = "自取";
                preoders.TAKESAMPLINGPERSON            = mUserInfo.uRealName;
                preoders.STORAGECONDITION              = 0;
                preoders.OTHERSAMPLETYPE               = 0;
                preoders.OTHERRESTAURANTTACHE          = 0;
                preoders.OTHERCIRCULATIONTACHE         = 0;
                preoders.STRIPNUMBERANDSUM             = 0;
                preoders.SAMPLINGPRODUCTIMPLEMENTATION = "按文件要求";
                preoders.SAMPLEDELIVERYMODE            = "抽样";
                preoders.REPORTRECYCLE                 = "Y";
                preoders.SELFNUMBER                    = model.PmPlanSubInfo.PLAN_CODE + model.PmPlanSubInfo.LOT_NUM;
                preoders.PRINTNUM                      = 0;
                preoders.ZHENGSHUNO                    = model.PmPlanSubInfo.GOODS_CERT_CODE;
                preoders.ISADD_FG                      = "N";
                preoders.ALLOTTYPE                     = "CP";
                preoders.PRINTBYNUMS                   = 0;
                preoders.PRINTJYNUMS                   = 1;
                preoders.ISNEEDCOVERING                = "N";
                preoders.TESTPERIOD                    = 7;
                preoders.REALPAY2                      = 0;

                var IsPreExist = _PreOrdersDal.GetPreOrdersByNo(preoders.PREORDNO) != null ? true : false;
                if (!IsPreExist)
                {
                    _PreOrdersDal.SavePreOrders(preoders);
                }
                #endregion

                #region 3. 子样单
                ORDERS orders = new ORDERS();
                orders.ORDNO        = string.Format("{0}-001", preoders.PREORDNO);
                orders.ORIGSTS      = "N";
                orders.STATUS       = "Draft";
                orders.DISPSTS      = "新建";
                orders.CREATETIME   = DateTime.Now;
                orders.SAMPLENAME   = model.PmPlanSubInfo.GOODS_NAME;
                orders.DEPT         = model.Department.DEPT;
                orders.DIVISIONCODE = model.Division.DIVISIONCODE;
                orders.ISMAKESAMPLE = "N";
                orders.ISPREPARE    = "N";
                orders.ISCHOICE     = "N";
                orders.FOLDERNO     = folders.FOLDERNO;
                orders.MAJORUSRNAM  = mUserInfo.uLoginName;
                orders.PREORDNO     = preoders.PREORDNO;
                var IsOrderExist = _OrderDal.GetOrdersByNo(orders.ORDNO) != null ? true : false;
                if (!IsOrderExist)
                {
                    _OrderDal.SaveOrders(orders);
                }
                #endregion

                _UnitOfWork.CommitTran();
                return(true);
            }
            catch (Exception ex)
            {
                _UnitOfWork.RollbackTran();
                SerilogServer.WriteErrorLog("SaveInspectAcceptance", ex.Message, ex);
                throw ex;
            }
        }
Ejemplo n.º 26
0
        public JObject GetPmInsPectByCode(int iUserId, string iCodeNum)
        {
            try
            {
                #region 参数检测
                iCodeNum.NotAllowNullOrEmpty("抽查批次号");
                int StringLength = iCodeNum.Length;
                (iCodeNum.Length <= 4).ThrowException("抽查批次号格式不正确");
                string mCode = iCodeNum.Substring(0, StringLength - 4).ToUpper();
                string mNum  = iCodeNum.Substring(StringLength - 4);
                #endregion

                #region 获取主表信息
                var mPmPlanSubInfo = _dal.GetPmPlanSubByCode(mCode, mNum);
                mPmPlanSubInfo.NotAllowNull("未查询到抽查任务单信息");
                #endregion

                #region 获得任务信息 ****查询NQI_LIMS********
                ADD_SUPERVISEPLAN mAddSupervisePlan = null;
                mAddSupervisePlan = _AddSuperviserPlanDal.GetSupervisePlanByCode(mCode);
                #endregion

                #region 获取用户部门信息****查询NQI_LIMS********

                var mUserInfo = _SysUserInfoServices.QueryById(iUserId).Result;//用户信息
                mUserInfo.addr.NotAllowNullOrEmpty("部门编号");

                /*
                 * 20200801 没有组织架构,后期要增加,
                 * 临时在adress字段 里面配置用户的部门信息
                 * 格式: DEPT部门编号RY01
                 */

                DIVISIONS   mDivisions   = null;
                DEPARTMENTS mDepartments = null;

                mDepartments = _DepartmentsDal.GetDepartmentsByCode(mUserInfo.addr);
                mDivisions   = _DivisionsDal.GetDivisionsByCode(mDepartments.PARENTDIV);
                #endregion

                #region 任务表
                PM_PLAN mPmPlanInfo = null;
                if (!string.IsNullOrEmpty(mPmPlanSubInfo.PLAN_CODE))
                {
                    mPmPlanInfo = _dal.GetPmPlanByCode(mPmPlanSubInfo.PLAN_CODE);
                }
                else
                {
                    throw new MyException("为查询到对应编号的数据。", data: iCodeNum);
                }
                #endregion

                #region 受检单位信息
                PM_CARY mPmCaryInfo = null;
                if (mPmPlanSubInfo.CARY_ID > 0)
                {
                    mPmCaryInfo = _dal.GetPmCaryById(mPmPlanSubInfo.CARY_ID);
                }

                #endregion

                #region 生产企业信息
                PM_PRODUCE_UNIT mPmProduceUnit = null;
                if (mPmPlanSubInfo.PRO_ID > 0)
                {
                    mPmProduceUnit = _dal.GetPmProduceUnitById(mPmPlanSubInfo.PRO_ID);
                }
                #endregion

                #region 抽样单位信息
                PM_EXEC_UINT mPmExecUintInfo = null;
                if (mPmPlanSubInfo.EXEC_ID > 0)
                {
                    mPmExecUintInfo = _dal.GetPmExecUintById(mPmPlanSubInfo.EXEC_ID);
                }
                #endregion

                #region 网店信息
                PM_EC_PLATFORM mPmEcPlatFormInfo = null;
                if (mPmPlanSubInfo.EC_ID > 0)
                {
                    mPmEcPlatFormInfo = _dal.GetPmEcPlatFormById(mPmPlanSubInfo.EC_ID);
                }
                #endregion

                #region 组装数据
                return(new JObject()
                {
                    { "ID", mPmPlanSubInfo.ID },
                    { "PLAN_CODE", mPmPlanSubInfo.PLAN_CODE },
                    { "LOT_NUM", mPmPlanSubInfo.LOT_NUM },

                    //任务信息
                    { "SupervisePlanInfo", JObject.Parse(JsonConvert.SerializeObject(mAddSupervisePlan)) },
                    //部门信息
                    { "Department", JObject.Parse(JsonConvert.SerializeObject(mDepartments)) },
                    //中心信息
                    { "Division", JObject.Parse(JsonConvert.SerializeObject(mDivisions)) },

                    //抽检数据库的相关表格:
                    { "PmPlanSubInfo", JObject.Parse(JsonConvert.SerializeObject(mPmPlanSubInfo)) },
                    { "PmPlanInfo", mPmPlanInfo != null?JObject.Parse(JsonConvert.SerializeObject(mPmPlanInfo)) : new JObject() },
                    { "PmCaryInfo", mPmCaryInfo != null?JObject.Parse(JsonConvert.SerializeObject(mPmCaryInfo)) : new JObject() },
                    { "PmProduceUnit", mPmProduceUnit != null?JObject.Parse(JsonConvert.SerializeObject(mPmProduceUnit)) : new JObject() },
                    { "PmExecUintInfo", mPmExecUintInfo != null?JObject.Parse(JsonConvert.SerializeObject(mPmExecUintInfo)) : new JObject() },
                    { "PmEcPlatFormInfo", mPmEcPlatFormInfo != null?JObject.Parse(JsonConvert.SerializeObject(mPmEcPlatFormInfo)) : new JObject() },
                });

                #endregion
            }
            catch (Exception ex)
            {
                SerilogServer.WriteErrorLog("GetPmInsPectByCode", ex.Message, ex);
                throw ex;
            }
        }