Browse Source

全民护河小程序问题定位

tags/V1.6.0
itcast 2 years ago
parent
commit
3353dd5cd4
6 changed files with 332 additions and 4 deletions
  1. +6
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Feedback.java
  2. +243
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/User.java
  3. +16
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserMapper.java
  4. +10
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IJwtService.java
  5. +16
    -4
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/FeedbackServiceImpl.java
  6. +41
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/JwtServiceImpl.java

+ 6
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Feedback.java View File

@TableField(exist = false) @TableField(exist = false)
private String feedbackCover; private String feedbackCover;


/**
* 处理人
*/
@TableField(exist =false)
private String realname;



} }

+ 243
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/User.java View File

package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
* <p>
* 后台用户管理表
* </p>
*
* @author 拓恒
* @since 2020-10-30
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
public class User implements Serializable {

private static final long serialVersionUID = 1L;

/**
* 用户ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;

/**
* 租户ID
*/
private Integer tenantId;

/**
* 用户编号
*/
private String code;

/**
* 真实姓名
*/
private String realname;

/**
* 昵称
*/
private String nickname;

/**
* 性别:1男 2女 3保密
*/
private Integer gender;

/**
* 头像
*/
private String avatar;

/**
* 手机号码
*/
private String mobile;

/**
* 邮箱地址
*/
private String email;

/**
* 出生日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;

/**
* 部门ID
*/
private Integer deptId;

/**
* 职级ID
*/
private Integer levelId;

/**
* 岗位ID
*/
private Integer positionId;

/**
* 省份编码
*/
private String provinceCode;

/**
* 城市编码
*/
private String cityCode;

/**
* 区县编码
*/
private String districtCode;

/**
* 街道编码
*/
private String streetCode;

/**
* 详细地址
*/
private String address;

/**
* 所属城市
*/
private String cityName;

/**
* 登录用户名
*/
private String username;

/**
* 登录密码
*/
private String password;

/**
* 用户类型:1普通用户 2飞手 3问题处理员 4市河湖长 5区河湖长 6街道河湖长
*/
private Integer type;

/**
* 驾照类型:1飞行执照 2飞行许可证
*/
private Integer driverType;

/**
* 驾照编号
*/
private String driverCode;

/**
* 盐加密
*/
private String salt;

/**
* 个人简介
*/
private String intro;

/**
* 状态:1正常 2禁用
*/
private Integer status;

/**
* 备注
*/
private String note;

/**
* 显示顺序
*/
private Integer sort;

/**
* 登录次数
*/
private Integer loginNum;

/**
* 最近登录IP
*/
private String loginIp;

/**
* 最近登录时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date loginTime;

/**
* 是否有问题分派人权限(1是 0否)
*/
private Integer isAssignAuth;

/**
* 添加人
*/
private Integer createUser;

/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;

/**
* 更新人
*/
private Integer updateUser;

/**
* 更新时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;

/**
* 有效标识
*/
private Integer mark;

/**
* 角色ID
*/
@TableField(exist = false)
private Integer[] roleIds;

/**
* 城市集合
*/
@TableField(exist = false)
private String[] city;

}

+ 16
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserMapper.java View File

package com.tuoheng.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.api.entity.domain.User;

/**
* <p>
* 后台用户管理表 Mapper 接口
* </p>
*
* @author 拓恒
* @since 2020-10-30
*/
public interface UserMapper extends BaseMapper<User> {

}

+ 10
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IJwtService.java View File

package com.tuoheng.api.service;

import com.tuoheng.api.entity.domain.User;

public interface IJwtService {

User getUserInfo();

Integer getTenantId();
}

+ 16
- 4
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/FeedbackServiceImpl.java View File

import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.api.entity.domain.Feedback; import com.tuoheng.api.entity.domain.Feedback;
import com.tuoheng.api.entity.domain.Stream; import com.tuoheng.api.entity.domain.Stream;
import com.tuoheng.api.entity.domain.User;
import com.tuoheng.api.entity.request.FeedbackQuery; import com.tuoheng.api.entity.request.FeedbackQuery;
import com.tuoheng.api.mapper.FeedbackMapper; import com.tuoheng.api.mapper.FeedbackMapper;
import com.tuoheng.api.mapper.StreamMapper; import com.tuoheng.api.mapper.StreamMapper;
import com.tuoheng.api.mapper.UserMapper;
import com.tuoheng.api.service.IFeedbackService; import com.tuoheng.api.service.IFeedbackService;
import com.tuoheng.common.common.BaseServiceImpl; import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.common.OperationEnum;
import com.tuoheng.common.config.CommonConfig; import com.tuoheng.common.config.CommonConfig;
import com.tuoheng.common.utils.CommonUtils; import com.tuoheng.common.utils.CommonUtils;
import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils; import com.tuoheng.common.utils.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


@Autowired @Autowired
private StreamMapper streamMapper; private StreamMapper streamMapper;


@Autowired
private UserMapper userMapper;



@Override @Override
public JsonResult submit(Feedback feedback) { public JsonResult submit(Feedback feedback) {
.orderByDesc(Feedback::getCreateTime)); .orderByDesc(Feedback::getCreateTime));
pageData.getRecords().stream().map(vo -> { pageData.getRecords().stream().map(vo -> {
Stream stream = streamMapper.selectById(vo.getStreamId()); Stream stream = streamMapper.selectById(vo.getStreamId());
vo.setStreamImage(CommonUtils.getImageURL(stream.getImage()));

if(StringUtils.isNotNull(stream)){
vo.setStreamImage(CommonUtils.getImageURL(stream.getImage()));
}
User user = userMapper.selectById(vo.getStreamAdminId());
if (StringUtils.isNotNull(vo.getStatus())){
if(vo.getStatus()==4){
vo.setRealname(user.getRealname());
}else {
vo.setHandleTime(null);
}
}
//反馈图片地址 //反馈图片地址
if(StringUtils.isNotEmpty(vo.getFeedbackUrl())){ if(StringUtils.isNotEmpty(vo.getFeedbackUrl())){
String[] feedbackUrls = vo.getFeedbackUrl().split(","); String[] feedbackUrls = vo.getFeedbackUrl().split(",");

+ 41
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/JwtServiceImpl.java View File

package com.tuoheng.api.service.impl;

import com.tuoheng.api.entity.domain.User;
import com.tuoheng.api.mapper.UserMapper;
import com.tuoheng.api.service.IJwtService;
import com.tuoheng.common.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class JwtServiceImpl implements IJwtService {

@Autowired
private UserMapper userMapper;

/**
* 获取当前用户信息
*
* @return
*/
@Override
public User getUserInfo() {
Integer userId = JwtUtil.userId();
User user = userMapper.selectById(userId);
return user;
}

/**
* 获取当前用户TenantId
*
* @return
*/
@Override
public Integer getTenantId() {
Integer userId = JwtUtil.userId();
User user = userMapper.selectById(userId);
return user.getTenantId();
}


}

Loading…
Cancel
Save