Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
PS
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBizPOC_20003
PS
提交
1fdf033f
提交
1fdf033f
编写于
4月 08, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
4916ad2f
变更
20
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
731 行增加
和
1 行删除
+731
-1
config.xml
config.xml
+8
-0
PSController.java
...ain/java/com/ibiz/web/module/controller/PSController.java
+8
-0
PSFeignClient.java
...rc/main/java/com/ibiz/web/module/feign/PSFeignClient.java
+3
-0
PSService.java
.../src/main/java/com/ibiz/web/module/service/PSService.java
+4
-0
healthcheckFeignClient.java
...va/com/ibiz/client/htsc/feign/healthcheckFeignClient.java
+41
-1
healthcheckClientServiceImpl.java
...biz/client/htsc/service/healthcheckClientServiceImpl.java
+65
-0
IhealthcheckClientService.java
...m/ibiz/core/client/service/IhealthcheckClientService.java
+20
-0
IPSService.java
...rc/main/java/com/ibiz/core/module/service/IPSService.java
+1
-0
PSServiceImpl.java
...java/com/ibiz/core/module/service/impl/PSServiceImpl.java
+11
-0
IPSXDLogic.java
...n/java/com/ibiz/core/module/service/logic/IPSXDLogic.java
+18
-0
PSXDLogicImpl.java
...om/ibiz/core/module/service/logic/impl/PSXDLogicImpl.java
+59
-0
Healthcheck.java
...c/main/java/com/ibiz/core/module2/domain/Healthcheck.java
+67
-0
HealthcheckSearchContext.java
...om/ibiz/core/module2/filter/HealthcheckSearchContext.java
+61
-0
IHealthcheckService.java
...va/com/ibiz/core/module2/service/IHealthcheckService.java
+48
-0
HealthcheckServiceImpl.java
...biz/core/module2/service/impl/HealthcheckServiceImpl.java
+159
-0
HealthcheckHealthcheckidDefault.java
...ule/anno/healthcheck/HealthcheckHealthcheckidDefault.java
+32
-0
HealthcheckHealthcheckidDefaultValidator.java
...healthcheck/HealthcheckHealthcheckidDefaultValidator.java
+70
-0
PSXDRule.drl
ps-core/src/main/resources/rules/PSXDRule.drl
+27
-0
PSXDRuleFlow.bpmn
ps-core/src/main/resources/rules/PSXDRuleFlow.bpmn
+19
-0
PSResource.java
...c/main/java/com/ibiz/service/web/resource/PSResource.java
+10
-0
未找到文件。
config.xml
浏览文件 @
1fdf033f
...
...
@@ -40,6 +40,14 @@
mvn install
cd ..
mvn install
cd ps-boot
mvn clean package
echo
'
echo
"
$para1
"'
>
apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS=
'
./apppasswd.sh
'
DISPLAY=
'
none:0
'
ssh root@172.16.102.61
"
mkdir -p /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5
"
setsid env SSH_ASKPASS=
'
./apppasswd.sh
'
DISPLAY=
'
none:0
'
scp -r ./target/ps.jar root@172.16.102.61:/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5
setsid env SSH_ASKPASS=
'
./apppasswd.sh
'
DISPLAY=
'
none:0
'
ssh root@172.16.102.61
"
ps -ef | grep
'
/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5
'
| tr -s
'
'
|cut -d
'
'
-f2,8,9 | grep -v grep | grep
'
jar
'
| cut -d
'
'
-f1|xargs --no-run-if-empty kill -9
"
setsid env SSH_ASKPASS=
'
./apppasswd.sh
'
DISPLAY=
'
none:0
'
ssh root@172.16.102.61
"
source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m /ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps.jar
>>
/ibiz/nodes/node1/F2F47711-2592-4F2B-9C54-F0722AEA90D5/ps_apips 服务-`date --date=
'
0 days ago
'
+%Y-%m-%d`.log 2
>&
1
&"
</command>
</hudson.tasks.Shell>
</builders>
...
...
ps-app/ps-app-web/src/main/java/com/ibiz/web/module/controller/PSController.java
浏览文件 @
1fdf033f
...
...
@@ -57,6 +57,14 @@ public class PSController {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps
);
}
//@GlobalTransactional
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ps/{ps_id}/xd"
)
@PreAuthorize
(
"@ps_pms.check(#ps_id,'')"
)
public
ResponseEntity
<
PS
>
xD
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
{
PS
ps2
=
psservice
.
xD
(
ps_id
,
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
ps2
);
}
//@GlobalTransactional
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ps/getdraft"
)
@PreAuthorize
(
"@ps_pms.check('CREATE')"
)
...
...
ps-app/ps-app-web/src/main/java/com/ibiz/web/module/feign/PSFeignClient.java
浏览文件 @
1fdf033f
...
...
@@ -29,6 +29,9 @@ public interface PSFeignClient {
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/{ps_id}"
)
public
PS
get
(
@PathVariable
(
"ps_id"
)
String
ps_id
)
;
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/web/ps/{ps_id}/xd"
)
public
PS
xD
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
;
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/{ps_id}/getdraft"
)
public
PS
getDraft
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PS
ps
)
;
...
...
ps-app/ps-app-web/src/main/java/com/ibiz/web/module/service/PSService.java
浏览文件 @
1fdf033f
...
...
@@ -75,6 +75,10 @@ public class PSService {
return
client
.
get
(
ps_id
);
}
public
PS
xD
(
String
ps_id
,
PS
ps
)
{
return
client
.
xD
(
ps_id
,
ps
);
}
public
PS
getDraft
(
String
ps_id
,
PS
ps
)
{
return
client
.
getDraft
(
ps_id
,
ps
);
}
...
...
ps-client/ps-client-htsc/src/main/java/com/ibiz/client/htsc/feign/healthcheckFeignClient.java
浏览文件 @
1fdf033f
...
...
@@ -16,9 +16,49 @@ import com.ibiz.util.SearchContext;
*/
public
interface
healthcheckFeignClient
{
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/
/
healthchecks/{healthcheckid}/test"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}/test"
)
public
healthcheckImpl
test
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/htsc-pos-nms/api/healthchecks/select"
)
public
Page
<
healthcheckImpl
>
select
();
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}/getdraft"
)
public
healthcheckImpl
getDraft
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}"
)
public
Boolean
remove
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}/checkkey"
)
public
healthcheckImpl
checkKey
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}"
)
public
healthcheckImpl
update
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/healthchecks"
)
public
healthcheckImpl
create
(
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}/test"
)
public
healthcheckImpl
test
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}"
)
public
healthcheckImpl
get
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
);
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/htsc-pos-nms/api/healthchecks/{healthcheckid}/save"
)
public
healthcheckImpl
save
(
@PathVariable
(
"healthcheckid"
)
String
healthcheckid
,
@RequestBody
healthcheckImpl
healthcheck
);
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/htsc-pos-nms/api/healthchecks/fetchdefault"
)
public
Page
<
healthcheckImpl
>
fetchDefault
(
SearchContext
context
);
}
ps-client/ps-client-htsc/src/main/java/com/ibiz/client/htsc/service/healthcheckClientServiceImpl.java
浏览文件 @
1fdf033f
...
...
@@ -81,6 +81,71 @@ public class healthcheckClientServiceImpl implements IhealthcheckClientService {
}
public
Page
<
Ihealthcheck
>
select
(
SearchContext
context
){
return
null
;
}
public
void
getDraft
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
getDraft
(
healthcheck
.
getHEALTHCHECKID
(),(
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
remove
(
Ihealthcheck
healthcheck
){
healthcheckFeignClient
.
remove
(
healthcheck
.
getHEALTHCHECKID
())
;
}
public
void
checkKey
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
checkKey
(
healthcheck
.
getHEALTHCHECKID
(),(
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
update
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
update
(
healthcheck
.
getHEALTHCHECKID
(),(
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
create
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
create
((
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
test
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
test
(
healthcheck
.
getHEALTHCHECKID
(),(
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
get
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
get
(
healthcheck
.
getHEALTHCHECKID
())
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
void
save
(
Ihealthcheck
healthcheck
){
Ihealthcheck
clientModel
=
healthcheckFeignClient
.
save
(
healthcheck
.
getHEALTHCHECKID
(),(
healthcheckImpl
)
healthcheck
)
;
BeanCopier
copier
=
BeanCopier
.
create
(
clientModel
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
clientModel
,
healthcheck
,
null
);
}
public
Page
<
Ihealthcheck
>
fetchDefault
(
SearchContext
context
){
Page
<
healthcheckImpl
>
page
=
this
.
healthcheckFeignClient
.
fetchDefault
(
context
)
;
return
new
PageImpl
(
page
.
getContent
(),
context
.
getPageable
(),
page
.
getTotalElements
());
}
}
ps-core/src/main/java/com/ibiz/core/client/service/IhealthcheckClientService.java
浏览文件 @
1fdf033f
...
...
@@ -22,4 +22,24 @@ public interface IhealthcheckClientService{
public
void
test
(
Ihealthcheck
healthcheck
);
public
Page
<
Ihealthcheck
>
select
(
SearchContext
context
);
public
void
getDraft
(
Ihealthcheck
healthcheck
);
public
void
remove
(
Ihealthcheck
healthcheck
);
public
void
checkKey
(
Ihealthcheck
healthcheck
);
public
void
update
(
Ihealthcheck
healthcheck
);
public
void
create
(
Ihealthcheck
healthcheck
);
public
void
test
(
Ihealthcheck
healthcheck
);
public
void
get
(
Ihealthcheck
healthcheck
);
public
void
save
(
Ihealthcheck
healthcheck
);
public
Page
<
Ihealthcheck
>
fetchDefault
(
SearchContext
context
);
}
ps-core/src/main/java/com/ibiz/core/module/service/IPSService.java
浏览文件 @
1fdf033f
...
...
@@ -24,6 +24,7 @@ public interface IPSService{
boolean
create
(
PS
pS
)
;
PS
get
(
String
pSId
)
;
PS
get
(
PS
pS
)
;
PS
xD
(
PS
pS
)
;
PS
getDraft
(
PS
pS
)
;
boolean
save
(
PS
pS
)
;
boolean
update
(
PS
pS
)
;
...
...
ps-core/src/main/java/com/ibiz/core/module/service/impl/PSServiceImpl.java
浏览文件 @
1fdf033f
...
...
@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
import
com.ibiz.core.module.domain.PS
;
import
com.ibiz.core.module.filter.PSSearchContext
;
import
com.ibiz.core.module.service.IPSService
;
import
com.ibiz.core.module.service.logic.IPSXDLogic
;
import
com.ibiz.core.module.service.logic.IPSCreateAndStartIMLogic
;
import
com.ibiz.util.SearchResult
;
import
com.ibiz.util.log.IBIZLog
;
...
...
@@ -36,6 +37,9 @@ public class PSServiceImpl implements IPSService {
@Autowired
com
.
ibiz
.
core
.
repository
.
PSRepository
pSRepository
;
@Autowired
private
IPSXDLogic
xdLogic
;
@Autowired
private
IPSCreateAndStartIMLogic
createandstartimLogic
;
...
...
@@ -82,6 +86,13 @@ public class PSServiceImpl implements IPSService {
return
ps
;
}
@Override
@Transactional
public
PS
xD
(
PS
ps
)
{
xdLogic
.
execute
(
ps
);
return
ps
;
}
@Override
public
PS
getDraft
(
PS
ps
)
{
return
ps
;
...
...
ps-core/src/main/java/com/ibiz/core/module/service/logic/IPSXDLogic.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module
.
service
.
logic
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
com.ibiz.core.module.domain.PS
;
/**
* 关系型数据实体[XD] 对象
*/
public
interface
IPSXDLogic
{
void
execute
(
PS
ps
)
;
}
ps-core/src/main/java/com/ibiz/core/module/service/logic/impl/PSXDLogicImpl.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module
.
service
.
logic
.
impl
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.kie.api.runtime.KieSession
;
import
org.kie.api.runtime.KieContainer
;
import
com.ibiz.core.module.service.logic.IPSXDLogic
;
import
com.ibiz.core.module.domain.PS
;
import
com.ibiz.util.log.IBIZLog
;
/**
* 关系型数据实体[XD] 对象
*/
@Slf4j
@IBIZLog
@Service
public
class
PSXDLogicImpl
implements
IPSXDLogic
{
@Autowired
private
KieContainer
kieContainer
;
@Autowired
private
com
.
ibiz
.
core
.
module2
.
service
.
IHealthcheckService
healthcheckservice
;
@Autowired
private
com
.
ibiz
.
core
.
module
.
service
.
IPSService
iBzSysDefaultService
;
public
void
execute
(
PS
et
){
KieSession
kieSession
=
null
;
try
{
kieSession
=
kieContainer
.
newKieSession
();
kieSession
.
insert
(
et
);
kieSession
.
setGlobal
(
"psxddefault"
,
et
);
com
.
ibiz
.
core
.
module2
.
domain
.
Healthcheck
psxdhealthcheck
=
new
com
.
ibiz
.
core
.
module2
.
domain
.
Healthcheck
();
kieSession
.
insert
(
psxdhealthcheck
);
kieSession
.
setGlobal
(
"psxdhealthcheck"
,
psxdhealthcheck
);
kieSession
.
setGlobal
(
"healthcheckservice"
,
healthcheckservice
);
kieSession
.
setGlobal
(
"iBzSysPsDefaultService"
,
iBzSysDefaultService
);
kieSession
.
startProcess
(
"com.ibiz.core.module.service.logic.psxd"
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
"执行[下单]处理逻辑发生异常"
+
e
);
}
finally
{
if
(
kieSession
!=
null
)
kieSession
.
destroy
();
}
}
}
ps-core/src/main/java/com/ibiz/core/module2/domain/Healthcheck.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
domain
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ibiz.core.util.annotation.DEField
;
import
com.ibiz.core.util.annotation.DEPredefinedField
;
import
com.ibiz.core.util.enums.DEPredefinedFieldFillMode
;
import
com.ibiz.core.util.enums.DEPredefinedFieldType
;
import
java.io.Serializable
;
/**
* 实体[HEALTHCHECK]
*/
public
class
Healthcheck
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* HEALTHCHECKID
*/
@DEField
(
isKeyField
=
true
)
private
String
healthcheckid
;
@JsonIgnore
@JSONField
(
serialize
=
false
)
private
boolean
healthcheckidDirtyFlag
;
/**
* 获取 [HEALTHCHECKID]
*/
@JsonProperty
(
"healthcheckid"
)
@JSONField
(
name
=
"healthcheckid"
)
public
String
getHealthcheckid
(){
return
this
.
healthcheckid
;
}
/**
* 设置 [HEALTHCHECKID]
*/
@JsonProperty
(
"healthcheckid"
)
@JSONField
(
name
=
"healthcheckid"
)
public
void
setHealthcheckid
(
String
healthcheckid
){
this
.
healthcheckid
=
healthcheckid
;
this
.
healthcheckidDirtyFlag
=
true
;
}
/**
* 获取 [HEALTHCHECKID]脏标记
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
getHealthcheckidDirtyFlag
(){
return
this
.
healthcheckidDirtyFlag
;
}
}
ps-core/src/main/java/com/ibiz/core/module2/filter/HealthcheckSearchContext.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
filter
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ibiz.util.ISearchFilter
;
import
com.ibiz.util.domain.DataObj
;
import
com.ibiz.util.SearchContext
;
import
com.ibiz.util.SearchFieldFilter
;
import
com.ibiz.util.enums.SearchFieldType
;
import
com.ibiz.util.enums.SearchGroupType
;
import
com.ibiz.util.SearchGroupFilter
;
import
com.ibiz.util.log.IBIZLog
;
/**
* 关系型数据实体[Healthcheck] 查询条件对象
*/
@Slf4j
@Data
@IBIZLog
public
class
HealthcheckSearchContext
extends
SearchContext
{
public
String
n_healthcheckid_like
;
//[HEALTHCHECKID]
public
void
setN_healthcheckid_like
(
String
n_healthcheckid_like
)
{
this
.
n_healthcheckid_like
=
n_healthcheckid_like
;
SearchFieldFilter
searchField
=
new
SearchFieldFilter
();
searchField
.
setParam
(
"healthcheckid"
);
searchField
.
setCondition
(
SearchFieldType
.
LIKE
);
searchField
.
setValue
(
n_healthcheckid_like
);
this
.
getCondition
().
add
(
searchField
);
}
/**
* 启用快速搜索
*/
public
void
setQuery
(
String
strQuery
)
{
this
.
query
=
strQuery
;
if
(!
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
strQuery
)){
SearchGroupFilter
searchGroupFilter
=
new
SearchGroupFilter
();
searchGroupFilter
.
setSearchGroupType
(
SearchGroupType
.
OR
);
SearchFieldFilter
healthcheckid
=
new
SearchFieldFilter
();
healthcheckid
.
setParam
(
"healthcheckid"
);
healthcheckid
.
setCondition
(
SearchFieldType
.
LIKE
);
healthcheckid
.
setValue
(
strQuery
);
searchGroupFilter
.
getCondition
().
add
(
healthcheckid
);
this
.
getCondition
().
add
(
searchGroupFilter
);
}
}
}
ps-core/src/main/java/com/ibiz/core/module2/service/IHealthcheckService.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
service
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.math.BigInteger
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
com.ibiz.core.module2.domain.Healthcheck
;
import
com.ibiz.core.module2.filter.HealthcheckSearchContext
;
/**
* 实体[Healthcheck] 服务对象接口
*/
public
interface
IHealthcheckService
{
Healthcheck
getDraft
(
Healthcheck
healthcheck
)
;
boolean
remove
(
String
healthcheckid
)
;
boolean
checkKey
(
Healthcheck
healthcheck
)
;
boolean
update
(
Healthcheck
healthcheck
)
;
boolean
create
(
Healthcheck
healthcheck
)
;
Healthcheck
test
(
Healthcheck
healthcheck
)
;
Healthcheck
get
(
String
healthcheckid
)
;
Healthcheck
get
(
Healthcheck
healthcheck
)
;
boolean
save
(
Healthcheck
healthcheck
)
;
/**
* 查询集合 DEFAULT
*/
Page
<
Healthcheck
>
searchDefault
(
HealthcheckSearchContext
context
)
;
/**
* 转换ClientModel为Domain
*/
public
Healthcheck
convert2Domain
(
com
.
ibiz
.
core
.
client
.
model
.
Ihealthcheck
model
,
Healthcheck
domain
);
/**
* 转换Domain为ClientModel
*/
public
com
.
ibiz
.
core
.
client
.
model
.
Ihealthcheck
convert2Model
(
Healthcheck
domain
,
com
.
ibiz
.
core
.
client
.
model
.
Ihealthcheck
model
);
}
ps-core/src/main/java/com/ibiz/core/module2/service/impl/HealthcheckServiceImpl.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
service
.
impl
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.math.BigInteger
;
import
java.util.Collection
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
com.ibiz.core.client.model.Ihealthcheck
;
import
com.ibiz.core.module2.domain.Healthcheck
;
import
com.ibiz.core.module2.filter.HealthcheckSearchContext
;
import
com.ibiz.core.module2.service.IHealthcheckService
;
import
com.ibiz.util.SearchResult
;
import
com.ibiz.util.log.IBIZLog
;
/**
* 实体[HEALTHCHECK] 服务对象接口实现
*/
@Slf4j
@IBIZLog
@Service
public
class
HealthcheckServiceImpl
implements
IHealthcheckService
{
@Autowired
private
com
.
ibiz
.
core
.
client
.
service
.
IhealthcheckClientService
healthcheckClientService
;
@Override
public
Healthcheck
getDraft
(
Healthcheck
healthcheck
)
{
return
healthcheck
;
}
@Override
public
boolean
remove
(
String
healthcheckid
)
{
boolean
bOk
=
false
;
Ihealthcheck
clientModel
=
healthcheckClientService
.
createModel
();
clientModel
.
setHEALTHCHECKID
(
healthcheckid
);
healthcheckClientService
.
remove
(
clientModel
)
;
bOk
=
true
;
return
bOk
;
}
@Override
public
boolean
checkKey
(
Healthcheck
healthcheck
)
{
return
true
;
}
@Override
public
boolean
update
(
Healthcheck
healthcheck
)
{
boolean
bOk
=
false
;
Ihealthcheck
clientModel
=
this
.
convert2Model
(
healthcheck
,
null
);
healthcheckClientService
.
update
(
clientModel
)
;
this
.
convert2Domain
(
clientModel
,
healthcheck
)
;
bOk
=
true
;
return
bOk
;
}
@Override
public
boolean
create
(
Healthcheck
healthcheck
)
{
boolean
bOk
=
false
;
Ihealthcheck
clientModel
=
this
.
convert2Model
(
healthcheck
,
null
);
healthcheckClientService
.
create
(
clientModel
)
;
this
.
convert2Domain
(
clientModel
,
healthcheck
);
bOk
=
true
;
return
bOk
;
}
@Override
public
Healthcheck
test
(
Healthcheck
healthcheck
)
{
Ihealthcheck
clientModel
=
this
.
convert2Model
(
healthcheck
,
null
);
healthcheckClientService
.
test
(
clientModel
)
;
this
.
convert2Domain
(
clientModel
,
null
);
return
healthcheck
;
}
@Override
public
Healthcheck
get
(
String
healthcheckid
)
{
Ihealthcheck
clientModel
=
healthcheckClientService
.
createModel
();
clientModel
.
setHEALTHCHECKID
(
healthcheckid
);
healthcheckClientService
.
get
(
clientModel
)
;
return
this
.
convert2Domain
(
clientModel
,
null
);
}
@Override
public
Healthcheck
get
(
Healthcheck
healthcheck
)
{
Healthcheck
rethealthcheck
=
this
.
get
(
healthcheck
.
getHealthcheckid
())
;
BeanCopier
copier
=
BeanCopier
.
create
(
rethealthcheck
.
getClass
(),
healthcheck
.
getClass
(),
false
);
copier
.
copy
(
rethealthcheck
,
healthcheck
,
null
);
return
healthcheck
;
}
@Override
public
boolean
save
(
Healthcheck
healthcheck
)
{
if
(
healthcheck
.
getHealthcheckid
()==
null
){
return
create
(
healthcheck
);
}
else
{
if
(
this
.
get
(
healthcheck
.
getHealthcheckid
())!=
null
){
return
update
(
healthcheck
);
}
return
create
(
healthcheck
);
}
}
/**
* 查询集合 DEFAULT
*/
@Override
public
Page
<
Healthcheck
>
searchDefault
(
HealthcheckSearchContext
context
)
{
List
<
Healthcheck
>
list
=
new
ArrayList
<
Healthcheck
>();
Page
<
com
.
ibiz
.
core
.
client
.
model
.
Ihealthcheck
>
clientModelList
=
healthcheckClientService
.
fetchDefault
(
context
)
;
for
(
com
.
ibiz
.
core
.
client
.
model
.
Ihealthcheck
clientModel
:
clientModelList
){
list
.
add
(
this
.
convert2Domain
(
clientModel
,
null
));
}
return
new
PageImpl
<
Healthcheck
>(
list
,
context
.
getPageable
(),
clientModelList
.
getTotalElements
());
}
@Override
public
Ihealthcheck
convert2Model
(
Healthcheck
domain
,
Ihealthcheck
model
)
{
if
(
domain
==
null
)
return
model
;
if
(
model
==
null
){
model
=
healthcheckClientService
.
createModel
()
;
}
if
(
domain
.
getHealthcheckidDirtyFlag
())
model
.
setHEALTHCHECKID
(
domain
.
getHealthcheckid
());
return
model
;
}
@Override
public
Healthcheck
convert2Domain
(
Ihealthcheck
model
,
Healthcheck
domain
)
{
if
(
model
==
null
)
return
domain
;
if
(
domain
==
null
){
domain
=
new
Healthcheck
();
}
if
(
model
.
getHEALTHCHECKIDDirtyFlag
())
domain
.
setHealthcheckid
(
model
.
getHEALTHCHECKID
());
return
domain
;
}
}
ps-core/src/main/java/com/ibiz/core/module2/valuerule/anno/healthcheck/HealthcheckHealthcheckidDefault.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
valuerule
.
anno
.
healthcheck
;
import
com.ibiz.core.module2.valuerule.validator.healthcheck.HealthcheckHealthcheckidDefaultValidator
;
import
javax.validation.Constraint
;
import
javax.validation.Payload
;
import
java.lang.annotation.*
;
/**
* 值规则注解
* 实体:Healthcheck
* 属性:Healthcheckid
* 值规则:Default
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
FIELD
,
ElementType
.
PARAMETER
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Constraint
(
validatedBy
=
{
HealthcheckHealthcheckidDefaultValidator
.
class
})
public
@interface
HealthcheckHealthcheckidDefault
{
//是否默认检查
boolean
flag
()
default
true
;
//值规则名称
String
info
()
default
"默认规则"
;
//值规则信息,如果为空,使用值规则名称。
String
message
()
default
"内容长度必须小于等于[60]"
;
Class
<?>[]
groups
()
default
{};
Class
<?
extends
Payload
>[]
payload
()
default
{};
}
ps-core/src/main/java/com/ibiz/core/module2/valuerule/validator/healthcheck/HealthcheckHealthcheckidDefaultValidator.java
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
core
.
module2
.
valuerule
.
validator
.
healthcheck
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.validation.Errors
;
import
org.springframework.validation.Validator
;
import
javax.validation.ConstraintValidator
;
import
javax.validation.ConstraintValidatorContext
;
import
com.ibiz.util.valuerule.DefaultValueRule
;
import
com.ibiz.util.valuerule.VRCondition
;
import
com.ibiz.util.valuerule.condition.*
;
import
com.ibiz.core.module2.valuerule.anno.healthcheck.HealthcheckHealthcheckidDefault
;
import
com.ibiz.util.log.IBIZLog
;
/**
* 值规则注解解析类
* 实体:Healthcheck
* 属性:Healthcheckid
* 值规则:Default
* 值规则信息:内容长度必须小于等于[60]
*/
@Slf4j
@IBIZLog
@Component
(
"HealthcheckHealthcheckidDefaultValidator"
)
public
class
HealthcheckHealthcheckidDefaultValidator
implements
ConstraintValidator
<
HealthcheckHealthcheckidDefault
,
String
>,
Validator
{
private
static
final
String
MESSAGE
=
"值规则校验失败:【内容长度必须小于等于[60]】"
;
@Override
public
boolean
isValid
(
String
value
,
ConstraintValidatorContext
context
)
{
boolean
isValid
=
doValidate
(
value
);
if
(!
isValid
)
{
context
.
disableDefaultConstraintViolation
();
context
.
buildConstraintViolationWithTemplate
(
MESSAGE
)
.
addConstraintViolation
();
}
return
doValidate
(
value
);
}
@Override
public
boolean
supports
(
Class
<?>
aClass
)
{
return
true
;
}
@Override
public
void
validate
(
Object
o
,
Errors
errors
)
{
if
(
o
!=
null
&&
supports
(
o
.
getClass
())){
if
(!
doValidate
((
String
)
o
)){
errors
.
reject
(
MESSAGE
);
}
}
}
public
boolean
doValidate
(
String
value
)
{
DefaultValueRule
<
String
>
valueRule
=
new
DefaultValueRule
<>(
"默认值规则"
,
MESSAGE
,
"Healthcheckid"
,
value
)
//字符串长度,重复检查模式,重复值范围,基础值规则,是否递归检查。
.
init
(
60
,
"NONE"
,
null
,
null
,
false
);
return
valueRule
.
isValid
();
}
}
ps-core/src/main/resources/rules/PSXDRule.drl
0 → 100644
浏览文件 @
1fdf033f
package
com
.
ibiz
.
module
.
logic
.
pslogic
.
xd
;
import
java
.
util
.
Map
;
global
com
.
ibiz
.
core
.
module
.
domain
.
PS
psxddefault
;
global
com
.
ibiz
.
core
.
module2
.
domain
.
Healthcheck
psxdhealthcheck
;
global
com
.
ibiz
.
core
.
module2
.
service
.
IHealthcheckService
healthcheckservice
;
global
com
.
ibiz
.
core
.
module
.
service
.
IPSService
iBzSysPsDefaultService
;
no
-
loop
//
逻辑处理节点
[
开始
]
rule
"begin"
ruleflow
-
group
"psxdbegin"
when
then
end
//
逻辑处理节点
[
healthcheck
]
rule
"deaction1"
ruleflow
-
group
"psxddeaction1"
when
then
healthcheckservice
.
test
(
psxdhealthcheck
);
update
(
psxddefault
);//
更新
fact
中变量值
update
(
psxdhealthcheck
);//
更新
fact
中变量值
end
ps-core/src/main/resources/rules/PSXDRuleFlow.bpmn
0 → 100644
浏览文件 @
1fdf033f
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:di=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:g=
"http://www.jboss.org/drools/flow/gpd"
xmlns:tns=
"http://www.jboss.org/drools"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.mvel.org/2.0"
id=
"Definition"
name=
""
targetNamespace=
"http://www.jboss.org/drools"
typeLanguage=
"http://www.java.com/javaTypes"
>
<process
id=
"com.ibiz.core.module.service.logic.psxd"
isClosed=
"false"
isExecutable=
"true"
name=
"ScoreRule"
processType=
"Private"
tns:packageName=
"com.ibiz.core.module.service.logic.psxd"
>
<extensionElements>
<tns:import
name=
"java.util.Map"
/>
<tns:import
name=
"org.springframework.util.StringUtils"
/>
<tns:import
name=
"com.ibiz.util.helper.CompareHelper"
/>
<tns:global
identifier=
"psxddefault"
type=
"com.ibiz.core.module.domain.PS"
/>
<tns:global
identifier=
"psxdhealthcheck"
type=
"com.ibiz.core.module2.domain.Healthcheck"
/>
</extensionElements>
<startEvent
id=
"ACDDC51E-15B7-4939-BF9A-F8AFF9CACEE6"
isInterrupting=
"true"
/>
<businessRuleTask
activiti:exclusive=
"true"
g:ruleFlowGroup=
"psxddeaction1"
id=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C"
implementation=
"http://www.jboss.org/drools/rule"
name=
"HEALTHCHECK"
/>
<endEvent
id=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C_End"
name=
"End"
/>
<sequenceFlow
id=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C_End_Line"
sourceRef=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C"
targetRef=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C_End"
/>
<sequenceFlow
id=
"A09AE34B-B4D0-49FC-9A4B-381A955209E9"
sourceRef=
"ACDDC51E-15B7-4939-BF9A-F8AFF9CACEE6"
targetRef=
"A9FB6F0E-5F68-4756-A948-55CEE6301F6C"
>
</sequenceFlow>
</process>
</definitions>
ps-service/ps-service-web/src/main/java/com/ibiz/service/web/resource/PSResource.java
浏览文件 @
1fdf033f
...
...
@@ -85,6 +85,16 @@ public class PSResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"下单"
,
tags
=
{
"PS"
},
notes
=
"下单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/web/ps/{ps_id}/xd"
)
@Transactional
public
ResponseEntity
<
PSDTO
>
xD
(
@PathVariable
(
"ps_id"
)
String
ps_id
,
@RequestBody
PSDTO
psdto
)
{
PS
ps
=
psdto
.
toDO
();
ps
=
psService
.
xD
(
ps
)
;
psdto
.
fromDO
(
ps
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
psdto
);
}
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"PS"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/web/ps/{ps_id}/getdraft"
)
@Transactional
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录