| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql1 = string.Format(@"select * from h_v_IF_EmployeeList where 组织名称='" + Organization + "'"); |
| | | //string sql1 = string.Format(@"select * from h_v_IF_EmployeeList where 组织名称='" + Organization + "'"); |
| | | string sql1 = string.Format(@"select * from h_v_IF_EmployeeList where 1=1 "); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere, "h_v_IF_EmployeeList"); |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region 职员 树形图 |
| | | public class TreeModel |
| | | { |
| | | public string id { get; set; } |
| | | public string title { get; set; } |
| | | public List<TreeModel> children = new List<TreeModel>(); |
| | | } |
| | | [Route("Gy_Employee/Gy_EmployeeTreeList")] |
| | | [HttpGet] |
| | | public object Gy_SourceTreeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format("select hitemid,hnumber,hname,HUSEORGID from Gy_Employee" + sWhere + " order by hnumber"); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Employee"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | | first.id = "0"; |
| | | first.title = "职员设置"; |
| | | treeModels.Add(first); |
| | | |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | var strLen = row["hitemid"].ToString().Split('.'); |
| | | if (strLen.Length == 1) |
| | | { |
| | | TreeModel tree = new TreeModel(); |
| | | tree.id = row["hitemid"].ToString(); |
| | | tree.title = row["hname"].ToString(); |
| | | treeModels[0].children.Add(tree); |
| | | } |
| | | } |
| | | digui(ds.Tables[0], treeModels[0].children, 2); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 递归函数 |
| | | /// </summary> |
| | | public void digui(DataTable dt, List<TreeModel> tree, int num) |
| | | { |
| | | for (int m = 0; m < tree.Count; m++) |
| | | { |
| | | tree[m].children = new List<TreeModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++)//第一次循环,得到所有根节点的子集 |
| | | { |
| | | var strLen = dt.Rows[i]["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + ".")) |
| | | { |
| | | TreeModel tbjson = new TreeModel(); |
| | | tbjson.id = dt.Rows[i]["hitemid"].ToString(); |
| | | tbjson.title = dt.Rows[i]["hname"].ToString(); |
| | | tree[m].children.Add(tbjson); |
| | | } |
| | | } |
| | | var strLens = tree[m].id.Split('.'); |
| | | for (int i = 0; i < tree[m].children.Count; i++) |
| | | { |
| | | digui(dt, tree[m].children, strLens.Length + 2);//再次用子集去循环,拿出子集的子集 |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | ///// <summary> |
| | | ///// 新增职员-保存按钮 |
| | |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | { |
| | | DAL.ClsGy_Employee_Ctl oDept = new DAL.ClsGy_Employee_Ctl(); |
| | | DAL.ClsGy_Employee_View oDeptHlp = new DAL.ClsGy_Employee_View(); |
| | | |
| | |
| | | string msg4 = sArray[2].ToString(); |
| | | //string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | |
| | | oCN.BeginTran(); |
| | | //编辑权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_Employee_Edit", 1, false, msg3)) |
| | | { |
| | |
| | | long HCTPrjID = list[0].HCTPrjID; |
| | | long HProcID = list[0].HProcID; |
| | | string HBasePay = list[0].HBasePay; |
| | | DateTime HInComDate = list[0].HInComDate; //进厂日期 |
| | | DateTime HDimissionDate = list[0].HDimissionDate; //离职日期 (允许NULL) |
| | | DateTime HInComDate = list[0].HInComDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HInComDate.Value; //进厂日期 |
| | | DateTime HDimissionDate = list[0].HDimissionDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HDimissionDate.Value; //离职日期 (允许NULL) |
| | | bool HOverType = list[0].HOverType; |
| | | string HEmpType = list[0].HEmpType; |
| | | string HOtherDeduct3 = list[0].HOtherDeduct3; |
| | |
| | | string HDimissionReason = list[0].HDimissionReason; |
| | | long HDormID = list[0].HDormID; |
| | | string HArchivesNo = list[0].HArchivesNo; |
| | | DateTime HStayCardEDate = list[0].HStayCardEDate; //暂住证到期日 |
| | | DateTime HStayCardEDate = list[0].HStayCardEDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HStayCardEDate.Value; //暂住证到期日 |
| | | DateTime HCheckCardEDate = Convert.ToDateTime("1900/1/1"); //审检证到期日 |
| | | string HJobCardNo = list[0].HJobCardNo ?? ""; |
| | | DateTime HJobCardEDate = Convert.ToDateTime("1900/1/1"); //就业证到期日 |
| | | string HWorkType = list[0].HWorkType; |
| | | long HContractYear = list[0].HContractYear; |
| | | DateTime HContractBDate = list[0].HContractBDate; //合同开始日 |
| | | DateTime HContractEDate = list[0].HContractEDate; //合同到期日 |
| | | DateTime HContractBDate = list[0].HContractBDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HContractBDate.Value; //合同开始日 |
| | | DateTime HContractEDate = list[0].HContractEDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HContractEDate.Value; //合同到期日 |
| | | string HInsuranceNo = list[0].HInsuranceNo; |
| | | DateTime HInsuranceDate = list[0].HInsuranceDate; //参保日期 |
| | | DateTime HInsuranceDate = list[0].HInsuranceDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HInsuranceDate.Value; //参保日期 |
| | | bool HInsuranceStatus = list[0].HInsuranceStatus; |
| | | DateTime HSignDate = Convert.ToDateTime("1900/1/1"); //签约日期 |
| | | bool HSignStatus = list[0].HSignStatus; |
| | |
| | | string HSpec = list[0].HSpec ?? ""; |
| | | string HCompLev = list[0].HCompLev ?? ""; |
| | | string HEngLev = list[0].HEngLev ?? ""; |
| | | DateTime HGradDate = list[0].HGradDate; //毕业日期 |
| | | DateTime HGradDate = list[0].HGradDate == null ? Convert.ToDateTime("1900/1/1") : list[0].HGradDate.Value; //毕业日期 |
| | | string HGradSchool = list[0].HGradSchool ?? ""; |
| | | string HSalaryLev = list[0].HSalaryLev ?? ""; |
| | | long HDutyID = list[0].HDutyID; |
| | |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //查询数据中是否存在重复代码 |
| | | ds = oCN.RunProcReturn("Select HItemID from Gy_Employee Where HItemID<>" + HItemID + " and HNumber='" + HNumber + "' and HUSEORGID=" + HUSEORGID, "Gy_Warehouse"); |
| | | |
| | |
| | | //保存完毕后处理 |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | oCN.RunProc("Insert into Gy_Employee (" + |
| | | "HNumber,HName,HShortNumber,HEmpRate,HExamRate" + |
| | | ",HLevel,HParentID,HEndflag,HHighestPay,HOverPayRate" + |
| | |
| | | } |
| | | LogService.Write(sql3); |
| | | oCN.RunProcReturn(sql3, "Gy_Employee_Post"); |
| | | oCN.Commit(); |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | |
| | | //已审核不允许修改 |
| | | DataSet dss; |
| | | dss = oCN.RunProcReturn("select * from Gy_Employee where HItemID=" + HItemID, "Gy_Employee"); |
| | |
| | | } |
| | | LogService.Write(sql3); |
| | | oCN.RunProcReturn(sql3, "Gy_WorkCenterSub"); |
| | | oCN.Commit(); |
| | | |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.Message; |
| | |
| | | ,HPostalCode,HBank,HBasePay,HExamLevPostMoney,HBSTDeptID |
| | | ,HOtherDeduct3,HInsurance,HMedicare,HDrydock |
| | | ,HBankAccount,HGroupID,HDeptID,HWorkTypeID,HCTPrjID,HUSEORGID,HAddress) |
| | | values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HShortNumber}',{lsmain[0].HEmpRate},{lsmain[0].HExamRate},{lsmain[0].HLevel},{lsmain[0].HParentID},{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{lsmain[0].HHighestPay},{lsmain[0].HOverPayRate},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}','{lsmain[0].HHelpCode}',{lsmain[0].HInsuranceSubsidy},'{lsmain[0].HBirthDay}','{lsmain[0].HGradDate}','{lsmain[0].HInsuranceDate}','{lsmain[0].HContractBDate}','{lsmain[0].HContractEDate}','{lsmain[0].HJobCardEDate}','{lsmain[0].HCheckCardEDate}','{lsmain[0].HStayCardEDate}','{lsmain[0].HHealthCardEDate}',{lsmain[0].HAge},'{lsmain[0].HSalaryLev}',{lsmain[0].HContractYear},{lsmain[0].HInsuranceStatus},{lsmain[0].HSignStatus},'{lsmain[0].HSex}','{lsmain[0].HMarr}','{lsmain[0].HBlighty}','{lsmain[0].HNation}','{lsmain[0].HBlightyType}','{lsmain[0].HGovStatus}','{lsmain[0].HBloodType}','{lsmain[0].HStature}','{lsmain[0].HAvoird}','{lsmain[0].HKnowLev}','{lsmain[0].HProTitleID}','{lsmain[0].HGradSchool}','{lsmain[0].HEngLev}','{lsmain[0].HCompLev}','{lsmain[0].HSpec}','{lsmain[0].HEmail}','{lsmain[0].HNowAdd}','{lsmain[0].HHomeAdd}','{lsmain[0].HIDCard}','{lsmain[0].HLinkPhone}','{lsmain[0].HMobilePhone}','{lsmain[0].HFax}','{lsmain[0].HOldCompany}','{lsmain[0].HInsuranceNo}','{lsmain[0].HJobCardNo}','{lsmain[0].HArchivesNo}','{lsmain[0].HWorkType}','{lsmain[0].HDimissionReason}','{lsmain[0].HDimissionDate}','{lsmain[0].HInComDate}','{lsmain[0].HSignDate}','{lsmain[0].HRelDate}',{lsmain[0].HPostID},{lsmain[0].HDormID},{lsmain[0].HDutyID},{lsmain[0].HLeftMoneyRate},'{lsmain[0].HEmpType}','{lsmain[0].HPayType}','{lsmain[0].HOverType}',{lsmain[0].HNoBrushFlag},{lsmain[0].HShiftFlag},{lsmain[0].HStopwagesFlag},'{lsmain[0].HPostalCode}','{lsmain[0].HBank}',{lsmain[0].HBasePay},{lsmain[0].HExamLevPostMoney},{lsmain[0].HBSTDeptID},{lsmain[0].HOtherDeduct3},{lsmain[0].HInsurance},{lsmain[0].HMedicare},{lsmain[0].HDrydock},'{lsmain[0].HBankAccount}',{lsmain[0].HGroupID},{lsmain[0].HDeptID},{lsmain[0].HWorkTypeID},{lsmain[0].HCTPrjID},{lsmain[0].HUSEORGID},'{lsmain[0].HAddress}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | values('{lsmain[0].HItemID}','{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HShortNumber}','{lsmain[0].HEmpRate}','{lsmain[0].HExamRate}','{lsmain[0].HLevel}','{lsmain[0].HParentID}','{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)}','{lsmain[0].HHighestPay}','{lsmain[0].HOverPayRate}','{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) }','{lsmain[0].HRemark}','{lsmain[0].HHelpCode}','{lsmain[0].HInsuranceSubsidy}','{lsmain[0].HBirthDay}','{lsmain[0].HGradDate}','{lsmain[0].HInsuranceDate}','{lsmain[0].HContractBDate}','{lsmain[0].HContractEDate}','{lsmain[0].HJobCardEDate}','{lsmain[0].HCheckCardEDate}','{lsmain[0].HStayCardEDate}','{lsmain[0].HHealthCardEDate}','{lsmain[0].HAge}','{lsmain[0].HSalaryLev}','{lsmain[0].HContractYear}','{lsmain[0].HInsuranceStatus}','{lsmain[0].HSignStatus}','{lsmain[0].HSex}','{lsmain[0].HMarr}','{lsmain[0].HBlighty}','{lsmain[0].HNation}','{lsmain[0].HBlightyType}','{lsmain[0].HGovStatus}','{lsmain[0].HBloodType}','{lsmain[0].HStature}','{lsmain[0].HAvoird}','{lsmain[0].HKnowLev}','{lsmain[0].HProTitleID}','{lsmain[0].HGradSchool}','{lsmain[0].HEngLev}','{lsmain[0].HCompLev}','{lsmain[0].HSpec}','{lsmain[0].HEmail}','{lsmain[0].HNowAdd}','{lsmain[0].HHomeAdd}','{lsmain[0].HIDCard}','{lsmain[0].HLinkPhone}','{lsmain[0].HMobilePhone}','{lsmain[0].HFax}','{lsmain[0].HOldCompany}','{lsmain[0].HInsuranceNo}','{lsmain[0].HJobCardNo}','{lsmain[0].HArchivesNo}','{lsmain[0].HWorkType}','{lsmain[0].HDimissionReason}','{lsmain[0].HDimissionDate}','{lsmain[0].HInComDate}','{lsmain[0].HSignDate}','{lsmain[0].HRelDate}','{lsmain[0].HPostID}','{lsmain[0].HDormID}','{lsmain[0].HDutyID}','{lsmain[0].HLeftMoneyRate}','{lsmain[0].HEmpType}','{lsmain[0].HPayType}','{lsmain[0].HOverType}','{lsmain[0].HNoBrushFlag}','{lsmain[0].HShiftFlag}','{lsmain[0].HStopwagesFlag}','{lsmain[0].HPostalCode}','{lsmain[0].HBank}','{lsmain[0].HBasePay}','{lsmain[0].HExamLevPostMoney}','{lsmain[0].HBSTDeptID}','{lsmain[0].HOtherDeduct3}','{lsmain[0].HInsurance}','{lsmain[0].HMedicare}','{lsmain[0].HDrydock}','{lsmain[0].HBankAccount}','{lsmain[0].HGroupID}','{lsmain[0].HDeptID}','{lsmain[0].HWorkTypeID}','{lsmain[0].HCTPrjID}','{lsmain[0].HUSEORGID}','{lsmain[0].HAddress}')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改上级为非末级代码 |
| | | sql = "set identity_insert Gy_Employee off"; |
| | | oCN.RunProc(sql); |