9 files modified
8 files added
| | |
| | | @PostMapping("/AppSave") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入attendance") |
| | | public R AppSave(@Valid Attendance attendance) { |
| | | public R AppSave(@Valid Attendance attendance,HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | System.out.println("attendance = " + attendance); |
| | | Enclosure enclosure = new Enclosure(); |
| | | enclosure.setAnumber(attendance.getNumber()); |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.controller; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.chatrecords.entity.ChatRecords; |
| | | import org.springblade.modules.chatrecords.service.ChatRecordsService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.feign.IUserClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-06-18 |
| | | * 聊天消息控制层 |
| | | */ |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/chat-records") |
| | | public class ChatRecordsController { |
| | | |
| | | private final IUserClient iUserClient; |
| | | |
| | | private final ChatRecordsService chatRecordsService; |
| | | |
| | | /** |
| | | * 查询单聊消息记录 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param response 响应 |
| | | * @param query 查询条件,分页 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSingleMessagePage") |
| | | public R getSingleMessagePage(@Valid ChatRecords chatRecords, HttpServletResponse response, Query query){ |
| | | //跨域设置 |
| | | crossDomain(response); |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | //查询单聊人的信息 |
| | | List<User> user = Arrays.asList(iUserClient.userInfoById(chatRecords.getSenderId()).getData(), iUserClient.userInfoById(chatRecords.getRecipientId()).getData()); |
| | | //查询单聊记录信息 |
| | | if (null==query.getCurrent()){ |
| | | map.put("chatRecordsIPage",chatRecordsService.selectChatlist(chatRecords)); |
| | | }else { |
| | | map.put("chatRecordsIPage",chatRecordsService.selectChatRecordsPage(Condition.getPage(query), chatRecords)); |
| | | } |
| | | //封装数据 |
| | | map.put("user",user); |
| | | //返回数据 |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param response 响应 |
| | | * @param query 查询条件,分页 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getChatListPage") |
| | | public R getChatListPage(@Valid ChatRecords chatRecords, HttpServletResponse response, Query query){ |
| | | //跨域设置 |
| | | crossDomain(response); |
| | | if(null==query.getCurrent()){ |
| | | //不分页 |
| | | return R.data(chatRecordsService.getChatList( chatRecords)); |
| | | } |
| | | //查询当前人员的聊天列表,并返回数据 |
| | | return R.data(chatRecordsService.getChatListPage(Condition.getPage(query), chatRecords)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 单聊消息插入 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param response 响应 |
| | | * @return |
| | | */ |
| | | @PostMapping("/insertSingleChat") |
| | | public R insertSingleChat(@Valid @RequestBody ChatRecords chatRecords, HttpServletResponse response){ |
| | | //跨域设置 |
| | | crossDomain(response); |
| | | //单聊消息插入 |
| | | return R.data(chatRecordsService.save(chatRecords)); |
| | | } |
| | | |
| | | /** |
| | | * 配置跨域设置 |
| | | * @param response |
| | | */ |
| | | private void crossDomain(HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.entity; |
| | | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @author zhongrj |
| | | * @time 2021-06-18 |
| | | * @desc 聊天记录实体类 |
| | | * |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("sys_chat_records") |
| | | public class ChatRecords implements Serializable { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 发送消息内容 |
| | | */ |
| | | @TableField("post_message") |
| | | private String postMessage; |
| | | |
| | | /** |
| | | * 消息类型 0 文本 1 表情 2 图片 3 视频... |
| | | */ |
| | | @TableField("message_type") |
| | | private Integer messageType; |
| | | |
| | | /** |
| | | * 接收状态 0 已接收 1 未接收 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 发送时间 |
| | | */ |
| | | @TableField("post_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date postTime; |
| | | |
| | | /** |
| | | * 发送消息人id |
| | | * |
| | | */ |
| | | @NotNull(message = "发送消息人id不能为空") |
| | | @TableField("sender_id") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private Long senderId; |
| | | |
| | | /** |
| | | * 接收消息人id |
| | | * @NotNull(message = "接收消息人id不能为空") |
| | | */ |
| | | @TableField("recipient_id") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private Long recipientId; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.chatrecords.entity.ChatRecords; |
| | | import org.springblade.modules.chatrecords.vo.ChatRecordsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * mapper 映射层 |
| | | */ |
| | | public interface ChatRecordsMapper extends BaseMapper<ChatRecords> { |
| | | |
| | | /** |
| | | * 查询单聊消息记录分页信息 |
| | | * @param page |
| | | * @param chatRecords 聊天消息对象 |
| | | * @return |
| | | */ |
| | | List<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords); |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | List<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.chatrecords.mapper.ChatRecordsMapper"> |
| | | |
| | | <!--查询单聊的消息记录列表--> |
| | | <select id="selectChatRecordsPage" resultType="org.springblade.modules.chatrecords.entity.ChatRecords"> |
| | | select * from sys_chat_records where sender_id = #{chatRecords.senderId} and recipient_id = #{chatRecords.recipientId} |
| | | union |
| | | select * from sys_chat_records where sender_id = #{chatRecords.recipientId} and recipient_id = #{chatRecords.senderId} |
| | | order by post_time desc |
| | | </select> |
| | | |
| | | <!--聊天列表--> |
| | | <select id="getChatListPage" resultType="org.springblade.modules.chatrecords.vo.ChatRecordsVo"> |
| | | select scrss.*,name recipientNickName,real_name recipientName,avatar from jfpthpublicsecurity.blade_user bu |
| | | right join |
| | | ( |
| | | select scr.id,scrs.uid recipientId,post_time postTime,post_message postMessage from sys_chat_records scr |
| | | right join |
| | | ( |
| | | select max(max_id) id,uid from ( |
| | | select recipient_id as uid,max(id) as max_id from sys_chat_records where sender_id = #{chatRecords.senderId} group by recipient_id |
| | | union all |
| | | select sender_id as uid,max(id) as max_id from sys_chat_records where recipient_id = #{chatRecords.senderId} group by sender_id |
| | | )t group by uid |
| | | ) scrs |
| | | on |
| | | scr.id = scrs.id |
| | | ) scrss |
| | | on |
| | | bu.id = scrss.recipientId |
| | | order by postTime desc |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.chatrecords.entity.ChatRecords; |
| | | import org.springblade.modules.chatrecords.vo.ChatRecordsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * 聊天消息接口层 |
| | | */ |
| | | public interface ChatRecordsService extends IService<ChatRecords> { |
| | | |
| | | /** |
| | | * 查询聊天消息分页信息 |
| | | * @param page |
| | | * @param chatRecords 聊天消息对象 |
| | | * @return |
| | | */ |
| | | IPage<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords); |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords); |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表(不分页) |
| | | * @param chatRecords 消息记录对象 |
| | | * @return |
| | | */ |
| | | List<ChatRecordsVo> getChatList(ChatRecords chatRecords); |
| | | |
| | | /** |
| | | * 查询单聊消息记录 (不分页) |
| | | * @param chatRecords 消息记录对象 |
| | | * @return |
| | | */ |
| | | List<ChatRecords> selectChatlist(ChatRecords chatRecords); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.chatrecords.entity.ChatRecords; |
| | | import org.springblade.modules.chatrecords.mapper.ChatRecordsMapper; |
| | | import org.springblade.modules.chatrecords.service.ChatRecordsService; |
| | | import org.springblade.modules.chatrecords.vo.ChatRecordsVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | */ |
| | | @Service |
| | | public class ChatRecordsServiceImpl extends ServiceImpl<ChatRecordsMapper, ChatRecords> implements ChatRecordsService { |
| | | |
| | | /** |
| | | * 查询聊天消息分页信息 |
| | | * @param page |
| | | * @param chatRecords 聊天消息对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords) { |
| | | return page.setRecords(baseMapper.selectChatRecordsPage(page,chatRecords)); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表 |
| | | * @param chatRecords 消息记录对象 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords) { |
| | | return page.setRecords(baseMapper.getChatListPage(page,chatRecords)); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前用户的聊天列表(不分页) |
| | | * @param chatRecords 消息记录对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ChatRecordsVo> getChatList(ChatRecords chatRecords) { |
| | | return baseMapper.getChatListPage(null,chatRecords); |
| | | } |
| | | |
| | | /** |
| | | * 查询单聊消息记录 (不分页) |
| | | * @param chatRecords 消息记录对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ChatRecords> selectChatlist(ChatRecords chatRecords) { |
| | | return baseMapper.selectChatRecordsPage(null,chatRecords); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.chatrecords.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springblade.modules.chatrecords.entity.ChatRecords; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-06-19 |
| | | * @desc 聊天列表vo |
| | | */ |
| | | @Data |
| | | public class ChatRecordsVo extends ChatRecords implements Serializable { |
| | | /** |
| | | * 接收或者发送的昵称 |
| | | */ |
| | | private String recipientNickName; |
| | | |
| | | /** |
| | | * 接收或者发送的姓名 |
| | | */ |
| | | private String recipientName; |
| | | |
| | | /** |
| | | * 接收或者发送的头像 url |
| | | */ |
| | | private String avatar; |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/insertfeed") |
| | | public R insertfeed(String jid, String snumber, String sname, String addvcd, String place, |
| | | String result, String describe, String type, String devicenumber, String galarmpeople, |
| | | String phone, String stime, String ctime, String feedbackaudio, String feedbackvideo, |
| | | String feedbackphoto, String jd, String wd, String tname, HttpServletResponse response) { |
| | | String result, String describe, String type, String devicenumber, String galarmpeople, |
| | | String phone, String stime, String ctime, String feedbackaudio, String feedbackvideo, |
| | | String feedbackphoto, String jd, String wd, String tname, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | |
| | | @PostMapping("/saves") |
| | | public R saves(FeedbackVO feedback) { |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间 |
| | | sdf.applyPattern("yyyy-MM-dd HH:mm:ss");// a为am/pm的标记 |
| | | Date date = new Date();// 获取当前时间 |
| | | //System.out.println("现在时间:" + sdf.format(date)); // 输出已经格式化的现在时间(24小时制) |
| | | if (feedback.getStatus()==0) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间 |
| | | sdf.applyPattern("yyyy-MM-dd HH:mm:ss");// a为am/pm的标记 |
| | | Date date = new Date();// 获取当前时间 |
| | | //System.out.println("现在时间:" + sdf.format(date)); // 输出已经格式化的现在时间(24小时制) |
| | | |
| | | Operation operation = new Operation(); |
| | | operation.setJid(feedback.getJid()); |
| | | operation.setSnumber(feedback.getSnumber()); |
| | | operation.setZc("任务反馈提交,警情结束"); |
| | | operation.setSname(feedback.getSname()); |
| | | Operation operation = new Operation(); |
| | | operation.setJid(feedback.getJid()); |
| | | operation.setSnumber(feedback.getSnumber()); |
| | | operation.setZc("任务反馈提交,警情结束"); |
| | | operation.setSname(feedback.getSname()); |
| | | |
| | | operation.setZctime(sdf.format(date)); |
| | | operationService.save(operation); |
| | | operation.setZctime(sdf.format(date)); |
| | | operationService.save(operation); |
| | | |
| | | Wj wj = new Wj(); |
| | | if (feedback.getSpaddress().equals("") && feedback.getSpaddress() != null) { |
| | | |
| | | } else { |
| | | //获取视频地址 |
| | | String[] splitsp = feedback.getSpaddress().split(",");//以逗号分割 |
| | | for (String string2 : splitsp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string2); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | if (feedback.getTpaddress().equals("") && feedback.getTpaddress() != null) { |
| | | |
| | | } else { |
| | | String[] splittp = feedback.getTpaddress().split(",");//以逗号分割 |
| | | for ( |
| | | String string3 : splittp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string3); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | |
| | | alarmService.updateJtype(operation.getJid(), "2", null, null); |
| | | } |
| | | |
| | | if (feedback.getStatus()==1){ |
| | | Wj wj = new Wj(); |
| | | if (feedback.getSpaddress() != null && feedback.getSpaddress()!="") { |
| | | //获取视频地址 |
| | | String[] splitsp = feedback.getSpaddress().split(",");//以逗号分割 |
| | | for (String string2 : splitsp) { |
| | | wj.setSnumber(feedback.getSnumber()); |
| | | wj.setAddress(string2); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | if (feedback.getTpaddress() != null && feedback.getTpaddress()!="") { |
| | | String[] splittp = feedback.getTpaddress().split(",");//以逗号分割 |
| | | for ( |
| | | String string3 : splittp) { |
| | | wj.setSnumber(feedback.getSnumber()); |
| | | wj.setAddress(string3); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | } |
| | | |
| | | feedbackService.save(feedback); |
| | | Wj wj = new Wj(); |
| | | if (feedback.getSpaddress().equals("")&&feedback.getSpaddress()!=null) { |
| | | |
| | | } else { |
| | | //获取视频地址 |
| | | String[] splitsp = feedback.getSpaddress().split(",");//以逗号分割 |
| | | for (String string2 : splitsp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string2); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | if (feedback.getTpaddress().equals("")&&feedback.getTpaddress()!=null){ |
| | | |
| | | } |
| | | else { |
| | | String[] splittp = feedback.getTpaddress().split(",");//以逗号分割 |
| | | for ( |
| | | String string3 : splittp) { |
| | | wj.setJid(feedback.getJid()); |
| | | wj.setAddress(string3); |
| | | iWjService.insertfeed(wj); |
| | | } |
| | | } |
| | | alarmService.updateJtype(operation.getJid(), "2", null, null); |
| | | |
| | | return R.success("新增成功"); |
| | | } |
| | |
| | | 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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 实体类 |
| | |
| | | */ |
| | | @ApiModelProperty(value = "事发时间") |
| | | @TableField("stime") |
| | | private String stime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date stime; |
| | | /** |
| | | * 处理完成时间 |
| | | */ |
| | |
| | | */ |
| | | package org.springblade.modules.feedback.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.feedback.entity.Feedback; |
| | |
| | | * @since 2020-07-14 |
| | | */ |
| | | @Service |
| | | |
| | | public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService { |
| | | |
| | | @Override |
| | |
| | | private String spaddress; |
| | | private String tpaddress; |
| | | |
| | | /** |
| | | * 0 警情反馈 1 调查取证上报 |
| | | */ |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | @ApiOperation(value = "修改基本信息", notes = "传入User") |
| | | public R updateInfo(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | if (null!= user.getAvatar() && user.getAvatar()!="") { |
| | | String avatar = user.getAvatar(); |
| | | String substring = avatar.substring(25, avatar.length()); |
| | | String url = "https://web.byisf.com/minio" + substring; |
| | | user.setAvatar(url); |
| | | } |
| | | return R.status(userService.updateUserInfo(user)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户基本信息,不修改用户密码 |
| | | * @param user 用户信息 |
| | | * @autor zhongrj |
| | | * @time 2021-06-16 |
| | | */ |
| | | @PostMapping("/updateUserInfo") |
| | | public R updateUserInfo(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | return R.status(userService.updateUserInfos(user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | return R.data(userService.selectSecurityUserPageList(Condition.getPage(query),user)); |
| | | return R.data(userService.selectSecurityUserList(Condition.getPage(query),user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date birthday; |
| | | /** |
| | | * 性别 |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.system.feign; |
| | | |
| | | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.entity.UserInfo; |
| | | import org.springblade.modules.system.entity.UserOauth; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * User Feign接口类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_USER_NAME |
| | | ) |
| | | public interface IUserClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String USER_INFO = API_PREFIX + "/user-info"; |
| | | String USER_INFO_BY_TYPE = API_PREFIX + "/user-info-by-type"; |
| | | String USER_INFO_BY_ID = API_PREFIX + "/user-info-by-id"; |
| | | String USER_INFO_BY_ACCOUNT = API_PREFIX + "/user-info-by-account"; |
| | | String USER_AUTH_INFO = API_PREFIX + "/user-auth-info"; |
| | | String SAVE_USER = API_PREFIX + "/save-user"; |
| | | String REMOVE_USER = API_PREFIX + "/remove-user"; |
| | | String SELUSERBYCODE = API_PREFIX + "/selUserByCode"; |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping(USER_INFO_BY_ID) |
| | | R<User> userInfoById(@RequestParam("userId") Long userId); |
| | | |
| | | |
| | | /** |
| | | * 根据账号获取用户信息 |
| | | * |
| | | * @param tenantId 租户id |
| | | * @param account 账号 |
| | | * @return |
| | | */ |
| | | @GetMapping(USER_INFO_BY_ACCOUNT) |
| | | R<User> userByAccount(@RequestParam("tenantId") String tenantId, @RequestParam("account") String account); |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @param tenantId 租户ID |
| | | * @param account 账号 |
| | | * @return |
| | | */ |
| | | @GetMapping(USER_INFO) |
| | | R<UserInfo> userInfo(@RequestParam("tenantId") String tenantId, @RequestParam("account") String account); |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @param tenantId 租户ID |
| | | * @param account 账号 |
| | | * @param userType 用户平台 |
| | | * @return |
| | | */ |
| | | @GetMapping(USER_INFO_BY_TYPE) |
| | | R<UserInfo> userInfo(@RequestParam("tenantId") String tenantId, @RequestParam("account") String account, @RequestParam("userType") String userType); |
| | | |
| | | /** |
| | | * 获取第三方平台信息 |
| | | * |
| | | * @param userOauth 第三方授权用户信息 |
| | | * @return UserInfo |
| | | */ |
| | | @PostMapping(USER_AUTH_INFO) |
| | | R<UserInfo> userAuthInfo(@RequestBody UserOauth userOauth); |
| | | |
| | | /** |
| | | * 新建用户 |
| | | * |
| | | * @param user 用户实体 |
| | | * @return |
| | | */ |
| | | @PostMapping(SAVE_USER) |
| | | R<Boolean> saveUser(@RequestBody User user); |
| | | |
| | | /** |
| | | * 删除用户 |
| | | * |
| | | * @param tenantIds 租户id集合 |
| | | * @return |
| | | */ |
| | | @PostMapping(REMOVE_USER) |
| | | R<Boolean> removeUser(@RequestParam("tenantIds") String tenantIds); |
| | | |
| | | /** |
| | | * 根据用户编号查询用户新 |
| | | * @param code 用户编号 |
| | | * @return |
| | | */ |
| | | @GetMapping(SELUSERBYCODE) |
| | | User selUserByCode(@RequestParam("code") String code); |
| | | } |
| | |
| | | * @param user 用户对象 |
| | | * @param page 分页 |
| | | */ |
| | | IPage<UsersVo> selectSecurityUserPageList(IPage<UsersVo> page, User user); |
| | | IPage<UsersVo> selectSecurityUserList(IPage<UsersVo> page, User user); |
| | | |
| | | R<Boolean> saveUser(User user); |
| | | /** |
| | | * 修改用户基本信息,不修改用户密码 |
| | | * @param user 用户信息 |
| | | * @autor zhongrj |
| | | * @time 2021-06-16 |
| | | */ |
| | | boolean updateUserInfos(User user); |
| | | |
| | | } |
| | |
| | | return userVO; |
| | | } |
| | | |
| | | /** |
| | | * 查询处警人员列表 |
| | | * @param page 分页 |
| | | * @param user 用户对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<UsersVo> selectSecurityUserList(IPage<UsersVo> page, User user) { |
| | | return page.setRecords(baseMapper.selectSecurityUserPageList(page,user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户编号查询用户新 |
| | | * @param code 用户编号 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public User selUserByCode(String code) { |
| | | return baseMapper.selUserByCode(code); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户基本信息,不修改用户密码 |
| | | * @param user 用户信息 |
| | | * @autor zhongrj |
| | | * @time 2021-06-16 |
| | | */ |
| | | @Override |
| | | public IPage<UsersVo> selectSecurityUserPageList(IPage<UsersVo> page, User user) { |
| | | return page.setRecords(baseMapper.selectSecurityUserPageList(page,user)); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> saveUser(User user) { |
| | | return null; |
| | | public boolean updateUserInfos(User user) { |
| | | return updateById(user); |
| | | } |
| | | |
| | | |