LR-20210131IOQH\Administrator
2021-06-25 ac4f98f9d24552d1c43935f20a969a2fda0723f0
zhengcaioa/Services/UserService.cs
@@ -84,13 +84,21 @@
                    return resultEntity;
                }
                var checkNumber = _context.PltUsers.Where(x => x.Usernumber == pltUserDTO.Usernumber && x.RecStatus == "A" && x.Id != pltUserDTO.Id).FirstOrDefault();
                if (checkNumber != null && (string.IsNullOrWhiteSpace(pltUserDTO.Id) || (!string.IsNullOrWhiteSpace(pltUserDTO.Id) && checkNumber.Id != pltUserDTO.Id)))
                {
                    resultEntity.Result = false;
                    resultEntity.Message = "工号重复";
                    return resultEntity;
                }
                var checkPhone = _context.PltUsers.Where(x => x.Phone == pltUserDTO.Phone && x.RecStatus == "A" && x.Id != pltUserDTO.Id).FirstOrDefault();
                if (checkPhone != null && (string.IsNullOrWhiteSpace(pltUserDTO.Id) || (!string.IsNullOrWhiteSpace(pltUserDTO.Id) && checkPhone.Id != pltUserDTO.Id)))
                {
                    resultEntity.Result = false;
                    resultEntity.Message = "用户手机号重复";
                    return resultEntity;
                }
                }
                var checkIdcard = _context.PltUsers.Where(x => x.Idcard == pltUserDTO.Idcard && x.RecStatus == "A" && x.Id != pltUserDTO.Id).FirstOrDefault();
                if (checkIdcard != null && (string.IsNullOrWhiteSpace(pltUserDTO.Id) || (!string.IsNullOrWhiteSpace(pltUserDTO.Id) && checkIdcard.Id != pltUserDTO.Id)))
@@ -99,7 +107,6 @@
                    resultEntity.Message = "用户身份证号重复";
                    return resultEntity;
                }
                var pltUser = _mapper.Map<PltUser>(pltUserDTO);
                if (String.IsNullOrEmpty(pltUser.Id))
@@ -169,6 +176,19 @@
                    updatepltUser.JzYoubian = pltUser.JzYoubian;
                    updatepltUser.HjYoubian = pltUser.HjYoubian;
                    updatepltUser.IpMac = pltUser.IpMac;
                    updatepltUser.Iswdenter = pltUser.Iswdenter;
                    updatepltUser.Isxmenter = pltUser.Isxmenter;
                    updatepltUser.Usernumber = pltUser.Usernumber;
                    updatepltUser.advancewages = pltUser.advancewages;
                    updatepltUser.miniyearsalary = pltUser.miniyearsalary;
                    updatepltUser.senioritywages = pltUser.senioritywages;
                    updatepltUser.Istravelsubsidy = pltUser.Istravelsubsidy;
                    updatepltUser.Beizhu = pltUser.Beizhu;
                    updatepltUser.baomisalary = pltUser.baomisalary;
                    updatepltUser.jibensalary = pltUser.jibensalary;
                    updatepltUser.jintiesalary = pltUser.jintiesalary;
                    updatepltUser.geshuiqizheng = pltUser.geshuiqizheng;
                }
                _context.SaveChanges();
@@ -246,7 +266,10 @@
                         into fsssss
                         from fff in fsssss.DefaultIfEmpty()
                         join h in listCode.Where(x => x.CodeTable == "system" && x.CodeField == "shifou")
                        on a.Istravelsubsidy equals h.CodeSn
                        into hsssss
                         from hhh in hsssss.DefaultIfEmpty()
                         where a.RecStatus == "A"
@@ -261,6 +284,7 @@
                                      && (string.IsNullOrWhiteSpace(searchEntity.Phone) || a.Phone.Contains(searchEntity.Phone.Trim()))
                                       && (string.IsNullOrWhiteSpace(searchEntity.Zhiwustatus) || a.Zhiwustatus == searchEntity.Zhiwustatus.Trim())
                                        && (string.IsNullOrWhiteSpace(searchEntity.Usernumber) || a.Usernumber == searchEntity.Usernumber.Trim())
                         //select a
                         select new PltUserDTO
                         {
@@ -289,9 +313,31 @@
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
                             UserSn = a.UserSn,
                             Coler = (a.IsQdht!="A"?"red":((!a.Shebaodate.HasValue) && (a.IsGmsb != "D")? "Darkorange" : ""))
                             Coler = (a.IsQdht!="A"?"red":((!a.Shebaodate.HasValue) && (a.IsGmsb != "D")? "Darkorange" : "")),
                             IpMac = a.IpMac,
                             Iswdenter = a.Iswdenter,
                             Isxmenter = a.Isxmenter,
                             Usernumber = a.Usernumber,
                             advancewages = a.advancewages,
                             miniyearsalary = a.miniyearsalary,
                             senioritywages = a.senioritywages,
                             Istravelsubsidy = a.Istravelsubsidy,
                             Beizhu = a.Beizhu,
                             IstravelsubsidyName = hhh.Comments,
                             advancewagesName = a.advancewages.HasValue ? a.advancewages.Value.ToString("F2") : "",
                             miniyearsalaryName =   a.miniyearsalary.HasValue ? a.miniyearsalary.Value.ToString("F2") : "",
                             senioritywagesName =   a.senioritywages.HasValue ? a.senioritywages.Value.ToString("F2") : "",
                             jibensalary = a.jibensalary,
                             baomisalary = a.baomisalary,
                             jintiesalary = a.jintiesalary,
                             jibensalaryName = a.jibensalary.HasValue ? a.jibensalary.Value.ToString("F2") : "",
                             baomisalaryName = a.baomisalary.HasValue ? a.baomisalary.Value.ToString("F2") : "",
                             jintiesalaryName = a.jintiesalary.HasValue ? a.jintiesalary.Value.ToString("F2") : "",
                             geshuiqizheng = a.geshuiqizheng,
                             geshuiqizhengName = a.geshuiqizheng.HasValue ? a.geshuiqizheng.Value.ToString("F2") : "",
                         }
              ).OrderBy(x => x.UserSn).ToList();
              ).OrderBy(x => x.Usernumber).ToList();