Merge branch 'dev'
This commit is contained in:
commit
1e624749cb
|
@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
@ -141,7 +142,8 @@ public class SysNoticeController {
|
|||
public Result save(@RequestBody SysNoticeDTO dto) {
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
dto.setCreator(SecurityUser.getUser().getId());
|
||||
dto.setCreateDate(new Date());
|
||||
sysNoticeService.save(dto);
|
||||
|
||||
return new Result();
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package io.renren.modules.notice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
@ -14,9 +15,26 @@ import java.util.Date;
|
|||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_notice")
|
||||
public class SysNoticeEntity extends BaseEntity {
|
||||
public class SysNoticeEntity {
|
||||
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;
|
||||
|
||||
/**
|
||||
* 通知类型
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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.metadata.IPage;
|
||||
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.data.MessageData;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.session.UnknownSessionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -92,25 +94,33 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(SysNoticeDTO dto) {
|
||||
SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class);
|
||||
try {
|
||||
SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class);
|
||||
if (StringUtils.isEmpty(entity.getFrom())) {
|
||||
entity.setFrom("其它"); // 站内信通知来源 (通知、评论、其它)
|
||||
}
|
||||
|
||||
if (entity.getCreator() == null) {
|
||||
entity.setCreator(0L);
|
||||
}
|
||||
|
||||
//更新发送者信息
|
||||
if (dto.getStatus() == NoticeStatusEnum.SEND.value() && StringUtils.isEmpty(dto.getSenderName())) {
|
||||
entity.setSenderName(SecurityUser.getUser().getRealName());
|
||||
entity.setSenderDate(new Date());
|
||||
}
|
||||
|
||||
baseDao.insert(entity);
|
||||
try {
|
||||
baseDao.insert(entity);
|
||||
} catch (UnknownSessionException unknownSessionException) {
|
||||
|
||||
}
|
||||
|
||||
//发送通知
|
||||
dto.setId(entity.getId());
|
||||
sendNotice(dto);
|
||||
} catch (Exception exception) {
|
||||
logger.error("发送站内信异常", exception);
|
||||
logger.error("发送站内信异常" + JSON.toJSONString(entity), exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1743,7 +1743,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
|
||||
}
|
||||
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());
|
||||
ArrayList<ResourceDTO> recordLists = new ArrayList<>();
|
||||
for (int i = (curPage - 1) * limit; i < j; i++) {
|
||||
|
|
|
@ -42,7 +42,9 @@ public class ShiroConfig {
|
|||
|
||||
@Bean
|
||||
public DefaultWebSessionManager sessionManager() {
|
||||
return new ShiroSessionManager();
|
||||
ShiroSessionManager sessionManager = new ShiroSessionManager();
|
||||
sessionManager.setGlobalSessionTimeout(-1000L);
|
||||
return sessionManager;
|
||||
}
|
||||
|
||||
@Bean("securityManager")
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1319,9 +1319,9 @@
|
|||
a.del_flag = 0
|
||||
AND
|
||||
d.del_flag = 0
|
||||
group by
|
||||
GROUP BY
|
||||
c.name,c.id
|
||||
order by
|
||||
ORDER BY
|
||||
c.name,c.id
|
||||
LIMIT ${pageNum}, ${pageSize}
|
||||
</select>
|
||||
|
@ -1388,7 +1388,7 @@
|
|||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by tdr.id order by count desc
|
||||
GROUP BY tdr.id ORDER BY count desc
|
||||
</select>
|
||||
|
||||
<select id="selectUsersApplyAndCount" resultMap="resourceDTO">
|
||||
|
@ -1397,13 +1397,13 @@
|
|||
WHERE
|
||||
1 = 1
|
||||
AND tdr.del_flag = 0
|
||||
<if test="null != userIds">
|
||||
<if test="null != userIds and userIds.size > 0">
|
||||
and taa.user_id in
|
||||
<foreach item="userId" collection="userIds" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by tdr.id order by applyCount desc
|
||||
GROUP BY tdr.id ORDER BY applyCount desc
|
||||
</select>
|
||||
|
||||
<select id="trafficDeptResource" resultType="java.util.Map">
|
||||
|
|
Loading…
Reference in New Issue