使机构管理可以多根目录,可以全部删除
This commit is contained in:
@@ -54,13 +54,6 @@
|
|||||||
data-options="required:true,validType:'length[2,30]'" style="width: 200px;height: 20px"/>
|
data-options="required:true,validType:'length[2,30]'" style="width: 200px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--<tr>
|
|
||||||
<td>类型</td>
|
|
||||||
<td style="padding:5px">
|
|
||||||
<input name="orgTpcd" id="orgTpcd" class="easyui-validatebox"
|
|
||||||
data-options="required:true,validType:'length[2,30]'" style="width: 200px;height: 20px"/>
|
|
||||||
</td>
|
|
||||||
</tr>-->
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>状态</td>
|
<td>状态</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
@@ -75,7 +68,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>编号</td>
|
<td>编号</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input name="orgNo" id="orgNo" style="width: 200px;height: 20px"/>
|
<input name="orgNo" id="orgNo" class="easyui-validatebox"
|
||||||
|
data-options="required:true,validType:'length[2,30]'" style="width: 200px;height: 20px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -270,8 +264,16 @@
|
|||||||
|
|
||||||
//保存信息
|
//保存信息
|
||||||
$("#saveOrganization").off("click").on("click", function () {
|
$("#saveOrganization").off("click").on("click", function () {
|
||||||
|
if (!$("#orgFullName").val()) {
|
||||||
|
$.messager.alert('提示', '全称不能为空!', 'warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!$("#orgAbr").val()) {
|
if (!$("#orgAbr").val()) {
|
||||||
$.messager.alert('提示', '机构名称不能为空!', 'warning');
|
$.messager.alert('提示', '简称不能为空!', 'warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!$("#orgNo").val()) {
|
||||||
|
$.messager.alert('提示', '编号不能为空!', 'warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var objInfo = $("#organizationFM").serializeObject();
|
var objInfo = $("#organizationFM").serializeObject();
|
||||||
|
|||||||
@@ -102,9 +102,9 @@ public class BusinessConstants {
|
|||||||
public static final String ORGANIZATION_STCD_REMOVED = "5";
|
public static final String ORGANIZATION_STCD_REMOVED = "5";
|
||||||
/**
|
/**
|
||||||
* 根机构编号
|
* 根机构编号
|
||||||
* 根机构编号默认为01
|
* 根机构编号默认为-1
|
||||||
* */
|
* */
|
||||||
public static final String ORGANIZATION_ROOT_NO = "01";
|
public static final String ORGANIZATION_ROOT_NO = "-1";
|
||||||
/**
|
/**
|
||||||
* 新增用户默认密码
|
* 新增用户默认密码
|
||||||
* */
|
* */
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class OrganizationService {
|
|||||||
checkOrgNoIsExists(org.getOrgNo(),null);
|
checkOrgNoIsExists(org.getOrgNo(),null);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 未指定父级机构的时候默认放在根机构下
|
* 未指定父级机构的时候默认为根机构
|
||||||
* */
|
* */
|
||||||
if(StringUtil.isEmpty(org.getOrgParentNo())){
|
if(StringUtil.isEmpty(org.getOrgParentNo())){
|
||||||
org.setOrgParentNo(BusinessConstants.ORGANIZATION_ROOT_NO);
|
org.setOrgParentNo(BusinessConstants.ORGANIZATION_ROOT_NO);
|
||||||
@@ -100,20 +100,11 @@ public class OrganizationService {
|
|||||||
checkOrgNoIsExists(org.getOrgNo(),org.getId());
|
checkOrgNoIsExists(org.getOrgNo(),org.getId());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 未指定父级机构的时候默认放在根机构下
|
* 未指定父级机构的时候默认为根机构
|
||||||
* */
|
* */
|
||||||
if(StringUtil.isEmpty(org.getOrgParentNo())){
|
if(StringUtil.isEmpty(org.getOrgParentNo())){
|
||||||
org.setOrgParentNo(BusinessConstants.ORGANIZATION_ROOT_NO);
|
org.setOrgParentNo(BusinessConstants.ORGANIZATION_ROOT_NO);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 添加一个限制,根机构不允许修改
|
|
||||||
* */
|
|
||||||
if(BusinessConstants.ORGANIZATION_ROOT_NO.equals(org.getOrgNo())){
|
|
||||||
logger.error("异常码[{}],异常提示[{}],参数,orgNo[{}]",
|
|
||||||
ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE,ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG,org.getOrgNo());
|
|
||||||
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE,
|
|
||||||
ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG);
|
|
||||||
}
|
|
||||||
return organizationMapperEx.editOrganization(org);
|
return organizationMapperEx.editOrganization(org);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,17 +163,6 @@ public class OrganizationService {
|
|||||||
public int batchDeleteOrganizationByIds(String ids) throws Exception{
|
public int batchDeleteOrganizationByIds(String ids) throws Exception{
|
||||||
User userInfo=userService.getCurrentUser();
|
User userInfo=userService.getCurrentUser();
|
||||||
String [] idArray=ids.split(",");
|
String [] idArray=ids.split(",");
|
||||||
/**
|
|
||||||
* 添加一个限制,根机构不允许删除
|
|
||||||
* */
|
|
||||||
List<Organization> orgRootList=organizationMapperEx.getOrganizationRootByIds(idArray);
|
|
||||||
if(orgRootList!=null&&orgRootList.size()>0){
|
|
||||||
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
|
|
||||||
ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE,ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG,ids);
|
|
||||||
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_CODE,
|
|
||||||
ExceptionConstants.ORGANIZATION_ROOT_NOT_ALLOWED_DELETE_MSG);
|
|
||||||
}
|
|
||||||
|
|
||||||
return organizationMapperEx.batchDeleteOrganizationByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
return organizationMapperEx.batchDeleteOrganizationByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user