Merge branch 'master' into docker_package
This commit is contained in:
commit
f823e24e6c
|
@ -0,0 +1,7 @@
|
||||||
|
ALTER TABLE `tb_data_resource`
|
||||||
|
ADD COLUMN `pin_top` int NULL COMMENT '是否置顶' ,
|
||||||
|
ADD COLUMN `pin_top_time` datetime NULL COMMENT '置顶操作时间';
|
||||||
|
|
||||||
|
UPDATE tb_data_resource
|
||||||
|
SET pin_top = 0,
|
||||||
|
pin_top_time = NOW();
|
|
@ -153,6 +153,16 @@ public class ResourceController {
|
||||||
return new Result<>().ok(resourceService.pageWithAttrs(jsonObject, resourceService.selectDTOPageSpecilTotal(resourceDTO)));
|
return new Result<>().ok(resourceService.pageWithAttrs(jsonObject, resourceService.selectDTOPageSpecilTotal(resourceDTO)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/pin_top/{id}")
|
||||||
|
@LogOperation(value = "置顶该能力资源")
|
||||||
|
public Result pinTop(@PathVariable("id") Long id) {
|
||||||
|
ResourceDTO data = resourceService.get(id);
|
||||||
|
data.setPinTop(1);
|
||||||
|
data.setPinTopTime(new Date());
|
||||||
|
resourceService.update(data);
|
||||||
|
return new Result<>().ok(id);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
@ApiOperation("查询能力资源详细信息")
|
@ApiOperation("查询能力资源详细信息")
|
||||||
@LogOperation("查询能力资源详细信息")
|
@LogOperation("查询能力资源详细信息")
|
||||||
|
@ -253,7 +263,7 @@ public class ResourceController {
|
||||||
if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架
|
if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架
|
||||||
try {
|
try {
|
||||||
apiGatewayService.registerApi2Gateway(dto.getId().toString());
|
apiGatewayService.registerApi2Gateway(dto.getId().toString());
|
||||||
}catch (Exception exception){
|
} catch (Exception exception) {
|
||||||
//注册失败忽略,简单记录一下
|
//注册失败忽略,简单记录一下
|
||||||
logger.error("挂接网关注册失败", exception);
|
logger.error("挂接网关注册失败", exception);
|
||||||
}
|
}
|
||||||
|
@ -268,7 +278,7 @@ public class ResourceController {
|
||||||
try {
|
try {
|
||||||
apiGatewayService.resetApiGroup(source);
|
apiGatewayService.resetApiGroup(source);
|
||||||
apiGatewayService.registerApi2Gateway(source);
|
apiGatewayService.registerApi2Gateway(source);
|
||||||
}catch (Exception exception){
|
} catch (Exception exception) {
|
||||||
//注册失败忽略,简单记录一下
|
//注册失败忽略,简单记录一下
|
||||||
logger.error("挂接网关注册失败", exception);
|
logger.error("挂接网关注册失败", exception);
|
||||||
return new Result().error(exception.getMessage());
|
return new Result().error(exception.getMessage());
|
||||||
|
|
|
@ -116,6 +116,12 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable {
|
||||||
@ApiModelProperty(value = "申请单号")
|
@ApiModelProperty(value = "申请单号")
|
||||||
private String applyNumber;
|
private String applyNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "置顶标识")
|
||||||
|
private Integer pinTop;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "置顶时间")
|
||||||
|
private Date pinTopTime;
|
||||||
|
|
||||||
public String getDelFlagTip() {
|
public String getDelFlagTip() {
|
||||||
if (this.delFlag != null) {
|
if (this.delFlag != null) {
|
||||||
Optional<ResourceEntityDelFlag> resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag));
|
Optional<ResourceEntityDelFlag> resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag));
|
||||||
|
|
|
@ -140,6 +140,17 @@ public class ResourceEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String undercarriageEnclosure;
|
private String undercarriageEnclosure;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置顶标识
|
||||||
|
*/
|
||||||
|
private Integer pinTop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 置顶时间
|
||||||
|
*/
|
||||||
|
private Date pinTopTime;
|
||||||
|
|
||||||
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
|
@TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class)
|
||||||
private List<AttrEntity> infoList;
|
private List<AttrEntity> infoList;
|
||||||
|
|
||||||
|
|
|
@ -389,7 +389,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
Integer pageNum = jsonObject.getInteger("pageNum");
|
Integer pageNum = jsonObject.getInteger("pageNum");
|
||||||
Integer pageSize = jsonObject.getInteger("pageSize");
|
Integer pageSize = jsonObject.getInteger("pageSize");
|
||||||
//默认按上架时间降序排列
|
//默认按上架时间降序排列
|
||||||
String orderField = StringUtils.isBlank(jsonObject.getString("orderField")) ? "total" : jsonObject.getString("orderField");
|
String orderField;
|
||||||
|
if (StringUtils.isBlank(jsonObject.getString("orderField"))) {
|
||||||
|
if ("应用资源".equals(jsonObject.getString("type"))) {
|
||||||
|
orderField = "deptSort";
|
||||||
|
} else if ("组件服务".equals(jsonObject.getString("type"))) {
|
||||||
|
orderField = "pin_top";
|
||||||
|
} else {
|
||||||
|
orderField = "total";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
orderField = jsonObject.getString("orderField");
|
||||||
|
}
|
||||||
String orderType = StringUtils.isBlank(jsonObject.getString("orderType")) ? "DESC" : jsonObject.getString("orderType");
|
String orderType = StringUtils.isBlank(jsonObject.getString("orderType")) ? "DESC" : jsonObject.getString("orderType");
|
||||||
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
Page<ResourceDTO> resultPage = new Page<>(pageNum, pageSize);
|
||||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||||
|
|
|
@ -6,9 +6,9 @@ spring:
|
||||||
#MySQL
|
#MySQL
|
||||||
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.124.236:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
url: jdbc:mysql://192.168.124.243:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false
|
||||||
username: root
|
username: root
|
||||||
password: Hisense2019
|
password: Liwen073898!
|
||||||
#Hisense2019
|
#Hisense2019
|
||||||
# #Oracle
|
# #Oracle
|
||||||
# driver-class-name: oracle.jdbc.OracleDriver
|
# driver-class-name: oracle.jdbc.OracleDriver
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
<result property="infoList" column="info_list"
|
<result property="infoList" column="info_list"
|
||||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||||
<result property="applyNumber" column="apply_number"/>
|
<result property="applyNumber" column="apply_number"/>
|
||||||
|
<result property="pinTop" column="pin_top"/>
|
||||||
|
<result property="pinTopTime" column="pin_top_time"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
|
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
|
||||||
|
@ -81,6 +83,8 @@
|
||||||
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||||
<result property="total" column="total"/>
|
<result property="total" column="total"/>
|
||||||
<result property="applyNumber" column="apply_number"/>
|
<result property="applyNumber" column="apply_number"/>
|
||||||
|
<result property="pinTop" column="pin_top"/>
|
||||||
|
<result property="pinTopTime" column="pin_top_time"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<update id="deleteByIds">
|
<update id="deleteByIds">
|
||||||
|
@ -128,8 +132,7 @@
|
||||||
AND user_id = #{dto.creator}
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
||||||
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id
|
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
|
||||||
=
|
|
||||||
taa3.resource_id
|
taa3.resource_id
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -184,10 +187,13 @@
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="orderField != null and orderField !=''">
|
<if test="orderField != null and orderField !=''">
|
||||||
ORDER BY ${orderField} ${orderType}
|
|
||||||
<if test="orderField == 'pin_top'">
|
<if test="orderField == 'pin_top'">
|
||||||
, pin_top_time DESC
|
ORDER BY ${orderField} ${orderType}, pin_top_time DESC
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderField == 'deptSort'">
|
||||||
|
ORDER BY sd.type, sd.sort
|
||||||
|
</if>
|
||||||
|
ORDER BY ${orderField} ${orderType}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -401,8 +407,7 @@
|
||||||
AND user_id = #{dto.creator}
|
AND user_id = #{dto.creator}
|
||||||
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
|
||||||
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
|
||||||
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id
|
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
|
||||||
=
|
|
||||||
taa3.resource_id
|
taa3.resource_id
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
@ -447,10 +452,13 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="orderField != null and orderField !=''">
|
<if test="orderField != null and orderField !=''">
|
||||||
ORDER BY ${orderField} ${orderType}
|
|
||||||
<if test="orderField == 'pin_top'">
|
<if test="orderField == 'pin_top'">
|
||||||
, pin_top_time DESC
|
ORDER BY ${orderField} ${orderType}, pin_top_time DESC
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderField == 'deptSort'">
|
||||||
|
ORDER BY sd.type, sd.sort
|
||||||
|
</if>
|
||||||
|
ORDER BY ${orderField} ${orderType}
|
||||||
LIMIT ${pageNum}, ${pageSize}
|
LIMIT ${pageNum}, ${pageSize}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
@ -578,8 +586,7 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
|
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||||
"type",
|
|
||||||
sd.NAME AS "deptName",
|
sd.NAME AS "deptName",
|
||||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount",
|
IFNULL( tdr.deptCount, 0 ) AS "deptCount",
|
||||||
sd.id AS "deptId",
|
sd.id AS "deptId",
|
||||||
|
@ -610,8 +617,7 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
|
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||||
"type",
|
|
||||||
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
|
||||||
FROM
|
FROM
|
||||||
sys_dept sd
|
sys_dept sd
|
||||||
|
@ -649,8 +655,7 @@
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
|
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
|
||||||
"type",
|
|
||||||
IFNULL( tdr.deptCount, 0) AS "deptCount",
|
IFNULL( tdr.deptCount, 0) AS "deptCount",
|
||||||
IFNULL(sr.name, '暂无该地区') AS "districtName"
|
IFNULL(sr.name, '暂无该地区') AS "districtName"
|
||||||
FROM
|
FROM
|
||||||
|
@ -1480,7 +1485,7 @@
|
||||||
|
|
||||||
<select id="resourceInstallationOrDataResourceDetails" parameterType="java.util.Map" resultType="java.util.Map">
|
<select id="resourceInstallationOrDataResourceDetails" parameterType="java.util.Map" resultType="java.util.Map">
|
||||||
SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName
|
SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName
|
||||||
FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
|
||||||
WHERE a.type = #{resourceType} AND a.del_flag = 0
|
WHERE a.type = #{resourceType} AND a.del_flag = 0
|
||||||
<if test="id != '0'.toString()">
|
<if test="id != '0'.toString()">
|
||||||
AND (b.ID = #{id} OR INSTR(b.pids,#{id}))
|
AND (b.ID = #{id} OR INSTR(b.pids,#{id}))
|
||||||
|
@ -1490,33 +1495,33 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="selectAppList" resultType="java.util.Map">
|
<select id="selectAppList" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
tdr.id,
|
tdr.id,
|
||||||
tdr.`name`,
|
tdr.`name`,
|
||||||
sd.name AS "deptName"
|
sd.name AS "deptName"
|
||||||
FROM
|
FROM
|
||||||
tb_data_resource tdr
|
tb_data_resource tdr
|
||||||
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
AND tdr.type = '应用资源'
|
AND tdr.type = '应用资源'
|
||||||
AND tdr.del_flag = 0
|
AND tdr.del_flag = 0
|
||||||
<if test=" type != null and type != ''">
|
<if test=" type != null and type != ''">
|
||||||
AND sd.type = #{type}
|
AND sd.type = #{type}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
tdr.visitor
|
tdr.visitor
|
||||||
LIMIT ${pageNum}, 9
|
LIMIT ${pageNum}, 9
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectPicByResId" resultType="java.lang.String">
|
<select id="selectPicByResId" resultType="java.lang.String">
|
||||||
SELECT
|
SELECT
|
||||||
tda.attr_value
|
tda.attr_value
|
||||||
FROM
|
FROM
|
||||||
tb_data_attr tda
|
tb_data_attr tda
|
||||||
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
|
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
|
||||||
WHERE
|
WHERE
|
||||||
tda.attr_type = '应用图片'
|
tda.attr_type = '应用图片'
|
||||||
AND tdr.id = #{id}
|
AND tdr.id = #{id}
|
||||||
AND tda.del_flag = 0
|
AND tda.del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue