Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
07320537
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
07320537
编写于
5月 16, 2019
作者:
R
roo00
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加委托授权数据访问接口
上级
35dd8e78
变更
60
隐藏空白更改
内联
并排
Showing
60 changed file
with
2584 addition
and
180 deletion
+2584
-180
o2server/x_organization_assemble_authentication/src/main/webapp/jest/describe.js
..._assemble_authentication/src/main/webapp/jest/describe.js
+17
-5
o2server/x_organization_assemble_control/src/main/webapp/jest/describe.js
...ization_assemble_control/src/main/webapp/jest/describe.js
+17
-5
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/CacheFactory.java
...ava/com/x/organization/assemble/express/CacheFactory.java
+7
-2
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/TrustFactory.java
...x/organization/assemble/express/factory/TrustFactory.java
+18
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/TrustLogFactory.java
...rganization/assemble/express/factory/TrustLogFactory.java
+12
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/ActionApplication.java
...rganization/assemble/express/jaxrs/ActionApplication.java
+4
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/TrustJaxrsFilter.java
...organization/assemble/express/jaxrs/TrustJaxrsFilter.java
+10
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/TrustLogJaxrsFilter.java
...anization/assemble/express/jaxrs/TrustLogJaxrsFilter.java
+10
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/ActionListWithIdentityObject.java
...ble/express/jaxrs/trust/ActionListWithIdentityObject.java
+166
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/BaseAction.java
...organization/assemble/express/jaxrs/trust/BaseAction.java
+61
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/TrustAction.java
...rganization/assemble/express/jaxrs/trust/TrustAction.java
+49
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ActionCreate.java
...ization/assemble/express/jaxrs/trustlog/ActionCreate.java
+81
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/BaseAction.java
...anization/assemble/express/jaxrs/trustlog/BaseAction.java
+61
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyApplication.java
...ble/express/jaxrs/trustlog/ExceptionEmptyApplication.java
+12
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyFromIdentity.java
...le/express/jaxrs/trustlog/ExceptionEmptyFromIdentity.java
+12
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyProcess.java
...ssemble/express/jaxrs/trustlog/ExceptionEmptyProcess.java
+12
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyToIdentity.java
...mble/express/jaxrs/trustlog/ExceptionEmptyToIdentity.java
+12
-0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/TrustLogAction.java
...ation/assemble/express/jaxrs/trustlog/TrustLogAction.java
+46
-0
o2server/x_organization_assemble_express/src/main/webapp/jest/describe.js
...ization_assemble_express/src/main/webapp/jest/describe.js
+17
-5
o2server/x_organization_assemble_express/src/test/java/com/x/organization/service/express/test/TestClient.java
...a/com/x/organization/service/express/test/TestClient.java
+68
-14
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/ActionApplication.java
...ganization/assemble/personal/jaxrs/ActionApplication.java
+4
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/TrustJaxrsFilter.java
...rganization/assemble/personal/jaxrs/TrustJaxrsFilter.java
+10
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/TrustLogJaxrsFilter.java
...nization/assemble/personal/jaxrs/TrustLogJaxrsFilter.java
+10
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGetComplex.java
...tion/assemble/personal/jaxrs/person/ActionGetComplex.java
+0
-132
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionCreate.java
...anization/assemble/personal/jaxrs/trust/ActionCreate.java
+92
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionDelete.java
...anization/assemble/personal/jaxrs/trust/ActionDelete.java
+40
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionEdit.java
...rganization/assemble/personal/jaxrs/trust/ActionEdit.java
+93
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListNext.java
...ization/assemble/personal/jaxrs/trust/ActionListNext.java
+45
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListPrev.java
...ization/assemble/personal/jaxrs/trust/ActionListPrev.java
+44
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListTo.java
...anization/assemble/personal/jaxrs/trust/ActionListTo.java
+53
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListWithCurrentPerson.java
...ble/personal/jaxrs/trust/ActionListWithCurrentPerson.java
+53
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/BaseAction.java
...rganization/assemble/personal/jaxrs/trust/BaseAction.java
+78
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionApplicationExist.java
...emble/personal/jaxrs/trust/ExceptionApplicationExist.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionEmptyFromIdentity.java
...mble/personal/jaxrs/trust/ExceptionEmptyFromIdentity.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionEmptyToIdentity.java
...semble/personal/jaxrs/trust/ExceptionEmptyToIdentity.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionPersonNotExistWithIdentity.java
...onal/jaxrs/trust/ExceptionPersonNotExistWithIdentity.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionProcessExist.java
.../assemble/personal/jaxrs/trust/ExceptionProcessExist.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionWholeExist.java
...on/assemble/personal/jaxrs/trust/ExceptionWholeExist.java
+13
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/TrustAction.java
...ganization/assemble/personal/jaxrs/trust/TrustAction.java
+161
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionDelete.java
...zation/assemble/personal/jaxrs/trustlog/ActionDelete.java
+40
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListNext.java
...tion/assemble/personal/jaxrs/trustlog/ActionListNext.java
+45
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListPrev.java
...tion/assemble/personal/jaxrs/trustlog/ActionListPrev.java
+44
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListTo.java
...zation/assemble/personal/jaxrs/trustlog/ActionListTo.java
+53
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListWithCurrentPerson.java
.../personal/jaxrs/trustlog/ActionListWithCurrentPerson.java
+53
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/BaseAction.java
...nization/assemble/personal/jaxrs/trustlog/BaseAction.java
+7
-0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/TrustLogAction.java
...tion/assemble/personal/jaxrs/trustlog/TrustLogAction.java
+127
-0
o2server/x_organization_assemble_personal/src/main/webapp/jest/describe.js
...zation_assemble_personal/src/main/webapp/jest/describe.js
+17
-5
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/Custom.java
.../src/main/java/com/x/organization/core/entity/Custom.java
+0
-2
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/PersistenceProperties.java
...com/x/organization/core/entity/PersistenceProperties.java
+11
-0
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/Trust.java
...n/java/com/x/organization/core/entity/accredit/Trust.java
+216
-0
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/TrustLog.java
...ava/com/x/organization/core/entity/accredit/TrustLog.java
+311
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java
...in/java/com/x/organization/core/express/Organization.java
+20
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/ActionListWithIdentityObject.java
...tion/core/express/trust/ActionListWithIdentityObject.java
+28
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/BaseAction.java
...ava/com/x/organization/core/express/trust/BaseAction.java
+51
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/TrustFactory.java
...a/com/x/organization/core/express/trust/TrustFactory.java
+29
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/ActionLog.java
...a/com/x/organization/core/express/trustlog/ActionLog.java
+17
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/BaseAction.java
.../com/x/organization/core/express/trustlog/BaseAction.java
+9
-0
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/TrustLogFactory.java
...x/organization/core/express/trustlog/TrustLogFactory.java
+19
-0
o2server/x_portal_assemble_designer/src/main/webapp/jest/describe.js
...portal_assemble_designer/src/main/webapp/jest/describe.js
+17
-5
o2server/x_portal_assemble_surface/src/main/webapp/jest/describe.js
..._portal_assemble_surface/src/main/webapp/jest/describe.js
+17
-5
未找到文件。
o2server/x_organization_assemble_authentication/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_organization_assemble_control/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/CacheFactory.java
浏览文件 @
07320537
...
...
@@ -9,6 +9,7 @@ import com.x.organization.core.entity.Role;
import
com.x.organization.core.entity.Unit
;
import
com.x.organization.core.entity.UnitAttribute
;
import
com.x.organization.core.entity.UnitDuty
;
import
com.x.organization.core.entity.accredit.Trust
;
import
net.sf.ehcache.Ehcache
;
...
...
@@ -16,7 +17,7 @@ public class CacheFactory {
public
static
Ehcache
getOrganizationCache
()
{
return
ApplicationCache
.
instance
().
getCache
(
Identity
.
class
,
Unit
.
class
,
UnitAttribute
.
class
,
UnitDuty
.
class
,
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Group
.
class
);
Role
.
class
,
Person
.
class
,
PersonAttribute
.
class
,
Group
.
class
,
Trust
.
class
);
}
public
static
Ehcache
getIdentityCache
()
{
...
...
@@ -27,6 +28,10 @@ public class CacheFactory {
return
ApplicationCache
.
instance
().
getCache
(
Unit
.
class
);
}
public
static
Ehcache
getTrustCache
()
{
return
ApplicationCache
.
instance
().
getCache
(
Trust
.
class
);
}
public
static
Ehcache
getUnitAttributeCache
()
{
return
ApplicationCache
.
instance
().
getCache
(
UnitAttribute
.
class
);
}
...
...
@@ -60,6 +65,6 @@ public class CacheFactory {
ApplicationCache
.
notify
(
UnitDuty
.
class
);
ApplicationCache
.
notify
(
Group
.
class
);
ApplicationCache
.
notify
(
Role
.
class
);
ApplicationCache
.
notify
(
Trust
.
class
);
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/TrustFactory.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.factory
;
import
com.x.organization.assemble.express.AbstractFactory
;
import
com.x.organization.assemble.express.Business
;
import
com.x.organization.assemble.express.CacheFactory
;
import
net.sf.ehcache.Ehcache
;
public
class
TrustFactory
extends
AbstractFactory
{
private
Ehcache
cache
;
public
TrustFactory
(
Business
business
)
throws
Exception
{
super
(
business
);
this
.
cache
=
CacheFactory
.
getTrustCache
();
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/factory/TrustLogFactory.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.factory
;
import
com.x.organization.assemble.express.AbstractFactory
;
import
com.x.organization.assemble.express.Business
;
public
class
TrustLogFactory
extends
AbstractFactory
{
public
TrustLogFactory
(
Business
business
)
throws
Exception
{
super
(
business
);
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/ActionApplication.java
浏览文件 @
07320537
...
...
@@ -10,6 +10,8 @@ import com.x.organization.assemble.express.jaxrs.identity.IdentityAction;
import
com.x.organization.assemble.express.jaxrs.person.PersonAction
;
import
com.x.organization.assemble.express.jaxrs.personattribute.PersonAttributeAction
;
import
com.x.organization.assemble.express.jaxrs.role.RoleAction
;
import
com.x.organization.assemble.express.jaxrs.trust.TrustAction
;
import
com.x.organization.assemble.express.jaxrs.trustlog.TrustLogAction
;
import
com.x.organization.assemble.express.jaxrs.unit.UnitAction
;
import
com.x.organization.assemble.express.jaxrs.unitattribute.UnitAttributeAction
;
import
com.x.organization.assemble.express.jaxrs.unitduty.UnitDutyAction
;
...
...
@@ -25,6 +27,8 @@ public class ActionApplication extends AbstractActionApplication {
classes
.
add
(
UnitAction
.
class
);
classes
.
add
(
UnitAttributeAction
.
class
);
classes
.
add
(
UnitDutyAction
.
class
);
classes
.
add
(
TrustAction
.
class
);
classes
.
add
(
TrustLogAction
.
class
);
return
classes
;
}
...
...
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/TrustJaxrsFilter.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs
;
import
javax.servlet.annotation.WebFilter
;
import
com.x.base.core.project.jaxrs.CipherManagerUserJaxrsFilter
;
@WebFilter
(
urlPatterns
=
"/jaxrs/trust/*"
,
asyncSupported
=
true
)
public
class
TrustJaxrsFilter
extends
CipherManagerUserJaxrsFilter
{
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/TrustLogJaxrsFilter.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs
;
import
javax.servlet.annotation.WebFilter
;
import
com.x.base.core.project.jaxrs.CipherManagerUserJaxrsFilter
;
@WebFilter
(
urlPatterns
=
"/jaxrs/trustlog/*"
,
asyncSupported
=
true
)
public
class
TrustLogJaxrsFilter
extends
CipherManagerUserJaxrsFilter
{
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/ActionListWithIdentityObject.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trust
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.assemble.express.Business
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.accredit.Trust
;
import
com.x.organization.core.entity.accredit.Trust_
;
import
net.sf.ehcache.Element
;
class
ActionListWithIdentityObject
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionListWithIdentityObject
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
wi
.
getApplication
(),
wi
.
getProcess
(),
StringUtils
.
join
(
wi
.
getIdentityList
(),
","
));
Element
element
=
cache
.
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
}
else
{
List
<
Wo
>
wos
=
this
.
execute
(
business
,
wi
);
cache
.
put
(
new
Element
(
cacheKey
,
wos
));
result
.
setData
(
wos
);
}
return
result
;
}
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"应用"
)
private
String
application
;
@FieldDescribe
(
"流程"
)
private
String
process
;
@FieldDescribe
(
"身份"
)
private
List
<
String
>
identityList
=
new
ArrayList
<>();
public
List
<
String
>
getIdentityList
()
{
return
identityList
;
}
public
void
setIdentityList
(
List
<
String
>
identityList
)
{
this
.
identityList
=
identityList
;
}
public
String
getApplication
()
{
return
application
;
}
public
void
setApplication
(
String
application
)
{
this
.
application
=
application
;
}
public
String
getProcess
()
{
return
process
;
}
public
void
setProcess
(
String
process
)
{
this
.
process
=
process
;
}
}
public
static
class
Wo
extends
com
.
x
.
base
.
core
.
project
.
organization
.
Trust
{
public
Wo
()
{
}
public
Wo
(
String
fromIdentity
,
String
toIdentity
)
{
this
.
setFromIdentity
(
fromIdentity
);
this
.
setToIdentity
(
toIdentity
);
}
}
private
List
<
Trust
>
list
(
Business
business
,
Wi
wi
)
throws
Exception
{
List
<
Identity
>
identities
=
business
.
identity
().
pick
(
wi
.
getIdentityList
());
List
<
String
>
ids
=
ListTools
.
extractProperty
(
identities
,
JpaObject
.
id_FIELDNAME
,
String
.
class
,
true
,
true
);
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Trust
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Trust
>
cq
=
cb
.
createQuery
(
Trust
.
class
);
Root
<
Trust
>
root
=
cq
.
from
(
Trust
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Trust_
.
whole
),
true
);
if
(
StringUtils
.
isNotEmpty
(
wi
.
getApplication
()))
{
p
=
cb
.
and
(
p
,
cb
.
and
(
cb
.
notEqual
(
root
.
get
(
Trust_
.
whole
),
true
),
cb
.
equal
(
root
.
get
(
Trust_
.
application
),
wi
.
getApplication
()),
cb
.
or
(
cb
.
equal
(
root
.
get
(
Trust_
.
process
),
""
),
cb
.
isNull
(
root
.
get
(
Trust_
.
process
)))));
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getProcess
()))
{
p
=
cb
.
and
(
p
,
cb
.
and
(
cb
.
notEqual
(
root
.
get
(
Trust_
.
whole
),
true
),
cb
.
equal
(
root
.
get
(
Trust_
.
process
),
wi
.
getProcess
())));
}
cb
.
and
(
p
,
cb
.
isMember
(
root
.
get
(
Trust_
.
fromIdentity
),
cb
.
literal
(
ids
)));
return
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
).
distinct
(
true
)).
getResultList
();
}
private
List
<
Wo
>
execute
(
Business
business
,
Wi
wi
)
throws
Exception
{
List
<
Wo
>
wos
=
new
ArrayList
<>();
this
.
list
(
business
,
wi
).
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getFromIdentity
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
out:
for
(;;)
{
for
(
Trust
t
:
o
.
getValue
())
{
if
((
BooleanUtils
.
isNotTrue
(
t
.
getWhole
()))
&&
StringUtils
.
isNotEmpty
(
t
.
getProcess
()))
{
Wo
wo
=
new
Wo
(
t
.
getFromIdentity
(),
t
.
getToIdentity
());
wos
.
add
(
wo
);
break
out
;
}
}
for
(
Trust
t
:
o
.
getValue
())
{
if
((
BooleanUtils
.
isNotTrue
(
t
.
getWhole
()))
&&
StringUtils
.
isNotEmpty
(
t
.
getApplication
()))
{
Wo
wo
=
new
Wo
(
t
.
getFromIdentity
(),
t
.
getToIdentity
());
wos
.
add
(
wo
);
break
out
;
}
}
for
(
Trust
t
:
o
.
getValue
())
{
if
(
BooleanUtils
.
isTrue
(
t
.
getWhole
()))
{
Wo
wo
=
new
Wo
(
t
.
getFromIdentity
(),
t
.
getToIdentity
());
wos
.
add
(
wo
);
break
out
;
}
}
break
;
}
});
return
wos
;
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trust
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.organization.assemble.express.Business
;
import
com.x.organization.assemble.express.CacheFactory
;
import
com.x.organization.core.entity.Unit
;
import
net.sf.ehcache.Ehcache
;
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
cache
=
CacheFactory
.
getOrganizationCache
();
static
class
WoUnitListAbstract
extends
GsonPropertyObject
{
@FieldDescribe
(
"组织识别名"
)
private
List
<
String
>
unitList
=
new
ArrayList
<>();
public
List
<
String
>
getUnitList
()
{
return
unitList
;
}
public
void
setUnitList
(
List
<
String
>
unitList
)
{
this
.
unitList
=
unitList
;
}
}
protected
<
T
extends
com
.
x
.
base
.
core
.
project
.
organization
.
Unit
>
T
convert
(
Business
business
,
Unit
unit
,
Class
<
T
>
clz
)
throws
Exception
{
T
t
=
clz
.
newInstance
();
t
.
setName
(
unit
.
getName
());
t
.
setUnique
(
unit
.
getUnique
());
t
.
setDistinguishedName
(
unit
.
getDistinguishedName
());
t
.
setDescription
(
unit
.
getDescription
());
t
.
setTypeList
(
unit
.
getTypeList
());
t
.
setShortName
(
unit
.
getShortName
());
t
.
setLevel
(
unit
.
getLevel
());
t
.
setLevelName
(
unit
.
getLevelName
());
t
.
setOrderNumber
(
unit
.
getOrderNumber
());
t
.
setQiyeweixinId
(
unit
.
getQiyeweixinId
());
t
.
setDingdingId
(
unit
.
getDingdingId
());
t
.
setZhengwuDingdingId
(
unit
.
getZhengwuDingdingId
());
if
(
StringUtils
.
isNotEmpty
(
unit
.
getSuperior
()))
{
Unit
superior
=
business
.
unit
().
pick
(
unit
.
getSuperior
());
if
(
null
!=
superior
)
{
t
.
setSuperior
(
superior
.
getDistinguishedName
());
}
}
return
t
;
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trust/TrustAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trust
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@Path
(
"trust"
)
@JaxrsDescribe
(
"委托接口"
)
public
class
TrustAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TrustAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"查找指定人员的委托办理."
,
action
=
ActionListWithIdentityObject
.
class
)
@POST
@Path
(
"list/identity/object"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithIdentityObject
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionListWithIdentityObject
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithIdentityObject
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ActionCreate.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.tools.JpaObjectTools
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.organization.assemble.express.Business
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.accredit.TrustLog
;
class
ActionCreate
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
if
(
StringUtils
.
isEmpty
(
wi
.
getApplication
()))
{
throw
new
ExceptionEmptyApplication
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getProcess
()))
{
throw
new
ExceptionEmptyProcess
();
}
Identity
fromIdentity
=
business
.
identity
().
pick
(
wi
.
getFromIdentity
());
if
(
null
==
fromIdentity
)
{
throw
new
ExceptionEmptyFromIdentity
();
}
Identity
toIdentity
=
business
.
identity
().
pick
(
wi
.
getToIdentity
());
if
(
null
==
toIdentity
)
{
throw
new
ExceptionEmptyToIdentity
();
}
TrustLog
trustLog
=
Wi
.
copier
.
copy
(
wi
);
trustLog
.
setTitle
(
StringTools
.
utf8SubString
(
wi
.
getTitle
(),
JpaObjectTools
.
definedLength
(
TrustLog
.
class
,
TrustLog
.
title_FIELDNAME
)));
emc
.
beginTransaction
(
TrustLog
.
class
);
emc
.
persist
(
trustLog
,
CheckPersistType
.
all
);
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wi
extends
TrustLog
{
private
static
final
long
serialVersionUID
=
4099666546308723776L
;
static
WrapCopier
<
Wi
,
TrustLog
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
TrustLog
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.organization.assemble.express.Business
;
import
com.x.organization.assemble.express.CacheFactory
;
import
com.x.organization.core.entity.Unit
;
import
net.sf.ehcache.Ehcache
;
class
BaseAction
extends
StandardJaxrsAction
{
Ehcache
cache
=
CacheFactory
.
getOrganizationCache
();
static
class
WoUnitListAbstract
extends
GsonPropertyObject
{
@FieldDescribe
(
"组织识别名"
)
private
List
<
String
>
unitList
=
new
ArrayList
<>();
public
List
<
String
>
getUnitList
()
{
return
unitList
;
}
public
void
setUnitList
(
List
<
String
>
unitList
)
{
this
.
unitList
=
unitList
;
}
}
protected
<
T
extends
com
.
x
.
base
.
core
.
project
.
organization
.
Unit
>
T
convert
(
Business
business
,
Unit
unit
,
Class
<
T
>
clz
)
throws
Exception
{
T
t
=
clz
.
newInstance
();
t
.
setName
(
unit
.
getName
());
t
.
setUnique
(
unit
.
getUnique
());
t
.
setDistinguishedName
(
unit
.
getDistinguishedName
());
t
.
setDescription
(
unit
.
getDescription
());
t
.
setTypeList
(
unit
.
getTypeList
());
t
.
setShortName
(
unit
.
getShortName
());
t
.
setLevel
(
unit
.
getLevel
());
t
.
setLevelName
(
unit
.
getLevelName
());
t
.
setOrderNumber
(
unit
.
getOrderNumber
());
t
.
setQiyeweixinId
(
unit
.
getQiyeweixinId
());
t
.
setDingdingId
(
unit
.
getDingdingId
());
t
.
setZhengwuDingdingId
(
unit
.
getZhengwuDingdingId
());
if
(
StringUtils
.
isNotEmpty
(
unit
.
getSuperior
()))
{
Unit
superior
=
business
.
unit
().
pick
(
unit
.
getSuperior
());
if
(
null
!=
superior
)
{
t
.
setSuperior
(
superior
.
getDistinguishedName
());
}
}
return
t
;
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyApplication.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyApplication
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
665095222445791960L
;
ExceptionEmptyApplication
()
{
super
(
"应用不能为空."
);
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyFromIdentity.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyFromIdentity
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
665095222445791960L
;
ExceptionEmptyFromIdentity
()
{
super
(
"委托人不能为空."
);
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyProcess.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyProcess
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
665095222445791960L
;
ExceptionEmptyProcess
()
{
super
(
"流程不能为空."
);
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/ExceptionEmptyToIdentity.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyToIdentity
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
665095222445791960L
;
ExceptionEmptyToIdentity
()
{
super
(
"被委托人不能为空."
);
}
}
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/jaxrs/trustlog/TrustLogAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.express.jaxrs.trustlog
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@Path
(
"trustlog"
)
@JaxrsDescribe
(
"委托日志接口"
)
public
class
TrustLogAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TrustLogAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"创建委托日志."
,
action
=
ActionCreate
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
create
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionCreate
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionCreate
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
}
\ No newline at end of file
o2server/x_organization_assemble_express/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_organization_assemble_express/src/test/java/com/x/organization/service/express/test/TestClient.java
浏览文件 @
07320537
package
com.x.organization.service.express.test
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.junit.Test
;
import
com.x.organization.core.entity.accredit.Trust
;
public
class
TestClient
{
// @Test
// public void test() throws Exception {
// Request request = Request.Post("http://xa.ray.local:8080/x_organization_service_express/jaxrs/identity/list");
// Gson gson = XGsonBuilder.instance();
// List<String> data = new ArrayList<>();
// data.add("张三");
// data.add("赵六");
// if (null != data) {
// request.bodyString(gson.toJson(data), ContentType.APPLICATION_JSON);
// }
// String str = request.execute().returnContent().asString(Charset.forName("UTF-8"));
// System.out.println(str);
//
// }
@Test
public
void
test
()
throws
Exception
{
List
<
Trust
>
list
=
new
ArrayList
<>();
Trust
t1
=
new
Trust
();
t1
.
setApplication
(
"applicationa"
);
Trust
t2
=
new
Trust
();
t2
.
setApplication
(
"applicationb"
);
t2
.
setProcess
(
"processb"
);
Trust
t3
=
new
Trust
();
t3
.
setApplication
(
"applicationc"
);
t3
.
setProcess
(
"processc"
);
t3
.
setWhole
(
true
);
list
.
add
(
t1
);
list
.
add
(
t2
);
list
.
add
(
t3
);
// list.stream().sorted((o1, o2) -> {
// if (StringUtils.isNotEmpty(o1.getProcess()) && StringUtils.isNotEmpty(o2.getProcess())) {
// return 0;
// } else if (StringUtils.isNotEmpty(o1.getProcess()) && StringUtils.isEmpty(o2.getProcess())) {
// return -1;
// } else if (StringUtils.isEmpty(o1.getProcess()) && StringUtils.isNotEmpty(o2.getProcess())) {
// return 1;
// } else if (StringUtils.isNotEmpty(o1.getApplication()) && StringUtils.isNotEmpty(o2.getApplication())) {
// return 0;
// } else if (StringUtils.isNotEmpty(o1.getApplication()) && StringUtils.isEmpty(o2.getApplication())) {
// return -1;
// } else if (StringUtils.isEmpty(o1.getApplication()) && StringUtils.isNotEmpty(o2.getApplication())) {
// return 1;
// } else {
// return 1;
// }
// }).forEach(o -> {
// System.out.println(o);
// });
Trust
trust
=
null
;
out:
for
(;;)
{
for
(
Trust
t
:
list
)
{
if
((
BooleanUtils
.
isNotTrue
(
t
.
getWhole
()))
&&
StringUtils
.
isNotEmpty
(
t
.
getProcess
()))
{
trust
=
t
;
break
out
;
}
}
for
(
Trust
t
:
list
)
{
if
((
BooleanUtils
.
isNotTrue
(
t
.
getWhole
()))
&&
StringUtils
.
isNotEmpty
(
t
.
getApplication
()))
{
trust
=
t
;
break
out
;
}
}
for
(
Trust
t
:
list
)
{
if
(
BooleanUtils
.
isTrue
(
t
.
getWhole
()))
{
trust
=
t
;
break
out
;
}
}
break
;
}
System
.
out
.
println
(
trust
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/ActionApplication.java
浏览文件 @
07320537
...
...
@@ -12,6 +12,8 @@ import com.x.organization.assemble.personal.jaxrs.password.PasswordAction;
import
com.x.organization.assemble.personal.jaxrs.person.PersonAction
;
import
com.x.organization.assemble.personal.jaxrs.regist.RegistAction
;
import
com.x.organization.assemble.personal.jaxrs.reset.ResetAction
;
import
com.x.organization.assemble.personal.jaxrs.trust.TrustAction
;
import
com.x.organization.assemble.personal.jaxrs.trustlog.TrustLogAction
;
@ApplicationPath
(
"jaxrs"
)
public
class
ActionApplication
extends
AbstractActionApplication
{
...
...
@@ -24,6 +26,8 @@ public class ActionApplication extends AbstractActionApplication {
classes
.
add
(
IconAction
.
class
);
classes
.
add
(
DefinitionAction
.
class
);
classes
.
add
(
CustomAction
.
class
);
classes
.
add
(
TrustAction
.
class
);
classes
.
add
(
TrustLogAction
.
class
);
return
classes
;
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/TrustJaxrsFilter.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs
;
import
javax.servlet.annotation.WebFilter
;
import
com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter
;
@WebFilter
(
urlPatterns
=
"/jaxrs/trust/*"
,
asyncSupported
=
true
)
public
class
TrustJaxrsFilter
extends
AnonymousCipherManagerUserJaxrsFilter
{
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/TrustLogJaxrsFilter.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs
;
import
javax.servlet.annotation.WebFilter
;
import
com.x.base.core.project.jaxrs.AnonymousCipherManagerUserJaxrsFilter
;
@WebFilter
(
urlPatterns
=
"/jaxrs/trustlog/*"
,
asyncSupported
=
true
)
public
class
TrustLogJaxrsFilter
extends
AnonymousCipherManagerUserJaxrsFilter
{
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionGetComplex.java
已删除
100644 → 0
浏览文件 @
35dd8e78
//package com.x.organization.assemble.personal.jaxrs.person;
//
//import java.net.URLEncoder;
//import java.util.ArrayList;
//import java.util.List;
//
//import com.x.base.core.DefaultCharset;
//import com.x.base.core.bean.WrapCopier;
//import com.x.base.core.bean.WrapCopierFactory;
//import com.x.base.core.cache.ApplicationCache;
//import com.x.base.core.container.EntityManagerContainer;
//import com.x.base.core.container.factory.EntityManagerContainerFactory;
//import com.x.base.core.entity.JpaObject;
//import com.x.base.core.http.ActionResult;
//import com.x.base.core.http.EffectivePerson;
//import com.x.base.core.http.WrapOutOnline;
//import com.x.base.core.project.x_collaboration_assemble_websocket;
//import com.x.base.core.project.organization.Identity;
//import com.x.base.core.project.organization.Person;
//import com.x.base.core.project.server.Config;
//import com.x.organization.assemble.personal.Business;
//import com.x.organization.assemble.personal.ThisApplication;
//import com.x.organization.core.express.Organization;
//
//import net.sf.ehcache.Element;
//
//class ActionGetComplex extends BaseAction {
//
// ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
// ActionResult<Wo> result = new ActionResult<>();
// Wo wo = null;
// if (Config.token().isInitialManager(effectivePerson.getDistinguishedName())) {
// wo = new Wo();
// Config.token().initialManagerInstance().copyTo(wo);
// } else {
// String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(),
// effectivePerson.getDistinguishedName());
// Element element = cache.get(cacheKey);
// if ((null != element) && (null != element.getObjectValue())) {
// wo = (Wo) element.getObjectValue();
// } else {
// try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
// Business business = new Business(emc);
// Person person = business.organization().person().getObject(effectivePerson.getDistinguishedName());
// if (null != person) {
// wo = Wo.copier.copy(person);
// // if (StringUtils.isEmpty(wrap.getIcon())) {
// // if (Objects.equals(wrap.getGenderType(),
// // GenderType.f)) {
// // wrap.setIcon(Person.ICON_FEMALE);
// // } else if (Objects.equals(wrap.getGenderType(),
// // GenderType.m)) {
// // wrap.setIcon(Person.ICON_MALE);
// // } else {
// // wrap.setIcon(Person.ICON_UNKOWN);
// // }
// // }
// wo.setIdentityList(this.listIdentity(business.organization(), wo.getDistinguishedName()));
// // wo.setOnlineStatus(this.getOnlineStatus(business,
// // wrap.getName()));
// cache.put(new Element(cacheKey, wo));
// }
// }
// }
// }
// result.setData(wo);
// return result;
// }
//
// public static class Wo extends Person {
//
// static WrapCopier<Person, Wo> copier = WrapCopierFactory.create(Person.class, Wo.class, null,
// JpaObject.FieldsInvisible);
//
// private List<WoIdentity> identityList = new ArrayList<>();
//
// private String onlineStatus;
//
// public String getOnlineStatus() {
// return onlineStatus;
// }
//
// public void setOnlineStatus(String onlineStatus) {
// this.onlineStatus = onlineStatus;
// }
//
// public List<WoIdentity> getIdentityList() {
// return identityList;
// }
//
// public void setIdentityList(List<WoIdentity> identityList) {
// this.identityList = identityList;
// }
//
// }
//
// public static class WoIdentity extends Identity {
//
// static WrapCopier<Identity, WoIdentity> copier = WrapCopierFactory.create(Identity.class,
// WoIdentity.class, null, JpaObject.FieldsInvisible);
//
// private List<String> unitDutyList = new ArrayList<>();
//
// public List<String> getUnitDutyList() {
// return unitDutyList;
// }
//
// public void setUnitDutyList(List<String> unitDutyList) {
// this.unitDutyList = unitDutyList;
// }
//
// }
//
// private List<WoIdentity> listIdentity(Organization organization, String personName) throws Exception {
// List<WoIdentity> list = new ArrayList<>();
// List<Identity> os = organization.identity().listObject(organization.identity().listWithPerson(personName));
// for (Identity o : os) {
// WoIdentity wo = WoIdentity.copier.copy(o);
// wo.getUnitDutyList().addAll(organization.unitDuty().listNameWithIdentity(o.getDistinguishedName()));
// list.add(wo);
// }
// return list;
// }
//
// private String getOnlineStatus(Business business, String person) throws Exception {
// WrapOutOnline online = ThisApplication.context().applications()
// .getQuery(x_collaboration_assemble_websocket.class,
// "online/person/" + URLEncoder.encode(person, DefaultCharset.name))
// .getData(WrapOutOnline.class);
// return online.getOnlineStatus();
// }
//}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionCreate.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.assemble.personal.jaxrs.trust.ActionEdit.Wi
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.accredit.Trust
;
class
ActionCreate
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
if
(
StringUtils
.
isEmpty
(
wi
.
getFromIdentity
()))
{
throw
new
ExceptionEmptyFromIdentity
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getToIdentity
()))
{
throw
new
ExceptionEmptyToIdentity
();
}
if
(
BooleanUtils
.
isTrue
(
wi
.
getWhole
()))
{
if
(!
this
.
checkWhole
(
business
,
wi
))
{
throw
new
ExceptionWholeExist
(
wi
.
getFromIdentity
());
}
}
else
{
if
(
StringUtils
.
isNotEmpty
(
wi
.
getApplication
()))
{
if
(
StringUtils
.
isNotEmpty
(
wi
.
getProcess
()))
{
if
(!
this
.
checkProcess
(
business
,
wi
))
{
throw
new
ExceptionProcessExist
(
wi
.
getFromIdentity
(),
wi
.
getApplication
(),
wi
.
getProcess
());
}
}
else
if
(!
this
.
checkApplication
(
business
,
wi
))
{
throw
new
ExceptionApplicationExist
(
wi
.
getFromIdentity
(),
wi
.
getApplication
());
}
}
}
Trust
trust
=
new
Trust
();
Wi
.
copier
.
copy
(
wi
,
trust
);
String
fromPerson
=
this
.
getPersonDNWithIdentityDN
(
business
,
trust
.
getFromIdentity
());
if
(
StringUtils
.
isEmpty
(
fromPerson
))
{
throw
new
ExceptionPersonNotExistWithIdentity
(
trust
.
getFromIdentity
());
}
else
{
trust
.
setFromPerson
(
fromPerson
);
}
String
toPerson
=
this
.
getPersonDNWithIdentityDN
(
business
,
trust
.
getToIdentity
());
if
(
StringUtils
.
isEmpty
(
toPerson
))
{
throw
new
ExceptionPersonNotExistWithIdentity
(
trust
.
getToIdentity
());
}
else
{
trust
.
setToPerson
(
toPerson
);
}
emc
.
beginTransaction
(
Trust
.
class
);
emc
.
persist
(
trust
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Trust
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
trust
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wi
extends
Trust
{
private
static
final
long
serialVersionUID
=
1571810726944802231L
;
static
WrapCopier
<
Wi
,
Trust
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Trust
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
public
static
class
Wo
extends
WoId
{
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionDelete.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.organization.core.entity.accredit.Trust
;
class
ActionDelete
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Trust
trust
=
emc
.
find
(
id
,
Trust
.
class
);
if
(
null
==
trust
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Trust
.
class
);
}
if
(
effectivePerson
.
isNotManager
()
&&
effectivePerson
.
isNotPerson
(
trust
.
getFromPerson
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
trust
);
}
emc
.
beginTransaction
(
Trust
.
class
);
emc
.
remove
(
trust
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Trust
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionEdit.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Trust
;
class
ActionEdit
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionEdit
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Business
business
=
new
Business
(
emc
);
Trust
trust
=
emc
.
find
(
id
,
Trust
.
class
);
if
(
null
==
trust
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Trust
.
class
);
}
if
(
StringUtils
.
isEmpty
(
wi
.
getFromIdentity
()))
{
throw
new
ExceptionEmptyFromIdentity
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getToIdentity
()))
{
throw
new
ExceptionEmptyToIdentity
();
}
if
(
BooleanUtils
.
isTrue
(
wi
.
getWhole
()))
{
if
(!
this
.
checkWhole
(
business
,
wi
))
{
throw
new
ExceptionWholeExist
(
wi
.
getFromIdentity
());
}
}
else
{
if
(
StringUtils
.
isNotEmpty
(
wi
.
getApplication
()))
{
if
(
StringUtils
.
isNotEmpty
(
wi
.
getProcess
()))
{
if
(!
this
.
checkProcess
(
business
,
wi
))
{
throw
new
ExceptionProcessExist
(
wi
.
getFromIdentity
(),
wi
.
getApplication
(),
wi
.
getProcess
());
}
}
else
if
(!
this
.
checkApplication
(
business
,
wi
))
{
throw
new
ExceptionApplicationExist
(
wi
.
getFromIdentity
(),
wi
.
getApplication
());
}
}
}
Wi
.
copier
.
copy
(
wi
,
trust
);
String
fromPerson
=
this
.
getPersonDNWithIdentityDN
(
business
,
trust
.
getFromIdentity
());
if
(
StringUtils
.
isEmpty
(
fromPerson
))
{
throw
new
ExceptionPersonNotExistWithIdentity
(
trust
.
getFromIdentity
());
}
else
{
trust
.
setFromPerson
(
fromPerson
);
}
String
toPerson
=
this
.
getPersonDNWithIdentityDN
(
business
,
trust
.
getToIdentity
());
if
(
StringUtils
.
isEmpty
(
toPerson
))
{
throw
new
ExceptionPersonNotExistWithIdentity
(
trust
.
getToIdentity
());
}
else
{
trust
.
setToPerson
(
toPerson
);
}
emc
.
beginTransaction
(
Trust
.
class
);
emc
.
persist
(
trust
,
CheckPersistType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
Trust
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
trust
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wi
extends
Trust
{
private
static
final
long
serialVersionUID
=
1571810726944802231L
;
static
WrapCopier
<
Wi
,
Trust
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Trust
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
public
static
class
Wo
extends
WoId
{
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListNext.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
java.util.List
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.core.entity.accredit.Trust
;
class
ActionListNext
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
result
=
this
.
standardListNext
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
return
result
;
}
public
static
class
Wo
extends
Trust
{
private
static
final
long
serialVersionUID
=
-
7495725325510376323L
;
public
static
WrapCopier
<
Trust
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Trust
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
Trust
.
class
,
true
,
true
),
null
);
@FieldDescribe
(
"排序号"
)
private
Long
rank
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListPrev.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
java.util.List
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.core.entity.accredit.Trust
;
class
ActionListPrev
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
result
=
this
.
standardListPrev
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
return
result
;
}
public
static
class
Wo
extends
Trust
{
private
static
final
long
serialVersionUID
=
4663181401822986160L
;
public
static
WrapCopier
<
Trust
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Trust
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
Trust
.
class
,
true
,
true
),
null
);
@FieldDescribe
(
"排序号"
)
private
Long
rank
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListTo.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Trust
;
import
net.sf.ehcache.Element
;
class
ActionListTo
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
}
else
{
List
<
Wo
>
wos
=
this
.
list
(
business
,
effectivePerson
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wos
));
result
.
setData
(
wos
);
}
return
result
;
}
}
private
List
<
Wo
>
list
(
Business
business
,
EffectivePerson
effectivePerson
)
throws
Exception
{
List
<
Trust
>
os
=
business
.
entityManagerContainer
().
listEqual
(
Trust
.
class
,
Trust
.
toPerson_FIELDNAME
,
effectivePerson
.
getDistinguishedName
());
return
Wo
.
copier
.
copy
(
os
);
}
public
static
class
Wo
extends
Trust
{
private
static
final
long
serialVersionUID
=
4279205128463146835L
;
static
WrapCopier
<
Trust
,
Wo
>
copier
=
WrapCopierFactory
.
wi
(
Trust
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ActionListWithCurrentPerson.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.Trust
;
import
net.sf.ehcache.Element
;
class
ActionListWithCurrentPerson
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
}
else
{
List
<
Wo
>
wos
=
this
.
list
(
business
,
effectivePerson
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wos
));
result
.
setData
(
wos
);
}
return
result
;
}
}
private
List
<
Wo
>
list
(
Business
business
,
EffectivePerson
effectivePerson
)
throws
Exception
{
List
<
Trust
>
os
=
business
.
entityManagerContainer
().
listEqual
(
Trust
.
class
,
Trust
.
fromPerson_FIELDNAME
,
effectivePerson
.
getDistinguishedName
());
return
Wo
.
copier
.
copy
(
os
);
}
public
static
class
Wo
extends
Trust
{
private
static
final
long
serialVersionUID
=
4279205128463146835L
;
static
WrapCopier
<
Trust
,
Wo
>
copier
=
WrapCopierFactory
.
wi
(
Trust
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.accredit.Trust
;
import
com.x.organization.core.entity.accredit.Trust_
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
boolean
checkWhole
(
Business
business
,
Trust
trust
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Trust
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Trust
>
root
=
cq
.
from
(
Trust
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Trust_
.
fromIdentity
),
trust
.
getFromIdentity
());
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Trust_
.
whole
),
true
));
p
=
cb
.
and
(
p
,
cb
.
notEqual
(
root
.
get
(
Trust_
.
id
),
trust
.
getId
()));
Long
count
=
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
if
(
count
>
0
)
{
return
false
;
}
else
{
return
true
;
}
}
protected
boolean
checkApplication
(
Business
business
,
Trust
trust
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Trust
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Trust
>
root
=
cq
.
from
(
Trust
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Trust_
.
fromIdentity
),
trust
.
getFromIdentity
());
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Trust_
.
application
),
trust
.
getApplication
()));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
Trust_
.
process
),
""
),
cb
.
isNull
(
root
.
get
(
Trust_
.
process
))));
p
=
cb
.
and
(
p
,
cb
.
notEqual
(
root
.
get
(
Trust_
.
id
),
trust
.
getId
()));
Long
count
=
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
if
(
count
>
0
)
{
return
false
;
}
else
{
return
true
;
}
}
protected
boolean
checkProcess
(
Business
business
,
Trust
trust
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
Trust
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Long
>
cq
=
cb
.
createQuery
(
Long
.
class
);
Root
<
Trust
>
root
=
cq
.
from
(
Trust
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Trust_
.
fromIdentity
),
trust
.
getFromIdentity
());
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Trust_
.
application
),
trust
.
getApplication
()));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Trust_
.
process
),
trust
.
getProcess
()));
p
=
cb
.
and
(
p
,
cb
.
notEqual
(
root
.
get
(
Trust_
.
id
),
trust
.
getId
()));
Long
count
=
em
.
createQuery
(
cq
.
select
(
cb
.
count
(
root
)).
where
(
p
)).
getSingleResult
();
if
(
count
>
0
)
{
return
false
;
}
else
{
return
true
;
}
}
protected
String
getPersonDNWithIdentityDN
(
Business
business
,
String
dn
)
throws
Exception
{
Identity
identity
=
business
.
identity
().
pick
(
dn
);
if
(
null
!=
identity
)
{
Person
person
=
business
.
person
().
pick
(
identity
.
getPerson
());
if
(
null
!=
person
)
{
return
person
.
getDistinguishedName
();
}
}
return
null
;
}
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionApplicationExist.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionApplicationExist
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionApplicationExist
(
String
identity
,
String
application
)
{
super
(
"身份 {} 在指定应用 {} 的委托已经存在."
,
identity
,
application
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionEmptyFromIdentity.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyFromIdentity
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionEmptyFromIdentity
()
{
super
(
"委托身份为空."
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionEmptyToIdentity.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionEmptyToIdentity
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionEmptyToIdentity
()
{
super
(
"被委托身份为空."
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionPersonNotExistWithIdentity.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionPersonNotExistWithIdentity
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionPersonNotExistWithIdentity
(
String
identity
)
{
super
(
"无法定位 {} 的人员."
,
identity
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionProcessExist.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionProcessExist
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionProcessExist
(
String
identity
,
String
application
,
String
process
)
{
super
(
"身份 {} 在指定应用 {} 的指定 流程 {} 的委托已经存在."
,
identity
,
application
,
process
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/ExceptionWholeExist.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionWholeExist
extends
PromptException
{
private
static
final
long
serialVersionUID
=
-
3885997486474873786L
;
ExceptionWholeExist
(
String
identity
)
{
super
(
"身份 {} 的全局设置已经存在."
,
identity
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trust/TrustAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trust
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.DELETE
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.PUT
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.annotation.JaxrsParameterDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@Path
(
"trust"
)
@JaxrsDescribe
(
"委托操作"
)
public
class
TrustAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TrustAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"管理员列示授权对象,下一页."
,
action
=
ActionListNext
.
class
)
@GET
@Path
(
"list/{id}/next/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listNext
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"count"
)
Integer
count
)
{
ActionResult
<
List
<
ActionListNext
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListNext
().
execute
(
effectivePerson
,
id
,
count
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"管理员列示授权对象,上一页."
,
action
=
ActionListPrev
.
class
)
@GET
@Path
(
"list/{id}/prev/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listPrev
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"count"
)
Integer
count
)
{
ActionResult
<
List
<
ActionListPrev
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListPrev
().
execute
(
effectivePerson
,
id
,
count
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取当前人员的委托."
,
action
=
ActionListWithCurrentPerson
.
class
)
@GET
@Path
(
"list/currentperson"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithCurrentPerson
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListWithCurrentPerson
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithCurrentPerson
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取当前人员的被委托."
,
action
=
ActionListTo
.
class
)
@GET
@Path
(
"list/to"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listTo
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListTo
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListTo
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"创建委托"
,
action
=
ActionCreate
.
class
)
@POST
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
create
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionCreate
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionCreate
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"更新委托"
,
action
=
ActionEdit
.
class
)
@PUT
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
edit
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionEdit
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionEdit
().
execute
(
effectivePerson
,
id
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"删除委托"
,
action
=
ActionDelete
.
class
)
@DELETE
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
delete
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
ActionDelete
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionDelete
().
execute
(
effectivePerson
,
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionDelete.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.organization.core.entity.accredit.TrustLog
;
class
ActionDelete
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
TrustLog
trustLog
=
emc
.
find
(
id
,
TrustLog
.
class
);
if
(
null
==
trustLog
)
{
throw
new
ExceptionEntityNotExist
(
id
,
TrustLog
.
class
);
}
if
(
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
trustLog
);
}
emc
.
beginTransaction
(
TrustLog
.
class
);
emc
.
remove
(
trustLog
,
CheckRemoveType
.
all
);
emc
.
commit
();
ApplicationCache
.
notify
(
TrustLog
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListNext.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
java.util.List
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.core.entity.accredit.TrustLog
;
class
ActionListNext
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
result
=
this
.
standardListNext
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
return
result
;
}
public
static
class
Wo
extends
TrustLog
{
private
static
final
long
serialVersionUID
=
-
7495725325510376323L
;
public
static
WrapCopier
<
TrustLog
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
TrustLog
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
TrustLog
.
class
,
true
,
true
),
null
);
@FieldDescribe
(
"排序号"
)
private
Long
rank
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListPrev.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
java.util.List
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.core.entity.accredit.TrustLog
;
class
ActionListPrev
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
Integer
count
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
if
(
effectivePerson
.
isNotManager
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
result
=
this
.
standardListPrev
(
Wo
.
copier
,
id
,
count
,
JpaObject
.
sequence_FIELDNAME
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
true
,
DESC
);
return
result
;
}
public
static
class
Wo
extends
TrustLog
{
private
static
final
long
serialVersionUID
=
4663181401822986160L
;
public
static
WrapCopier
<
TrustLog
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
TrustLog
.
class
,
Wo
.
class
,
JpaObject
.
singularAttributeField
(
TrustLog
.
class
,
true
,
true
),
null
);
@FieldDescribe
(
"排序号"
)
private
Long
rank
;
public
Long
getRank
()
{
return
rank
;
}
public
void
setRank
(
Long
rank
)
{
this
.
rank
=
rank
;
}
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListTo.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.TrustLog
;
import
net.sf.ehcache.Element
;
class
ActionListTo
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
}
else
{
List
<
Wo
>
wos
=
this
.
list
(
business
,
effectivePerson
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wos
));
result
.
setData
(
wos
);
}
return
result
;
}
}
private
List
<
Wo
>
list
(
Business
business
,
EffectivePerson
effectivePerson
)
throws
Exception
{
List
<
TrustLog
>
os
=
business
.
entityManagerContainer
().
listEqual
(
TrustLog
.
class
,
TrustLog
.
toPerson_FIELDNAME
,
effectivePerson
.
getDistinguishedName
());
return
Wo
.
copier
.
copy
(
os
);
}
public
static
class
Wo
extends
TrustLog
{
private
static
final
long
serialVersionUID
=
4279205128463146835L
;
static
WrapCopier
<
TrustLog
,
Wo
>
copier
=
WrapCopierFactory
.
wi
(
TrustLog
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/ActionListWithCurrentPerson.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
java.util.List
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.organization.assemble.personal.Business
;
import
com.x.organization.core.entity.accredit.TrustLog
;
import
net.sf.ehcache.Element
;
class
ActionListWithCurrentPerson
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
String
cacheKey
=
ApplicationCache
.
concreteCacheKey
(
this
.
getClass
(),
effectivePerson
.
getDistinguishedName
());
Element
element
=
business
.
cache
().
get
(
cacheKey
);
if
(
null
!=
element
&&
(
null
!=
element
.
getObjectValue
()))
{
result
.
setData
((
List
<
Wo
>)
element
.
getObjectValue
());
}
else
{
List
<
Wo
>
wos
=
this
.
list
(
business
,
effectivePerson
);
business
.
cache
().
put
(
new
Element
(
cacheKey
,
wos
));
result
.
setData
(
wos
);
}
return
result
;
}
}
private
List
<
Wo
>
list
(
Business
business
,
EffectivePerson
effectivePerson
)
throws
Exception
{
List
<
TrustLog
>
os
=
business
.
entityManagerContainer
().
listEqual
(
TrustLog
.
class
,
TrustLog
.
fromPerson_FIELDNAME
,
effectivePerson
.
getDistinguishedName
());
return
Wo
.
copier
.
copy
(
os
);
}
public
static
class
Wo
extends
TrustLog
{
private
static
final
long
serialVersionUID
=
4279205128463146835L
;
static
WrapCopier
<
TrustLog
,
Wo
>
copier
=
WrapCopierFactory
.
wi
(
TrustLog
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
}
}
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/trustlog/TrustLogAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.assemble.personal.jaxrs.trustlog
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.DELETE
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.PUT
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.annotation.JaxrsParameterDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@Path
(
"trustlog"
)
@JaxrsDescribe
(
"委托日志操作"
)
public
class
TrustLogAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TrustLogAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"管理员列示委托日志对象,下一页."
,
action
=
ActionListNext
.
class
)
@GET
@Path
(
"list/{id}/next/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listNext
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"count"
)
Integer
count
)
{
ActionResult
<
List
<
ActionListNext
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListNext
().
execute
(
effectivePerson
,
id
,
count
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"管理员列示委托日志对象,上一页."
,
action
=
ActionListPrev
.
class
)
@GET
@Path
(
"list/{id}/prev/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listPrev
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
,
@JaxrsParameterDescribe
(
"数量"
)
@PathParam
(
"count"
)
Integer
count
)
{
ActionResult
<
List
<
ActionListPrev
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListPrev
().
execute
(
effectivePerson
,
id
,
count
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取当前人员的委托日志."
,
action
=
ActionListWithCurrentPerson
.
class
)
@GET
@Path
(
"list/currentperson"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithCurrentPerson
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListWithCurrentPerson
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithCurrentPerson
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取当前人员的被委托日志."
,
action
=
ActionListTo
.
class
)
@GET
@Path
(
"list/to"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listTo
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListTo
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListTo
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"删除委托日志."
,
action
=
ActionDelete
.
class
)
@DELETE
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
delete
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
ActionDelete
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionDelete
().
execute
(
effectivePerson
,
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
}
\ No newline at end of file
o2server/x_organization_assemble_personal/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/Custom.java
浏览文件 @
07320537
package
com.x.organization.core.entity
;
import
java.util.Date
;
import
javax.persistence.Basic
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
...
...
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/PersistenceProperties.java
浏览文件 @
07320537
...
...
@@ -74,4 +74,15 @@ public final class PersistenceProperties extends AbstractPersistenceProperties {
public
static
class
OauthCode
{
public
static
final
String
table
=
"ORG_OAUTHCODE"
;
}
public
static
class
Accredit
{
public
static
class
Trust
{
public
static
final
String
table
=
"ORG_A_TRUST"
;
}
public
static
class
TrustLog
{
public
static
final
String
table
=
"ORG_A_TRUSTLOG"
;
}
}
}
\ No newline at end of file
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/Trust.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.entity.accredit
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Inheritance
;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.organization.core.entity.PersistenceProperties
;
@Entity
@ContainerEntity
@Table
(
name
=
PersistenceProperties
.
Accredit
.
Trust
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Accredit
.
Trust
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
JpaObject
.
CREATETIMECOLUMN
,
JpaObject
.
UPDATETIMECOLUMN
,
JpaObject
.
SEQUENCECOLUMN
})
})
@Inheritance
(
strategy
=
InheritanceType
.
TABLE_PER_CLASS
)
public
class
Trust
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
-
6518383742766451210L
;
private
static
final
String
TABLE
=
PersistenceProperties
.
Accredit
.
Trust
.
table
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@FieldDescribe
(
"数据库主键,自动生成."
)
@Id
@Column
(
length
=
length_id
,
name
=
ColumnNamePrefix
+
id_FIELDNAME
)
private
String
id
=
createId
();
/* 以上为 JpaObject 默认字段 */
public
void
onPersist
()
throws
Exception
{
}
/** 更新运行方法 */
/** flag标志位 */
/** 默认内容结束 */
public
static
final
String
fromPerson_FIELDNAME
=
"fromPerson"
;
@FieldDescribe
(
"人员."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
fromPerson_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
fromPerson_FIELDNAME
)
private
String
fromPerson
;
public
static
final
String
fromIdentity_FIELDNAME
=
"fromIdentity"
;
@FieldDescribe
(
"身份."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
fromIdentity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
fromIdentity_FIELDNAME
)
private
String
fromIdentity
;
public
static
final
String
toPerson_FIELDNAME
=
"toPerson"
;
@FieldDescribe
(
"委托人员."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
toPerson_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
toPerson_FIELDNAME
)
private
String
toPerson
;
public
static
final
String
toIdentity_FIELDNAME
=
"toIdentity"
;
@FieldDescribe
(
"委托身份."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
toIdentity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
toIdentity_FIELDNAME
)
private
String
toIdentity
;
public
static
final
String
application_FIELDNAME
=
"application"
;
@FieldDescribe
(
"应用."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
application_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
application_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
application
;
public
static
final
String
applicationName_FIELDNAME
=
"applicationName"
;
@FieldDescribe
(
"应用名称."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
applicationName_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
applicationName_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
applicationName
;
public
static
final
String
applicationAlias_FIELDNAME
=
"applicationAlias"
;
@FieldDescribe
(
"应用别名."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
applicationAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
applicationAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
applicationAlias
;
public
static
final
String
process_FIELDNAME
=
"process"
;
@FieldDescribe
(
"流程ID."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
process_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
process_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
process
;
public
static
final
String
processName_FIELDNAME
=
"processName"
;
@FieldDescribe
(
"流程名称."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
processName_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
processName_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
processName
;
public
static
final
String
processAlias_FIELDNAME
=
"processAlias"
;
@FieldDescribe
(
"流程别名."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
processAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
processAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
processAlias
;
public
static
final
String
whole_FIELDNAME
=
"whole"
;
@FieldDescribe
(
"全部进行授权."
)
@Column
(
name
=
ColumnNamePrefix
+
whole_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
whole_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
Boolean
whole
;
public
String
getFromPerson
()
{
return
fromPerson
;
}
public
void
setFromPerson
(
String
fromPerson
)
{
this
.
fromPerson
=
fromPerson
;
}
public
String
getFromIdentity
()
{
return
fromIdentity
;
}
public
void
setFromIdentity
(
String
fromIdentity
)
{
this
.
fromIdentity
=
fromIdentity
;
}
public
String
getToPerson
()
{
return
toPerson
;
}
public
void
setToPerson
(
String
toPerson
)
{
this
.
toPerson
=
toPerson
;
}
public
String
getToIdentity
()
{
return
toIdentity
;
}
public
void
setToIdentity
(
String
toIdentity
)
{
this
.
toIdentity
=
toIdentity
;
}
public
String
getApplication
()
{
return
application
;
}
public
void
setApplication
(
String
application
)
{
this
.
application
=
application
;
}
public
String
getApplicationName
()
{
return
applicationName
;
}
public
void
setApplicationName
(
String
applicationName
)
{
this
.
applicationName
=
applicationName
;
}
public
String
getApplicationAlias
()
{
return
applicationAlias
;
}
public
void
setApplicationAlias
(
String
applicationAlias
)
{
this
.
applicationAlias
=
applicationAlias
;
}
public
String
getProcess
()
{
return
process
;
}
public
void
setProcess
(
String
process
)
{
this
.
process
=
process
;
}
public
String
getProcessName
()
{
return
processName
;
}
public
void
setProcessName
(
String
processName
)
{
this
.
processName
=
processName
;
}
public
String
getProcessAlias
()
{
return
processAlias
;
}
public
void
setProcessAlias
(
String
processAlias
)
{
this
.
processAlias
=
processAlias
;
}
public
Boolean
getWhole
()
{
return
whole
;
}
public
void
setWhole
(
Boolean
whole
)
{
this
.
whole
=
whole
;
}
}
\ No newline at end of file
o2server/x_organization_core_entity/src/main/java/com/x/organization/core/entity/accredit/TrustLog.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.entity.accredit
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Inheritance
;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Table
;
import
javax.persistence.Temporal
;
import
javax.persistence.TemporalType
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.organization.core.entity.PersistenceProperties
;
@Entity
@ContainerEntity
@Table
(
name
=
PersistenceProperties
.
Accredit
.
TrustLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Accredit
.
TrustLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
JpaObject
.
CREATETIMECOLUMN
,
JpaObject
.
UPDATETIMECOLUMN
,
JpaObject
.
SEQUENCECOLUMN
})
})
@Inheritance
(
strategy
=
InheritanceType
.
TABLE_PER_CLASS
)
public
class
TrustLog
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
6677140471323901242L
;
private
static
final
String
TABLE
=
PersistenceProperties
.
Accredit
.
TrustLog
.
table
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@FieldDescribe
(
"数据库主键,自动生成."
)
@Id
@Column
(
length
=
length_id
,
name
=
ColumnNamePrefix
+
id_FIELDNAME
)
private
String
id
=
createId
();
/* 以上为 JpaObject 默认字段 */
public
void
onPersist
()
throws
Exception
{
}
/** 更新运行方法 */
/** flag标志位 */
/** 默认内容结束 */
public
static
final
String
fromPerson_FIELDNAME
=
"fromPerson"
;
@FieldDescribe
(
"人员."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
fromPerson_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
fromPerson_FIELDNAME
)
private
String
fromPerson
;
public
static
final
String
fromIdentity_FIELDNAME
=
"fromIdentity"
;
@FieldDescribe
(
"身份."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
fromIdentity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
fromIdentity_FIELDNAME
)
private
String
fromIdentity
;
public
static
final
String
toPerson_FIELDNAME
=
"toPerson"
;
@FieldDescribe
(
"委托人员."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
toPerson_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
toPerson_FIELDNAME
)
private
String
toPerson
;
public
static
final
String
toIdentity_FIELDNAME
=
"toIdentity"
;
@FieldDescribe
(
"委托身份."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
toIdentity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
toIdentity_FIELDNAME
)
private
String
toIdentity
;
public
static
final
String
application_FIELDNAME
=
"application"
;
@FieldDescribe
(
"应用."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
application_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
application_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
application
;
public
static
final
String
applicationName_FIELDNAME
=
"applicationName"
;
@FieldDescribe
(
"应用名称."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
applicationName_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
applicationName_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
applicationName
;
public
static
final
String
applicationAlias_FIELDNAME
=
"applicationAlias"
;
@FieldDescribe
(
"应用别名."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
applicationAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
applicationAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
applicationAlias
;
public
static
final
String
process_FIELDNAME
=
"process"
;
@FieldDescribe
(
"流程ID."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
process_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
process_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
process
;
public
static
final
String
processName_FIELDNAME
=
"processName"
;
@FieldDescribe
(
"流程名称."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
processName_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
processName_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
processName
;
public
static
final
String
processAlias_FIELDNAME
=
"processAlias"
;
@FieldDescribe
(
"流程别名."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
processAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
processAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
processAlias
;
public
static
final
String
job_FIELDNAME
=
"job"
;
@FieldDescribe
(
"任务标识."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
job_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
job_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
job
;
public
static
final
String
work_FIELDNAME
=
"work"
;
@FieldDescribe
(
"work标识."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
work_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
work_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
work
;
public
static
final
String
trustTime_FIELDNAME
=
"trustTime"
;
@FieldDescribe
(
"委托时间."
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Column
(
name
=
ColumnNamePrefix
+
trustTime_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
trustTime_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
Date
trustTime
;
public
static
final
String
title_FIELDNAME
=
"title"
;
@FieldDescribe
(
"标题."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
title_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
title_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
title
;
public
static
final
String
activity_FIELDNAME
=
"activity"
;
@FieldDescribe
(
"当前活动ID"
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
activity_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activity_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activity
;
public
static
final
String
activityName_FIELDNAME
=
"activityName"
;
@FieldDescribe
(
"活动名称"
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
activityName_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activityName_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activityName
;
public
static
final
String
activityAlias_FIELDNAME
=
"activityAlias"
;
@FieldDescribe
(
"活动别名"
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
activityAlias_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
activityAlias_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
activityAlias
;
public
String
getFromPerson
()
{
return
fromPerson
;
}
public
void
setFromPerson
(
String
fromPerson
)
{
this
.
fromPerson
=
fromPerson
;
}
public
String
getFromIdentity
()
{
return
fromIdentity
;
}
public
void
setFromIdentity
(
String
fromIdentity
)
{
this
.
fromIdentity
=
fromIdentity
;
}
public
String
getToPerson
()
{
return
toPerson
;
}
public
void
setToPerson
(
String
toPerson
)
{
this
.
toPerson
=
toPerson
;
}
public
String
getToIdentity
()
{
return
toIdentity
;
}
public
void
setToIdentity
(
String
toIdentity
)
{
this
.
toIdentity
=
toIdentity
;
}
public
String
getApplication
()
{
return
application
;
}
public
void
setApplication
(
String
application
)
{
this
.
application
=
application
;
}
public
String
getApplicationName
()
{
return
applicationName
;
}
public
void
setApplicationName
(
String
applicationName
)
{
this
.
applicationName
=
applicationName
;
}
public
String
getApplicationAlias
()
{
return
applicationAlias
;
}
public
void
setApplicationAlias
(
String
applicationAlias
)
{
this
.
applicationAlias
=
applicationAlias
;
}
public
String
getProcess
()
{
return
process
;
}
public
void
setProcess
(
String
process
)
{
this
.
process
=
process
;
}
public
String
getProcessName
()
{
return
processName
;
}
public
void
setProcessName
(
String
processName
)
{
this
.
processName
=
processName
;
}
public
String
getProcessAlias
()
{
return
processAlias
;
}
public
void
setProcessAlias
(
String
processAlias
)
{
this
.
processAlias
=
processAlias
;
}
public
String
getJob
()
{
return
job
;
}
public
void
setJob
(
String
job
)
{
this
.
job
=
job
;
}
public
String
getWork
()
{
return
work
;
}
public
void
setWork
(
String
work
)
{
this
.
work
=
work
;
}
public
Date
getTrustTime
()
{
return
trustTime
;
}
public
void
setTrustTime
(
Date
trustTime
)
{
this
.
trustTime
=
trustTime
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getActivity
()
{
return
activity
;
}
public
void
setActivity
(
String
activity
)
{
this
.
activity
=
activity
;
}
public
String
getActivityName
()
{
return
activityName
;
}
public
void
setActivityName
(
String
activityName
)
{
this
.
activityName
=
activityName
;
}
public
String
getActivityAlias
()
{
return
activityAlias
;
}
public
void
setActivityAlias
(
String
activityAlias
)
{
this
.
activityAlias
=
activityAlias
;
}
}
\ No newline at end of file
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/Organization.java
浏览文件 @
07320537
...
...
@@ -12,6 +12,8 @@ import com.x.organization.core.express.identity.IdentityFactory;
import
com.x.organization.core.express.person.PersonFactory
;
import
com.x.organization.core.express.personattribute.PersonAttributeFactory
;
import
com.x.organization.core.express.role.RoleFactory
;
import
com.x.organization.core.express.trust.TrustFactory
;
import
com.x.organization.core.express.trustlog.TrustLogFactory
;
import
com.x.organization.core.express.unit.UnitFactory
;
import
com.x.organization.core.express.unitattribute.UnitAttributeFactory
;
import
com.x.organization.core.express.unitduty.UnitDutyFactory
;
...
...
@@ -96,6 +98,24 @@ public class Organization {
return
unitDuty
;
}
private
TrustFactory
trust
;
public
TrustFactory
trust
()
throws
Exception
{
if
(
null
==
this
.
trust
)
{
this
.
trust
=
new
TrustFactory
(
context
);
}
return
trust
;
}
private
TrustLogFactory
trustLog
;
public
TrustLogFactory
trustLog
()
throws
Exception
{
if
(
null
==
this
.
trustLog
)
{
this
.
trustLog
=
new
TrustLogFactory
(
context
);
}
return
trustLog
;
}
/** 根据个人身份获取组织 */
/** 表示获取第几层的组织 */
public
String
listSupUnit
(
String
name
,
Integer
nested
)
throws
Exception
{
...
...
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/ActionListWithIdentityObject.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trust
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
com.x.base.core.project.AbstractContext
;
import
com.x.base.core.project.organization.Trust
;
class
ActionListWithIdentityObject
extends
BaseAction
{
public
static
List
<
Trust
>
execute
(
AbstractContext
context
,
String
application
,
String
process
,
Collection
<
String
>
collection
)
throws
Exception
{
Wi
wi
=
new
Wi
();
List
<
Trust
>
wos
=
new
ArrayList
<>();
if
((
null
!=
collection
)
&&
(!
collection
.
isEmpty
()))
{
wi
.
getIdentityList
().
addAll
(
collection
);
wos
=
context
.
applications
().
postQuery
(
applicationClass
,
"trust/list/identity/object"
,
wi
)
.
getDataAsList
(
Trust
.
class
);
}
return
wos
;
}
public
static
class
Wi
extends
WoAbstract
{
}
}
\ No newline at end of file
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trust
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.x.base.core.project.x_organization_assemble_express
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
abstract
class
BaseAction
{
protected
static
Class
<?>
applicationClass
=
x_organization_assemble_express
.
class
;
static
class
WoAbstract
extends
GsonPropertyObject
{
@FieldDescribe
(
"身份"
)
private
List
<
String
>
identityList
=
new
ArrayList
<>();
@FieldDescribe
(
"应用"
)
private
String
application
;
@FieldDescribe
(
"流程"
)
private
String
process
;
public
List
<
String
>
getIdentityList
()
{
return
identityList
;
}
public
void
setIdentityList
(
List
<
String
>
identityList
)
{
this
.
identityList
=
identityList
;
}
public
String
getApplication
()
{
return
application
;
}
public
void
setApplication
(
String
application
)
{
this
.
application
=
application
;
}
public
String
getProcess
()
{
return
process
;
}
public
void
setProcess
(
String
process
)
{
this
.
process
=
process
;
}
}
}
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trust/TrustFactory.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trust
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.List
;
import
com.x.base.core.project.AbstractContext
;
import
com.x.base.core.project.organization.Trust
;
public
class
TrustFactory
{
public
TrustFactory
(
AbstractContext
context
)
{
this
.
context
=
context
;
}
private
AbstractContext
context
;
/** 根据应用和流程获取指定身份是否有委托 */
public
List
<
Trust
>
listWithIdentityObject
(
String
application
,
String
process
,
String
value
)
throws
Exception
{
return
ActionListWithIdentityObject
.
execute
(
context
,
application
,
process
,
Arrays
.
asList
(
value
));
}
/** 根据应用和流程获取指定身份是否有委托 */
public
List
<
Trust
>
listWithIdentityObject
(
String
application
,
String
process
,
Collection
<
String
>
values
)
throws
Exception
{
return
ActionListWithIdentityObject
.
execute
(
context
,
application
,
process
,
values
);
}
}
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/ActionLog.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trustlog
;
import
com.x.base.core.project.AbstractContext
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.organization.TrustLog
;
class
ActionLog
extends
BaseAction
{
public
static
boolean
execute
(
AbstractContext
context
,
TrustLog
trustLog
)
throws
Exception
{
Wo
wo
=
context
.
applications
().
postQuery
(
applicationClass
,
"trustlog"
,
trustLog
).
getData
(
Wo
.
class
);
return
wo
.
getValue
();
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/BaseAction.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trustlog
;
import
com.x.base.core.project.x_organization_assemble_express
;
abstract
class
BaseAction
{
protected
static
Class
<?>
applicationClass
=
x_organization_assemble_express
.
class
;
}
o2server/x_organization_core_express/src/main/java/com/x/organization/core/express/trustlog/TrustLogFactory.java
0 → 100644
浏览文件 @
07320537
package
com.x.organization.core.express.trustlog
;
import
com.x.base.core.project.AbstractContext
;
import
com.x.base.core.project.organization.TrustLog
;
public
class
TrustLogFactory
{
public
TrustLogFactory
(
AbstractContext
context
)
{
this
.
context
=
context
;
}
private
AbstractContext
context
;
/** 创建委托记录 */
public
boolean
log
(
TrustLog
trustLog
)
throws
Exception
{
return
ActionLog
.
execute
(
context
,
trustLog
);
}
}
o2server/x_portal_assemble_designer/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
o2server/x_portal_assemble_surface/src/main/webapp/jest/describe.js
浏览文件 @
07320537
var
Describe
=
function
()
{
//
20180730
//
20180730
}
Describe
.
splitValue
=
function
(
str
)
{
...
...
@@ -38,7 +38,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -55,7 +55,7 @@ Describe.doPost = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -74,7 +74,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
}).
always
(
function
(
resultJson
)
{
$
(
'
#result
'
).
html
(
JSON
.
stringify
(
resultJson
,
null
,
4
));
Describe
.
writeOut
(
m
.
outs
,
resultJson
);
...
...
@@ -91,7 +91,7 @@ Describe.doPut = function(address, m, data) {
xhrFields
:
{
'
withCredentials
'
:
true
},
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
?
JSON
.
stringify
(
data
)
:
data
)
data
:
((
m
.
contentType
.
indexOf
(
'
application/json
'
)
>
-
1
)
&&
(
!
m
.
useStringParameter
)
?
JSON
.
stringify
(
data
)
:
data
)
});
}
}
...
...
@@ -269,6 +269,14 @@ Describe.prototype = {
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
useStringParameter
)
{
txt
+=
'
<fieldset><legend>String</legend>
'
;
txt
+=
'
<table><tr><td>
'
;
txt
+=
'
<textarea id="string" style="height:300px; width:600px; padding:1px; border:1px #000000 solid"/>
'
;
txt
+=
'
</td><td>string</td></tr>
'
;
txt
+=
'
</table>
'
;
txt
+=
'
</fieldset>
'
;
}
if
(
m
.
outs
&&
m
.
outs
.
length
>
0
)
{
txt
+=
'
<fieldset id="outs"><legend>Out</legend>
'
;
txt
+=
'
<table>
'
;
...
...
@@ -318,6 +326,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPost
(
address
,
m
,
data
);
break
;
...
...
@@ -340,6 +350,8 @@ Describe.prototype = {
});
}
else
if
(
m
.
useJsonElementParameter
)
{
data
=
$
.
parseJSON
(
$
(
'
#jsonElement
'
).
val
());
}
else
if
(
m
.
useStringParameter
)
{
data
=
$
(
'
#string
'
).
val
();
}
Describe
.
doPut
(
address
,
m
,
data
);
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录