* 'dev' of http://221.0.232.152:9393/ability-center/share-platform:
  统计报表筛选完善
  分配到系统默认审核人时,调整通知文案
  能力统计各榜单排序逻辑修改
This commit is contained in:
huangweixiong 2022-10-21 11:49:20 +08:00
commit d8821ec1a6
12 changed files with 285 additions and 27 deletions

View File

@ -362,6 +362,7 @@ public class ActivitiNoticeAspect {
LOGGER.error("------------自动审批通过,不通知------------");
return;
}
Boolean allowEntrust = Boolean.valueOf(kv.get("allowEntrust") != null ? kv.get("allowEntrust").toString() : Boolean.FALSE.toString()); // 允许被委托他人(特殊通知)
String key = null;
if (kv.containsKey("id")) {
key = kv.getOrDefault("id", "").toString();
@ -440,7 +441,14 @@ public class ActivitiNoticeAspect {
try {
SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您";
String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() +
" 已进入审核节点:" + activitiNoticeOperation.value() +
";当前审核人指派为您";
if (allowEntrust) {
content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() +
" 已进入审核节点:" + activitiNoticeOperation.value() +
";因无法分配到审核人,故当前审核人指派为您";
}
Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 1;

View File

@ -47,4 +47,9 @@ public class AuditingBaseDTO implements Serializable {
*/
private String flowType = null;
/**
* 允许被委托他人(特殊通知)
*/
private Boolean allowEntrust = null;
}

View File

@ -129,6 +129,7 @@ public class ApplyDeptListener implements TaskListener, ExecutionListener, Activ
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托
assignee = defaultAssigneeRoleId;
}

View File

@ -111,6 +111,7 @@ public class ApplyDistrictListener implements TaskListener, ExecutionListener, A
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托
assignee = defaultAssigneeRoleId;
}
mpComplete(delegateTask, assignee);

View File

@ -112,6 +112,7 @@ public class CityListener implements TaskListener, ExecutionListener, ActivitiEv
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托
assignee = defaultAssigneeRoleId;
}
mpComplete(delegateTask, assignee);

View File

@ -196,6 +196,7 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac
} else {
logger.error("未查到该部门 {} 对应的 {}", deptId, roleName);
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托
assignee = defaultAssigneeRoleId;
}
if (kv.containsKey("tAbilityApplicationDTOList")) {

View File

@ -108,6 +108,7 @@ public class OwnerDistrictListener implements TaskListener, ExecutionListener, A
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
taskService.setVariable(delegateTask.getId(), "allowEntrust", Boolean.TRUE); // 允许被委托
assignee = defaultAssigneeRoleId;
}
mpComplete(delegateTask, assignee);

View File

@ -641,4 +641,34 @@ public class ResourceController {
}
@GetMapping("/getPraiseList")
@ApiOperation("获取好评榜")
@LogOperation("获取好评榜")
public Result getPraiseList() {
return new Result<>().ok(resourceService.getPraiseList());
}
@GetMapping("/getPopularList")
@ApiOperation("获取热门榜")
@LogOperation("获取热门榜")
public Result getPopularList() {
return new Result<>().ok(resourceService.getPopularList());
}
@GetMapping("/getStarList")
@ApiOperation("获取明星榜")
@LogOperation("获取明星榜")
public Result getStarList() {
return new Result<>().ok(resourceService.getStarList());
}
@GetMapping("/getPotentialList")
@ApiOperation("获取潜力榜")
@LogOperation("获取潜力榜")
public Result getPotentialList() {
return new Result<>().ok(resourceService.getPotentialList());
}
}

View File

@ -197,4 +197,12 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map> selectCollectList(@Param("resourceType") String resourceType, @Param("attrType") String attrType);
List<Map> selectCollectResourceList();
List<Map> getPraiseList();
List<Map> getPopularList(@Param("startDate") String startDate);
List<Map> getPotentialList(@Param("halfMonthDay") String halfMonthDay, @Param("monthDay") String monthDay);
List<Map> getStarList();
}

View File

@ -149,4 +149,12 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object selectCensusResourceTable(Map params);
Object selectCensusApplyTable(Map params);
Object getPraiseList();
Object getPopularList();
Object getStarList();
Object getPotentialList();
}

View File

