bug修复
parent
cd627d7b2a
commit
4f5bd67a47
|
@ -8,7 +8,7 @@ import java.util.List;
|
|||
|
||||
|
||||
public interface AdminRepository extends JpaRepository<Admin, Integer> {
|
||||
@Query("from Admin where isDeleted=0 AND enabled=1 AND userName=?1")
|
||||
@Query("from Admin where isDeleted=0 AND userName=?1")
|
||||
Admin getAdminByUsername(String username);
|
||||
|
||||
@Query("from Admin where isDeleted=0 AND enabled=1 AND userName=?1")
|
||||
|
@ -35,6 +35,9 @@ public interface AdminRepository extends JpaRepository<Admin, Integer> {
|
|||
@Query("from Admin where isDeleted=0 AND telephone=?1")
|
||||
Admin findByTelephone(String phone);
|
||||
|
||||
@Query("from Admin where isDeleted=0 AND empCode=?1")
|
||||
Admin findByEmpCode(String empCode);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有未删除启用的账号
|
||||
|
|
|
@ -111,7 +111,7 @@ public class AccountService {
|
|||
|
||||
BeanUtils.copyProperties(admin, oldAdmin);
|
||||
|
||||
oldAdmin.setRealName(sysRole.getName());
|
||||
oldAdmin.setRealName(admin.getRealName());
|
||||
oldAdmin.setDeptName(dept.getName());
|
||||
oldAdmin.setPositionName(userPosition.getPositionName());
|
||||
oldAdmin.setPassword(newPassword);
|
||||
|
@ -125,7 +125,7 @@ public class AccountService {
|
|||
String userName = admin.getUserName();
|
||||
oldAdmin.setDeptId(admin.getDeptId());
|
||||
oldAdmin.setPositionId(admin.getPositionId());
|
||||
oldAdmin.setRealName(sysRole.getName());
|
||||
oldAdmin.setRealName(admin.getRealName());
|
||||
oldAdmin.setDeptName(dept.getName());
|
||||
oldAdmin.setPositionName(userPosition.getPositionName());
|
||||
oldAdmin.setEmpCode(admin.getEmpCode());
|
||||
|
@ -167,15 +167,28 @@ public class AccountService {
|
|||
return "请填写正确的电话号码!";
|
||||
}
|
||||
|
||||
//工号重复校验
|
||||
Admin empCode = adminRepository.findByEmpCode(admin.getEmpCode());
|
||||
if (userId == -1) {
|
||||
if (null != empCode) {
|
||||
message = "该工号已存在!";
|
||||
return message;
|
||||
}
|
||||
} else {
|
||||
if (null != empCode && empCode.getId() != userId) {
|
||||
message = "该工号已存在!";
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
//手机号重复校验
|
||||
Admin byTelephoneEquals = adminRepository.findByTelephone(phone);
|
||||
if (userId == -1) {
|
||||
//新增校验手机号是否存在
|
||||
if (null != byTelephoneEquals) {
|
||||
message = "该手机号已存在!";
|
||||
return message;
|
||||
}
|
||||
} else {
|
||||
//编辑校验手机号是否存在
|
||||
if (null != byTelephoneEquals && byTelephoneEquals.getId() != userId) {
|
||||
message = "该手机号已存在!";
|
||||
return message;
|
||||
|
@ -183,25 +196,33 @@ public class AccountService {
|
|||
}
|
||||
|
||||
if (StringUtils.isEmpty(admin.getUserName())) {
|
||||
message = "亲,用户名不能为空!";
|
||||
message = "登录名不能为空!";
|
||||
return message;
|
||||
}
|
||||
Admin existAdmin = adminRepository.getAdminByUsername(admin.getUserName());
|
||||
if (userId == -1) {//只在新增时候校验
|
||||
if (userId == -1) {
|
||||
if (existAdmin != null) {
|
||||
message = "亲,该账号已存在!";
|
||||
message = "该登录名称已存在!";
|
||||
return message;
|
||||
}
|
||||
} else {
|
||||
if (existAdmin != null && existAdmin.getId() != userId) {
|
||||
message = "亲,该账号名称已存在!";
|
||||
message = "该登录名称已存在!";
|
||||
return message;
|
||||
}
|
||||
}
|
||||
existAdmin = adminRepository.getAdminByRealName(admin.getRealName());
|
||||
if (existAdmin != null && existAdmin.getId() != userId) {
|
||||
message = "亲,该账号名称已存在!";
|
||||
return message;
|
||||
|
||||
Admin realName = adminRepository.getAdminByRealName(admin.getRealName());
|
||||
if (userId == -1) {
|
||||
if (realName != null) {
|
||||
message = "该姓名已存在!";
|
||||
return message;
|
||||
}
|
||||
} else {
|
||||
if (realName != null && realName.getId() != userId) {
|
||||
message = "该姓名已存在!";
|
||||
return message;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
@ -264,6 +285,7 @@ public class AccountService {
|
|||
|
||||
/**
|
||||
* 通过id查询姓名
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
@ -274,6 +296,7 @@ public class AccountService {
|
|||
|
||||
/**
|
||||
* 通过角色id查询用户姓名列表
|
||||
*
|
||||
* @param roleIds
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
手机号
|
||||
</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input name="telephone" class="am-form-field am-input-sm"
|
||||
<input name="telephone" class="am-form-field"
|
||||
data-validate-async data-validation-message="请输入正确格式手机号码!"
|
||||
onkeyup="value=value.replace(/[^\d]/g,'')"
|
||||
type="text" id="telephone" value="${account.telephone!}" minlength="11"
|
||||
|
@ -79,10 +79,10 @@
|
|||
</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input name="realName" class="js-ajax-validate"
|
||||
data-validate-async data-validation-message="请输入账户名称(20字符以内)"
|
||||
data-validate-async data-validation-message="请输入姓名(20字符以内)"
|
||||
type="text" id="realName" value="${account.realName!}" minlength="1"
|
||||
maxlength="20" <#if userId!=-1>readonly</#if>
|
||||
required placeholder="请输入账户名称(20字符以内)"/>
|
||||
required placeholder="请输入姓名名称(20字符以内)"/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
@ -110,7 +110,6 @@
|
|||
<div class="am-u-sm-8 am-u-md-10">
|
||||
<select id="deptId" name="deptId"
|
||||
data-am-selected="{btnSize: 'sm',maxHeight: 200,searchBox: 1}">
|
||||
<option value="-1">请选择</option>
|
||||
<#if deptList?exists>
|
||||
<#list deptList as node>
|
||||
<option value="${node.id!}" <#if account.deptId! == node.id >
|
||||
|
@ -144,7 +143,6 @@
|
|||
<div class="am-u-sm-8 am-u-md-10">
|
||||
<select id="positionId" name="positionId"
|
||||
data-am-selected="{btnSize: 'sm',maxHeight: 200,searchBox: 1}">
|
||||
<option value="-1">请选择</option>
|
||||
<#if positionList?exists>
|
||||
<#list positionList as node>
|
||||
<option value="${node.id!}" <#if account.positionId! == node.id >
|
||||
|
@ -163,7 +161,6 @@
|
|||
<div class="am-u-sm-8 am-u-md-10">
|
||||
<select id="roleId" name="roleId"
|
||||
data-am-selected="{btnSize: 'sm',maxHeight: 200,searchBox: 1}">
|
||||
<option value="-1">请选择</option>
|
||||
<#if roleList?exists>
|
||||
<#list roleList as node>
|
||||
<option value="${node.id!}" <#if account.roleId! == node.id >
|
||||
|
|
|
@ -79,13 +79,13 @@
|
|||
<div class="am-form am-form-inline">
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="startTime"
|
||||
<input type="text" class="am-form-field am-input-sm" id="startTime" readonly
|
||||
value="${startTime!}" placeholder="开始日期" data-am-datepicker>
|
||||
</div>
|
||||
<div class="am-form-group">至</div>
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="endTime"
|
||||
<input type="text" class="am-form-field am-input-sm" id="endTime" readonly
|
||||
value="${endTime!}"
|
||||
placeholder="结束日期" data-am-datepicker>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<span style="color: red;">*</span>采购类型名称</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input class="js-ajax-validate" name="name" data-validation-message="请输入告警类型名称(20字符以内)"
|
||||
minlength="1" maxlength="20"
|
||||
minlength="1" maxlength="10"
|
||||
value="${procurementType.name!}" type="text" required/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
|
@ -38,7 +38,6 @@
|
|||
<span style="color: red;">*</span>所属大类</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<select data-am-selected="{btnWidth: '40%', btnSize: 'sm'" id="category" name="category">
|
||||
<option value="-1" >请选择所属大类</option>
|
||||
<option value="1" <#if procurementType.category! ==1>selected</#if> >设备</option>
|
||||
<option value="2" <#if procurementType.category! ==2>selected</#if> >服务</option>
|
||||
<option value="3" <#if procurementType.category! ==3>selected</#if> >施工</option>
|
||||
|
|
|
@ -43,14 +43,14 @@
|
|||
<div class="am-form am-form-inline">
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="startTime"
|
||||
<input type="text" class="am-form-field am-input-sm" id="startTime" readonly
|
||||
value="${startTime!}" placeholder="开始日期" data-am-datepicker>
|
||||
</div>
|
||||
<div class="am-form-group">至</div>
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="endTime"
|
||||
value="${endTime!}"
|
||||
value="${endTime!}" readonly
|
||||
placeholder="结束日期" data-am-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -123,7 +123,18 @@
|
|||
<tr>
|
||||
<td><input type="checkbox" name="ids" value="${list.id}"/></td>
|
||||
<td>${list.name!}</td>
|
||||
<td>${list.category!}</td>
|
||||
<td>
|
||||
<#if list.category ==1 >
|
||||
设备
|
||||
<#elseif list.category ==2>
|
||||
服务
|
||||
<#elseif list.category ==3>
|
||||
施工
|
||||
<#elseif list.category ==4>
|
||||
其他
|
||||
</#if>
|
||||
|
||||
</td>
|
||||
<td>${list.createdBy!}</td>
|
||||
<td><#if list.createdTime??>${list.createdTime?datetime}</#if></td>
|
||||
<td>
|
||||
|
|
|
@ -23,37 +23,34 @@
|
|||
<input name="tId" id="tId" type="hidden" value="${tId!}"/>
|
||||
<!--验证表单元素(validate) begin-->
|
||||
<!--input begin-->
|
||||
<div class="am-g am-form-group am-margin-top" id="threshold">
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right">
|
||||
<span style="color: red;">*</span>
|
||||
项目贡献利润率阀值:
|
||||
<span style="color: red;">*</span>项目贡献利润率阀值:
|
||||
</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input name="projectContributionProfitRateThreshold" class="js-ajax-validate"
|
||||
data-validate-async data-validation-message="请输入项目贡献利润率阀值"
|
||||
type="number" step="0.01" id="projectContributionProfitRateThreshold"
|
||||
value="${projectContributionProfitRateThreshold!}" minlength="1"
|
||||
maxlength="4" oninput="if(value.length>4)value=value.slice(0,4)"
|
||||
placeholder="请输入项目贡献利润率阀值" required/>
|
||||
<p>注:请注意保留小数点后两位</p>
|
||||
</div>
|
||||
type="number" id="projectContributionProfitRateThreshold" value="${projectContributionProfitRateThreshold!}"
|
||||
minlength="1" step="0.01"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1')"
|
||||
maxlength="10" placeholder="请输入项目贡献利润率阀值" required/>
|
||||
</div>% 注:请注意保留小数点后两位
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
<div class="am-g am-form-group am-margin-top" id="threshold">
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right">
|
||||
<span style="color: red;">*</span>
|
||||
项目年利润率:
|
||||
<span style="color: red;">*</span>设置项目年利率:
|
||||
</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input name="underwrittenTaxRate" class="js-ajax-validate"
|
||||
data-validate-async data-validation-message="请输入项目年利润率"
|
||||
type="number" step="0.01" id="underwrittenTaxRate"
|
||||
value="${underwrittenTaxRate!}" minlength="1"
|
||||
maxlength="4" oninput="if(value.length>4)value=value.slice(0,4)"
|
||||
placeholder="请输入项目年利润率" required/>
|
||||
<p>注:请注意保留小数点后两位</p>
|
||||
</div>
|
||||
data-validate-async data-validation-message="请输入项目年利率"
|
||||
type="number" id="underwrittenTaxRate" value="${underwrittenTaxRate!}"
|
||||
minlength="1" step="0.01"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,6})?).*$/g, '$1')"
|
||||
maxlength="10" placeholder="请输入项目年利率" required/>
|
||||
</div>% 注:请注意保留小数点后两位
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input name="roleName" class="js-ajax-validate"
|
||||
data-validate-async data-validation-message="请输入角色名称(100字符以内)"
|
||||
type="text" id="roleName" value="${roleName!}" minlength="1" maxlength="100"
|
||||
placeholder="请输入角色名称(100字符以内)" required onblur="checkRoleName($(this));" onKeyUp="clearValidInfo()" />
|
||||
type="text" id="roleName" value="${roleName!}" minlength="1" maxlength="20"
|
||||
placeholder="请输入角色名称(20字符以内)" required onblur="checkRoleName($(this));" onKeyUp="clearValidInfo()" />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg" id="role_name_valid"></div>
|
||||
</div>
|
||||
|
|
|
@ -98,7 +98,8 @@
|
|||
编辑
|
||||
</button>
|
||||
</@shiro.hasPermission>
|
||||
<div class="am-btn-group am-btn-group-xs">
|
||||
<#if list.id != 1>
|
||||
<div class="am-btn-group am-btn-group-xs">
|
||||
<div class="switch-button">
|
||||
<#--是否启用:0禁用,1启用-->
|
||||
<input id="${list.id}" type="checkbox" data-size='xs'
|
||||
|
@ -106,6 +107,7 @@
|
|||
<#if list.isEnable==1 >checked</#if>/>
|
||||
</div>
|
||||
</div>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue