Ejemplo n.º 1
0
        public override void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
        {
            var sql = string.Empty;

            if (queueData.SynType == SynType.Save.ToString())
            {
                var responseData = JsonHelper.ToObject(responseDataStr);
                var synID        = responseData.GetValue("ID");
                var synData      = JsonHelper.ToObject <BaseEnumRequestData>(queueData.RequestData);
                if (synID == synData.id)
                {
                    synID = string.Empty;
                }
                sql = @"if exists(select 1 from S_A_BaseEnum where ID='{0}' or SynID='{0}')
                                update S_A_BaseEnum set Code = '{1}', Name='{2}', SynTime='{6}',SynData='{7}' where ID='{0}' or SynID='{0}'
                            else
	                            insert into S_A_BaseEnum(ID,Code,Name,State,Type,SynID,SynTime,SynData) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')"    ;
                sql = string.Format(sql, queueData.RelateID, synData.code, synData.name.Replace("'", "''"), DataState.Normal.ToString(), queueData.RelateType,
                                    synID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), queueData.RequestData.Replace("'", "''"));
            }
            else if (queueData.SynType == SynType.Remove.ToString())
            {
                sql = "update S_A_BaseEnum set State='" + DataState.Deleted.ToString() + "' where id='" + queueData.RelateID + "'";
            }
            interfaceSb.AppendLine(sql);
        }
Ejemplo n.º 2
0
        public override void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
        {
            var sql = string.Empty;

            if (queueData.SynType == SynType.Save.ToString())
            {
                var responseData = JsonHelper.ToObject(responseDataStr);
                sql = @"if exists(select 1 from S_P_MileStone where ID='{0}')
                                update S_P_MileStone set Type = '{1}', Name='{2}', SynTime='{5}',SynData='{6}' where ID='{0}'
                            else
	                            insert into S_P_MileStone(ID,Type,Name,State,SynID,SynTime,SynData,ProjectInfoID) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')"    ;
                if (queueData.RelateType.ToLower() == "major")
                {
                    var synData = JsonHelper.ToObject <PlanRequestData>(queueData.RequestData);
                    sql = string.Format(sql, queueData.RelateID, queueData.RelateType, synData.name.Replace("'", "''"), DataState.Normal.ToString(), ""
                                        , DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), queueData.RequestData.Replace("'", "''"), synData.projectId);
                }
                else
                {
                    var synData = JsonHelper.ToObject <ExchangeRequestData>(queueData.RequestData);
                    sql = string.Format(sql, queueData.RelateID, queueData.RelateType, synData.name.Replace("'", "''"), DataState.Normal.ToString(), ""
                                        , DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), queueData.RequestData.Replace("'", "''"), synData.projectId);
                }
            }
            else if (queueData.SynType == SynType.Remove.ToString())
            {
                sql = "update S_P_MileStone set State='" + DataState.Deleted.ToString() + "' where id='" + queueData.RelateID + "'";
            }
            interfaceSb.AppendLine(sql);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 接口正常返回处理
 /// </summary>
 /// <param name="queueData"></param>
 private void ComplateSync(I_DataSynQueue queueData, StringBuilder interfaceSb)
 {
     queueData.SynTime = DateTime.Now;
     interfaceSb.AppendLine(@" delete from I_DataSynQueue where ID='" + queueData.ID.ToString() + "'");
     if (interfaceSb.Length > 0)
     {
         this.SQLHelperInterface.ExecuteNonQuery(interfaceSb.ToString());
     }
 }
