Browse Source

短信提醒BUG修复(null处理)

anderx 7 years ago
parent
commit
e2a5d416c6

+ 8 - 3
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -452,9 +452,11 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 			System.out.println(t.getSalesmanId());
 			if (null!=t&&t.getSalesmanId()!=null) {
 				ad=adminMapper.selectByPrimaryKey(t.getSalesmanId());
+				if(null!=ad&&null!=ad.getContactMobile()){
 				Matcher s1 = p.matcher(ad.getContactMobile());
 				if (s1.matches()) {
 					mobile=ad.getContactMobile();
+					}
 				}
 			}
 		}
@@ -604,16 +606,18 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 					TOrder tb=tOrderMapper.selectByPrimaryKey(t.getOrderNo());
 					if (null!=tb&&tb.getSalesmanId()!=null) {
 						Admin ad=adminMapper.selectByPrimaryKey(tb.getSalesmanId());
+					if (null!=ad&&null!=ad.getContactMobile()){	
 						Matcher s1 = p.matcher(ad.getContactMobile() );
 						if(s1.matches()){
-							mobile=ad.getContactMobile();
+							 mobile=ad.getContactMobile();
 						}
 					}
 				}
-			if (null!=a.getContactMobile()) {
+			}
+			if (null!=a&&null!=a.getContactMobile()) {
 				Matcher m = p.matcher(a.getContactMobile());
 			if ( m.matches()) {
-				mobile=mobile+","+a.getContactMobile();
+				 mobile=mobile+","+a.getContactMobile();
 				}
 			}
 			sendMessage(t.getOrderNo(),mobile,OrderFlowState.RWPD.getDesc());
@@ -689,4 +693,5 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		params.put("taskReceiver", TokenManager.getAdminId()); 
 		return (Pagination<TaskListBo>)findPage("selectProjectTaskByPage", "selectProjectTaskCount", params, pageNo, pageSize);
 	}
+	
 }