Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-09-15 09:23:24 +08:00
commit 3a3ccaa356
5 changed files with 132 additions and 32 deletions

View File

@ -353,7 +353,7 @@ public class CensusController {
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public Result selectApplyDeptDetailTypeCountList(@RequestParam Map<String, Object> params) {
return new Result().ok(resourceService.selectApplyDeptDetailTypeCountList(params));
@ -366,10 +366,38 @@ public class CensusController {
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public Result selectDeptDetailTypeCountList(@RequestParam Map<String, Object> params) {
return new Result().ok(resourceService.selectDeptDetailTypeCountList(params));
}
@GetMapping("/selectCensusResourceTable")
@ApiOperation("查询部门上架资源及审批结果详细信息")
@LogOperation("查询部门上架资源及审批结果详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public Result selectCensusResourceTable(@RequestParam Map<String, Object> params){
return new Result().ok(resourceService.selectCensusResourceTable(params));
}
@GetMapping("/selectCensusApplyTable")
@ApiOperation("查询部门申请资源及审批结果详细信息")
@LogOperation("查询部门申请资源及审批结果详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
public Result selectCensusApplyTable(@RequestParam Map<String, Object> params){
return new Result().ok(resourceService.selectCensusApplyTable(params));
}
}

View File

@ -188,8 +188,9 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map<String, Object>> selectApplyDeptDetailTypeCountList(Map params);
List<Map<String, Object>> selectDeptDetailTypeCountList(@Param("delFlags") List<Integer> delFlags,
@Param("deptId") Long deptId,
@Param("startDate") String startDate,
@Param("endDate") String endDate);
List<Map<String, Object>> selectDeptDetailTypeCountList(Map params);
List<Map> selectCensusResourceTable(Map params);
List<Map> selectCensusApplyTable(Map params);
}

View File

@ -142,4 +142,8 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object selectApplyDeptDetailTypeCountList(Map params);
Object selectDeptDetailTypeCountList(Map params);
Object selectCensusResourceTable(Map params);
Object selectCensusApplyTable(Map params);
}

View File

@ -2023,23 +2023,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override
public Object selectDeptDetailTypeCountList(Map params) {
String startDate= (String) params.get("startDate");
String endDate= (String) params.get("endDate");
Long deptId= Long.parseLong((String) params.get("deptId"));
List<Integer> delFlags=new ArrayList<>();
if(params.get("approveStatus") != null){
if("审核完成".equals(params.get("approveStatus"))){
delFlags.add(0);
}else if("审核中".equals(params.get("approveStatus"))){
delFlags.add(2);
delFlags.add(3);
}
}else {
delFlags.add(0);
delFlags.add(2);
delFlags.add(3);
}
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(delFlags, deptId, startDate, endDate);
List<Map<String, Object>> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params);
Map<String, List<Map<String, Object>>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
ArrayList<Map> resultList = new ArrayList<>();
typeCountListMap.forEach((k, v) -> {
@ -2051,4 +2035,14 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return resultList;
}
@Override
public Object selectCensusResourceTable(Map params){
return resourceDao.selectCensusResourceTable(params);
}
@Override
public Object selectCensusApplyTable(Map params){
return resourceDao.selectCensusApplyTable(params);
}
}

View File

@ -1711,9 +1711,14 @@
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.resource_id = tdr.id
<if test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</if>
<choose>
<when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</when>
<otherwise>
AND taa.approve_status != '不通过'
</otherwise>
</choose>
<if test="deptId != null and approveStatus != ''">
AND sd.id = #{deptId}
</if>
@ -1745,12 +1750,17 @@
WHERE
1 = 1
AND tdr.dept_id = sd.id
<if test="null != delFlags">
AND tdr.del_flag in
<foreach item="delFlag" collection="delFlags" open="(" separator="," close=")">
#{delFlag}
</foreach>
</if>
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tdr.del_flag in (2, 3)
</when>
<otherwise>
AND tdr.del_flag in (0, 2, 3)
</otherwise>
</choose>
<if test="deptId != null and deptId != ''">
AND sd.id = #{deptId}
</if>
@ -1761,4 +1771,67 @@
tdr.dept_id,
tdr.type
</select>
<select id="selectCensusResourceTable" resultType="java.util.Map">
SELECT sd.name AS deptName, tdr.name AS resourceName, tdr.type, tdr.create_date AS createDate, if(tdr.del_flag=0, '审核通过', '审核中') AS approveStatus
FROM (SELECT IF(d.type='组件服务', A.attr_value, d.type) AS type, d.id, d.del_flag, d.dept_id, d.create_date, d.name
FROM tb_data_resource d LEFT JOIN tb_data_attr a ON d.id=a.data_resource_id AND a.attr_type='组件类型' AND a.del_flag=0
WHERE d.type NOT IN ('知识库','基础设施','数据资源')) tdr,
sys_dept sd
WHERE 1=1 AND tdr.dept_id=sd.id
<choose>
<when test="approveStatus != null and approveStatus == '通过'">
AND tdr.del_flag = 0
</when>
<when test="approveStatus != null and approveStatus == '审核中'">
AND tdr.del_flag in (2, 3)
</when>
<otherwise>
AND tdr.del_flag in (0, 2, 3)
</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>
ORDER BY tdr.create_date DESC
</select>
<select id="selectCensusApplyTable" resultType="java.util.Map">
SELECT sd.name AS deptName, tdr.name AS resourceName, tdr.type, taa.create_date AS createDate, taa.approve_status AS approveStatus
FROM (SELECT IF(d.type='组件服务', A.attr_value, d.type) AS type, d.id, d.del_flag, d.dept_id, d.create_date, d.name
FROM tb_data_resource d LEFT JOIN tb_data_attr a ON d.id=a.data_resource_id AND a.attr_type='组件类型' AND a.del_flag=0
WHERE d.type NOT IN ('知识库','基础设施','数据资源')) tdr,
sys_dept sd,
sys_user su,
t_ability_application taa
WHERE 1 = 1
AND tdr.del_flag = 0
AND taa.user_id = su.id
AND su.dept_id = sd.id
AND taa.resource_id = tdr.id
<choose>
<when test="approveStatus != null and approveStatus != ''">
AND taa.approve_status = #{approveStatus}
</when>
<otherwise>
AND taa.approve_status != '不通过'
</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(taa.create_date, 1, 10) BETWEEN #{startDate} AND #{endDate}
</if>
ORDER BY taa.create_date DESC
</select>
</mapper>