diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrMsgReadController.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrMsgReadController.java new file mode 100644 index 00000000..4db7fa5c --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrMsgReadController.java @@ -0,0 +1,114 @@ +package cn.jyjz.xiaoyao.ocr.controller; + +import cn.jyjz.xiaoyao.common.base.util.StringUtils; +import cn.jyjz.xiaoyao.oa.from.dataobject.Candidateuser; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead; +import cn.jyjz.xiaoyao.ocr.service.IOcrMsgService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.RequestParam; +import javax.servlet.http.HttpServletRequest; +import cn.jyjz.xiaoyao.ocr.service.IOcrMsgReadService; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * ocr控制器 + * + * @author 你的肉 + * @Date 2024-03-13 20:21:38 + */ +@CrossOrigin +@RestController +@RequestMapping("/ocr/msg") +public class OcrMsgReadController { + + + @Autowired + private IOcrMsgReadService ocrMsgReadService; + + @Autowired + private IOcrMsgService iocrmsgservice; + + + /** + * 分页查询 + * @param map + * @param map start 起始页 + * @param map limit 每页显示多少条 默认10 条 + * @return + */ + @ApiOperation(value = "系统消息分页", notes = "系统消息分页") + @RequestMapping(value = "/systempage", method = RequestMethod.GET) + public ResponseEntity systempage(@RequestBody Map map) { + + IPage iPage = new Page<>(Integer.valueOf(map.get("start")),Integer.valueOf(map.get("limit"))); + + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.select("id","titile","sender","bus_json","send_time").eq("msg_category",map.get("msgCategory")).eq("send_status","1").eq("send_status","2").apply(map.get("receiveUser"),"receive_user_ids"); +// if(!StringUtils.isEmpty(map.get("productsId"))) { +// } + //执行查询方法 + + IPage page = this.iocrmsgservice.page(iPage,wrapper); + + + + return new ResponseEntity(page,HttpStatus.OK); + } + + + + /** + * 查询 单条 信息 + * + * @param id + * @param id 编号 + * @return + */ + @ApiOperation(value = "消息详情", notes = "消息详情") + @RequestMapping(value = "/msgOne", method = RequestMethod.GET) + public ResponseEntity msgOne(@RequestParam(value = "id", required = false)String id) { + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.select("titile","msg_content","sender","msg_category","send_time"); + wrapper.eq("id", id); + //执行查询方法 + OcrMsg one = iocrmsgservice.getOne(wrapper); + + return new ResponseEntity(one,HttpStatus.OK); + } + + + /** + * 添加 + * @param listMsgRead + * @param listMsgRead + * @return + */ + @ApiOperation(value = "消除未读", notes = "消除未读") + @RequestMapping(value = "eliminateUnread", method = RequestMethod.POST) + public ResponseEntity eliminateUnread(@RequestBody List listMsgRead) { + List listCa = new ArrayList<>(); + for(OcrMsgRead list:listMsgRead){ + list.setReadTime(System.currentTimeMillis()); + listCa.add(list); + } + boolean save = ocrMsgReadService.saveBatch(listCa); + //此处需要手工处理 返回需要将修改后的数据返回 + return new ResponseEntity(save,HttpStatus.CREATED); + } +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrSUserTController.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrSUserTController.java index 9f314a3c..38e77901 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrSUserTController.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/controller/OcrSUserTController.java @@ -1,11 +1,15 @@ package cn.jyjz.xiaoyao.ocr.controller; +import cn.jyjz.xiaoyao.admin.dataobject.Tenant; import cn.jyjz.xiaoyao.admin.dataobject.User; +import cn.jyjz.xiaoyao.admin.service.TenantService; import cn.jyjz.xiaoyao.common.base.controller.BaseController; import cn.jyjz.xiaoyao.common.base.vo.ResultVo; import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil; +import cn.jyjz.xiaoyao.framework.security.service.SmsLoginService; import cn.jyjz.xiaoyao.ocr.dataobject.OcrSUserT; import cn.jyjz.xiaoyao.ocr.service.OcrISUserTService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import io.swagger.annotations.ApiOperation; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -17,8 +21,11 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestParam; + +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -35,6 +42,11 @@ public class OcrSUserTController { @Autowired private OcrISUserTService sUserTService; + @Autowired + private TenantService tenantService; + + @Resource + private SmsLoginService smsLoginService; /** 忘记密码 */ @@ -78,6 +90,63 @@ public class OcrSUserTController { return new ResponseEntity("请输入同时包含英文、数字的8~16位密码!",HttpStatus.OK); } + return new ResponseEntity(HttpStatus.OK); + } + + @ApiOperation(value = "忘记密码", notes = "忘记密码") + @RequestMapping(value = "/selectSUser", method = RequestMethod.GET) + public ResponseEntity selectSUser(@RequestBody Map map) { + + if(null!=map.get("loginname")){ + if(null!=map.get("phone")){ + if(null!=map.get("phonecode")){ + if(null!=map.get("agentcode")){ + + QueryWrapper agentcodewrapper = new QueryWrapper<>(); + agentcodewrapper.eq("OTHERNO", map.get("agentcode").toString()); + Tenant agentcodeone = tenantService.getOne(agentcodewrapper); + + if(null!=agentcodeone){ + + QueryWrapper loginnamewrapper = new QueryWrapper<>(); + loginnamewrapper.eq("LOGINNAME", map.get("loginname").toString()); + OcrSUserT loginnameone = sUserTService.getOne(loginnamewrapper); + if(null!=loginnameone){ + QueryWrapper phonewrapper = new QueryWrapper<>(); + phonewrapper.eq("MOBILE", map.get("phone").toString()).eq("LOGINNAME", map.get("loginname").toString()); + OcrSUserT phoneone = sUserTService.getOne(phonewrapper); + if(null!=phoneone){ + ResultVo phone = smsLoginService.sendCode(map.get("phone").toString()); + }else { + return new ResponseEntity("手机号错误!",HttpStatus.OK); + } + + }else { + return new ResponseEntity("账号不存在!",HttpStatus.OK); + } + + + }else { + return new ResponseEntity("企业编码错误!",HttpStatus.OK); + } + + }else { + return new ResponseEntity("请输入企业编码!",HttpStatus.OK); + } + }else { + return new ResponseEntity("请输入验证码!",HttpStatus.OK); + } + }else { + return new ResponseEntity("请输入手机号!",HttpStatus.OK); + } + }else { + + return new ResponseEntity("请输入账号!",HttpStatus.OK); + } + + + + return new ResponseEntity(HttpStatus.OK); } diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgMapper.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgMapper.java new file mode 100644 index 00000000..eeea9161 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgMapper.java @@ -0,0 +1,19 @@ +package cn.jyjz.xiaoyao.ocr.dataDao; + + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@Mapper +public interface OcrMsgMapper extends BaseMapper { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgReadMapper.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgReadMapper.java new file mode 100644 index 00000000..0729b27b --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataDao/OcrMsgReadMapper.java @@ -0,0 +1,18 @@ +package cn.jyjz.xiaoyao.ocr.dataDao; + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@Mapper +public interface OcrMsgReadMapper extends BaseMapper { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsg.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsg.java new file mode 100644 index 00000000..b2398e58 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsg.java @@ -0,0 +1,275 @@ +package cn.jyjz.xiaoyao.ocr.dataobject; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; + +import java.io.Serializable; + + +/** + *

+ * + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@TableName("ocr_msg") +public class OcrMsg extends Model { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + /** + * 标题 + */ + private String titile; + /** + * 内容(可能是整个页面的排版的标签数据) + */ + @TableField("msg_content") + private String msgContent; + /** + * 发送人 + */ + private Long sender; + /** + * 消息分类(1.审批通知,2.系统通知) + */ + @TableField("msg_category") + private Integer msgCategory; + /** + * 接收人类型(1.用户,2.全部 3.部分用户) + */ + @TableField("receive_user_type") + private Integer receiveUserType; + /** + * 业务参数json,例如 +{ +bus_id:xxx, //审核id +bug_status:xxx,//审核状态 +bus_node:xxx//审核节点 +} + */ + @TableField("bus_json") + private String busJson; + /** + * 创建时间戳 + */ + @TableField("create_time") + private Long createTime; + /** + * 创建人id + */ + @TableField("create_by") + private Long createBy; + /** + * 修改时间戳 + */ + @TableField("update_time") + private Long updateTime; + /** + * 修改人id + */ + @TableField("update_by") + private Long updateBy; + /** + * 接收人 字符串,分割 例如:xxx,xx,xx,xx, + */ + @TableField("receive_user_ids") + private String receiveUserIds; + /** + * 前端打开方式 组件:component 路由:ur1 + */ + @TableField("open_type") + private String openType; + /** + * 组件/路由 地址 + */ + @TableField("open_page") + private String openPage; + /** + * 发布状态(0未发布,1已发布,2已撤销) + */ + @TableField("send_status") + private String sendStatus; + /** + * 发送时间 + */ + @TableField("send_time") + private Long sendTime; + /** + * 撤销时间 + */ + @TableField("cancel_time") + private Long cancelTime; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitile() { + return titile; + } + + public void setTitile(String titile) { + this.titile = titile; + } + + public String getMsgContent() { + return msgContent; + } + + public void setMsgContent(String msgContent) { + this.msgContent = msgContent; + } + + public Long getSender() { + return sender; + } + + public void setSender(Long sender) { + this.sender = sender; + } + + public Integer getMsgCategory() { + return msgCategory; + } + + public void setMsgCategory(Integer msgCategory) { + this.msgCategory = msgCategory; + } + + public Integer getReceiveUserType() { + return receiveUserType; + } + + public void setReceiveUserType(Integer receiveUserType) { + this.receiveUserType = receiveUserType; + } + + public String getBusJson() { + return busJson; + } + + public void setBusJson(String busJson) { + this.busJson = busJson; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getCreateBy() { + return createBy; + } + + public void setCreateBy(Long createBy) { + this.createBy = createBy; + } + + public Long getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Long updateTime) { + this.updateTime = updateTime; + } + + public Long getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(Long updateBy) { + this.updateBy = updateBy; + } + + public String getReceiveUserIds() { + return receiveUserIds; + } + + public void setReceiveUserIds(String receiveUserIds) { + this.receiveUserIds = receiveUserIds; + } + + public String getOpenType() { + return openType; + } + + public void setOpenType(String openType) { + this.openType = openType; + } + + public String getOpenPage() { + return openPage; + } + + public void setOpenPage(String openPage) { + this.openPage = openPage; + } + + public String getSendStatus() { + return sendStatus; + } + + public void setSendStatus(String sendStatus) { + this.sendStatus = sendStatus; + } + + public Long getSendTime() { + return sendTime; + } + + public void setSendTime(Long sendTime) { + this.sendTime = sendTime; + } + + public Long getCancelTime() { + return cancelTime; + } + + public void setCancelTime(Long cancelTime) { + this.cancelTime = cancelTime; + } + + @Override + public Serializable pkVal() { + return this.id; + } + + @Override + public String toString() { + return "OcrMsg{" + + "id=" + id + + ", titile=" + titile + + ", msgContent=" + msgContent + + ", sender=" + sender + + ", msgCategory=" + msgCategory + + ", receiveUserType=" + receiveUserType + + ", busJson=" + busJson + + ", createTime=" + createTime + + ", createBy=" + createBy + + ", updateTime=" + updateTime + + ", updateBy=" + updateBy + + ", receiveUserIds=" + receiveUserIds + + ", openType=" + openType + + ", openPage=" + openPage + + ", sendStatus=" + sendStatus + + ", sendTime=" + sendTime + + ", cancelTime=" + cancelTime + + "}"; + } +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsgRead.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsgRead.java new file mode 100644 index 00000000..6fb123b7 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/dataobject/OcrMsgRead.java @@ -0,0 +1,100 @@ +package cn.jyjz.xiaoyao.ocr.dataobject; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@TableName("ocr_msg_read") +public class OcrMsgRead extends Model { + + private static final long serialVersionUID = 1L; + + private Long id; + /** + * 消息id + */ + @TableField("msg_id") + private Long msgId; + /** + * 读取用户id + */ + @TableField("user_id") + private Long userId; + /** + * 1.已读 + */ + @TableField("read_flag") + private Integer readFlag; + /** + * 读取时间戳 + */ + @TableField("read_time") + private Long readTime; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getMsgId() { + return msgId; + } + + public void setMsgId(Long msgId) { + this.msgId = msgId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getReadFlag() { + return readFlag; + } + + public void setReadFlag(Integer readFlag) { + this.readFlag = readFlag; + } + + public Long getReadTime() { + return readTime; + } + + public void setReadTime(Long readTime) { + this.readTime = readTime; + } + + @Override + public Serializable pkVal() { + return this.id; + } + + @Override + public String toString() { + return "OcrMsgRead{" + + "id=" + id + + ", msgId=" + msgId + + ", userId=" + userId + + ", readFlag=" + readFlag + + ", readTime=" + readTime + + "}"; + } +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgReadService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgReadService.java new file mode 100644 index 00000000..94418857 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgReadService.java @@ -0,0 +1,17 @@ +package cn.jyjz.xiaoyao.ocr.service; + + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +public interface IOcrMsgReadService extends IService { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgService.java new file mode 100644 index 00000000..e82d72ce --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/IOcrMsgService.java @@ -0,0 +1,17 @@ +package cn.jyjz.xiaoyao.ocr.service; + + +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +public interface IOcrMsgService extends IService { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgReadServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgReadServiceImpl.java new file mode 100644 index 00000000..6f8df7a0 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgReadServiceImpl.java @@ -0,0 +1,20 @@ +package cn.jyjz.xiaoyao.ocr.service.impl; + +import cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgReadMapper; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsgRead; +import cn.jyjz.xiaoyao.ocr.service.IOcrMsgReadService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@Service +public class OcrMsgReadServiceImpl extends ServiceImpl implements IOcrMsgReadService { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgServiceImpl.java new file mode 100644 index 00000000..68286ecf --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrMsgServiceImpl.java @@ -0,0 +1,20 @@ +package cn.jyjz.xiaoyao.ocr.service.impl; + +import cn.jyjz.xiaoyao.ocr.dataDao.OcrMsgMapper; +import cn.jyjz.xiaoyao.ocr.dataobject.OcrMsg; +import cn.jyjz.xiaoyao.ocr.service.IOcrMsgService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author 你的肉123 + * @since 2024-03-13 + */ +@Service +public class OcrMsgServiceImpl extends ServiceImpl implements IOcrMsgService { + +} diff --git a/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgMapper.xml b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgMapper.xml new file mode 100644 index 00000000..4b7dacce --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, titile, msg_content AS msgContent, sender, msg_category AS msgCategory, receive_user_type AS receiveUserType, bus_json AS busJson, create_time AS createTime, create_by AS createBy, update_time AS updateTime, update_by AS updateBy, receive_user_ids AS receiveUserIds, open_type AS openType, open_page AS openPage, send_status AS sendStatus, send_time AS sendTime, cancel_time AS cancelTime + + + diff --git a/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgReadMapper.xml b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgReadMapper.xml new file mode 100644 index 00000000..0b39fed5 --- /dev/null +++ b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/OcrMsgReadMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + id, msg_id AS msgId, user_id AS userId, read_flag AS readFlag, read_time AS readTime + + +