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
a184aabd
Commit
a184aabd
authored
Apr 10, 2019
by
乾坤平台
Committed by
季圣华
Apr 10, 2019
Browse files
!48 修改注册时本地事务和远程调用问题
Merge pull request !48 from 乾坤平台/master
parents
6f379739
bce05cf0
Changes
35
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a184aabd
...
...
@@ -4,7 +4,6 @@
*
系统初始账号:jsh,密码:123456,部署如有问题请联系QQ:752718920,欢迎加入华夏ERP交流群,群号码:120725710
*
部署如遇到困难请参考Wiki文档
**https://gitee.com/jishenghua/JSH_ERP/wikis/pages**
*
**本系统演示地址:[http://120.78.214.220:8080](http://120.78.214.220:8080),账号:jsh,密码:123456,欢迎登录(如需试用,欢迎注册)**
# 开发初衷
*
华夏ERP立志为中小企业提供开源好用的ERP软件,降低企业的信息化成本
*
个人开发者也可以使用华夏ERP进行二次开发,承接外包ERP项目
...
...
erp_web/js/pages/financial/financial_base.js
View file @
a184aabd
...
...
@@ -495,7 +495,19 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
accountHeadID
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteAccountHeadForceConfirm
(
res
,
"
/accountHead/batchDeleteAccountHeadByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
return
;
}
}
},
//此处添加错误处理
...
...
@@ -553,29 +565,7 @@
}
ids
+=
row
[
i
].
id
+
"
,
"
;
}
//批量更新会员的预收款信息
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
listType
===
"
收预付款
"
){
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/supplier/updateAdvanceIn
"
,
dataType
:
"
json
"
,
data
:{
supplierId
:
row
[
i
].
organid
,
//会员id
advanceIn
:
0
-
row
[
i
].
totalprice
//删除时同时删除用户的预付款信息
},
success
:
function
(
res
){
if
(
res
&&
res
.
code
===
200
)
{
//保存会员预收款成功
}
},
error
:
function
(){
$
.
messager
.
alert
(
'
提示
'
,
'
保存信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
//批量删除
$
.
ajax
({
type
:
"
post
"
,
...
...
@@ -590,15 +580,19 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息失败,请稍后再试!
'
,
'
error
'
);
}
},
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteAccountHeadForceConfirm
(
res
,
"
/accountHead/batchDeleteAccountHeadByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
return
;
}
}
},
//此处添加错误处理
...
...
@@ -606,13 +600,71 @@
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
});
//批量更新会员的预收款信息
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
listType
===
"
收预付款
"
){
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/supplier/updateAdvanceIn
"
,
dataType
:
"
json
"
,
data
:{
supplierId
:
row
[
i
].
organid
,
//会员id
advanceIn
:
0
-
row
[
i
].
totalprice
//删除时同时删除用户的预付款信息
},
success
:
function
(
res
){
if
(
res
&&
res
.
code
===
200
)
{
//保存会员预收款成功
}
},
error
:
function
(){
$
.
messager
.
alert
(
'
提示
'
,
'
保存信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
}
});
}
}
/**
* 确认强制删除
* */
function
batDeleteAccountHeadForceConfirm
(
res
,
url
,
jsondata
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
return
;
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除财务信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//增加
//增加
function
addAccountHead
(){
$
(
'
#accountHeadFM
'
).
form
(
'
clear
'
);
var
thisDateTime
=
getNowFormatDateTime
();
//当前时间
...
...
erp_web/js/pages/manage/supplier.js
View file @
a184aabd
...
...
@@ -179,7 +179,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
supplierTotalInfo
[
0
];
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteSupplierForceConfirm
(
res
,
"
/supplier/batchDeleteSupplierByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -224,7 +234,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteSupplierForceConfirm
(
res
,
"
/supplier/batchDeleteSupplierByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -237,6 +257,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeleteSupplierForceConfirm
(
res
,
url
,
jsondata
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除信息失败,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//批量启用
function
setEnableFun
()
{
...
...
erp_web/pages/manage/account.html
View file @
a184aabd
...
...
@@ -234,7 +234,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
accountTotalInfo
[
0
];
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteAccountForceConfirm
(
res
,
"
/account/batchDeleteAccountByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -278,7 +288,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteAccountForceConfirm
(
res
,
"
/account/batchDeleteAccountByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -291,6 +311,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeleteAccountForceConfirm
(
res
,
url
,
jsondata
,
type
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//增加结算账户
var
url
;
...
...
erp_web/pages/manage/depot.html
View file @
a184aabd
...
...
@@ -264,7 +264,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
depotID
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteDepotForceConfirm
(
res
,
"
/depot/batchDeleteDepotByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息异常,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -308,7 +318,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteDepotForceConfirm
(
res
,
"
/depot/batchDeleteDepotByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息异常,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -321,6 +341,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeleteDepotForceConfirm
(
res
,
url
,
jsondata
,
type
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息异常,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除仓库信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//增加
var
url
;
...
...
erp_web/pages/manage/inOutItem.html
View file @
a184aabd
...
...
@@ -234,7 +234,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除收支项目失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
inOutItemTotalInfo
[
0
];
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteInOutItemForceConfirm
(
res
,
"
/inOutItem/batchDeleteInOutItemByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -278,7 +288,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除收支项目失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteInOutItemForceConfirm
(
res
,
"
/inOutItem/batchDeleteInOutItemByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除结算账户失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -291,6 +311,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeleteInOutItemForceConfirm
(
res
,
url
,
jsondata
,
type
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除收支项目失败,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除收支项目失败,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//增加收支项目
var
url
;
...
...
erp_web/pages/materials/material.html
View file @
a184aabd
...
...
@@ -780,7 +780,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
materialID
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeleteMaterialForceConfirm
(
res
,
"
/material/batchDeleteMaterialByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息异常,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -825,7 +835,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeleteMaterialForceConfirm
(
res
,
"
/material/batchDeleteMaterialByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息异常,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -838,6 +858,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeleteMaterialForceConfirm
(
res
,
url
,
jsondata
,
type
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息异常,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除商品信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//批量启用
function
setEnableFun
()
{
...
...
erp_web/pages/materials/person.html
View file @
a184aabd
...
...
@@ -258,7 +258,17 @@
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
personID
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
single
'
;
batDeletePersonForceConfirm
(
res
,
"
/person/batchDeletePersonByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -303,7 +313,17 @@
$
(
"
#searchBtn
"
).
click
();
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息失败,请稍后再试!
'
,
'
error
'
);
if
(
res
&&
res
.
code
==
601
){
var
jsondata
=
{};
jsondata
.
ids
=
ids
;
jsondata
.
deleteType
=
'
2
'
;
var
type
=
'
batch
'
;
batDeletePersonForceConfirm
(
res
,
"
/person/batchDeletePersonByIds
"
,
jsondata
,
type
);
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息失败,请稍后再试!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
...
...
@@ -316,6 +336,38 @@
});
}
}
/**
* 确认强制删除
* */
function
batDeletePersonForceConfirm
(
res
,
url
,
jsondata
,
type
)
{
$
.
messager
.
confirm
(
'
删除确认
'
,
res
.
msg
,
function
(
r
)
{
if
(
r
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
url
,
dataType
:
"
json
"
,
data
:
(
jsondata
),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
==
200
)
{
$
(
"
#searchBtn
"
).
click
();
if
(
type
==
'
batch
'
){
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
}
else
if
(
res
&&
res
.
code
==
600
){
$
.
messager
.
alert
(
'
删除提示
'
,
res
.
msg
,
'
error
'
);
}
else
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息异常,请稍后再试!
'
,
'
error
'
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
删除提示
'
,
'
删除经手人信息异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
});
}
//增加
var
url
;
...
...
src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
a184aabd
...
...
@@ -200,6 +200,14 @@ public class BusinessConstants {
public
static
final
String
TYPE_NAME_ROLE_APP
=
"RoleAPP"
;
public
static
final
String
TYPE_NAME_ROLE_FUNCTIONS
=
"RoleFunctions"
;
/**
* 删除类型
* 1正常删除
* 2强制删除
* */
public
static
final
String
DELETE_TYPE_NORMAL
=
"1"
;
public
static
final
String
DELETE_TYPE_FORCE
=
"2"
;
...
...
src/main/java/com/jsh/erp/constants/ExceptionConstants.java
View file @
a184aabd
...
...
@@ -23,6 +23,17 @@ public class ExceptionConstants {
**/
public
static
final
int
SERVICE_SYSTEM_ERROR_CODE
=
500
;
public
static
final
String
SERVICE_SYSTEM_ERROR_MSG
=
"未知异常"
;
/**
* 删除操作被拒绝,请联系管理员
**/
public
static
final
int
DELETE_REFUSED_CODE
=
600
;
public
static
final
String
DELETE_REFUSED_MSG
=
"删除操作被拒绝,请联系管理员"
;
/**
* 检测到存在依赖数据,是否强制删除?
**/
public
static
final
int
DELETE_FORCE_CONFIRM_CODE
=
601
;
public
static
final
String
DELETE_FORCE_CONFIRM_MSG
=
"检测到存在依赖数据,是否强制删除?"
;
/**
* 用户信息
* type = 5
...
...
src/main/java/com/jsh/erp/controller/AccountController.java
View file @
a184aabd
package
com.jsh.erp.controller
;
import
com.alibaba.druid.util.StringUtils
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.Account
;
import
com.jsh.erp.datasource.vo.AccountVo4InOutList
;
...
...
@@ -150,10 +152,28 @@ public class AccountController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteAccountByIds"
)
public
Object
batchDeleteAccountByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteAccountByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
accountService
.
batchDeleteAccountByIds
(
ids
);
/**
* create by: qiankunpingtai
* create time: 2019/4/10 10:19
* website:https://qiankunpingtai.cn
* description:
* 出于兼容性考虑,没有传递删除类型时,默认为正常删除
*/
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
accountService
.
batchDeleteAccountByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
accountService
.
batchDeleteAccountByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
ACCOUNT_DELETE_FAILED_CODE
,
ExceptionConstants
.
ACCOUNT_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/AccountHeadController.java
View file @
a184aabd
package
com.jsh.erp.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.AccountHead
;
import
com.jsh.erp.datasource.entities.AccountHeadVo4ListEx
;
...
...
@@ -158,10 +159,21 @@ public class AccountHeadController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteAccountHeadByIds"
)
public
Object
batchDeleteAccountHeadByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteAccountHeadByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
accountHeadService
.
batchDeleteAccountHeadByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
accountHeadService
.
batchDeleteAccountHeadByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
accountHeadService
.
batchDeleteAccountHeadByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_CODE
,
ExceptionConstants
.
ACCOUNT_HEAD_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/DepotController.java
View file @
a184aabd
...
...
@@ -185,9 +185,20 @@ public class DepotController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteDepotByIds"
)
public
Object
batchDeleteDepotByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteDepotByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
depotService
.
batchDeleteDepotByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
depotService
.
batchDeleteDepotByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
depotService
.
batchDeleteDepotByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
DEPOT_DELETE_FAILED_CODE
,
ExceptionConstants
.
DEPOT_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/InOutItemController.java
View file @
a184aabd
...
...
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.InOutItem
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
...
...
@@ -66,9 +67,20 @@ public class InOutItemController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteInOutItemByIds"
)
public
Object
batchDeleteInOutItemByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteInOutItemByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
inOutItemService
.
batchDeleteInOutItemByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
inOutItemService
.
batchDeleteInOutItemByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
inOutItemService
.
batchDeleteInOutItemByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
IN_OUT_ITEM_DELETE_FAILED_CODE
,
ExceptionConstants
.
IN_OUT_ITEM_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
a184aabd
...
...
@@ -353,9 +353,20 @@ public class MaterialController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteMaterialByIds"
)
public
Object
batchDeleteMaterialByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteMaterialByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
materialService
.
batchDeleteMaterialByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
materialService
.
batchDeleteMaterialByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
materialService
.
batchDeleteMaterialByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
MATERIAL_DELETE_FAILED_CODE
,
ExceptionConstants
.
MATERIAL_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/PersonController.java
View file @
a184aabd
...
...
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.Person
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
...
...
@@ -133,9 +134,20 @@ public class PersonController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeletePersonByIds"
)
public
Object
batchDeletePersonByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeletePersonByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
personService
.
batchDeletePersonByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
personService
.
batchDeletePersonByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
personService
.
batchDeletePersonByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
PERSON_DELETE_FAILED_CODE
,
ExceptionConstants
.
PERSON_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/SupplierController.java
View file @
a184aabd
...
...
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.Supplier
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
...
...
@@ -452,9 +453,20 @@ public class SupplierController {
* @return java.lang.Object
*/
@RequestMapping
(
value
=
"/batchDeleteSupplierByIds"
)
public
Object
batchDeleteSupplierByIds
(
@RequestParam
(
"ids"
)
String
ids
)
throws
Exception
{
public
Object
batchDeleteSupplierByIds
(
@RequestParam
(
"ids"
)
String
ids
,
@RequestParam
(
value
=
"deleteType"
,
required
=
false
,
defaultValue
=
BusinessConstants
.
DELETE_TYPE_NORMAL
)
String
deleteType
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
int
i
=
supplierService
.
batchDeleteSupplierByIds
(
ids
);
int
i
=
0
;
if
(
BusinessConstants
.
DELETE_TYPE_NORMAL
.
equals
(
deleteType
)){
i
=
supplierService
.
batchDeleteSupplierByIdsNormal
(
ids
);
}
else
if
(
BusinessConstants
.
DELETE_TYPE_FORCE
.
equals
(
deleteType
)){
i
=
supplierService
.
batchDeleteSupplierByIds
(
ids
);
}
else
{
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}],deleteType[{}]"
,
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
,
ids
,
deleteType
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DELETE_REFUSED_CODE
,
ExceptionConstants
.
DELETE_REFUSED_MSG
);
}
if
(
i
<
1
){
logger
.
error
(
"异常码[{}],异常提示[{}],参数,ids[{}]"
,
ExceptionConstants
.
SUPPLIER_DELETE_FAILED_CODE
,
ExceptionConstants
.
SUPPLIER_DELETE_FAILED_MSG
,
ids
);
...
...
src/main/java/com/jsh/erp/controller/UserController.java
View file @
a184aabd
...
...
@@ -7,15 +7,11 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.DepotEx
;
import
com.jsh.erp.datasource.entities.SerialNumberEx
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.entities.UserEx
;
import
com.jsh.erp.datasource.vo.TreeNode
;
import
com.jsh.erp.datasource.vo.TreeNodeEx
;
import
com.jsh.erp.exception.BusinessParamCheckingException
;
import
com.jsh.erp.service.user.UserService
;
import
com.jsh.erp.service.userBusiness.UserBusinessService
;
import
com.jsh.erp.utils.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -25,11 +21,11 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.*
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
static
com
.
jsh
.
erp
.
utils
.
ResponseJsonUtil
.
returnJson
;
...
...
@@ -39,7 +35,7 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@RestController
@RequestMapping
(
value
=
"/user"
)
public
class
UserController
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
Resource
Controller
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
User
Controller
.
class
);
@Value
(
"${mybatis-plus.status}"
)
private
String
mybatisPlusStatus
;
...
...
@@ -56,9 +52,6 @@ public class UserController {
@Resource
private
UserService
userService
;
@Resource
private
UserBusinessService
userBusinessService
;
private
static
String
message
=
"成功"
;
private
static
final
String
HTTP
=
"http://"
;
private
static
final
String
CODE_OK
=
"200"
;
...
...
@@ -357,31 +350,33 @@ public class UserController {
ue
.
setUsername
(
loginame
);
ue
.
setLoginame
(
loginame
);
ue
.
setPassword
(
password
);
ue
=
userService
.
registerUser
(
ue
);
//调第三方接口创建租户管理信息
String
url
=
HTTP
+
manageIp
+
":"
+
managePort
+
"/tenant/add"
;
JSONObject
tenantObj
=
new
JSONObject
();
tenantObj
.
put
(
"tenantId"
,
ue
.
getId
());
tenantObj
.
put
(
"loginName"
,
ue
.
getLoginame
());
String
param
=
URLEncoder
.
encode
(
tenantObj
.
toString
());
HttpClient
.
httpPost
(
url
+
"?info="
+
param
,
param
);
logger
.
info
(
"===============创建租户信息完成==============="
);
//更新租户id
User
user
=
new
User
();
user
.
setId
(
ue
.
getId
());
user
.
setTenantId
(
ue
.
getId
());
userService
.
updateUserTenant
(
user
);
ue
=
userService
.
registerUser
(
ue
,
manageRoleId
);
/**
* create by: qiankunpingtai
* create time: 2019/4/9 17:17
* website:https://qiankunpingtai.cn
* description:
* 这里涉及到多个项目,需要用分布式事务去处理
* 为了不使问题复杂化,暂时另外开启一个线程去处理其它项目的数据操作
*/
final
UserEx
ueFinal
=
ue
;
final
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
1
);
executorService
.
execute
(()
->
{
try
{
//调第三方接口创建租户管理信息
String
url
=
HTTP
+
manageIp
+
":"
+
managePort
+
"/tenant/add"
;
JSONObject
tenantObj
=
new
JSONObject
();
tenantObj
.
put
(
"tenantId"
,
ueFinal
.
getId
());
tenantObj
.
put
(
"loginName"
,
ueFinal
.
getLoginame
());
String
param
=
URLEncoder
.
encode
(
tenantObj
.
toString
());
HttpClient
.
httpPost
(
url
+
"?info="
+
param
,
param
);
logger
.
info
(
"===============创建租户信息完成==============="
);
}
catch
(
Exception
e
){
//记录一下第三方接口创建租户管理信息创建失败
logger
.
debug
(
"调用第三方接口创建租户管理信息失败:tenantId:[{}],loginName:[{}]"
,
ueFinal
.
getId
(),
ueFinal
.
getLoginame
());
}
});
//新增用户与角色的关系
JSONObject
ubObj
=
new
JSONObject
();
ubObj
.
put
(
"type"
,
"UserRole"
);
ubObj
.
put
(
"keyid"
,
ue
.
getId
());
JSONArray
ubArr
=
new
JSONArray
();
ubArr
.
add
(
manageRoleId
);
ubObj
.
put
(
"value"
,
ubArr
.
toString
());
userBusinessService
.
insertUserBusiness
(
ubObj
.
toString
(),
request
);
return
result
;
}
/**
...
...
src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java
View file @
a184aabd
...
...
@@ -36,5 +36,11 @@ public interface AccountHeadMapperEx {
List
<
AccountHeadVo4ListEx
>
getDetailByNumber
(
@Param
(
"billNo"
)
String
billNo
);
int
batchDeleteAccountHeadByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
ids
[]);
int
batchDeleteAccountHeadByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
[]
ids
);
List
<
AccountHead
>
getAccountHeadListByAccountIds
(
@Param
(
"accountIds"
)
String
[]
accountIds
);
List
<
AccountHead
>
getAccountHeadListByOrganIds
(
@Param
(
"organIds"
)
String
[]
organIds
);
List
<
AccountHead
>
getAccountHeadListByHandsPersonIds
(
@Param
(
"handsPersonIds"
)
String
[]
handsPersonIds
);
}
\ No newline at end of file
src/main/java/com/jsh/erp/datasource/mappers/AccountItemMapperEx.java
View file @
a184aabd
...
...
@@ -25,5 +25,11 @@ public interface AccountItemMapperEx {
List
<
AccountItemVo4List
>
getDetailList
(
@Param
(
"headerId"
)
Long
headerId
);
int
batchDeleteAccountItemByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
ids
[]);
int
batchDeleteAccountItemByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
[]
ids
);
List
<
AccountItem
>
getAccountItemListByAccountIds
(
@Param
(
"accountIds"
)
String
[]
accountIds
);
List
<
AccountItem
>
getAccountItemListByHeaderIds
(
@Param
(
"headerIds"
)
String
[]
headerIds
);
List
<
AccountItem
>
getAccountItemListByInOutItemIds
(
@Param
(
"inOutItemIds"
)
String
[]
inOutItemIds
);
}
\ No newline at end of file
Prev
1
2
Next
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