Browse Source

专利提醒发送邮件逻辑调整

anderx 4 years ago
parent
commit
144e6dbc11

+ 20 - 19
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -105,26 +105,8 @@ public class PatentTask {
 					status = 5;
 					s5.add(p.getId().toString());
 				}else if(count<0) {
+					flag=true;
 					s6.add(p.getId().toString());
-					if (p.getSalesmanRemind()==0){
-						Notice n = new Notice();
-						n.setId(UUID.randomUUID().toString());
-						n.setCreateTime(date);
-						n.setReaded(0);// 未读
-						n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
-						PatentNewLog pl = new PatentNewLog();
-						StringBuffer str =new StringBuffer();
-						str.append("专利编号[").append(p.getPatentNo()).append("],名称[").append(p.getName()).append("],email[")
-								.append(p.getEmail().trim()).append("]").append("已超过结束时间,但未做提醒,请悉知!!!");
-						pl.setContent(str.toString());
-						pl.setCreateTime(new Date());
-						pl.setPid(p.getId());
-						logList.add(pl);
-						n.setAid(p.getAid());
-						n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
-						n.setContent(str.toString());
-						nlist.add(n);
-					}
 				}
 				if (flag) {
 					Notice n = new Notice();
@@ -158,6 +140,25 @@ public class PatentTask {
 						nlist.add(n2);
 						continue;
 					} else {
+						if (p.getSalesmanRemind()==0){
+							Notice nt = new Notice();
+							nt.setId(UUID.randomUUID().toString());
+							nt.setCreateTime(date);
+							nt.setReaded(0);// 未读
+							nt.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
+							PatentNewLog pl = new PatentNewLog();
+							StringBuffer str =new StringBuffer();
+							str.append("专利编号[").append(p.getPatentNo()).append("],名称[").append(p.getName()).append("],email[")
+									.append(p.getEmail().trim()).append("]").append("已超过结束时间,但未做提醒,请悉知!!!");
+							pl.setContent(str.toString());
+							pl.setCreateTime(new Date());
+							pl.setPid(p.getId());
+							logList.add(pl);
+							n.setAid(p.getAid());
+							n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
+							n.setContent(str.toString());
+							nlist.add(n);
+						}
 						PatentNewLog pl = new PatentNewLog();
 						String str = StrToString(str2,p.getEndDate(),status);
 						pl.setContent(str);

+ 8 - 8
src/main/java/com/goafanti/common/utils/SendEmailUtil.java

@@ -149,13 +149,13 @@ public class SendEmailUtil {
 	
 	
 	
-	public static void main(String[] args) {
-		  EmailBo emailBo = new EmailBo( "专利提醒失败",  "312518615@qq.com",  "超管", "平台",  "系统", "专利提醒失败");
-				try {
-					SendEmailUtil.getInstance().send(emailBo);
-				} catch (UnsupportedEncodingException | MessagingException e) {
-					e.printStackTrace();
-				}
-	}
+//	public static void main(String[] args) {
+//		  EmailBo emailBo = new EmailBo( "专利提醒失败",  "312518615@qq.com",  "超管", "平台",  "系统", "专利提醒失败");
+//				try {
+//					SendEmailUtil.getInstance().send(emailBo);
+//				} catch (UnsupportedEncodingException | MessagingException e) {
+//					e.printStackTrace();
+//				}
+//	}
 	
 }

+ 0 - 1
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -990,7 +990,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			n.setNoticeType(NoticeStatus.ITEM_CHECK_START.getCode());
 			n.setContent(str);
 			n.setReaded(0);//未读
-
 			asyncUtils.addNoticAndEmail(n);
 		}
 		projcetCheckLogMapper.insertSelective(log);