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
bc6bb636
Commit
bc6bb636
authored
May 21, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(JG):监管集成Seata全局事务
parent
454ae6a0
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
510 additions
and
80 deletions
+510
-80
pom.xml
amos-boot-biz-common/pom.xml
+3
-3
FeignAuthRequestInterceptor.java
...os/boot/biz/common/feign/FeignAuthRequestInterceptor.java
+4
-1
MultipartSupportConfig.java
...in/amos/boot/biz/common/feign/MultipartSupportConfig.java
+13
-2
MybatisSqlInjector.java
.../com/yeejoin/amos/boot/biz/config/MybatisSqlInjector.java
+22
-0
TaskV2FeignService.java
...amos/boot/module/jg/flc/api/fegin/TaskV2FeignService.java
+75
-0
WorkFlowFeignService.java
...os/boot/module/jg/flc/api/fegin/WorkFlowFeignService.java
+68
-12
pom.xml
...m-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/pom.xml
+24
-0
AmosJGApplication.java
...biz/src/main/java/com/yeejoin/amos/AmosJGApplication.java
+1
-1
DataSourceConfiguration.java
...os/boot/module/jg/biz/config/DataSourceConfiguration.java
+72
-0
CmWorkflowServiceImpl.java
...oot/module/jg/biz/service/impl/CmWorkflowServiceImpl.java
+12
-14
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+25
-22
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+11
-5
JgMaintenanceContractServiceImpl.java
...jg/biz/service/impl/JgMaintenanceContractServiceImpl.java
+8
-2
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+5
-0
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+5
-7
application-dev.properties
...dule-jg-biz/src/main/resources/application-dev.properties
+7
-3
application.properties
...t-module-jg-biz/src/main/resources/application.properties
+6
-3
file.conf
...e-jg/amos-boot-module-jg-biz/src/main/resources/file.conf
+67
-0
registry.conf
.../amos-boot-module-jg-biz/src/main/resources/registry.conf
+82
-0
pom.xml
pom.xml
+0
-5
No files found.
amos-boot-biz-common/pom.xml
View file @
bc6bb636
...
...
@@ -127,9 +127,9 @@
<version>
5.1.10
</version>
</dependency>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<
scope>
runtime
</scope
>
<groupId>
io.seata
</groupId>
<artifactId>
seata-spring-boot-starter
</artifactId>
<
version>
1.8.0
</version
>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/feign/FeignAuthRequestInterceptor.java
View file @
bc6bb636
...
...
@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.biz.common.feign;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
io.seata.core.context.RootContext
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
javax.servlet.http.HttpServletRequest
;
/**
...
...
@@ -46,5 +46,8 @@ public class FeignAuthRequestInterceptor implements RequestInterceptor {
template
.
header
(
"appKey"
,
RequestContext
.
getAppKey
());
template
.
header
(
"product"
,
RequestContext
.
getProduct
());
}
if
(
StringUtils
.
hasText
(
RootContext
.
getXID
())){
template
.
header
(
RootContext
.
KEY_XID
,
RootContext
.
getXID
());
}
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/feign/MultipartSupportConfig.java
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
feign
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
io.seata.core.context.RootContext
;
import
org.springframework.beans.factory.ObjectFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConverters
;
import
org.springframework.cloud.openfeign.support.SpringEncoder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestContextListener
;
import
feign.codec.Encoder
;
import
feign.form.spring.SpringFormEncoder
;
...
...
@@ -17,7 +20,7 @@ import feign.form.spring.SpringFormEncoder;
* @Date: 2020/3/30 16:26
*/
@Configuration
public
class
MultipartSupportConfig
{
public
class
MultipartSupportConfig
implements
RequestInterceptor
{
@Autowired
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
...
...
@@ -34,4 +37,12 @@ public class MultipartSupportConfig {
public
RequestContextListener
requestInterceptor
()
{
return
new
RequestContextListener
();
}
@Override
public
void
apply
(
RequestTemplate
template
)
{
String
xid
=
RootContext
.
getXID
();
if
(
StringUtils
.
hasText
(
xid
)){
template
.
header
(
RootContext
.
KEY_XID
,
xid
);
}
}
}
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/config/MybatisSqlInjector.java
0 → 100644
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
biz
.
config
;
import
com.baomidou.mybatisplus.core.injector.AbstractMethod
;
import
com.baomidou.mybatisplus.core.injector.DefaultSqlInjector
;
import
com.baomidou.mybatisplus.extension.injector.methods.additional.InsertBatchSomeColumn
;
import
java.util.List
;
/**
* @apiNote 解决集成seata后,InsertBatchSomeColumn报错问题
* @author LiuLin
* @date 2024-05-15
*/
public
class
MybatisSqlInjector
extends
DefaultSqlInjector
{
@Override
public
List
<
AbstractMethod
>
getMethodList
(
Class
<?>
mapperClass
)
{
List
<
AbstractMethod
>
methodList
=
super
.
getMethodList
(
mapperClass
);
methodList
.
add
(
new
InsertBatchSomeColumn
());
return
methodList
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/flc/api/fegin/TaskV2FeignService.java
0 → 100644
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
flc
.
api
.
fegin
;
import
com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author LiuLin
* @apiNote 待办Feign调用
* @date 2024-05-16
*/
@FeignClient
(
name
=
"AMOS-API-PRIVILEGE"
,
path
=
"/systemctl/v2/task"
,
configuration
=
{
FeignConfiguration
.
class
})
public
interface
TaskV2FeignService
{
/**
* 批量新增任务
*
* @param modelList 新增待办
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/batch/add"
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
List
<
TaskV2Model
>>
batchAdd
(
@RequestBody
List
<
TaskV2Model
>
modelList
)
throws
InnerInvokException
;
/**
* 更新任务
*
* @param model 待办信息
* @param sequenceNbr 主键
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/{sequenceNbr}"
,
method
=
RequestMethod
.
PUT
)
FeignClientResult
<
TaskV2Model
>
update
(
@RequestBody
TaskV2Model
model
,
@PathVariable
(
"sequenceNbr"
)
Long
sequenceNbr
)
throws
InnerInvokException
;
/**
* 创建任务
*
* @param model 待办
* @return
* @throws InnerInvokException
*/
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
TaskV2Model
>
create
(
@RequestBody
TaskV2Model
model
)
throws
InnerInvokException
;
/**
* 批量删除任务
*
* @param ids 主键
* @return Long
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/{ids}"
,
method
=
RequestMethod
.
DELETE
)
FeignClientResult
<
List
<
Long
>>
delete
(
@PathVariable
(
"ids"
)
String
ids
)
throws
InnerInvokException
;
/**
* 查询指定任务
*
* @param relationId 关联Id
* @return List<TaskV2Model>
* @throws InnerInvokException
*/
@RequestMapping
(
value
=
"/queryByRelationId/{relationId}"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
List
<
TaskV2Model
>>
selectListByRelationId
(
@PathVariable
(
"relationId"
)
String
relationId
)
throws
InnerInvokException
;
/**
* 批量修改任务
*/
@RequestMapping
(
value
=
"/batch/update"
,
method
=
RequestMethod
.
PUT
)
FeignClientResult
<
List
<
TaskV2Model
>>
batchUpdate
(
@RequestBody
List
<
TaskV2Model
>
modelList
)
throws
InnerInvokException
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/flc/api/fegin/WorkFlowFeignService.java
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
flc
.
api
.
fegin
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
@FeignClient
(
name
=
"AMOS-API-WORKFLOW"
,
path
=
"workflow"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
WorkFlowFeignService
{
...
...
@@ -34,15 +33,14 @@ public interface WorkFlowFeignService {
* 获取流程审批日志
* */
@RequestMapping
(
value
=
"/task/flowLogger/{procInsId}"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
Map
<
String
,
Object
>>
getFlowLogger
(
@PathVariable
(
value
=
"procInsId"
)
String
procInsId
);
FeignClientResult
<
Map
<
String
,
Object
>>
getFlowLogger
(
@PathVariable
(
value
=
"procInsId"
)
String
procInsId
);
@RequestMapping
(
value
=
"/history/task/nodeInfo"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
JSONObject
>
getNodeInfotoken
(
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
,
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
,
@RequestParam
(
value
=
"taskId"
)
String
taskId
);
...
...
@@ -53,15 +51,73 @@ public interface WorkFlowFeignService {
@RequestMapping
(
value
=
"/task/getTaskNoAuth/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getTaskNoAuthtoken
(
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
,
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"token"
,
required
=
true
)
String
token
,
@PathVariable
(
value
=
"processInstanceId"
)
String
processInstanceId
);
@RequestMapping
(
value
=
"/v2/task/rollBack/{processInstanceId}"
,
method
=
RequestMethod
.
POST
)
JSONObject
rollBack
(
@PathVariable
(
value
=
"processInstanceId"
)
String
processInstanceId
);
/**
* 工作流启动接口
*
* @param params 业务参数
* @return ProcessTaskDTO
* @throws Exception e
*/
@RequestMapping
(
value
=
"/v2/task/start/batch"
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
List
<
ProcessTaskDTO
>>
startForBatch
(
@RequestBody
ActWorkflowBatchDTO
params
)
throws
Exception
;
/**
* 工作流驳回任务接口
*
* @param taskId 任务Id
* @param data 业务参数
* @return ProcessTaskDTO
* @throws Exception e
*/
@RequestMapping
(
value
=
"/v2/task/reject/{taskId}"
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
ProcessTaskDTO
>
reject
(
@PathVariable
(
"taskId"
)
String
taskId
,
@RequestBody
TaskResultDTO
data
)
throws
Exception
;
/**
* 工作流完成任务接口
*
* @param taskId 任务Id
* @param data 业务参数
* @return ProcessTaskDTO
* @throws Exception e
*/
@RequestMapping
(
value
=
"/v2/task/complete/standard/{taskId}"
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
ProcessTaskDTO
>
completeByTaskFroStandard
(
@PathVariable
(
"taskId"
)
String
taskId
,
@RequestBody
TaskResultDTO
data
)
throws
Exception
;
/**
* 工作流撤回
*
* @param processInstanceId processInstanceId
* @return ProcessTaskDTO
*/
@PostMapping
(
value
=
"/v2/task/rollBack/standard/{processInstanceId}"
)
FeignClientResult
<
ProcessTaskDTO
>
rollBackTask
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
);
/**
* 转办任务
*
* @param flowTaskVo flowTaskVo
* @return ProcessTaskDTO
*/
@PostMapping
(
value
=
"/v2/task/assign"
)
FeignClientResult
<
ProcessTaskDTO
>
assign
(
@RequestBody
FlowTaskVo
flowTaskVo
);
/**
* 终止流程
*
* @param processInstanceId processInstanceId
* @return ProcessInstanceDTO
* @throws Exception e
*/
@DeleteMapping
(
value
=
"/v2/task/stopProcess/{processInstanceId}"
)
FeignClientResult
<
ProcessInstanceDTO
>
stopProcess
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
,
@RequestParam
(
required
=
false
,
value
=
"stopReason"
)
String
stopReason
)
throws
Exception
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/pom.xml
View file @
bc6bb636
...
...
@@ -31,6 +31,30 @@
<version>
19.5jdk
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
io.github.openfeign
</groupId>
<artifactId>
feign-httpclient
</artifactId>
</dependency>
<dependency>
<groupId>
com.esotericsoftware.kryo
</groupId>
<artifactId>
kryo
</artifactId>
<version>
2.24.0
</version>
</dependency>
<dependency>
<groupId>
de.javakaffee
</groupId>
<artifactId>
kryo-serializers
</artifactId>
<version>
0.45
</version>
</dependency>
<dependency>
<groupId>
com.esotericsoftware
</groupId>
<artifactId>
kryo
</artifactId>
<version>
4.0.2
</version>
</dependency>
<dependency>
<groupId>
cn.com.vastdata
</groupId>
<artifactId>
vastbase-jdbc
</artifactId>
<version>
2.7p
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/AmosJGApplication.java
View file @
bc6bb636
...
...
@@ -29,7 +29,6 @@ import java.net.UnknownHostException;
*
* @author DELL
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@ServletComponentScan
...
...
@@ -44,6 +43,7 @@ import java.net.UnknownHostException;
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
{
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
{
org
.
typroject
.
tyboot
.
core
.
restful
.
exception
.
GlobalExceptionHandler
.
class
})})
@SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
jdbc
.
DataSourceAutoConfiguration
.
class
})
public
class
AmosJGApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosJGApplication
.
class
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/config/DataSourceConfiguration.java
0 → 100644
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
config
;
import
com.baomidou.mybatisplus.core.config.GlobalConfig
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
com.yeejoin.amos.boot.biz.config.MetaHandler
;
import
com.yeejoin.amos.boot.biz.config.MybatisSqlInjector
;
import
com.zaxxer.hikari.HikariDataSource
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
javax.sql.DataSource
;
import
org.apache.ibatis.plugin.Interceptor
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
/**
* 数据源代理
*
* @author LiuLin
*/
@Configuration
public
class
DataSourceConfiguration
{
@Autowired
private
DataSourceProperties
dsp
;
@Bean
(
name
=
"hikariDataSource"
)
public
HikariDataSource
hikariDataSource
()
{
HikariDataSource
hds
=
new
HikariDataSource
();
hds
.
setSchema
(
dsp
.
getSchema
().
get
(
0
));
hds
.
setUsername
(
dsp
.
getUsername
());
hds
.
setPassword
(
dsp
.
getPassword
());
hds
.
setJdbcUrl
(
dsp
.
getUrl
());
hds
.
setDriverClassName
(
dsp
.
getDriverClassName
());
hds
.
setConnectionTimeout
(
3000
);
hds
.
setMaximumPoolSize
(
30
);
hds
.
setMinimumIdle
(
10
);
return
hds
;
}
@Primary
@Bean
(
"dataSource"
)
public
DataSourceProxy
dataSourceProxy
(
DataSource
hikariDataSource
)
{
return
new
DataSourceProxy
(
hikariDataSource
);
}
@Bean
(
name
=
"sqlSessionFactory"
)
@Autowired
public
SqlSessionFactory
sqlSessionFactoryBean
(
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MetaHandler
metaHandler
)
throws
Exception
{
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSourceProxy
);
ResourcePatternResolver
resolver
=
new
PathMatchingResourcePatternResolver
();
bean
.
setMapperLocations
(
resolver
.
getResources
(
"classpath*:mapper/*.xml"
));
GlobalConfig
globalConfig
=
new
GlobalConfig
();
globalConfig
.
setSqlInjector
(
new
MybatisSqlInjector
());
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
Interceptor
[]
plugins
=
{
paginationInterceptor
};
bean
.
setPlugins
(
plugins
);
return
bean
.
getObject
();
}
@Bean
public
MetaHandler
metaHandler
()
{
return
new
MetaHandler
();
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CmWorkflowServiceImpl.java
View file @
bc6bb636
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author Administrator
...
...
@@ -33,14 +30,15 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
*/
public
static
String
REJECT_OPERATE
=
"1"
;
@Autowired
private
WorkFlowFeignService
workFlowFeignService
;
@Override
public
List
<
ProcessTaskDTO
>
startBatch
(
ActWorkflowBatchDTO
params
)
{
List
<
ProcessTaskDTO
>
processTasks
;
try
{
log
.
info
(
"开始请求工作流启动接口:/start/batch,请求参数:{}"
,
JSONObject
.
toJSONString
(
params
));
processTasks
=
Workflow
.
taskV2Client
.
startForBatch
(
params
).
getResult
();
processTasks
=
workFlowFeignService
.
startForBatch
(
params
).
getResult
();
}
catch
(
InnerInvokException
e
)
{
//拦截无审核人异常信息
String
devMessage
=
getErrorMessage
(
e
);
...
...
@@ -73,15 +71,15 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
if
(
PASS_OPERATE
.
equals
(
operate
)){
// 通过操作
log
.
info
(
"开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}"
,
taskId
,
JSONObject
.
toJSONString
(
data
));
processTaskDTO
=
Workflow
.
taskV2Client
.
completeByTaskFroStandard
(
taskId
,
data
).
getResult
();
processTaskDTO
=
workFlowFeignService
.
completeByTaskFroStandard
(
taskId
,
data
).
getResult
();
}
else
if
(
REJECT_OPERATE
.
equals
(
operate
))
{
// 驳回操作
log
.
info
(
"开始请求工作流驳回任务接口:/reject/{taskId},请求参数:{},{}"
,
taskId
,
JSONObject
.
toJSONString
(
data
));
processTaskDTO
=
Workflow
.
taskV2Client
.
reject
(
taskId
,
data
).
getResult
();
processTaskDTO
=
workFlowFeignService
.
reject
(
taskId
,
data
).
getResult
();
}
else
{
// 执行普通节点(提交)
log
.
info
(
"开始请求工作流完成任务接口:/complete/standard/{taskId},请求参数:{},{}"
,
taskId
,
JSONObject
.
toJSONString
(
data
));
processTaskDTO
=
Workflow
.
taskV2Client
.
completeByTaskFroStandard
(
taskId
,
data
).
getResult
();
processTaskDTO
=
workFlowFeignService
.
completeByTaskFroStandard
(
taskId
,
data
).
getResult
();
}
}
catch
(
InnerInvokException
e
)
{
//拦截无审核人异常信息
...
...
@@ -98,7 +96,7 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
@Override
public
ProcessTaskDTO
rollBack
(
String
processInstanceId
)
{
log
.
info
(
"开始请求工作流撤回接口:/rollBack/standard/{processInstanceId},请求参数:{}"
,
processInstanceId
);
return
FeignUtil
.
remoteCall
(()
->
Workflow
.
taskV2Client
.
rollBackTask
(
processInstanceId
));
return
FeignUtil
.
remoteCall
(()
->
workFlowFeignService
.
rollBackTask
(
processInstanceId
));
}
...
...
@@ -106,8 +104,8 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
public
ProcessTaskDTO
assign
(
FlowTaskVo
taskVo
)
{
ProcessTaskDTO
processTaskDTO
=
new
ProcessTaskDTO
();
try
{
log
.
info
(
"开始请求工作流转办任务接口:/assign/{taskVo},请求参数:{}
,{}
"
,
taskVo
);
processTaskDTO
=
Workflow
.
taskV2Client
.
assign
(
taskVo
).
getResult
();
log
.
info
(
"开始请求工作流转办任务接口:/assign/{taskVo},请求参数:{}"
,
taskVo
);
processTaskDTO
=
workFlowFeignService
.
assign
(
taskVo
).
getResult
();
}
catch
(
InnerInvokException
e
)
{
//拦截无审核人异常信息
String
devMessage
=
getErrorMessage
(
e
);
...
...
@@ -126,7 +124,7 @@ public class CmWorkflowServiceImpl implements ICmWorkflowService {
ProcessInstanceDTO
processTaskDTO
=
new
ProcessInstanceDTO
();
try
{
log
.
info
(
"开始请求工作流终止流程接口:/stopProcess/{processInstanceId},请求参数:{},{}"
,
processInstanceId
,
stopReason
);
processTaskDTO
=
Workflow
.
taskV2Client
.
stopProcess
(
processInstanceId
,
stopReason
).
getResult
();
processTaskDTO
=
workFlowFeignService
.
stopProcess
(
processInstanceId
,
stopReason
).
getResult
();
}
catch
(
InnerInvokException
e
)
{
//拦截无审核人异常信息
String
devMessage
=
getErrorMessage
(
e
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
bc6bb636
...
...
@@ -42,6 +42,7 @@ import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import
com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.TaskV2FeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
...
...
@@ -226,6 +227,8 @@ public class CommonServiceImpl implements ICommonService {
@Autowired
private
JgVehicleInformationServiceImpl
jgVehicleInformationService
;
private
Map
<
String
,
String
>
companyCodeRegNameMap
;
@Autowired
private
TaskV2FeignService
taskV2FeignService
;
public
static
byte
[]
file2byte
(
File
file
)
{
try
{
...
...
@@ -1153,9 +1156,9 @@ public class CommonServiceImpl implements ICommonService {
flowTaskVo
.
setAssignee
(
assignee
);
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
assign
(
flowTaskVo
);
// 修改待办
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
instanceId
).
getResult
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
instanceId
).
getResult
();
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
collect
.
size
()
==
0
)
{
if
(
collect
.
isEmpty
()
)
{
return
null
;
}
TaskV2Model
taskV2Model
=
collect
.
get
(
0
);
...
...
@@ -1166,7 +1169,7 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model
.
setEndDate
(
new
Date
());
String
routhPath
=
taskV2Model
.
getRoutePath
().
replace
(
"nextExecuteUserIds"
,
"executeUserId"
)
+
"&nextExecuteUserIds="
+
assignee
;
taskV2Model
.
setRoutePath
(
routhPath
);
Systemctl
.
taskV2Client
.
update
(
taskV2Model
,
taskV2Model
.
getSequenceNbr
());
taskV2FeignService
.
update
(
taskV2Model
,
taskV2Model
.
getSequenceNbr
());
// 创建新待办
taskV2Model
.
setExecuteUserIds
(
assignee
);
String
nextTaskId
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
();
...
...
@@ -1179,7 +1182,7 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model
.
setEndUserId
(
null
);
taskV2Model
.
setEndDate
(
null
);
taskV2Model
.
setSequenceNbr
(
null
);
Systemctl
.
taskV2Client
.
create
(
taskV2Model
);
taskV2FeignService
.
create
(
taskV2Model
);
String
id
=
commonMapper
.
selectBusinessData
(
tableName
,
instanceId
);
id
=
ObjectUtils
.
isEmpty
(
id
)
?
assignee
:
id
+
","
+
assignee
;
...
...
@@ -1201,11 +1204,11 @@ public class CommonServiceImpl implements ICommonService {
}
public
void
deleteTaskModel
(
String
id
)
{
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
id
).
getResult
();
if
(
result
.
size
()
>
0
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
id
).
getResult
();
if
(
!
result
.
isEmpty
()
)
{
List
<
Long
>
idList
=
result
.
stream
().
map
(
TaskV2Model:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
String
ids
=
idList
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
));
Systemctl
.
taskV2Client
.
delete
(
ids
);
taskV2FeignService
.
delete
(
ids
);
}
}
...
...
@@ -1216,10 +1219,10 @@ public class CommonServiceImpl implements ICommonService {
List
<
TaskV2Model
>
taskV2Models
=
new
ArrayList
<>();
for
(
TaskModelDto
obj
:
list
)
{
// 判断是否是暂存 新增若无下一节点执行人即为暂存
boolean
flag
=
StringUtils
.
isEmpty
(
obj
.
getNextExecuteUser
())
?
true
:
false
;
boolean
flag
=
StringUtils
.
isEmpty
(
obj
.
getNextExecuteUser
());
if
(
flag
)
{
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
obj
.
getRelationId
()).
getResult
();
if
(
CollectionUtil
.
isNotEmpty
(
result
)
&&
result
.
size
()
>
0
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
obj
.
getRelationId
()).
getResult
();
if
(
CollectionUtil
.
isNotEmpty
(
result
)
&&
!
result
.
isEmpty
()
)
{
break
;
}
}
...
...
@@ -1284,7 +1287,7 @@ public class CommonServiceImpl implements ICommonService {
taskV2Models
.
add
(
model
);
}
Systemctl
.
taskV2Client
.
batchAdd
(
taskV2Models
);
taskV2FeignService
.
batchAdd
(
taskV2Models
);
}
/**
...
...
@@ -1298,10 +1301,10 @@ public class CommonServiceImpl implements ICommonService {
**/
public
TaskV2Model
updateTaskModel
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
collect
==
null
||
collect
.
size
()
==
0
)
{
if
(
collect
.
isEmpty
()
)
{
return
null
;
}
collect
.
get
(
0
).
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
...
...
@@ -1339,10 +1342,10 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model
.
setFlowStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
}
Systemctl
.
taskV2Client
.
batchUpdate
(
collect
);
taskV2FeignService
.
batchUpdate
(
collect
);
}
else
{
collect
.
get
(
0
).
setRoutePath
(
collect
.
get
(
0
).
getRoutePath
().
replace
(
"roleIds="
,
"roleIds=55555&fq="
));
Systemctl
.
taskV2Client
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
taskV2FeignService
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
}
// 修改model并返回 用于组装新待办
collect
.
get
(
0
).
setEndUserId
(
null
);
...
...
@@ -1365,7 +1368,7 @@ public class CommonServiceImpl implements ICommonService {
**/
public
TaskV2Model
updateTaskModelNew
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
// TaskV2Model model = result.stream().filter(e->e.getFlowCode().equals(params.get("flowCode").toString())).sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r2.getSequenceNbr())) // 按时间降序排序
// .findFirst()
...
...
@@ -1407,10 +1410,10 @@ public class CommonServiceImpl implements ICommonService {
taskV2Model
.
setFlowStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
}
Systemctl
.
taskV2Client
.
batchUpdate
(
collect
);
taskV2FeignService
.
batchUpdate
(
collect
);
}
else
{
collect
.
get
(
0
).
setRoutePath
(
collect
.
get
(
0
).
getRoutePath
().
replace
(
"roleIds="
,
"roleIds=55555&fq="
));
Systemctl
.
taskV2Client
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
taskV2FeignService
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
}
collect
.
get
(
0
).
setEndUserId
(
null
);
collect
.
get
(
0
).
setTaskStatus
(
null
);
...
...
@@ -1429,10 +1432,10 @@ public class CommonServiceImpl implements ICommonService {
*/
public
void
rollbackTask
(
String
id
,
JSONObject
obj
)
{
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
id
).
getResult
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
id
).
getResult
();
List
<
TaskV2Model
>
list
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
TaskV2Model
model
=
list
.
get
(
0
);
Systemctl
.
taskV2Client
.
delete
(
String
.
valueOf
(
model
.
getSequenceNbr
()));
taskV2FeignService
.
delete
(
String
.
valueOf
(
model
.
getSequenceNbr
()));
String
urlParams
=
""
;
urlParams
=
"&"
+
toQueryParams2
(
obj
);
...
...
@@ -1461,7 +1464,7 @@ public class CommonServiceImpl implements ICommonService {
break
;
}
}
Systemctl
.
taskV2Client
.
update
(
lastTaskModel
,
lastTaskModel
.
getSequenceNbr
());
taskV2FeignService
.
update
(
lastTaskModel
,
lastTaskModel
.
getSequenceNbr
());
}
else
if
(
list
.
size
()
==
1
)
{
model
.
setExecuteUserIds
(
model
.
getStartUserId
());
model
.
setTaskStatusLabel
(
"重新提交"
);
...
...
@@ -1482,7 +1485,7 @@ public class CommonServiceImpl implements ICommonService {
break
;
}
}
Systemctl
.
taskV2Client
.
create
(
model
);
taskV2FeignService
.
create
(
model
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
bc6bb636
...
...
@@ -51,6 +51,9 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.core.context.RootContext
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.seata.tm.api.GlobalTransactionContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
...
...
@@ -69,14 +72,12 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
/**
...
...
@@ -254,8 +255,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param noticeDto 安装告知
*/
@Override
@
SuppressWarnings
({
"rawtypes"
,
"Duplicates"
}
)
@Transactional
@
GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
JgInstallationNoticeDto
updateInstallationNotice
(
String
submitType
,
JgInstallationNoticeDto
noticeDto
,
String
op
)
{
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
...
...
@@ -517,8 +518,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgInstallationNotice
>
saveNotice
(
String
submitType
,
JSONObject
jgInstallationNoticeDtoMap
,
ReginParams
reginParams
)
{
try
{
JgInstallationNoticeDto
model
=
JSON
.
parseObject
(
jgInstallationNoticeDtoMap
.
get
(
TABLE_PAGE_ID
).
toString
(),
JgInstallationNoticeDto
.
class
);
...
...
@@ -839,6 +840,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
cancel
(
JgInstallationNoticeDto
noticeDto
)
{
String
instanceId
=
noticeDto
.
getInstanceId
();
String
nextTaskId
=
noticeDto
.
getNextTaskId
();
...
...
@@ -894,8 +896,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
"installNotice"
).
delDataForCheckEquipRepeatUsed
(
Collections
.
singletonList
(
jgRelationEquip
.
getEquId
()),
jgInstallationNotice
.
getInstallUnitCreditCode
());
}
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgInstallationNoticeDto
dto
,
String
op
)
{
String
xid
=
GlobalTransactionContext
.
getCurrentOrCreate
().
getXid
();
log
.
info
(
xid
);
RootContext
.
bind
(
xid
);
String
instanceId
=
dto
.
getInstanceId
();
String
nextTaskId
=
dto
.
getNextTaskId
();
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgMaintenanceContractServiceImpl.java
View file @
bc6bb636
...
...
@@ -32,6 +32,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
...
...
@@ -174,6 +175,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
,
Boolean
update
,
String
nextTaskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -242,7 +244,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
/**
* 批量删除
*/
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteForBatch
(
Long
[]
ids
)
{
List
<
Long
>
list
=
Arrays
.
asList
(
ids
);
list
.
forEach
(
x
->
{
...
...
@@ -296,6 +299,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
* 维保合同撤回
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
revocation
(
String
instanceId
,
String
_nextTaskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -354,6 +358,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
* 新增维保合同
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgMaintenanceContract
>
saveOrSubmit
(
String
submit
,
Map
<
String
,
Object
>
map
,
ReginParams
reginParams
)
{
JgMaintenanceContractDto
contractDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgMaintenanceContractDto
.
class
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
...
...
@@ -543,7 +548,8 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
});
}
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateExecuteIds
(
String
instanceId
,
Long
sequenceNbr
,
String
operate
,
ProcessTaskDTO
processTaskDTO
)
{
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
bc6bb636
...
...
@@ -53,6 +53,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.IOUtils
;
...
...
@@ -369,6 +370,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @return list
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
Map
<
String
,
Object
>>
save
(
JSONObject
map
)
{
Map
<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
functionMap
=
MapBuilder
.<
String
,
Function
<
JSONObject
,
List
<
Map
<
String
,
Object
>>>>
create
()
.
put
(
"unit"
,
this
::
handleUnitUseRegistration
).
build
();
...
...
@@ -1111,6 +1113,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
,
String
carNumber
,
String
manageType
,
String
nextTaskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -1186,6 +1189,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
withdraw
(
String
instanceId
,
String
nextTaskId
,
String
manageType
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -1854,6 +1858,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @return JgUseRegistration
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgUseRegistration
cancelApplication
(
Long
sequenceNbr
,
String
cancelReason
)
{
// 1.更新为已作废
JgUseRegistration
jgUseRegistration
=
this
.
getById
(
sequenceNbr
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgVehicleInformationServiceImpl.java
View file @
bc6bb636
...
...
@@ -48,12 +48,12 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -64,13 +64,11 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XIAN_YANG
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XI_XIAN
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
...
...
@@ -126,19 +124,16 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
private
JgUseRegistrationServiceImpl
jgUseRegistrationService
;
@Autowired
private
IdxBizJgInspectionDetectionInfoServiceImpl
idxBizJgInspectionDetectionInfoService
;
@Autowired
private
ESEquipmentCategory
esEquipmentCategory
;
private
Map
<
String
,
Object
>
fillingMediumMap
;
private
static
final
String
[]
DEFAULT_KEYS
=
{
"useRegistrationCode"
,
"useUnitName"
,
"fullAddress"
,
"equList"
,
"equipDefine"
,
"equipCode"
,
"equipCategory"
,
"useInnerCode"
,
"factoryNum"
,
"giveOutYear"
,
"giveOutMonth"
,
"giveOutDay"
};
/**
* 新增(提交)车用气瓶
*
...
...
@@ -146,6 +141,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
* @return list
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgVehicleInformation
>
save
(
String
submit
,
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JgVehicleInformationDto
vehicleInfoDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgVehicleInformationDto
.
class
);
...
...
@@ -359,6 +355,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
* @param _nextTaskId nextTaskId
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
cancel
(
String
instanceId
,
String
_nextTaskId
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -549,6 +546,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
* @param nextTaskId nextTaskId
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
flowExecute
(
Long
sequenceNbr
,
String
instanceId
,
String
operate
,
String
comment
,
String
nextTaskId
,
String
equDefineCode
)
{
String
lockKey
=
CommonServiceImpl
.
buildJgExecuteLockKey
(
instanceId
);
RLock
lock
=
redissonClient
.
getLock
(
lockKey
);
...
...
@@ -739,7 +737,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
commonService
.
updateTaskModel
(
params
);
}
commonService
.
saveExecuteFlowData2Redis
(
jgVehicleInformation
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgVehicleInformation
));
this
.
getBaseMapper
().
updateById
(
jgVehicleInformation
);
}
private
void
updateEsData
(
JSONObject
dataMap
,
JgVehicleInformation
jgVehicleInformation
,
IdxBizJgOtherInfo
otherInfo
)
{
...
...
@@ -1087,6 +1084,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgVehicleInformation
cancelApplication
(
Long
sequenceNbr
,
String
cancelReason
)
{
// 1.更新为已作废
JgVehicleInformation
vehicleInformation
=
this
.
getById
(
sequenceNbr
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/application-dev.properties
View file @
bc6bb636
#DB properties:
spring.datasource.url
=
jdbc:
vastbase
://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.url
=
jdbc:
postgresql
://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username
=
admin
spring.datasource.password
=
Yeejoin@2023
eureka.client.service-url.defaultZone
=
http://172.16.10.243:10001/eureka/
...
...
@@ -86,4 +86,8 @@ tzs.domain=http://sxtzsb.sxsei.com
outSystem.user.password
=
a1234560
amos.system.user.app-key
=
AMOS_STUDIO
amos.system.user.product
=
STUDIO_APP_WEB
\ No newline at end of file
amos.system.user.product
=
STUDIO_APP_WEB
#Seata Config
seata.tx-service-group
=
tzs-seata
seata.service.grouplist.tzs-seata
=
172.16.10.243:8091
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/application.properties
View file @
bc6bb636
...
...
@@ -29,7 +29,7 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path
=
/actuator/info
eureka.instance.metadata-map.management.api-docs
=
http://localhost:${server.port}${server.servlet.context-path}/doc.html
#DB properties:
spring.datasource.driver-class-name
=
cn.com.vastbase
.Driver
spring.datasource.driver-class-name
=
org.postgresql
.Driver
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle
=
10
spring.datasource.hikari.maximum-pool-size
=
25
...
...
@@ -39,6 +39,7 @@ spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime
=
120000
spring.datasource.hikari.connection-timeout
=
30000
spring.datasource.hikari.connection-test-query
=
SELECT 1
spring.datasource.schema
=
amos_tzs_biz
spring.main.allow-bean-definition-overriding
=
true
iot.fegin.name
=
AMOS-API-IOT
...
...
@@ -162,4 +163,6 @@ tzs.WxApp.secret=ac4f4a9d3c97676badb70c19a2f37b16
tzs.WxApp.grant-type
=
authorization_code
amos.wechat.robot.user
=
we_robot
amos.wechat.robot.password
=
a1234567
\ No newline at end of file
amos.wechat.robot.password
=
a1234567
feign.okhttp.enabled
=
true
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/file.conf
0 → 100644
View file @
bc6bb636
transport
{
# tcp udt unix-domain-socket
type
=
"TCP"
#NIO NATIVE
server
=
"NIO"
#enable heartbeat
heartbeat
=
true
# the client batch send request enable
enableClientBatchSendRequest
=
true
#thread factory for netty
threadFactory
{
bossThreadPrefix
=
"NettyBoss"
workerThreadPrefix
=
"NettyServerNIOWorker"
serverExecutorThread
-
prefix
=
"NettyServerBizHandler"
shareBossWorker
=
false
clientSelectorThreadPrefix
=
"NettyClientSelector"
clientSelectorThreadSize
=
1
clientWorkerThreadPrefix
=
"NettyClientWorkerThread"
# netty boss thread size,will not be used for UDT
bossThreadSize
=
1
#auto default pin or 8
workerThreadSize
=
"8"
}
shutdown
{
# when destroy server, wait seconds
wait
=
3
}
serialization
=
"seata"
compressor
=
"none"
}
service
{
#transaction service group mapping
vgroupMapping
.
tzs
-
seata
=
"tzs-seata"
#only support when registry.type=file, please don't set multiple addresses
default
.
grouplist
=
"172.16.10.243:8091"
#degrade, current not support
enableDegrade
=
false
#disable seata
disableGlobalTransaction
=
false
}
client
{
rm
{
asyncCommitBufferLimit
=
10000
lock
{
retryInterval
=
10
retryTimes
=
30
retryPolicyBranchRollbackOnConflict
=
true
}
reportRetryCount
=
5
tableMetaCheckEnable
=
false
reportSuccessEnable
=
false
}
tm
{
commitRetryCount
=
5
rollbackRetryCount
=
5
}
undo
{
dataValidation
=
true
logSerialization
=
"protostuff"
logTable
=
"undo_log"
}
log
{
exceptionRate
=
100
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/registry.conf
0 → 100644
View file @
bc6bb636
registry
{
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
type
=
"eureka"
nacos
{
serverAddr
=
"localhost"
namespace
=
""
cluster
=
"default"
}
eureka
{
serviceUrl
=
"http://172.16.10.243:10001/eureka"
application
=
"default"
weight
=
"1"
}
redis
{
serverAddr
=
"localhost:6379"
db
=
"0"
password
=
""
cluster
=
"default"
timeout
=
"0"
}
zk
{
cluster
=
"default"
serverAddr
=
"127.0.0.1:2181"
session
.
timeout
=
6000
connect
.
timeout
=
2000
username
=
""
password
=
""
}
consul
{
cluster
=
"default"
serverAddr
=
"127.0.0.1:8500"
}
etcd3
{
cluster
=
"default"
serverAddr
=
"http://localhost:2379"
}
sofa
{
serverAddr
=
"127.0.0.1:9603"
application
=
"default"
region
=
"DEFAULT_ZONE"
datacenter
=
"DefaultDataCenter"
cluster
=
"default"
group
=
"SEATA_GROUP"
addressWaitTime
=
"3000"
}
file
{
name
=
"file.conf"
}
}
config
{
# file、nacos 、apollo、zk、consul、etcd3、springCloudConfig
type
=
"file"
nacos
{
serverAddr
=
"localhost"
namespace
=
""
group
=
"SEATA_GROUP"
}
consul
{
serverAddr
=
"127.0.0.1:8500"
}
apollo
{
app
.
id
=
"seata-server"
apollo
.
meta
=
"http://192.168.1.204:8801"
namespace
=
"application"
}
zk
{
serverAddr
=
"127.0.0.1:2181"
session
.
timeout
=
6000
connect
.
timeout
=
2000
username
=
""
password
=
""
}
etcd3
{
serverAddr
=
"http://localhost:2379"
}
file
{
name
=
"file.conf"
}
}
pom.xml
View file @
bc6bb636
...
...
@@ -68,11 +68,6 @@
</exclusions>
</dependency>
<dependency>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<version>
2.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-compress
</artifactId>
<version>
1.18
</version>
...
...
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