Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
85d5098d
Commit
85d5098d
authored
Mar 13, 2019
by
季圣华
Browse files
使机构管理可以多根目录,可以全部删除
parent
3da49de1
Changes
3
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/organization.html
View file @
85d5098d
...
...
@@ -54,13 +54,6 @@
data-options=
"required:true,validType:'length[2,30]'"
style=
"width: 200px;height: 20px"
/>
</td>
</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>
<td>
状态
</td>
<td
style=
"padding:5px"
>
...
...
@@ -75,7 +68,8 @@
<tr>
<td>
编号
</td>
<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>
</tr>
<tr>
...
...
@@ -270,8 +264,16 @@
//保存信息
$
(
"
#saveOrganization
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
if
(
!
$
(
"
#orgFullName
"
).
val
())
{
$
.
messager
.
alert
(
'
提示
'
,
'
全称不能为空!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
"
#orgAbr
"
).
val
())
{
$
.
messager
.
alert
(
'
提示
'
,
'
机构名称不能为空!
'
,
'
warning
'
);
$
.
messager
.
alert
(
'
提示
'
,
'
简称不能为空!
'
,
'
warning
'
);
return
;
}
if
(
!
$
(
"
#orgNo
"
).
val
())
{
$
.
messager
.
alert
(
'
提示
'
,
'
编号不能为空!
'
,
'
warning
'
);
return
;
}
var
objInfo
=
$
(
"
#organizationFM
"
).
serializeObject
();
...
...
src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
85d5098d
...
...
@@ -102,9 +102,9 @@ public class BusinessConstants {
public
static
final
String
ORGANIZATION_STCD_REMOVED
=
"5"
;
/**
* 根机构编号
* 根机构编号默认为
0
1
* 根机构编号默认为
-
1
* */
public
static
final
String
ORGANIZATION_ROOT_NO
=
"
0
1"
;
public
static
final
String
ORGANIZATION_ROOT_NO
=
"
-
1"
;
/**
* 新增用户默认密码
* */
...
...
src/main/java/com/jsh/erp/service/organization/OrganizationService.java
View file @
85d5098d
...
...
@@ -79,7 +79,7 @@ public class OrganizationService {
checkOrgNoIsExists
(
org
.
getOrgNo
(),
null
);
}
/**
* 未指定父级机构的时候默认
放在
根机构
下
* 未指定父级机构的时候默认
为
根机构
* */
if
(
StringUtil
.
isEmpty
(
org
.
getOrgParentNo
())){
org
.
setOrgParentNo
(
BusinessConstants
.
ORGANIZATION_ROOT_NO
);
...
...
@@ -100,20 +100,11 @@ public class OrganizationService {
checkOrgNoIsExists
(
org
.
getOrgNo
(),
org
.
getId
());
}
/**
* 未指定父级机构的时候默认
放在
根机构
下
* 未指定父级机构的时候默认
为
根机构
* */
if
(
StringUtil
.
isEmpty
(
org
.
getOrgParentNo
())){
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
);
}
...
...
@@ -172,17 +163,6 @@ public class OrganizationService {
public
int
batchDeleteOrganizationByIds
(
String
ids
)
throws
Exception
{
User
userInfo
=
userService
.
getCurrentUser
();
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
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment