/// <summary> /// 提交审稿单 /// </summary> /// <param name="auditBillEntity"></param> /// <returns></returns> public bool SubmitAuditBill(AuditBillEntity auditBillEntity) { bool flag = false; // 得到审稿操作信息 FlowActionQuery actionQuery = new FlowActionQuery(); actionQuery.ActionID = auditBillEntity.ActionID; actionQuery.JournalID = auditBillEntity.JournalID; FlowActionEntity actionEntity = new FlowActionService().GetFlowActionEntity(actionQuery); // 得到审稿状态及配置信息 FlowStatusQuery flowStatusQuery = new FlowStatusQuery(); flowStatusQuery.JournalID = auditBillEntity.JournalID; flowStatusQuery.StatusID = actionEntity == null ? 0 : actionEntity.StatusID; FlowStep flowStep = new FlowStatusService().GetFlowStep(flowStatusQuery); //得到稿件信息 ContributionInfoEntity contributionInfoEntity = new ContributionInfoEntity(); ContributionInfoQuery query = new ContributionInfoQuery(); query.JournalID = auditBillEntity.JournalID; query.CID = auditBillEntity.CID; ContributionInfoService service = new ContributionInfoService(); contributionInfoEntity = service.GetContributionInfo(query); if (contributionInfoEntity.AuthorID == Convert.ToInt64(auditBillEntity.ReveiverList.Split(',')[0])) { auditBillEntity.ReveiverList = contributionInfoEntity.AuthorID.ToString(); flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity); } else { flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity); } if (flag) { if (flowStep.FlowConfig != null) { if (flowStep.FlowConfig.IsEmailRemind) { /// TODO:记录定期发送邮件的任务 } if (flowStep.FlowConfig.IsSMSRemind) { /// TODO:记录定期发送短信的任务 } } } return(flag); }
/// <summary> /// 组装数据 /// </summary> /// <param name="list"></param> /// <returns></returns> private List <MessageRecodeEntity> GetMsgList(List <MessageRecodeEntity> list, MessageRecodeQuery mQuery) { if (list == null || list.Count == 0) { return(list); } AuthorInfoService service = new AuthorInfoService(); AuthorInfoEntity entity = new AuthorInfoEntity(); AuthorInfoQuery query = new AuthorInfoQuery(); query.JournalID = mQuery.JournalID; var dict = service.AuthorInfoBusProvider.GetAuthorDict(query); //获取稿件作者数据字典 ContributionInfoService cservice = new ContributionInfoService(); ContributionInfoEntity centity = new ContributionInfoEntity(); ContributionInfoQuery cquery = new ContributionInfoQuery(); cquery.JournalID = mQuery.JournalID; cquery.CID = (long)mQuery.CID; var cdict = cservice.GetContributionAuthorDict(cquery); centity = cservice.GetContributionInfo(cquery); foreach (var mode in list) { mode.SendUserName = dict.GetValue(mode.SendUser, mode.SendUser.ToString()); entity = service.GetAuthorInfo(mode.ReciveUser); if (entity != null) { mode.ReciveUserName = dict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString()); } else { mode.ReciveUserName = cdict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString()); } } return(list); }
/// <summary> /// 提交审稿单 /// </summary> /// <param name="auditBillEntity"></param> /// <returns></returns> public bool SubmitAuditBill(AuditBillEntity auditBillEntity) { bool flag = false; // 得到审稿操作信息 FlowActionQuery actionQuery = new FlowActionQuery(); actionQuery.ActionID = auditBillEntity.ActionID; actionQuery.JournalID = auditBillEntity.JournalID; FlowActionEntity actionEntity = new FlowActionService().GetFlowActionEntity(actionQuery); // 得到审稿状态及配置信息 FlowStatusQuery flowStatusQuery = new FlowStatusQuery(); flowStatusQuery.JournalID = auditBillEntity.JournalID; flowStatusQuery.StatusID = actionEntity == null ? 0 : actionEntity.StatusID; FlowStep flowStep = new FlowStatusService().GetFlowStep(flowStatusQuery); //得到稿件信息 ContributionInfoEntity contributionInfoEntity = new ContributionInfoEntity(); ContributionInfoQuery query = new ContributionInfoQuery(); query.JournalID = auditBillEntity.JournalID; query.CID = auditBillEntity.CID; ContributionInfoService service = new ContributionInfoService(); contributionInfoEntity=service.GetContributionInfo(query); if (contributionInfoEntity.AuthorID == Convert.ToInt64(auditBillEntity.ReveiverList.Split(',')[0])) { auditBillEntity.ReveiverList = contributionInfoEntity.AuthorID.ToString(); flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity); } else flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity); if (flag) { if (flowStep.FlowConfig != null) { if (flowStep.FlowConfig.IsEmailRemind) { /// TODO:记录定期发送邮件的任务 } if (flowStep.FlowConfig.IsSMSRemind) { /// TODO:记录定期发送短信的任务 } } } return flag; }
/// <summary> /// 组装数据 /// </summary> /// <param name="list"></param> /// <returns></returns> private List<MessageRecodeEntity> GetMsgList(List<MessageRecodeEntity> list, MessageRecodeQuery mQuery) { if (list == null || list.Count == 0) return list; AuthorInfoService service = new AuthorInfoService(); AuthorInfoEntity entity = new AuthorInfoEntity(); AuthorInfoQuery query = new AuthorInfoQuery(); query.JournalID = mQuery.JournalID; var dict = service.AuthorInfoBusProvider.GetAuthorDict(query); //获取稿件作者数据字典 ContributionInfoService cservice = new ContributionInfoService(); ContributionInfoEntity centity = new ContributionInfoEntity(); ContributionInfoQuery cquery = new ContributionInfoQuery(); cquery.JournalID = mQuery.JournalID; cquery.CID = (long)mQuery.CID; var cdict = cservice.GetContributionAuthorDict(cquery); centity = cservice.GetContributionInfo(cquery); foreach (var mode in list) { mode.SendUserName = dict.GetValue(mode.SendUser, mode.SendUser.ToString()); entity = service.GetAuthorInfo(mode.ReciveUser); if(entity!=null) mode.ReciveUserName = dict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString()); else mode.ReciveUserName = cdict.GetValue(mode.ReciveUser, mode.ReciveUser.ToString()); } return list; }