消息通知

hhw
杜函宇 1 month ago
parent 0ee71e0920
commit 2d7a2bfd94

@ -47,13 +47,13 @@ public class QyStatsController extends BaseController {
return success(qyStatsService.relationalProject(SecurityUtils.getUsername()));
}
// /**
// * 消息通知
// */
// @ApiOperation("消息通知")
// @GetMapping("/qyNotice")
// public AjaxResult qyNotice() {
// return success(qyStatsService.qyNotice(SecurityUtils.getUsername()));
// }
/**
*
*/
@ApiOperation("消息通知")
@GetMapping("/qyNotice")
public AjaxResult qyNotice() {
return success(qyStatsService.qyNotice(SecurityUtils.getUsername()));
}
}

@ -4,6 +4,7 @@ package com.ruoyi.gysl.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.service.BasicInformationService;
import com.ruoyi.gysl.service.ZwStatsService;
@ -69,5 +70,14 @@ public class ZwStatsController extends BaseController {
public AjaxResult projectList(Page<BasicInformation> page) {
return success(basicInformationService.projectList(page));
}
/**
*
*/
@ApiOperation("消息通知")
@GetMapping("/zwNotice")
public AjaxResult zwNotice() {
return success(zwStatsService.zwNotice());
}
}

@ -45,5 +45,8 @@ public class Notice implements Serializable {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@ApiModelProperty(value = "项目id")
private Long zwId;
}

@ -1,6 +1,7 @@
package com.ruoyi.gysl.mapper;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import org.apache.ibatis.annotations.Param;
@ -23,5 +24,10 @@ public interface QyStatsMapper {
*
*/
List<BasicInformation> relationalProject(String username);
/**
*
*/
List<Notice> qyNotice(@Param("username") String username);
}

@ -1,5 +1,6 @@
package com.ruoyi.gysl.mapper;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
@ -26,5 +27,10 @@ public interface ZwStatsMapper {
*
*/
List<RibbonResponse> investors();
/**
*
*/
List<Notice> zwNotice();
}

@ -7,6 +7,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.time.LocalDate;
/**
*
@ -23,11 +24,15 @@ public class NoticeTiming {
/**
*
*/
// @Scheduled(cron = "1 0 0 * * *")
// private void configureTasks() {
// Notice notice = new Notice();
// notice.setType(1);
//
// noticeService.save(notice);
// }
@Scheduled(cron = "0 0 0 1 * ?")
private void configureTasks() {
Notice notice = new Notice();
notice.setType(1);
notice.setContent(LocalDate.now().getYear() +
"年"+
LocalDate.now().getMonth().getValue()+
"月"+
"项目进展未填写");
noticeService.save(notice);
}
}

@ -1,6 +1,7 @@
package com.ruoyi.gysl.service;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
@ -25,5 +26,9 @@ public interface QyStatsService {
List<BasicInformation> relationalProject(String username);
/**
*
*/
List<Notice> qyNotice(String username);
}

@ -1,5 +1,6 @@
package com.ruoyi.gysl.service;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
@ -27,5 +28,11 @@ public interface ZwStatsService {
*
*/
List<RibbonResponse> investors();
/**
*
*/
List<Notice> zwNotice();
}

@ -1,6 +1,7 @@
package com.ruoyi.gysl.service.impl;
import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import com.ruoyi.gysl.mapper.QyStatsMapper;
@ -40,4 +41,12 @@ public class QyStatsServiceImpl implements QyStatsService {
return qyStatsMapper.relationalProject(username);
}
/**
*
*/
@Override
public List<Notice> qyNotice(String username) {
return qyStatsMapper.qyNotice(username);
}
}

@ -1,5 +1,6 @@
package com.ruoyi.gysl.service.impl;
import com.ruoyi.gysl.entity.Notice;
import com.ruoyi.gysl.entity.stats.AllProjectResponse;
import com.ruoyi.gysl.entity.stats.RibbonResponse;
import com.ruoyi.gysl.mapper.ZwStatsMapper;
@ -43,4 +44,12 @@ public class ZwStatsServiceImpl implements ZwStatsService {
public List<RibbonResponse> investors() {
return zwStatsMapper.investors();
}
/**
*
*/
@Override
public List<Notice> zwNotice() {
return zwStatsMapper.zwNotice();
}
}

@ -29,5 +29,9 @@
<select id="relationalProject" resultType="com.ruoyi.gysl.entity.BasicInformation">
</select>
<select id="qyNotice" resultType="com.ruoyi.gysl.entity.Notice">
select * from notice
where tyshxydm = #{username} and type = 2
</select>
</mapper>

@ -39,5 +39,9 @@
GROUP BY
nature
</select>
<select id="zwNotice" resultType="com.ruoyi.gysl.entity.Notice">
select * from notice
where type = 2
</select>
</mapper>

Loading…
Cancel
Save