Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-10-31 16:35:46 +08:00
commit 9b8d25b1fa
8 changed files with 54 additions and 8 deletions

View File

@ -29,6 +29,7 @@ import org.apache.shiro.session.UnknownSessionException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@ -65,6 +66,9 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Autowired @Autowired
private NoticeUntil noticeUntil; private NoticeUntil noticeUntil;
@Value("#{new Boolean(${notice.yawei})")
private Boolean noticeYaWei; // 是否发送消息到亚微中心
@Override @Override
public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) { public QueryWrapper<SysNoticeEntity> getWrapper(Map<String, Object> params) {
QueryWrapper<SysNoticeEntity> wrapper = new QueryWrapper<>(); QueryWrapper<SysNoticeEntity> wrapper = new QueryWrapper<>();
@ -212,10 +216,14 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
MessageData<String> message = new MessageData<String>().msg(notice.getTitle()); MessageData<String> message = new MessageData<String>().msg(notice.getTitle());
webSocketServer.sendMessage(finalUserIdList, message); webSocketServer.sendMessage(finalUserIdList, message);
}, executor).thenRunAsync(() -> { }, executor).thenRunAsync(() -> {
try { if (noticeYaWei) {
sendToYaweiUser(notice, finalUserIdList); try {
} catch (Exception exception) { sendToYaweiUser(notice, finalUserIdList);
logger.error("", exception); } catch (Exception exception) {
logger.error("", exception);
}
} else {
logger.info("无需发送到第三方 亚微消息");
} }
}, executor); }, executor);
} }

View File

@ -678,4 +678,12 @@ public class ResourceController {
return new Result().ok(resourceService.getSquareList(jsonObject)); return new Result().ok(resourceService.getSquareList(jsonObject));
} }
@GetMapping("/getAppListByDept")
@ApiOperation("/根据部门查询部门上架应用列表")
@LogOperation("/根据部门查询部门上架应用列表")
public Result getAppListByDept(String key) {
return new Result().ok(resourceService.getAppListByDept(key));
}
} }

View File

@ -215,4 +215,6 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize); @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area); Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area);
List<Map> getAppListByDept(@Param("deptId") Long deptId, @Param("key") String key);
} }

View File

@ -159,4 +159,7 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object getPotentialList(); Object getPotentialList();
Object getSquareList(JSONObject jsonObject); Object getSquareList(JSONObject jsonObject);
Object getAppListByDept(String key);
} }

View File

@ -2542,4 +2542,11 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}}; }};
} }
@Override
public Object getAppListByDept(String key) {
Long deptId = SecurityUser.getUser().getDeptId();
return resourceDao.getAppListByDept(deptId, key);
}
} }

View File

@ -152,4 +152,6 @@ front:
# 基础设施,部门最大申请数量 # 基础设施,部门最大申请数量
infrastructure: infrastructure:
dept-can-apply-max: 10 dept-can-apply-max: 10
# 是否发亚微消息
notice:
yawei: true

View File

@ -1938,7 +1938,7 @@
tdr.NAME AS resourceName, tdr.NAME AS resourceName,
dept.`name` AS resourceDeptName, dept.`name` AS resourceDeptName,
tdr.type, tdr.type,
DATE_FORMAT(tdr.create_date,'%Y-%m-%d %T') AS createDate, DATE_FORMAT(taa.create_date,'%Y-%m-%d %T') AS createDate,
taa.approve_status AS approveStatus, taa.approve_status AS approveStatus,
taa.apply_flag AS applyNumber taa.apply_flag AS applyNumber
FROM FROM
@ -2270,4 +2270,21 @@
</if> </if>
</select> </select>
<select id="getAppListByDept" resultType="java.util.Map">
SELECT
tdr.id,
tdr.NAME,
tdr.create_date
FROM
tb_data_resource tdr
WHERE
1 = 1
AND tdr.del_flag = 0
AND tdr.dept_id = #{deptId}
<if test="key != null and key != ''">
AND tdr.name like CONCAT('%', #{key}, '%')
</if>
ORDER BY create_date DESC
</select>
</mapper> </mapper>

View File

@ -7,12 +7,11 @@
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1 select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where 1 = 1 AND name != '访客部门' where 1 = 1 AND name != '访客部门'
<if test="deptIdList != null"> <if test="deptIdList != null">
t1.id in AND t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")"> <foreach item="id" collection="deptIdList" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</if> </if>
order by t1.sort asc order by t1.sort asc
</select> </select>