|
|
@@ -97,6 +97,8 @@ public class PatentTask {
|
|
|
// 当前时间
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.setTime(new Date());
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ Date date=new Date();
|
|
|
// 提醒
|
|
|
Calendar ted = Calendar.getInstance();
|
|
|
// 先获取到目前多少天数,再计算出年限
|
|
|
@@ -110,7 +112,7 @@ public class PatentTask {
|
|
|
int count = (int) ((ted.getTimeInMillis() - now.getTimeInMillis()) / (1000 * 3600 * 24));
|
|
|
Notice n = new Notice();
|
|
|
n.setId(UUID.randomUUID().toString());
|
|
|
- n.setCreateTime(now.getTime());
|
|
|
+ n.setCreateTime(date);
|
|
|
n.setReaded(0);// 未读
|
|
|
n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
|
|
|
boolean flag=false;
|
|
|
@@ -156,7 +158,7 @@ public class PatentTask {
|
|
|
// 再发一条给当事人
|
|
|
Notice n2 = new Notice();
|
|
|
n2.setId(UUID.randomUUID().toString());
|
|
|
- n2.setCreateTime(now.getTime());
|
|
|
+ n2.setCreateTime(date);
|
|
|
n2.setReaded(0);// 未读
|
|
|
n2.setContent(str2.toString());
|
|
|
n2.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
|
|
|
@@ -184,7 +186,7 @@ public class PatentTask {
|
|
|
p.setYears(y);
|
|
|
patentNewService.updatePatenNew(p);
|
|
|
PatentNewLog pl = new PatentNewLog();
|
|
|
- String str = StrToString(title, p.getEmail().trim(), userName ,p.getName(),now,status);
|
|
|
+ String str = StrToString(title, p.getEmail().trim(), userName ,p.getName(),date,status);
|
|
|
pl.setContent(str);
|
|
|
pl.setCreateTime(new Date());
|
|
|
pl.setPid(p.getId());
|
|
|
@@ -230,7 +232,7 @@ public class PatentTask {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private String StrToString(String title, String email, String userName, String pname, Calendar now, Integer status) {
|
|
|
+ private String StrToString(String title, String email, String userName, String pname, Date date, Integer status) {
|
|
|
//状态 0 未提醒 1 剩余90天 2剩余30天 3剩余20天 4剩余10天 5剩余3天 6剩余2天 7剩余1天
|
|
|
Integer days=0;
|
|
|
StringBuffer sb=new StringBuffer().append(title).append("客户[").append(userName).append("]专利[")
|
|
|
@@ -245,7 +247,7 @@ public class PatentTask {
|
|
|
if(days>0) {
|
|
|
sb.append(",续费时间还剩").append(days).append("天");
|
|
|
}
|
|
|
- sb.append(",已于").append(DateUtils.formatDate(now.getTime(), AFTConstants.YYYYMMDDHHMMSS)).append("发送专利提醒至邮箱")
|
|
|
+ sb.append(",已于").append(DateUtils.formatDate(date, AFTConstants.YYYYMMDDHHMMSS)).append("发送专利提醒至邮箱")
|
|
|
.append(email).append("!");
|
|
|
|
|
|
|
|
|
@@ -327,11 +329,12 @@ public class PatentTask {
|
|
|
public static void main(String[] args) {
|
|
|
// 申请时间一月份是0。
|
|
|
Calendar sq = Calendar.getInstance();
|
|
|
- sq.set(2020, 4, 30);
|
|
|
+ sq.set(2020, 5, 01);
|
|
|
System.out.println(DateUtils.formatDate(sq.getTime(), AFTConstants.YYYYMMDD));
|
|
|
// 当前时间
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.setTime(new Date());
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
// 提醒
|
|
|
Calendar ted = Calendar.getInstance();
|
|
|
// 先获取到目前多少天数,再计算出年限
|