Compare commits

...

12 Commits

Author SHA1 Message Date
wangliwen d1b6ae5e14 ... 2022-06-20 16:45:20 +08:00
dinggang db03b24e76 新增西海岸和包头配置文件 2022-06-20 16:24:14 +08:00
wangliwen 9598af3564 模板的暂时调整 2022-06-20 16:03:23 +08:00
wangliwen 45c5bf7489 调整一下sql 2022-06-20 14:35:41 +08:00
liyongbo2 47e19db5de Merge remote-tracking branch 'origin/master' 2022-06-20 14:30:12 +08:00
liyongbo2 413f62c395 版本重复,修改名称 2022-06-20 14:28:10 +08:00
wangliwen 0aac656f83 Merge remote-tracking branch 'origin/master' 2022-06-20 14:27:25 +08:00
wangliwen b165e91663 系统操作日志使用异步插入,解决平台所有日志阻塞问题!! 屮 2022-06-20 14:25:07 +08:00
liyongbo2 e6b17da32a 修改工作动态备用字段1注释,改为摘要 2022-06-20 11:44:02 +08:00
wangliwen e1edb302f5 能力资源导入模板的添加 2022-06-20 10:47:59 +08:00
wangliwen 0063546e5e ResourceEntity 增加infoList json字段 2022-06-20 10:23:37 +08:00
wangliwen 5b66808e7c 替换使用 CopyOnWriteArrayList 2022-06-20 09:18:52 +08:00
16 changed files with 366 additions and 233 deletions

View File

@ -0,0 +1 @@
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';

View File

@ -0,0 +1,2 @@
ALTER TABLE `share_platform`.`tb_work_dynamics`
MODIFY COLUMN `note1` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '摘要';

View File

