Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-07-28 17:41:20 +08:00
commit 41b80c5772
7 changed files with 46 additions and 13 deletions

View File

@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.Map; import java.util.Map;
@ -141,7 +142,8 @@ public class SysNoticeController {
public Result save(@RequestBody SysNoticeDTO dto) { public Result save(@RequestBody SysNoticeDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setCreator(SecurityUser.getUser().getId());
dto.setCreateDate(new Date());
sysNoticeService.save(dto); sysNoticeService.save(dto);
return new Result(); return new Result();

View File

@ -1,8 +1,9 @@
package io.renren.modules.notice.entity; package io.renren.modules.notice.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.renren.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -14,9 +15,26 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("sys_notice") @TableName("sys_notice")
public class SysNoticeEntity extends BaseEntity { public class SysNoticeEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private Long creator;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createDate;
/** /**
* 通知类型 * 通知类型
*/ */

View File

@ -1,5 +1,6 @@
package io.renren.modules.notice.service.impl; package io.renren.modules.notice.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import io.renren.common.constant.Constant; import io.renren.common.constant.Constant;
@ -21,6 +22,7 @@ import io.renren.modules.sys.service.SysUserService;
import io.renren.websocket.WebSocketServer; import io.renren.websocket.WebSocketServer;
import io.renren.websocket.data.MessageData; import io.renren.websocket.data.MessageData;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
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;
@ -92,25 +94,33 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(SysNoticeDTO dto) { public void save(SysNoticeDTO dto) {
try {
SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class); SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class);
try {
if (StringUtils.isEmpty(entity.getFrom())) { if (StringUtils.isEmpty(entity.getFrom())) {
entity.setFrom("其它"); // 站内信通知来源 (通知评论其它) entity.setFrom("其它"); // 站内信通知来源 (通知评论其它)
} }
if (entity.getCreator() == null) {
entity.setCreator(0L);
}
//更新发送者信息 //更新发送者信息
if (dto.getStatus() == NoticeStatusEnum.SEND.value() && StringUtils.isEmpty(dto.getSenderName())) { if (dto.getStatus() == NoticeStatusEnum.SEND.value() && StringUtils.isEmpty(dto.getSenderName())) {
entity.setSenderName(SecurityUser.getUser().getRealName()); entity.setSenderName(SecurityUser.getUser().getRealName());
entity.setSenderDate(new Date()); entity.setSenderDate(new Date());
} }
try {
baseDao.insert(entity); baseDao.insert(entity);
} catch (UnknownSessionException unknownSessionException) {
}
//发送通知 //发送通知
dto.setId(entity.getId()); dto.setId(entity.getId());
sendNotice(dto); sendNotice(dto);
} catch (Exception exception) { } catch (Exception exception) {
logger.error("发送站内信异常", exception); logger.error("发送站内信异常" + JSON.toJSONString(entity), exception);
} }
} }

View File

@ -1743,7 +1743,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
limit = Integer.parseInt((String) params.get(Constant.LIMIT)); limit = Integer.parseInt((String) params.get(Constant.LIMIT));
} }
List<SysUserDTO> sysUserList = sysUserService.list(new HashMap()); List<SysUserDTO> sysUserList = sysUserService.list(new HashMap());
List<ResourceDTO> result = resourceDao.selectUsersApplyAndCount(sysUserList.stream().map(dto -> dto.getId()).collect(Collectors.toList())); List<ResourceDTO> result = resourceDao.selectUsersApplyAndCount(sysUserList.stream().map(SysUserDTO::getId).collect(Collectors.toList()));
int j = Math.min(curPage * limit, result.size()); int j = Math.min(curPage * limit, result.size());
ArrayList<ResourceDTO> recordLists = new ArrayList<>(); ArrayList<ResourceDTO> recordLists = new ArrayList<>();
for (int i = (curPage - 1) * limit; i < j; i++) { for (int i = (curPage - 1) * limit; i < j; i++) {

View File

@ -42,7 +42,9 @@ public class ShiroConfig {
@Bean @Bean
public DefaultWebSessionManager sessionManager() { public DefaultWebSessionManager sessionManager() {
return new ShiroSessionManager(); ShiroSessionManager sessionManager = new ShiroSessionManager();
sessionManager.setGlobalSessionTimeout(-1000L);
return sessionManager;
} }
@Bean("securityManager") @Bean("securityManager")

View File

@ -1 +1,2 @@
-- 用于摄像头加申购车和申请使用所属部门字段根据各个地方自己修改dept_id字段即可
REPLACE INTO `tb_data_resource`(`id`, `type`, `name`, `description`, `link`, `api_method_type`, `api_url`, `group_id`, `dept_id`, `dept_contacts`, `dept_phone`, `share_type`, `share_mode`, `share_condition`, `district_id`, `visits`, `del_flag`, `creator`, `create_date`, `updater`, `update_date`, `note1`, `note2`, `note3`, `note4`, `note5`, `enclosure`, `undercarriage_reason`, `undercarriage_user_name`, `info_list`, `total`, `visitor`, `apply_number`, `undercarriage_enclosure`) VALUES (8888888880000000001, '基础设施', '申请摄像头', NULL, '', NULL, NULL, NULL, 1067246875800000066, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 9, NULL, NULL, NULL, '2022-07-04 18:23:47', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '[]', 13, 5, NULL, NULL); REPLACE INTO `tb_data_resource`(`id`, `type`, `name`, `description`, `link`, `api_method_type`, `api_url`, `group_id`, `dept_id`, `dept_contacts`, `dept_phone`, `share_type`, `share_mode`, `share_condition`, `district_id`, `visits`, `del_flag`, `creator`, `create_date`, `updater`, `update_date`, `note1`, `note2`, `note3`, `note4`, `note5`, `enclosure`, `undercarriage_reason`, `undercarriage_user_name`, `info_list`, `total`, `visitor`, `apply_number`, `undercarriage_enclosure`) VALUES (8888888880000000001, '基础设施', '申请摄像头', NULL, '', NULL, NULL, NULL, 1067246875800000066, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 9, NULL, NULL, NULL, '2022-07-04 18:23:47', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '[]', 13, 5, NULL, NULL);

View File

@ -1319,9 +1319,9 @@
a.del_flag = 0 a.del_flag = 0
AND AND
d.del_flag = 0 d.del_flag = 0
group by GROUP BY
c.name,c.id c.name,c.id
order by ORDER BY
c.name,c.id c.name,c.id
LIMIT ${pageNum}, ${pageSize} LIMIT ${pageNum}, ${pageSize}
</select> </select>
@ -1388,7 +1388,7 @@
#{deptId} #{deptId}
</foreach> </foreach>
</if> </if>
group by tdr.id order by count desc GROUP BY tdr.id ORDER BY count desc
</select> </select>
<select id="selectUsersApplyAndCount" resultMap="resourceDTO"> <select id="selectUsersApplyAndCount" resultMap="resourceDTO">
@ -1397,13 +1397,13 @@
WHERE WHERE
1 = 1 1 = 1
AND tdr.del_flag = 0 AND tdr.del_flag = 0
<if test="null != userIds"> <if test="null != userIds and userIds.size > 0">
and taa.user_id in and taa.user_id in
<foreach item="userId" collection="userIds" open="(" separator="," close=")"> <foreach item="userId" collection="userIds" open="(" separator="," close=")">
#{userId} #{userId}
</foreach> </foreach>
</if> </if>
group by tdr.id order by applyCount desc GROUP BY tdr.id ORDER BY applyCount desc
</select> </select>
<select id="trafficDeptResource" resultType="java.util.Map"> <select id="trafficDeptResource" resultType="java.util.Map">