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
cb46d886
Commit
cb46d886
authored
Mar 06, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
68fc642e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
12 deletions
+108
-12
ProcessTypeEnum.java
...eejoin/amos/boot/module/ugp/api/Enum/ProcessTypeEnum.java
+5
-4
PipeMapper.java
...m/yeejoin/amos/boot/module/ugp/api/mapper/PipeMapper.java
+6
-0
IPipeService.java
...eejoin/amos/boot/module/ugp/api/service/IPipeService.java
+6
-0
PipeMapper.xml
...t-module-ugp-api/src/main/resources/mapper/PipeMapper.xml
+16
-0
PipeController.java
...n/amos/boot/module/ugp/biz/controller/PipeController.java
+54
-5
IPipeServiceImpl.java
...os/boot/module/ugp/biz/service/impl/IPipeServiceImpl.java
+21
-3
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProcessTypeEnum.java
View file @
cb46d886
...
...
@@ -6,10 +6,11 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public
enum
ProcessTypeEnum
{
项目立项
(
"project
approval
"
),
项目结项
(
"project
closing
"
),
问题处理
(
"problem
handling
"
),
人工处理
(
"manual
handling
"
);
项目立项
(
"project
Approval"
,
"tz_ugp_project
"
),
项目结项
(
"project
Closing"
,
"
"
),
问题处理
(
"problem
Handling"
,
"tz_ugp_quality_problem
"
),
人工处理
(
"manual
Handling"
,
"
"
);
String
type
;
String
tableName
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/PipeMapper.java
View file @
cb46d886
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Pipe
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Map
;
@Repository
public
interface
PipeMapper
extends
BaseMapper
<
Pipe
>
{
Page
<
Map
<
String
,
Object
>>
getOperationalLogs
(
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"sequenceNbr"
)
Long
sequenceNbr
,
@Param
(
"type"
)
String
type
,
@Param
(
"tableName"
)
String
tableName
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IPipeService.java
View file @
cb46d886
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Map
;
public
interface
IPipeService
{
void
addPipeMessage
(
String
jsonMessage
,
Long
projectId
);
Page
<
Map
<
String
,
Object
>>
getOperationalLogs
(
Page
<
Map
<
String
,
Object
>>
mapPage
,
Long
sequenceNbr
,
String
type
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/PipeMapper.xml
View file @
cb46d886
...
...
@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ugp.api.mapper.PipeMapper"
>
<select
id=
"getOperationalLogs"
resultType=
"java.util.Map"
>
SELECT
il.task_name AS taskName,
il.rec_user_name userName,
il.rec_date as date
FROM
${tableName} AS temp
LEFT JOIN tz_ugp_initiation_log AS il ON temp.instance_id = il.instance_id
WHERE
temp.sequence_nbr = #{sequenceNbr}
and il.type = #{type}
ORDER BY
il.rec_date
</select>
</mapper>
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/PipeController.java
View file @
cb46d886
...
...
@@ -3,11 +3,14 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.RoleBo
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Pipe
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IPipeService
;
...
...
@@ -17,6 +20,8 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -39,10 +44,10 @@ import java.util.Map;
public
class
PipeController
extends
BaseController
{
@Autowired
IPipeServiceImpl
pipeService
;
IPipeServiceImpl
pipeService
Impl
;
@Autowired
IPipeService
pipeService
1
;
IPipeService
pipeService
;
@Autowired
private
RedisUtils
redisUtils
;
...
...
@@ -54,7 +59,7 @@ public class PipeController extends BaseController {
List
<
PipeDto
>
result
=
new
ArrayList
<>();
list
.
forEach
(
item
->
{
item
.
setProjectId
(
projectId
);
PipeDto
withModel
=
pipeService
.
createWithModel
(
item
);
PipeDto
withModel
=
pipeService
Impl
.
createWithModel
(
item
);
result
.
add
(
withModel
);
});
...
...
@@ -67,7 +72,7 @@ public class PipeController extends BaseController {
public
ResponseModel
<
String
>
getMessage
(
@PathVariable
Long
sequenceNbr
)
{
LambdaQueryWrapper
<
Pipe
>
lambda
=
new
QueryWrapper
<
Pipe
>().
lambda
();
lambda
.
eq
(
Pipe:
:
getProjectId
,
sequenceNbr
);
List
<
Pipe
>
pipes
=
pipeService
.
lambdaQuery
().
getBaseMapper
().
selectList
(
lambda
);
List
<
Pipe
>
pipes
=
pipeService
Impl
.
lambdaQuery
().
getBaseMapper
().
selectList
(
lambda
);
String
jArr
=
JSON
.
toJSONString
(
pipes
);
return
ResponseHelper
.
buildResponse
(
jArr
);
}
...
...
@@ -77,7 +82,7 @@ public class PipeController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增管段信息-json"
,
notes
=
"新增管段信息-json"
)
public
ResponseModel
<
Object
>
save
(
@RequestParam
(
value
=
"json"
)
String
json
,
@RequestParam
(
value
=
"projectId"
)
Long
projectId
)
{
pipeService
1
.
addPipeMessage
(
json
,
projectId
);
pipeService
.
addPipeMessage
(
json
,
projectId
);
return
ResponseHelper
.
buildResponse
(
json
);
}
...
...
@@ -128,9 +133,17 @@ public class PipeController extends BaseController {
@RequestParam
(
value
=
"roleId"
)
String
roleId
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
reginParams
)
&&
!
ObjectUtils
.
isEmpty
(
reginParams
.
getCompany
()))
{
// 所选公司覆盖
CompanyBo
company
=
reginParams
.
getCompany
();
company
.
setSequenceNbr
(
Long
.
valueOf
(
companyId
));
reginParams
.
setCompany
(
company
);
// 所选角色覆盖
RoleBo
role
=
reginParams
.
getRole
();
FeignClientResult
<
RoleModel
>
roleModelFeignClientResult
=
Privilege
.
roleClient
.
seleteOne
(
Long
.
valueOf
(
roleId
));
role
.
setRoleName
(
roleModelFeignClientResult
.
getResult
().
getRoleName
());
role
.
setRoleType
(
roleModelFeignClientResult
.
getResult
().
getRoleType
());
role
.
setSequenceNbr
(
Long
.
valueOf
(
roleId
));
reginParams
.
setRole
(
role
);
String
result
=
JSON
.
toJSONString
(
reginParams
);
redisUtils
.
set
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()),
result
);
return
ResponseHelper
.
buildResponse
(
company
);
...
...
@@ -138,5 +151,41 @@ public class PipeController extends BaseController {
return
ResponseHelper
.
buildResponse
(
null
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getUsed"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"常用功能"
,
notes
=
"常用功能"
)
public
ResponseModel
<
Object
>
getUsed
()
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
roleName
=
reginParams
.
getRole
().
getRoleName
();
String
key
=
"_commonly_used"
;
HashMap
<
String
,
Object
>
resultData
=
new
HashMap
<>();
ArrayList
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
FeignClientResult
<
List
<
DictionarieValueModel
>>
commonlyUsed
=
Systemctl
.
dictionarieClient
.
dictValues
(
roleName
+
key
);
List
<
DictionarieValueModel
>
result
=
commonlyUsed
.
getResult
();
result
.
forEach
(
item
->
{
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
item
.
getDictDataKey
());
map
.
put
(
"url"
,
item
.
getDictDataValue
());
map
.
put
(
"img"
,
item
.
getDictDataDesc
());
maps
.
add
(
map
);
});
resultData
.
put
(
"current"
,
1
);
resultData
.
put
(
"total"
,
maps
.
size
());
resultData
.
put
(
"records"
,
maps
);
return
ResponseHelper
.
buildResponse
(
resultData
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getOperationalLogs"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通用流程操作日志查询"
,
notes
=
"通用流程操作日志查询"
)
public
ResponseModel
<
Object
>
getOperationalLogs
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"current"
)
int
current
,
@RequestParam
(
"size"
)
int
size
)
{
Page
<
Map
<
String
,
Object
>>
mapPage
=
new
Page
(
current
,
size
);
Page
<
Map
<
String
,
Object
>>
operationalLogs
=
pipeService
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
);
return
ResponseHelper
.
buildResponse
(
operationalLogs
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/IPipeServiceImpl.java
View file @
cb46d886
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Pipe
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.PipeMapper
;
...
...
@@ -14,6 +16,7 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.List
;
import
java.util.Map
;
@Service
...
...
@@ -25,16 +28,31 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp
@Override
@Transactional
public
void
addPipeMessage
(
String
jsonMessage
,
Long
projectId
)
{
List
<
PipeDto
>
userList
2
=
JSON
.
parseArray
(
jsonMessage
,
PipeDto
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
userList
2
))
{
List
<
PipeDto
>
userList
=
JSON
.
parseArray
(
jsonMessage
,
PipeDto
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
userList
))
{
LambdaQueryWrapper
<
Pipe
>
lambda
=
new
QueryWrapper
<
Pipe
>().
lambda
();
lambda
.
eq
(
Pipe:
:
getProjectId
,
projectId
);
pipeMapper
.
delete
(
lambda
);
userList
2
.
forEach
(
item
->
{
userList
.
forEach
(
item
->
{
item
.
setProjectId
(
projectId
);
this
.
createWithModel
(
item
);
});
}
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getOperationalLogs
(
Page
<
Map
<
String
,
Object
>>
mapPage
,
Long
sequenceNbr
,
String
type
)
{
if
(
type
.
equals
(
ProcessTypeEnum
.
问题处理
.
getType
()))
{
return
pipeMapper
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
,
ProcessTypeEnum
.
问题处理
.
getTableName
());
}
else
if
(
type
.
equals
(
ProcessTypeEnum
.
项目立项
.
getType
()))
{
return
pipeMapper
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
,
ProcessTypeEnum
.
项目立项
.
getTableName
());
}
else
if
(
type
.
equals
(
ProcessTypeEnum
.
项目结项
.
getType
()))
{
return
pipeMapper
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
,
ProcessTypeEnum
.
项目结项
.
getTableName
());
}
else
if
(
type
.
equals
(
ProcessTypeEnum
.
人工处理
.
getType
()))
{
return
pipeMapper
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
,
ProcessTypeEnum
.
人工处理
.
getTableName
());
}
else
{
return
null
;
}
}
}
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