Browse Source

项目任务指派给经理增加提醒营销员

anderx 7 years ago
parent
commit
58c7362f13

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

@@ -50,6 +50,8 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.BillListBo;
+import com.goafanti.order.bo.ServiceOrderDetailBo;
 import com.goafanti.order.enums.CommodityType;
 import com.goafanti.order.enums.ProjectStage;
 import com.goafanti.order.enums.PublicStatus;
@@ -439,14 +441,23 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 		contractTaskLogMapper.insert(c);*/
 		//contractTaskMapper.updateByPrimaryKeySelective(task);
 		Admin a=adminMapper.selectByPrimaryKey(task.getTaskReceiver());
+		Admin ad=null;
 		TaskDetailBo tb= contractTaskMapper.selectProjectTaskDetail(task.getId());
+		String mobile = null;
+		if (null!=tb&&tb.getOrderNo()!=null) {
+			ServiceOrderDetailBo t=tOrderMapper.selectServiceOrderDetail(tb.getOrderNo());
+			if (null!=t&&t.getSalesmanId()!=null) {
+				ad=adminMapper.selectByPrimaryKey(t.getSalesmanId());
+				mobile=ad.getContactMobile();
+			}
+		}
 		String regex = "^(1[1-9][0-9])\\d{8}$";
 		 Pattern p = Pattern.compile(regex);
 		  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		if (null!=a&&null!=a.getContactMobile()) {
 			Matcher m = p.matcher(a.getContactMobile());
 			if ( m.matches()) {
-			String mobile=a.getContactMobile();
+			mobile=mobile+","+a.getContactMobile();
 			String paramString = "{\"number\":\"" + tb.getOrderNo() 
 			+ "\",\"operator\":\"" + TokenManager.getAdminToken().getName()
 			+ "\",\"time\":\"" +   sdf.format(new Date())
@@ -585,13 +596,23 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 			String regex = "^(1[1-9][0-9])\\d{8}$";
 			 Pattern p = Pattern.compile(regex);
 			 String mobile="";
+			 if (null!=t&&t.getOrderNo()!=null) {
+					TOrder tb=tOrderMapper.selectByPrimaryKey(t.getOrderNo());
+					if (null!=tb&&tb.getSalesmanId()!=null) {
+						Admin ad=adminMapper.selectByPrimaryKey(tb.getSalesmanId());
+						Matcher s1 = p.matcher(ad.getContactMobile() );
+						if(s1.matches()){
+							mobile=ad.getContactMobile();
+						}
+					}
+				}
 			if (null!=a.getContactMobile()) {
 				Matcher m = p.matcher(a.getContactMobile());
 			if ( m.matches()) {
-				mobile=a.getContactMobile();
-				sendMessage(t.getOrderNo(),mobile,OrderFlowState.RWPD.getDesc());
+				mobile=mobile+","+a.getContactMobile();
 				}
 			}
+			sendMessage(t.getOrderNo(),mobile,OrderFlowState.RWPD.getDesc());
 			return setTaskDistribution(task.getContractId());
 			
 		}