@ -1,5 +1,6 @@
package io.renren.modules.resource.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -2311,4 +2312,29 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return new PageData(result, dtoList.size());
}
@Override
public Object getPraiseList() {
return resourceDao.getPraiseList();
}
@Override
public Object getPopularList() {
String start = DateUtil.lastMonth().toDateStr() + " 00:00:00";
return resourceDao.getPopularList(start);
}
@Override
public Object getStarList() {
return resourceDao.getStarList();
}
@Override
public Object getPotentialList() {
String halfMonthDay = DateUtil.offsetDay(new Date(), -15).toDateStr() + " 00:00:00";
String monthDay = DateUtil.offsetDay(new Date(), -30).toDateStr() + " 00:00:00";
List<Map> potentialList = resourceDao.getPotentialList(halfMonthDay, monthDay);
return potentialList;
}
}

View File

@ -1757,26 +1757,22 @@
AND taa.resource_id = tdr.id
AND (tdr.type = '应用资源' OR tdr.type = '智能算法' OR tdr.type = '图层服务' OR tdr.type = '开发组件' OR
tdr.type = '业务组件')
<!--<choose>
<when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</when>
<otherwise>
AND taa.approve_status != '不通过'
</otherwise>
</choose> -->
<if test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</if>
<if test="deptId != null and deptId != ''">
AND sd.id = #{deptId}
</if>
<if test="type != null and type != ''">
AND tdr.type = #{type}
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND SUBSTR(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
GROUP BY
sd.id,
tdr.type
<if test="type == null or type == '' or type == '会议室'">
UNION
SELECT
@ -1788,8 +1784,27 @@
'hys' AS 'type'
FROM
t_meetingroom_book tmb
where 1=1
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tmb.state=2
</when>
<when test="approveStatus != null and approveStatus == '不通过'">
AND tmb.state=3
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tmb.state not in (2, 3)
</when>
</choose>
<if test="deptId != null and deptId != ''">
AND tmb.dept = #{deptId}
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND SUBSTR(tmb.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
GROUP BY
deptName
</if>
</select>
<select id="selectDeptDetailTypeCountList" resultType="java.util.Map">
@ -1821,18 +1836,24 @@
tdr.type = '业务组件')
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0
AND tdr.del_flag in (0, 5)
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tdr.del_flag in (2, 3)
AND tdr.del_flag not in (0, 1, 5, 6)
</when>
<when test="approveStatus != null and approveStatus == '不通过'">
AND tdr.del_flag=6
</when>
<otherwise>
AND tdr.del_flag in (0, 2, 3)
AND tdr.del_flag != 1
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND sd.id = #{deptId}
</if>
<if test="type != null and type != ''">
AND tdr.type = #{type}
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND SUBSTR(tdr.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
@ -1938,9 +1959,8 @@
tm.`name` AS 'resourceName',
'青岛市大数据发展管理局' AS 'resourceDeptName',
'会议室' AS 'type',
tm.create_date AS 'createDate',
CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS
'approveStatus',
tmb.create_date AS 'createDate',
CASE tmb.state WHEN 1 THEN '审核中' WHEN 2 THEN '通过' WHEN 3 THEN '不通过' ELSE '审核中' END AS 'approveStatus',
'' AS 'applyNumber'
FROM
t_meetingroom_book tmb,
@ -1958,6 +1978,12 @@
AND tmb.state not in (2, 3)
</when>
</choose>
<if test="deptId != null and deptId != ''">
AND tmb.dept = #{deptId}
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
AND SUBSTR(tmb.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
</if>
ORDER BY createDate DESC
@ -1982,4 +2008,146 @@
GROUP BY tda.attr_value
ORDER BY count DESC
</select>
<select id="getPraiseList" resultType="java.util.Map">
SELECT
tdr.id AS "resourceId",
tdr.NAME AS "resourceName",
IFNULL( AVG( trs.score ), 3 ) AS "score",
tdr.create_date AS "createDate"
FROM
tb_data_resource tdr LEFT JOIN
tb_resource_score trs ON tdr.id = trs.resource_id
WHERE
1 = 1
AND tdr.del_flag = 0
AND tdr.type IN('组件服务', '应用资源')
GROUP BY
resourceId
ORDER BY
score DESC, createDate
LIMIT 10
</select>
<select id="getPopularList" resultType="java.util.Map">
SELECT
tdr.id AS "resourceId",
tdr.NAME AS "resourceName",
IFNULL(taa.applyCount, 0) AS "applyCount",
IFNULL(trc.collectCount, 0) AS "collectCount",
IFNULL(trb.browseCount, 0) AS "browseCount",
tdr.create_date
FROM
tb_data_resource tdr
LEFT JOIN ( SELECT resource_id, COUNT( id ) AS "applyCount" FROM t_ability_application WHERE 1 = 1 AND del_flag
= 0 AND create_date > #{startDate} 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 AND create_date > #{startDate} GROUP BY resource_id ) trc ON tdr.id = trc.resource_id
LEFT JOIN (SELECT resource_id, COUNT(id) AS "browseCount" FROM tb_resource_browse WHERE 1 = 1
AND create_date > #{startDate} GROUP BY resource_id) trb ON tdr.id = trb.resource_id
WHERE
1 = 1
AND tdr.del_flag = 0
AND tdr.type IN('组件服务', '应用资源')
ORDER BY
applyCount DESC,
collectCount DESC,
browseCount DESC,
tdr.create_date
LIMIT 10
</select>
<select id="getPotentialList" resultType="java.util.Map">
SELECT
tdr.id AS "resourceId",
tdr.`name` AS "resourceName",
IF(temp2.oneCount IS NULL, '1' , '0') AS "isNew",
IFNULL(temp1.halfCount, 0) AS "halfMonthCount",
IFNULL(temp2.oneCount, 0) AS "lastMonthCount",
(IFNULL(temp1.halfCount, 0) - IFNULL(temp2.oneCount, 0)) / IFNULL(temp2.oneCount, 0) AS "growthRate",
tdr.create_date
FROM
tb_data_resource tdr
LEFT JOIN (
SELECT
COUNT( id ) AS "halfCount",
resource_id
FROM
t_ability_application taa
WHERE
1 = 1
AND del_flag = 0
AND camera_list IS NULL
AND create_date >= #{halfMonthDay}
GROUP BY
resource_id
) temp1 ON tdr.id = temp1.resource_id
LEFT JOIN (
SELECT
COUNT( id ) AS "oneCount",
resource_id
FROM
t_ability_application taa
WHERE
1 = 1
AND del_flag = 0
AND camera_list IS NULL
AND #{halfMonthDay} > create_date AND create_date >= #{monthDay}
GROUP BY
resource_id
) temp2 ON tdr.id = temp2.resource_id
WHERE
1 = 1
AND tdr.del_flag = 0
AND tdr.type IN ('组件服务', '应用资源')
ORDER BY isNew DESC, halfMonthCount DESC, create_date DESC, growthRate DESC
LIMIT 10
</select>
<select id="getStarList" resultType="java.util.Map">
SELECT list.resourceId,
list.resourceName,
(list.applyNum + list.browseNum + list.collectNum + list.scoreNum) AS "fireNum",
list.create_date AS "createDate"
FROM (
SELECT
tdr.id AS "resourceId",
tdr.name AS "resourceName",
IFNULL((taa.count / temp1.maxApplyCount), 0) * 1.5 AS "applyNum",
IFNULL((trc.count / temp2.maxCopllectCount), 0) * 1 AS "collectNum",
IFNULL((trb.count / temp3.maxBrowseCount), 0) * 0.5 AS "browseNum",
IFNULL((trs.score / temp4.maxScore), 0 ) * 2 AS "scoreNum",
tdr.create_date
FROM
tb_data_resource tdr
LEFT JOIN (SELECT COUNT(id) AS "count", resource_id FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND camera_list IS NULL GROUP BY resource_id ) taa ON tdr.id = taa.resource_id
LEFT JOIN (SELECT COUNT(id) AS "count", resource_id 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 COUNT(id) AS "count", resource_id FROM tb_resource_browse WHERE 1 = 1 GROUP BY resource_id) trb
ON tdr.id = trb.resource_id
LEFT JOIN (SELECT AVG(score) AS "score", resource_id FROM tb_resource_score WHERE 1 = 1 GROUP BY resource_id) trs
ON tdr.id = trs.resource_id
JOIN (SELECT IFNULL(MAX(count), 0) AS "maxApplyCount" FROM (SELECT COUNT(id) AS "count" FROM t_ability_application WHERE 1 = 1 AND del_flag = 0 AND camera_list IS NULL GROUP BY resource_id ) taa) temp1
JOIN (SELECT IFNULL(MAX(count), 0) AS "maxCopllectCount" FROM(SELECT COUNT(id) AS "count" FROM tb_resource_collection WHERE 1 = 1 AND del_flag = 0 GROUP BY resource_id)trc) temp2
JOIN (SELECT IFNULL(MAX(count), 0) AS "maxBrowseCount" FROM(SELECT COUNT(id) AS "count" FROM tb_resource_browse WHERE 1 = 1 GROUP BY resource_id) trb) temp3
JOIN (SELECT IFNULL(MAX(score), 0) AS "maxScore" FROM(SELECT AVG(score) AS "score" FROM tb_resource_score WHERE 1 = 1 GROUP BY resource_id) trs) temp4
WHERE 1 = 1
AND tdr.del_flag = 0
AND tdr.type IN ('组件服务', '应用资源')
)list
ORDER BY fireNum DESC, create_date DESC LIMIT 10
</select>
</mapper>