Ejemplo n.º 4
0
        public override bool ValidateRequeset(I_DataSynQueue queueData)
        {
            if (queueData.SynType == SynType.Remove.ToString())
            {
                return(true);
            }
            //判断文件夹是否存在,不存在文件夹不同步数据
            var synData = JsonHelper.ToObject <InputDocumentRequestData>(queueData.RequestData);
            var folder  = this.SQLHelperInterface.ExecuteObject <S_D_Input>("select * from S_D_Input where id='" + synData.folderId + "'");

            return(folder != null);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 接口错误处理
        /// </summary>
        /// <param name="queueData"></param>
        /// <param name="msg"></param>
        private void ErrorSync(I_DataSynQueue queueData, string msg)
        {
            queueData.SynState = SynState.Error.ToString();
            queueData.SynTime  = DateTime.Now;
            queueData.ErrorMsg = msg;
            if (string.IsNullOrEmpty(queueData.Response))
            {
                queueData.Response = string.Empty;
            }
            string sql = @" update I_DataSynQueue set SynTime = '{1}', Response='{2}',ErrorMsg='{3}' ,SynState='{4}' 
                where ID='{0}'";

            sql = string.Format(sql, queueData.ID.ToString(), queueData.SynTime.Value.ToString("yyyy-MM-dd HH:mm:ss")
                                , queueData.Response.Replace("'", "''"), queueData.ErrorMsg.Replace("'", "''"), queueData.SynState.ToString());
            this.SQLHelperInterface.ExecuteNonQuery(sql);
        }
Ejemplo n.º 6
0
 public override void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
 {
     if (queueData.SynType == SynType.Save.ToString())
     {
         var responseData = JsonHelper.ToObject(responseDataStr);
         var synData      = JsonHelper.ToObject <DesignInputRequestData>(queueData.RequestData);
         var sql          = createDesignInputString(synData, synData.ProjectInfoID, queueData.RelateType, queueData.RequestData.Replace("'", "''"));
         interfaceSb.AppendLine(sql);
     }
     else if (queueData.SynType == SynType.BatchSave.ToString())
     {
         var synData = JsonHelper.ToObject <DesignInputBatchRequestData>(queueData.RequestData);
         reccreateDesignInputString(interfaceSb, synData.folders, synData.parentId);
     }
     else if (queueData.SynType == SynType.Remove.ToString())
     {
         var delsql = "update S_D_Input set State='" + DataState.Deleted.ToString() + "' where id='" + queueData.RelateID + "'";
         interfaceSb.AppendLine(delsql);
     }
 }
Ejemplo n.º 7
0
        //校审意见库
        public override void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
        {
            var sql = string.Empty;

            if (queueData.SynType == SynType.Save.ToString())
            {
                var synData = JsonHelper.ToObject <AuditAdviceRequestData>(queueData.RequestData);
                sql = @"if exists(select 1 from S_AE_AuditAdvice where ID='{0}')
                                update S_AE_AuditAdvice set Name='{1}', SynTime='{4}',SynData='{5}' where ID='{0}'
                            else
                                insert into S_AE_AuditAdvice(ID,Name,State,SynID,SynTime,SynData) values ('{0}','{1}','{2}','{3}','{4}','{5}')";
                sql = string.Format(sql, queueData.RelateID, synData.content.Replace("'", "''"), DataState.Normal.ToString(), ""
                                    , DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), queueData.RequestData.Replace("'", "''"));
            }
            else if (queueData.SynType == SynType.Remove.ToString())
            {
                sql = "update S_AE_AuditAdvice set State='" + DataState.Deleted.ToString() + "' where id='" + queueData.RelateID + "'";
            }
            interfaceSb.AppendLine(sql);
        }
Ejemplo n.º 8
0
        public override void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
        {
            var sql = string.Empty;

            if (queueData.SynType == SynType.Save.ToString())
            {
                var responseData = JsonHelper.ToObject(responseDataStr);
                var synID        = responseData.GetValue("ID");
                var synData      = JsonHelper.ToObject <AuditAdviceCatalogRequestData>(queueData.RequestData);
                if (synID == synData.id)
                {
                    synID = string.Empty;
                }
                sql = @"insert into S_AE_AuditAdviceCatalog(ID,MajorCode,Name,State,SynID,SynTime,SynData) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')";
                sql = string.Format(sql, queueData.RelateID, synData.specialtyCode, synData.title.Replace("'", "''"), DataState.Normal.ToString(),
                                    synID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), queueData.RequestData.Replace("'", "''"));
            }
            else if (queueData.SynType == SynType.Remove.ToString())
            {
                sql = "update S_AE_AuditAdviceCatalog set State='" + DataState.Deleted.ToString() + "' where id='" + queueData.RelateID + "'";
            }
            interfaceSb.AppendLine(sql);
        }
Ejemplo n.º 9
0
 public virtual void ExecuteQueueLogic(I_DataSynQueue queueData, string responseDataStr, StringBuilder interfaceSb)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public virtual bool ValidateRequeset(I_DataSynQueue queueData)
 {
     return(true);
 }