|
|
@@ -34,7 +34,8 @@ import com.goafanti.patent.service.PatentNewService;
|
|
|
|
|
|
|
|
|
|
|
|
-@Component
|
|
|
+//@Component
|
|
|
+@RestController
|
|
|
public class PatentTask {
|
|
|
@Resource
|
|
|
private PatentNewService patentNewService;
|
|
|
@@ -64,8 +65,8 @@ public class PatentTask {
|
|
|
* 1、先计算出申请时间与当前时间相隔天数 2、然后用相隔天使除以365取余计算年份差 3、在用申请时间加上年限获取最后日期
|
|
|
* 4、在相隔30天、20天、10天、3天、2天、1天分别一次提醒。原是在距离90天提醒。
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0 0 * * ?")
|
|
|
-// @RequestMapping(value = "/open/patentRemind", method = RequestMethod.GET)
|
|
|
+// @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ @RequestMapping(value = "/open/patentRemind", method = RequestMethod.GET)
|
|
|
public void patentRemind() {
|
|
|
LoggerUtils.debug(getClass(), "====================开始检查专利提醒==================");
|
|
|
try {
|
|
|
@@ -116,7 +117,7 @@ public class PatentTask {
|
|
|
n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
|
|
|
Admin a = adminService.selectByPrimaryKey(p.getAid());
|
|
|
StringBuffer str2 = new StringBuffer();
|
|
|
-
|
|
|
+ str2.append("专利编号=").append(p.getPatentNo()).append("名称=").append(p.getName());
|
|
|
if (a == null) {
|
|
|
str2.append(",aid=").append(p.getAid()).append(",找不到管理员。");
|
|
|
n.setAid("1");
|
|
|
@@ -124,6 +125,7 @@ public class PatentTask {
|
|
|
nlist.add(n);
|
|
|
continue;
|
|
|
} else if (!SendEmailUtil.isEmail(p.getEmail())) {
|
|
|
+ System.out.println("pid="+p.getId()+",aid="+p.getAid());
|
|
|
str2.append(",管理员=").append(a.getName()).append(",邮箱不正确。");
|
|
|
n.setAid("1");
|
|
|
n.setContent(str2.toString());
|