/// <summary> /// 指定转正提醒日期 /// </summary> /// <param name="employeeCheck"></param> public void EmployeeCheckAlarm(T_HR_EMPLOYEECHECK employeeCheck) { try { SMT.Foundation.Log.Tracer.Debug("调用转正提醒:EmployeeCheckBLL类EmployeeCheckAlarm方法"); string submitName = ""; var ents = from a in dal.GetObjects <T_HR_EMPLOYEE>() where a.EMPLOYEEID == employeeCheck.OWNERID select a; EngineWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); EngineWS.CustomUserMsg userMsg = new EngineWS.CustomUserMsg(); userMsg.FormID = employeeCheck.BEREGULARID; userMsg.UserID = employeeCheck.CREATEUSERID; EngineWS.CustomUserMsg[] List = new EngineWS.CustomUserMsg[1]; List[0] = userMsg; if (ents.Count() > 0) { submitName = ents.FirstOrDefault().EMPLOYEECNAME; } Client.ApplicationMsgTrigger(List, "HR", "T_HR_EMPLOYEECHECK", Utility.ObjListToXml(employeeCheck, "HR", submitName), EngineWS.MsgType.Msg); Client.ApplicationMsgTrigger(List, "HR", "T_HR_EMPLOYEECHECK", Utility.ObjListToXml(employeeCheck, "HR", submitName), EngineWS.MsgType.Task); } catch (Exception ex) { SMT.Foundation.Log.Tracer.Debug("调用EmployeeCheckBLL类EmployeeCheckAlarm方法错误:" + ex.Message); } }
/// <summary> /// 考勤异常提醒消息 /// </summary> /// <param name="employeeCheck"></param> public void AbnormRecordCheckAlarm(string strEmployeeId) { string submitName = string.Empty; string strAttendState = (Convert.ToInt32(Common.AttendanceState.Abnormal) + 1).ToString(); var ents = from a in dal.GetObjects <T_HR_ATTENDANCERECORD>() where a.EMPLOYEEID == strEmployeeId && a.ATTENDANCESTATE == strAttendState select a; if (ents.Count() == 0) { return; } T_HR_ATTENDANCERECORD entTemp = ents.FirstOrDefault(); EngineWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); EngineWS.CustomUserMsg userMsg = new EngineWS.CustomUserMsg(); userMsg.FormID = Guid.NewGuid().ToString(); userMsg.UserID = entTemp.EMPLOYEEID; EngineWS.CustomUserMsg[] List = new EngineWS.CustomUserMsg[1]; List[0] = userMsg; if (ents.Count() > 0) { submitName = ents.FirstOrDefault().EMPLOYEENAME; } Client.ApplicationMsgTrigger(List, "HR", "T_HR_EMPLOYEESIGNINRECORD", Utility.ObjListToXml(entTemp, "HR", submitName), EngineWS.MsgType.Msg); }
/// <summary> /// 对指定发薪日期定时提醒 /// </summary> /// <param name="CreateUserID"></param> /// <returns></returns> public void TimingPay(T_HR_SALARYSOLUTION salarysolution) { string submitName = ""; var ents = from a in dal.GetObjects <T_HR_EMPLOYEE>() where a.EMPLOYEEID == salarysolution.OWNERID select a; EngineWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); EngineWS.CustomUserMsg userMsg = new EngineWS.CustomUserMsg(); userMsg.FormID = Guid.NewGuid().ToString(); userMsg.UserID = salarysolution.CREATEUSERID; EngineWS.CustomUserMsg[] List = new EngineWS.CustomUserMsg[1]; List[0] = userMsg; if (ents.Count() > 0) { submitName = ents.FirstOrDefault().EMPLOYEECNAME; } Client.ApplicationMsgTrigger(List, "HR", "T_HR_SALARYSOLUTION", Utility.ObjListToXml(salarysolution, "HR", submitName), EngineWS.MsgType.Msg); }
/// <summary> /// 员工合同到期提醒 /// </summary> /// <param name="employeeCheck"></param> public void EmployeeContractAlarm(T_HR_EMPLOYEECONTRACT entity) { string submitName = ""; var ents = from a in dal.GetObjects <T_HR_EMPLOYEE>() where a.EMPLOYEEID == entity.OWNERID select a; EngineWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); EngineWS.CustomUserMsg userMsg = new EngineWS.CustomUserMsg(); userMsg.FormID = entity.EMPLOYEECONTACTID; userMsg.UserID = entity.CREATEUSERID; EngineWS.CustomUserMsg[] List = new EngineWS.CustomUserMsg[1]; List[0] = userMsg; if (ents.Count() > 0) { submitName = ents.FirstOrDefault().EMPLOYEECNAME; } SMT.Foundation.Log.Tracer.Debug("合同到期开始调用ApplicationMsgTrigger。ID:" + entity.EMPLOYEECONTACTID); Client.ApplicationMsgTrigger(List, "HR", "T_HR_EMPLOYEECONTRACT", Utility.ObjListToXml(entity, "HR", submitName), EngineWS.MsgType.Task); }
/// <summary> /// 根据传回的XML,添加还款申请信息 /// </summary> /// <param name="eGFunc"></param> /// <returns></returns> private static string RepayApplyAdd(IEnumerable<XElement> eGFunc) { try { if (eGFunc.Count() == 0) { return ""; } string strEmployeeID = string.Empty; string strOwnerID = string.Empty; string strOwnerName = string.Empty; string strOwnerPostID = string.Empty; string strOwnerPostName = string.Empty; string strOwnerDepartmentID = string.Empty; string strOwnerDepartmentName = string.Empty; string strOwnerCompanyID = string.Empty; string strOwnerCompanyName = string.Empty; string strCheckState = string.Empty; string strCreateCompanyID = string.Empty; string strCreateCompanyName = string.Empty; string strCreateDepartmentID = string.Empty; string strCreateDepartmentName = string.Empty; string strCreatePostID = string.Empty; string strCreatePostName = string.Empty; string strCreateID = string.Empty; string strCreateName = string.Empty; string strBorrowMasterID = string.Empty; decimal dBorrowTotal = 0; foreach (var q in eGFunc) { string strName = q.Attribute("Name").Value; switch (strName) { case "CREATEUSERID": strEmployeeID = q.Attribute("Value").Value; break; case "OWNERID": strOwnerID = q.Attribute("Value").Value; break; case "OWNERNAME": strOwnerName = q.Attribute("Value").Value; break; case "OWNERPOSTID": strOwnerPostID = q.Attribute("Value").Value; break; case "OWNERPOSTNAME": strOwnerPostName = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTID": strOwnerDepartmentID = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTNAME": strOwnerDepartmentName = q.Attribute("Value").Value; break; case "OWNERCOMPANYID": strOwnerCompanyID = q.Attribute("Value").Value; break; case "OWNERCOMPANYNAME": strOwnerCompanyName = q.Attribute("Value").Value; break; case "CHECKSTATE": strCheckState = q.Attribute("Value").Value; break; case "CREATEID": strCreateID = q.Attribute("Value").Value; break; case "CREATENAME": strCreateName = q.Attribute("Value").Value; break; case "CREATEPOSTID": strCreatePostID = q.Attribute("Value").Value; break; case "CREATEPOSTNAME": strCreatePostName = q.Attribute("Value").Value; break; case "CREATEDEPARTMENTID": strCreateDepartmentID = q.Attribute("Value").Value; break; case "CREATEDEPARTMENTNAME": strCreateDepartmentName = q.Attribute("Value").Value; break; case "CREATECOMPANYID": strCreateCompanyID = q.Attribute("Value").Value; break; case "CREATECOMPANYNAME": strCreateCompanyName = q.Attribute("Value").Value; break; case "BORROWAPPLYMASTERID": strBorrowMasterID = q.Attribute("Value").Value; break; } } DailyManagementServices doc = new DailyManagementServices(); string employeeid = strEmployeeID.Replace("{", "").Replace("}", ""); T_FB_BORROWAPPLYMASTER borMaster = doc.GetBorrowApplyMasterByID(strBorrowMasterID); T_FB_REPAYAPPLYMASTER entity = new T_FB_REPAYAPPLYMASTER(); entity.REPAYAPPLYMASTERID = Guid.NewGuid().ToString(); entity.CHECKSTATES = 0; entity.CREATECOMPANYID = borMaster.CREATECOMPANYID; entity.CREATECOMPANYNAME = borMaster.CREATECOMPANYNAME; entity.CREATEDATE = DateTime.Now; entity.CREATEDEPARTMENTID = borMaster.CREATEDEPARTMENTID; entity.CREATEDEPARTMENTNAME = borMaster.CREATEDEPARTMENTNAME; entity.CREATEPOSTID = borMaster.CREATEPOSTID; entity.CREATEPOSTNAME = borMaster.CREATEPOSTNAME; entity.CREATEUSERID = borMaster.CREATEUSERID; entity.CREATEUSERNAME = borMaster.CREATEUSERNAME; entity.EDITSTATES = 0; entity.OWNERCOMPANYID = borMaster.OWNERCOMPANYID; entity.OWNERCOMPANYNAME = borMaster.OWNERCOMPANYNAME; entity.OWNERDEPARTMENTID = borMaster.OWNERDEPARTMENTID; entity.OWNERDEPARTMENTNAME = borMaster.OWNERDEPARTMENTNAME; entity.OWNERID = borMaster.OWNERID; entity.OWNERNAME = borMaster.OWNERNAME; entity.OWNERPOSTID = borMaster.OWNERPOSTID; entity.OWNERPOSTNAME = borMaster.OWNERPOSTNAME; entity.PROJECTEDREPAYDATE = DateTime.Now; entity.REMARK = ""; entity.UPDATEDATE = DateTime.Now; entity.UPDATEUSERID = borMaster.UPDATEUSERID; entity.UPDATEUSERNAME = borMaster.UPDATEUSERNAME; entity.REPAYTYPE = borMaster.REPAYTYPE; entity.TOTALMONEY = 0; entity.T_FB_BORROWAPPLYMASTER = borMaster; //从表操作 List<object> masterCode = new List<object>(); masterCode.Add(entity.T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERID); List<T_FB_BORROWAPPLYDETAIL> BorDetail = doc.GetBorrowApplyDetailByMasterID(masterCode); List<T_FB_REPAYAPPLYDETAIL> RepDetail = new List<T_FB_REPAYAPPLYDETAIL>();//还款从表 dBorrowTotal = 0; foreach (var detail in BorDetail) { T_FB_REPAYAPPLYDETAIL RepayDetailInfo = new T_FB_REPAYAPPLYDETAIL(); RepayDetailInfo.REPAYAPPLYDETAILID = Guid.NewGuid().ToString(); RepayDetailInfo.REPAYAPPLYDETAILID = System.Guid.NewGuid().ToString(); RepayDetailInfo.BORROWMONEY = detail.BORROWMONEY; RepayDetailInfo.REMARK = detail.REMARK; RepayDetailInfo.T_FB_SUBJECT = detail.T_FB_SUBJECT; RepayDetailInfo.T_FB_BORROWAPPLYDETAIL = detail; RepayDetailInfo.UPDATEDATE = DateTime.Now; RepayDetailInfo.CREATEDATE = DateTime.Now; RepayDetailInfo.T_FB_REPAYAPPLYMASTER = entity; RepayDetailInfo.CREATEUSERID = detail.CREATEUSERID; RepayDetailInfo.UPDATEUSERID = detail.UPDATEUSERID; RepayDetailInfo.CHARGETYPE = 1; RepayDetailInfo.REPAYMONEY = 0; RepayDetailInfo.CREATEDATE = DateTime.Now; dBorrowTotal += detail.BORROWMONEY; RepDetail.Add(RepayDetailInfo); } entity.BRORROWEDMONEY = dBorrowTotal; string strRepayCode = string.Empty, strMsg = string.Empty; doc.AddRepayApplyMasterAndDetail(entity, RepDetail); SMT.SaaS.BLLCommonServices.EngineConfigWS.EngineWcfGlobalFunctionClient Client = new EngineWS.EngineWcfGlobalFunctionClient(); EngineWS.CustomUserMsg[] user = new EngineWS.CustomUserMsg[1]; user[0] = new EngineWS.CustomUserMsg() { UserID = entity.OWNERID, FormID = entity.REPAYAPPLYMASTERID }; Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("BORROWAPPLYMASTERID", borMaster.BORROWAPPLYMASTERID); Client.ApplicationMsgTrigger(user, "FB", "T_FB_REPAYAPPLYMASTER", Utility.ObjListToXml<T_FB_REPAYAPPLYMASTER>(entity, "FB", null), EngineWS.MsgType.Task); return entity.REPAYAPPLYMASTERID; } catch (Exception e) { string abc = "<FB>Message=[" + e.Message + "]" + "<FB>Source=[" + e.Source + "]<FB>StackTrace=[" + e.StackTrace + "]<FB>TargetSite=[" + e.TargetSite + "]"; Tracer.Debug(abc); return abc; } }