@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
@ -55,7 +56,7 @@ public class CensusControllerV2 {
@GetMapping(value = "/whole_amount")
@ApiOperation("平台概览")
public Result<List<Map<String, Object>>> wholeAmount() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> userAmount = CompletableFuture.supplyAsync(() -> { // 获取平台用户总数
return sysUserService.countAllUser();
@ -102,7 +103,7 @@ public class CensusControllerV2 {
@ApiOperation("应用资源数量统计")
@LogOperation("应用资源数量统计")
public Result<List<Map<String, Object>>> applicationNum() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> allApplicationAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总应用数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='应用资源';", Long.class);
@ -156,7 +157,7 @@ public class CensusControllerV2 {
}
private List<Map<String, Object>> resourceRank(Integer type) {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
List<Map<String, Object>> result;
List<Map<String, Object>> district = jdbcTemplate.queryForList("SELECT * FROM sys_dept WHERE type = " + type);
List<Map<String, Long>> listMap =
district.stream().map(index -> {
@ -203,7 +204,7 @@ public class CensusControllerV2 {
@ApiOperation("组件服务简况")
@LogOperation("组件服务简况")
public Result<List<Map<String, Object>>> assemblerInfo() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> allAssemblyAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总组件服务数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='组件服务' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {
@ -263,7 +264,7 @@ public class CensusControllerV2 {
@ApiOperation("知识库简况")
@LogOperation("知识库简况")
public Result<List<Map<String, Object>>> knowledgeInfo() {
List<Map<String, Object>> result = Collections.synchronizedList(new ArrayList<>());
List<Map<String, Object>> result = new CopyOnWriteArrayList<>();
CompletableFuture<Void> allKnowledgeAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总知识库数目
return jdbcTemplate.queryForObject("SELECT COUNT(id) FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {

View File

@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
/**
* 操作日志
@ -42,7 +43,7 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class);
}
private QueryWrapper<SysLogOperationEntity> getWrapper(Map<String, Object> params){
private QueryWrapper<SysLogOperationEntity> getWrapper(Map<String, Object> params) {
String status = (String) params.get("status");
QueryWrapper<SysLogOperationEntity> wrapper = new QueryWrapper<>();
@ -54,7 +55,9 @@ public class SysLogOperationServiceImpl extends BaseServiceImpl<SysLogOperationD
@Override
@Transactional(rollbackFor = Exception.class)
public void save(SysLogOperationEntity entity) {
CompletableFuture.runAsync(() -> {
insert(entity);
});
}
}

View File

@ -210,7 +210,7 @@ public class ResourceController {
@ApiOperation("导入")
@LogOperation("导入")
@ApiImplicitParams({
@ApiImplicitParam(name = "source", value = "请求来源", paramType = "string", dataType = "string")
@ApiImplicitParam(name = "file", value = "数据文件文件", paramType = "file", dataType = "file")
})
public Result importResource(@RequestParam("file") MultipartFile uploadFile, HttpServletRequest request) {
List<Map<String, Object>> dept =

View File

@ -1,11 +1,15 @@
package io.renren.modules.resource.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.renren.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 资源表
@ -130,4 +134,7 @@ public class ResourceEntity extends BaseEntity {
* 提起下架人员
*/
private String undercarriageUserName;
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
private List<AttrEntity> infoList;
}

View File

@ -36,7 +36,7 @@ public class WorkDynamicsDTO implements Serializable {
private Long updater;
@ApiModelProperty(value = "修改时间")
private Date updateDate;
@ApiModelProperty(value = "备用字段1")
@ApiModelProperty(value = "摘要")
private String note1;
@ApiModelProperty(value = "备用字段2")
private String note2;

View File

@ -59,7 +59,7 @@ public class WorkDynamicsEntity {
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate;
/**
* 备用字段1
* 摘要
*/
private String note1;
/**

View File

@ -36,7 +36,7 @@ public class WorkDynamicsExcel {
private Long updater;
@ExcelProperty(value = "修改时间", index = 8)
private Date updateDate;
@ExcelProperty(value = "备用字段1", index = 9)
@ExcelProperty(value = "摘要", index = 9)
private String note1;
@ExcelProperty(value = "备用字段2", index = 10)
private String note2;

View File

@ -0,0 +1,55 @@
server:
port: 8888
spring:
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.10.30.10:3306/nlpt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
username: nlpt
password: Nlpt@2022
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 10
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#Oracle需要打开注释
validation-query: SELECT 1
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
#上传的静态资源配置
resource:
root_url: 10.10.30.9
pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path}
path: /data1/services/nengli/files/
devModelFilePath: /data1/services/nengli/files/devModelFile
# 大数据部门相关配置
big_date:
name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人
hisense:
gateway:
url: http://devtest-security-app.hismarttv.com:8080
#调用青岛应急局-查询青岛地区天气信息接口
qdyjj:
ipAndPort: 15.2.21.238:9015

View File

@ -0,0 +1,55 @@
server:
port: 8888
spring:
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://10.10.30.10:3306/nlpt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
username: nlpt
password: Nlpt@2022
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 10
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#Oracle需要打开注释
validation-query: SELECT 1
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
#上传的静态资源配置
resource:
root_url: 10.10.30.9
pic-host: http://${resource.root_url}:${server.port}${server.servlet.context-path}
path: /data1/services/nengli/files/
devModelFilePath: /data1/services/nengli/files/devModelFile
# 大数据部门相关配置
big_date:
name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人
hisense:
gateway:
url: http://devtest-security-app.hismarttv.com:8080
#调用青岛应急局-查询青岛地区天气信息接口
qdyjj:
ipAndPort: 15.2.21.238:9015

View File

@ -93,7 +93,7 @@ system:
yawei:
enable: true
#知识库
#对接知识库相关配置
zsk:
url:
sign: https://cms.qingdao.gov.cn:9020/api-gateway/jpaas-jags-server/interface/createsign.do

View File

@ -0,0 +1 @@
ALTER TABLE `share_platform`.`tb_data_resource` ADD COLUMN `info_list` json NULL COMMENT '属性信息';

View File

@ -0,0 +1,2 @@
ALTER TABLE `share_platform`.`tb_work_dynamics`
MODIFY COLUMN `note1` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '摘要';

View File

@ -33,6 +33,8 @@
<result property="enclosure" column="enclosure"/>
<result property="undercarriageReason" column="undercarriage_reason"/>
<result property="undercarriageUserName" column="undercarriage_user_name"/>
<result property="infoList" column="info_list"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap>
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
@ -103,7 +105,7 @@
<select id="selectWithAttrs" resultMap="resourceDTO">
SELECT
tdr.*,
DISTINCT tdr.*,
IFNULL(taa2.approve_status, '未申请') AS "applyState",
IFNULL(trs.score, 0 ) AS "score",
IFNULL(taa.applyCount, 0 ) AS "applyCount",
@ -215,34 +217,34 @@
</select>
<select id="selectDTOById" resultMap="resourceDTO">
<!-- SELECT-->
<!-- tdr.*,-->
<!--&lt;!&ndash; tda.*,&ndash;&gt;-->
<!-- IFNULL(trs.score, 0 ) AS "score",-->
<!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",-->
<!-- IFNULL(trc.collectCount, 0) AS "collectCount",-->
<!-- sd.name as "deptName",-->
<!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",-->
<!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"-->
<!-- FROM-->
<!-- tb_data_resource tdr-->
<!--&lt;!&ndash; LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id&ndash;&gt;-->
<!-- LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP-->
<!-- BY resource_id ) trs ON tdr.id = trs.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag =-->
<!-- 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag-->
<!-- = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"-->
<!-- FROM tb_resource_collection WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id-->
<!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id-->
<!-- WHERE 1 = 1-->
<!-- AND tdr.id = #{id}-->
<!-- SELECT-->
<!-- tdr.*,-->
<!--&lt;!&ndash; tda.*,&ndash;&gt;-->
<!-- IFNULL(trs.score, 0 ) AS "score",-->
<!-- IFNULL(taa.applyCount, 0 ) AS "applyCount",-->
<!-- IFNULL(trc.collectCount, 0) AS "collectCount",-->
<!-- sd.name as "deptName",-->
<!-- IFNULL(trc2.isCollect, 'false') AS "isCollect",-->
<!-- IFNULL(taa2.approve_status, '未申请') AS "applyState"-->
<!-- FROM-->
<!-- tb_data_resource tdr-->
<!--&lt;!&ndash; LEFT JOIN tb_data_attr tda ON tdr.id = tda.data_resource_id&ndash;&gt;-->
<!-- LEFT JOIN ( SELECT resource_id, AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 AND del_flag = 0 GROUP-->
<!-- BY resource_id ) trs ON tdr.id = trs.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, COUNT(id) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag =-->
<!-- 0 GROUP BY resource_id ) taa ON tdr.id = taa.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, COUNT(id) AS "collectCount" FROM tb_resource_collection WHERE 1 = 1 AND del_flag-->
<!-- = 0 GROUP BY resource_id ) trc ON tdr.id = trc.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, user_id, ( CASE COUNT( id ) WHEN 1 THEN 'true' ELSE 'false' END ) AS "isCollect"-->
<!-- FROM tb_resource_collection WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY resource_id) trc2 ON tdr.id = trc2.resource_id-->
<!-- LEFT JOIN ( SELECT resource_id, approve_status FROM t_ability_application WHERE-->
<!-- 1 = 1 AND del_flag = 0 AND user_id = #{userId}-->
<!-- GROUP BY id LIMIT 1) taa2 ON tdr.id = taa2.resource_id-->
<!-- LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id-->
<!-- WHERE 1 = 1-->
<!-- AND tdr.id = #{id}-->
SELECT
tdr.*,
@ -567,7 +569,8 @@
tdav.data_resource_id AS resourceId
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
@ -830,7 +833,8 @@
COUNT( tdav.data_resource_id ) AS "count"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
@ -850,7 +854,8 @@
COUNT( tdav.data_resource_id ) AS "count"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
@ -883,7 +888,8 @@
COUNT( tdav.data_resource_id ) AS "total"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'