Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
2681c7c7
Commit
2681c7c7
authored
Dec 13, 2023
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jyjc):新增工作流启动流程
parent
16eecf69
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
20 deletions
+37
-20
JyjcOpeningApplication.java
...s/boot/module/jyjc/api/entity/JyjcOpeningApplication.java
+1
-1
JyjcOpeningApplicationController.java
...jyjc/biz/controller/JyjcOpeningApplicationController.java
+1
-1
JyjcOpeningApplicationServiceImpl.java
...c/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
+29
-15
application-dev.properties
...le-jyjc-biz/src/main/resources/application-dev.properties
+6
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcOpeningApplication.java
View file @
2681c7c7
...
...
@@ -81,7 +81,7 @@ public class JyjcOpeningApplication extends BaseEntity {
/**
* 申请时间
*/
@TableField
(
value
=
"
rec_dat
e"
,
fill
=
FieldFill
.
INSERT
)
@TableField
(
value
=
"
apply_tim
e"
,
fill
=
FieldFill
.
INSERT
)
protected
Date
applyTime
;
/**
* 工作流执行角色
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcOpeningApplicationController.java
View file @
2681c7c7
...
...
@@ -40,7 +40,7 @@ public class JyjcOpeningApplicationController extends BaseController {
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
JyjcOpeningApplicationDto
>
save
(
@RequestBody
JyjcOpeningApplicationDto
model
)
{
model
=
jyjcOpeningApplicationServiceImpl
.
createWith
Model
(
model
);
model
=
jyjcOpeningApplicationServiceImpl
.
save
Model
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
View file @
2681c7c7
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
service
.
impl
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication
;
...
...
@@ -8,16 +10,21 @@ import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcOpeningApplicationMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcOpeningApplicationService
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.JyjcOpeningApplicationDto
;
import
com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException
;
import
com.yeejoin.amos.boot.module.jyjc.biz.config.CommonException
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseUnitLicenceDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.CommonErrorEnum
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.LicenceTypeEnum
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -35,6 +42,7 @@ import java.util.Map;
* @date 2023-12-13
*/
@Service
@Slf4j
public
class
JyjcOpeningApplicationServiceImpl
extends
BaseService
<
JyjcOpeningApplicationDto
,
JyjcOpeningApplication
,
JyjcOpeningApplicationMapper
>
implements
IJyjcOpeningApplicationService
{
@Autowired
CommonserviceImpl
commonserviceImpl
;
...
...
@@ -45,24 +53,30 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
@Resource
(
type
=
JyjcBaseMapper
.
class
)
private
JyjcBaseMapper
baseMapper
;
@Value
(
"${process-definition-key}"
)
@Value
(
"${process-definition-key
.jyjc.openapplication:
}"
)
private
String
processDefinitionKey
;
public
JyjcOpeningApplicationDto
save
(
JyjcOpeningApplicationDto
model
)
{
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
CommonException
.
class
})
public
JyjcOpeningApplicationDto
save
Model
(
JyjcOpeningApplicationDto
model
)
{
// 开启工作流 startProcess
JyjcOpeningApplicationDto
dto
=
this
.
createWithModel
(
model
);
return
dto
;
}
private
String
startProcess
(
HashMap
<
String
,
Object
>
dtoMap
)
throws
Exception
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
processDefinitionKey
);
dto
.
setBusinessKey
(
"1"
);
dto
.
setVariables
(
dtoMap
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
return
instanceId
;
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
processDefinitionKey
);
dto
.
setBusinessKey
(
"1"
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"工作流开始结果:{}"
,
ajaxResult
);
}
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
// model.setWorkflowRole();
model
.
setStatus
(!
ValidationUtil
.
isEmpty
(
dataObject
)
&&
!
ValidationUtil
.
isEmpty
(
dataObject
.
get
(
"name"
))
?
String
.
valueOf
(
dataObject
.
get
(
"name"
))
:
""
);
model
.
setWorkflowProstanceId
(
instanceId
);
return
this
.
createWithModel
(
model
);
}
catch
(
Exception
e
)
{
log
.
error
(
"saveModel: model={} error"
,
model
,
e
);
throw
new
BaseException
(
e
.
getMessage
());
}
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/resources/application-dev.properties
View file @
2681c7c7
...
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.17
#redis properties:
spring.redis.database
=
1
spring.redis.host
=
172.16.10.243
spring.redis.host
=
172.16.10.243
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.redis.lettuce.pool.max-active
=
200
...
...
@@ -34,4 +34,7 @@ emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.243:1883
emqx.client-user-name
=
super
emqx.client-password
=
123456
emqx.keepAliveInterval
=
1000
\ No newline at end of file
emqx.keepAliveInterval
=
1000
#检验检测流程KEY
process-definition-key.jyjc.openapplication
=
inspectionBusinessOpened
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment