Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -35,9 +35,14 @@ public class MessageRemindrule extends BaseEntity {
|
|||||||
@ApiModelProperty("系统消息0,手机短信1")
|
@ApiModelProperty("系统消息0,手机短信1")
|
||||||
private Integer remindWay;*/
|
private Integer remindWay;*/
|
||||||
|
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
private String ruleCode;
|
private String ruleCode;
|
||||||
|
@ApiModelProperty("提醒方式(事前提醒0,事后提醒1)")
|
||||||
private Integer rules;
|
private Integer rules;
|
||||||
|
@ApiModelProperty("提醒时间间隔")
|
||||||
private Integer timeInterval;
|
private Integer timeInterval;
|
||||||
|
@ApiModelProperty("提醒次数,超过次数不提醒")
|
||||||
private String frequency;
|
private String frequency;
|
||||||
|
@ApiModelProperty("提醒渠道")
|
||||||
private String remindWay;
|
private String remindWay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class MessageRemindruleDto implements Dto {
|
public class MessageRemindruleDto implements Dto {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
@ApiModelProperty("代码")
|
@ApiModelProperty("规则编码")
|
||||||
private String ruleCode;
|
private String ruleCode;
|
||||||
|
@ApiModelProperty("提醒方式(事前提醒0,事后提醒1)")
|
||||||
@ApiModelProperty("提前提醒0,超期循环提醒1,循环提醒2")
|
|
||||||
private Integer rules;
|
private Integer rules;
|
||||||
|
@ApiModelProperty("提醒时间间隔")
|
||||||
@ApiModelProperty("系统消息0,手机短信1")
|
private Integer timeInterval;
|
||||||
private Integer remindWay;
|
@ApiModelProperty("提醒次数,超过次数不提醒")
|
||||||
|
private String frequency;
|
||||||
|
@ApiModelProperty("提醒渠道")
|
||||||
|
private String remindWay;
|
||||||
|
private String remarks;
|
||||||
}
|
}
|
||||||
@@ -46,10 +46,23 @@ public interface MessageRemindruleFeign {
|
|||||||
@ApiOperation("新增保存")
|
@ApiOperation("新增保存")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public ResultBean save(@RequestBody MessageRemindruleDto dto);
|
public ResultBean save(@RequestBody MessageRemindruleDto dto);
|
||||||
|
|
||||||
|
@ApiOperation("保存修改")
|
||||||
|
@PostMapping("/saveRules")
|
||||||
|
public ResultBean saveRules(@RequestBody MessageRemindruleDto dto);
|
||||||
|
|
||||||
|
@ApiOperation("详情编辑回显")
|
||||||
|
@GetMapping("/detail/{sid}")
|
||||||
|
public ResultBean<MessageRemindruleInitVo> detail(@PathVariable("sid") String sid);
|
||||||
|
|
||||||
|
@ApiOperation("批量删除")
|
||||||
|
@DeleteMapping("/deleteBySids")
|
||||||
|
@ResponseBody
|
||||||
|
public ResultBean deleteBySids(@RequestBody String[] sids);
|
||||||
|
|
||||||
@ApiOperation("修改保存")
|
@ApiOperation("修改保存")
|
||||||
@PostMapping("/update/{sid}")
|
@PostMapping("/update/{sid}")
|
||||||
public ResultBean update(@RequestBody MessageRemindruleDto dto,@PathVariable("sid") String sid);
|
public ResultBean update(@RequestBody MessageRemindruleDto dto, @PathVariable("sid") String sid);
|
||||||
|
|
||||||
@ApiOperation("删除记录")
|
@ApiOperation("删除记录")
|
||||||
@GetMapping("/del/{ids}")
|
@GetMapping("/del/{ids}")
|
||||||
@@ -58,8 +71,8 @@ public interface MessageRemindruleFeign {
|
|||||||
@ApiOperation("获取一条记录")
|
@ApiOperation("获取一条记录")
|
||||||
@GetMapping("/fetch/{id}")
|
@GetMapping("/fetch/{id}")
|
||||||
public ResultBean<MessageRemindruleVo> fetch(@PathVariable("id") String id);
|
public ResultBean<MessageRemindruleVo> fetch(@PathVariable("id") String id);
|
||||||
|
|
||||||
@ApiOperation("获取一条记录")
|
@ApiOperation("获取一条记录")
|
||||||
@GetMapping("/fetchSid/{sid}")
|
@GetMapping("/fetchSid/{sid}")
|
||||||
public ResultBean<MessageRemindrule> fetchBySid(@PathVariable("sid") String sid);
|
public ResultBean<MessageRemindrule> fetchBySid(@PathVariable("sid") String sid);
|
||||||
}
|
}
|
||||||
@@ -45,8 +45,23 @@ public class MessageRemindruleFeignFallback implements MessageRemindruleFeign {
|
|||||||
public ResultBean save(MessageRemindruleDto dto){
|
public ResultBean save(MessageRemindruleDto dto){
|
||||||
return ResultBean.fireFail().setMsg("接口message-center/messageremindrule/save无法访问");
|
return ResultBean.fireFail().setMsg("接口message-center/messageremindrule/save无法访问");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
public ResultBean saveRules(MessageRemindruleDto dto) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean<MessageRemindruleInitVo> detail(String sid) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteBySids(String[] sids) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ResultBean update(MessageRemindruleDto dto,String sid){
|
public ResultBean update(MessageRemindruleDto dto,String sid){
|
||||||
return ResultBean.fireFail().setMsg("接口message-center/messageremindrule/update无法访问");
|
return ResultBean.fireFail().setMsg("接口message-center/messageremindrule/update无法访问");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.yxt.messagecenter.api.messageremindrule;
|
||||||
|
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Administrator
|
||||||
|
* @description
|
||||||
|
* @date 2023/10/26 14:19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MessageRemindruleInitVo implements Vo {
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("规则编码")
|
||||||
|
private String ruleCode;
|
||||||
|
@ApiModelProperty("提醒方式(事前提醒0,事后提醒1)")
|
||||||
|
private Integer rules;
|
||||||
|
@ApiModelProperty("提醒时间间隔")
|
||||||
|
private Integer timeInterval;
|
||||||
|
@ApiModelProperty("提醒次数,超过次数不提醒")
|
||||||
|
private String frequency;
|
||||||
|
@ApiModelProperty("提醒渠道")
|
||||||
|
private String remindWay;
|
||||||
|
private String remarks;
|
||||||
|
}
|
||||||
@@ -24,13 +24,9 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class MessageRemindruleQuery implements Query {
|
public class MessageRemindruleQuery implements Query {
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("代码")
|
@ApiModelProperty("规则编码")
|
||||||
private String ruleCode;
|
private String ruleCode;
|
||||||
|
@ApiModelProperty("提醒方式(事前提醒0,事后提醒1)")
|
||||||
@ApiModelProperty("提前提醒0,超期循环提醒1,循环提醒2")
|
|
||||||
private Integer rules;
|
private Integer rules;
|
||||||
|
|
||||||
@ApiModelProperty("系统消息0,手机短信1")
|
|
||||||
private Integer remindWay;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class MessageRemindruleVo implements Vo {
|
public class MessageRemindruleVo implements Vo {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
@ApiModelProperty("代码")
|
@ApiModelProperty("规则编码")
|
||||||
private String ruleCode;
|
private String ruleCode;
|
||||||
|
@ApiModelProperty("提醒方式(事前提醒0,事后提醒1)")
|
||||||
@ApiModelProperty("提前提醒0,超期循环提醒1,循环提醒2")
|
|
||||||
private Integer rules;
|
private Integer rules;
|
||||||
|
@ApiModelProperty("提醒时间间隔")
|
||||||
@ApiModelProperty("系统消息0,手机短信1")
|
private Integer timeInterval;
|
||||||
private Integer remindWay;
|
@ApiModelProperty("提醒次数,超过次数不提醒")
|
||||||
|
private String frequency;
|
||||||
|
@ApiModelProperty("提醒渠道")
|
||||||
|
private String remindWay;
|
||||||
|
private String remarks;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,13 @@ package com.yxt.messagecenter.biz.messageremindrule;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.messagecenter.api.messageremindrule.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindrule;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleQuery;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleVo;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleDto;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleFeign;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: message-center(消息中心) <br/>
|
* Project: message-center(消息中心) <br/>
|
||||||
@@ -63,8 +59,23 @@ public class MessageRemindruleRest implements MessageRemindruleFeign {
|
|||||||
messageRemindruleService.saveOrUpdateDto(dto);
|
messageRemindruleService.saveOrUpdateDto(dto);
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
public ResultBean saveRules(MessageRemindruleDto dto) {
|
||||||
|
return messageRemindruleService.saveRules(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean<MessageRemindruleInitVo> detail(String sid) {
|
||||||
|
return messageRemindruleService.detail(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean deleteBySids(String[] sids) {
|
||||||
|
return messageRemindruleService.deleteBySids(sids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ResultBean update(MessageRemindruleDto dto,String sid){
|
public ResultBean update(MessageRemindruleDto dto,String sid){
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
messageRemindruleService.updateBySid(dto.toMap(),sid);
|
messageRemindruleService.updateBySid(dto.toMap(),sid);
|
||||||
|
|||||||
@@ -3,17 +3,13 @@ package com.yxt.messagecenter.biz.messageremindrule;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
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 com.yxt.messagecenter.api.messageremindrule.*;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
import com.yxt.common.base.utils.PagerUtil;
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindrule;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleQuery;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleVo;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleDto;
|
|
||||||
import com.yxt.messagecenter.api.messageremindrule.MessageRemindruleFeign;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -34,70 +30,107 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MessageRemindruleService extends MybatisBaseService<MessageRemindruleMapper, MessageRemindrule> {
|
public class MessageRemindruleService extends MybatisBaseService<MessageRemindruleMapper, MessageRemindrule> {
|
||||||
public PagerVo<MessageRemindrule> listPage(PagerQuery<MessageRemindruleQuery> pq) {
|
public PagerVo<MessageRemindrule> listPage(PagerQuery<MessageRemindruleQuery> pq) {
|
||||||
MessageRemindruleQuery query = pq.getParams();
|
MessageRemindruleQuery query = pq.getParams();
|
||||||
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
||||||
IPage<MessageRemindrule> page = PagerUtil.queryToPage(pq);
|
IPage<MessageRemindrule> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<MessageRemindrule> pagging = baseMapper.selectPage(page, qw);
|
IPage<MessageRemindrule> pagging = baseMapper.selectPage(page, qw);
|
||||||
PagerVo<MessageRemindrule> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<MessageRemindrule> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
public List<MessageRemindrule> listAll(MessageRemindruleQuery query) {
|
|
||||||
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
public List<MessageRemindrule> listAll(MessageRemindruleQuery query) {
|
||||||
return baseMapper.selectList(qw);
|
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
||||||
}
|
return baseMapper.selectList(qw);
|
||||||
private QueryWrapper<MessageRemindrule> createQueryWrapper(MessageRemindruleQuery query) {
|
}
|
||||||
// todo: 这里根据具体业务调整查询条件
|
|
||||||
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
private QueryWrapper<MessageRemindrule> createQueryWrapper(MessageRemindruleQuery query) {
|
||||||
QueryWrapper<MessageRemindrule> qw = new QueryWrapper<>();
|
// todo: 这里根据具体业务调整查询条件
|
||||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||||
|
QueryWrapper<MessageRemindrule> qw = new QueryWrapper<>();
|
||||||
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(query.getRuleCode())) {
|
if (StringUtils.isNotBlank(query.getRuleCode())) {
|
||||||
qw.eq("ruleCode", query.getRuleCode());
|
qw.eq("ruleCode", query.getRuleCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.getRules() != null) {
|
if (query.getRules() != null) {
|
||||||
qw.eq("rules", query.getRules());
|
qw.eq("rules", query.getRules());
|
||||||
}
|
}
|
||||||
|
qw.eq("isDelete", 0);
|
||||||
|
qw.orderByDesc("createTime");
|
||||||
|
// if (query.getRemindWay() != null) {
|
||||||
|
// qw.eq("remindWay", query.getRemindWay());
|
||||||
|
// }
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
if (query.getRemindWay() != null) {
|
public PagerVo<MessageRemindruleVo> listPageVo(PagerQuery<MessageRemindruleQuery> pq) {
|
||||||
qw.eq("remindWay", query.getRemindWay());
|
MessageRemindruleQuery query = pq.getParams();
|
||||||
}
|
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
||||||
return qw;
|
IPage<MessageRemindrule> page = PagerUtil.queryToPage(pq);
|
||||||
}
|
IPage<MessageRemindruleVo> pagging = baseMapper.selectPageVo(page, qw);
|
||||||
|
PagerVo<MessageRemindruleVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
public PagerVo<MessageRemindruleVo> listPageVo(PagerQuery<MessageRemindruleQuery> pq) {
|
return p;
|
||||||
MessageRemindruleQuery query = pq.getParams();
|
}
|
||||||
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
|
||||||
IPage<MessageRemindrule> page = PagerUtil.queryToPage(pq);
|
|
||||||
IPage<MessageRemindruleVo> pagging = baseMapper.selectPageVo(page, qw);
|
|
||||||
PagerVo<MessageRemindruleVo> p = PagerUtil.pageToVo(pagging, null);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MessageRemindruleVo> listAllVo(MessageRemindruleQuery query) {
|
|
||||||
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
|
||||||
return baseMapper.selectListAllVo(qw);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MessageRemindruleVo> listVo() {
|
|
||||||
return baseMapper.selectListVo();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveOrUpdateDto(MessageRemindruleDto dto){
|
|
||||||
MessageRemindrule entity = new MessageRemindrule();
|
|
||||||
dto.fillEntity(entity);
|
|
||||||
this.saveOrUpdate(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessageRemindruleVo fetchByIdVo(String id){
|
|
||||||
MessageRemindrule entity = this.fetchById(id);
|
|
||||||
MessageRemindruleVo vo = new MessageRemindruleVo();
|
|
||||||
BeanUtil.copyProperties(entity, vo);
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessageRemindrule selectOne() {
|
public List<MessageRemindruleVo> listAllVo(MessageRemindruleQuery query) {
|
||||||
return baseMapper.selectOnes();
|
QueryWrapper<MessageRemindrule> qw = createQueryWrapper(query);
|
||||||
}
|
return baseMapper.selectListAllVo(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MessageRemindruleVo> listVo() {
|
||||||
|
return baseMapper.selectListVo();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveOrUpdateDto(MessageRemindruleDto dto) {
|
||||||
|
MessageRemindrule entity = new MessageRemindrule();
|
||||||
|
dto.fillEntity(entity);
|
||||||
|
this.saveOrUpdate(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageRemindruleVo fetchByIdVo(String id) {
|
||||||
|
MessageRemindrule entity = this.fetchById(id);
|
||||||
|
MessageRemindruleVo vo = new MessageRemindruleVo();
|
||||||
|
BeanUtil.copyProperties(entity, vo);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageRemindrule selectOne() {
|
||||||
|
return baseMapper.selectOnes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean saveRules(MessageRemindruleDto dto) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||||
|
MessageRemindrule messageRemindrule = fetchBySid(dto.getSid());
|
||||||
|
BeanUtil.copyProperties(dto, messageRemindrule, "id", "sid");
|
||||||
|
baseMapper.updateById(messageRemindrule);
|
||||||
|
} else {
|
||||||
|
MessageRemindrule entity = new MessageRemindrule();
|
||||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean<MessageRemindruleInitVo> detail(String sid) {
|
||||||
|
ResultBean<MessageRemindruleInitVo> rb = ResultBean.fireFail();
|
||||||
|
MessageRemindruleInitVo initVo = new MessageRemindruleInitVo();
|
||||||
|
MessageRemindrule messageRemindrule = fetchBySid(sid);
|
||||||
|
if (null != messageRemindrule) {
|
||||||
|
BeanUtil.copyProperties(messageRemindrule, initVo);
|
||||||
|
}
|
||||||
|
return rb.success().setData(initVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean deleteBySids(String[] sids) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
for (String sid : sids) {
|
||||||
|
MessageRemindrule messageRemindrule = fetchBySid(sid);
|
||||||
|
messageRemindrule.setIsDelete(1);
|
||||||
|
baseMapper.updateById(messageRemindrule);
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user