|
@@ -12,7 +12,6 @@ import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import com.uas.message.mail.service.MailService;
|
|
import com.uas.message.mail.service.MailService;
|
|
|
-import com.uas.message.sms.service.SmsService;
|
|
|
|
|
import com.uas.platform.b2b.dao.EnterpriseDao;
|
|
import com.uas.platform.b2b.dao.EnterpriseDao;
|
|
|
import com.uas.platform.b2b.dao.InvitationRecordDao;
|
|
import com.uas.platform.b2b.dao.InvitationRecordDao;
|
|
|
import com.uas.platform.b2b.model.Enterprise;
|
|
import com.uas.platform.b2b.model.Enterprise;
|
|
@@ -21,7 +20,10 @@ import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.InvitationRecordService;
|
|
import com.uas.platform.b2b.service.InvitationRecordService;
|
|
|
import com.uas.platform.b2b.support.MessageConf;
|
|
import com.uas.platform.b2b.support.MessageConf;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
|
|
+import com.uas.platform.b2b.temporary.model.SmsMessage;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
import com.uas.platform.core.model.Constant;
|
|
|
|
|
+import com.uas.platform.core.util.HttpUtil;
|
|
|
|
|
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
import com.uas.search.b2b.model.PageParams;
|
|
import com.uas.search.b2b.model.PageParams;
|
|
|
import com.uas.search.b2b.model.SPage;
|
|
import com.uas.search.b2b.model.SPage;
|
|
|
|
|
|
|
@@ -37,15 +39,17 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MessageConf messageConf;
|
|
private MessageConf messageConf;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private SmsService smsService;
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SearchService searchService;
|
|
private SearchService searchService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private EnterpriseDao enterpriseDao;
|
|
private EnterpriseDao enterpriseDao;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 短信接口
|
|
|
|
|
+ */
|
|
|
|
|
+ final String messageUrl = "http://message.ubtob.com/sms/send";
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public ModelMap invite(InvitationRecord record) {
|
|
public ModelMap invite(InvitationRecord record) {
|
|
|
ModelMap map = new ModelMap();
|
|
ModelMap map = new ModelMap();
|
|
@@ -95,10 +99,16 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
|
|
|
}
|
|
}
|
|
|
if(oldrecord.getVendusertel()!=null){
|
|
if(oldrecord.getVendusertel()!=null){
|
|
|
try {
|
|
try {
|
|
|
- smsService.send(messageConf.getMsgInvitationForB2B(), record.getVendusertel(),
|
|
|
|
|
- new Object[] { record.getVendusername(), record.getVendname(),
|
|
|
|
|
- SystemSession.getUser().getUserName() + "("
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName() + ")" });
|
|
|
|
|
|
|
+ SmsMessage sms = new SmsMessage();
|
|
|
|
|
+ List<Object> obj = new ArrayList<Object>();
|
|
|
|
|
+ obj.add(record.getVendusername());
|
|
|
|
|
+ obj.add(record.getVendname());
|
|
|
|
|
+ obj.add(SystemSession.getUser().getUserName() + "("
|
|
|
|
|
+ + SystemSession.getUser().getEnterprise().getEnName() + ")");
|
|
|
|
|
+ sms.setParams(obj);
|
|
|
|
|
+ sms.setReceiver(record.getVendusertel());
|
|
|
|
|
+ sms.setTemplateId(messageConf.getMsgInvitationForB2B());
|
|
|
|
|
+ HttpUtil.sendPost(messageUrl, FlexJsonUtils.toJsonDeep(sms));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -115,10 +125,16 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
|
|
|
}
|
|
}
|
|
|
if (record.getVendusertel() != null) {
|
|
if (record.getVendusertel() != null) {
|
|
|
try {
|
|
try {
|
|
|
- smsService.send(messageConf.getMsgInvitationForB2B(), record.getVendusertel(),
|
|
|
|
|
- new Object[] { record.getVendusername(), record.getVendname(),
|
|
|
|
|
- SystemSession.getUser().getUserName() + "("
|
|
|
|
|
- + SystemSession.getUser().getEnterprise().getEnName() + ")" });
|
|
|
|
|
|
|
+ SmsMessage sms = new SmsMessage();
|
|
|
|
|
+ List<Object> obj = new ArrayList<Object>();
|
|
|
|
|
+ obj.add(record.getVendusername());
|
|
|
|
|
+ obj.add(record.getVendname());
|
|
|
|
|
+ obj.add(SystemSession.getUser().getUserName() + "("
|
|
|
|
|
+ + SystemSession.getUser().getEnterprise().getEnName() + ")");
|
|
|
|
|
+ sms.setParams(obj);
|
|
|
|
|
+ sms.setReceiver(record.getVendusertel());
|
|
|
|
|
+ sms.setTemplateId(messageConf.getMsgInvitationForB2B());
|
|
|
|
|
+ HttpUtil.sendPost(messageUrl, FlexJsonUtils.toJsonDeep(sms));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -178,5 +194,4 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
|
|
|
public List<Enterprise> findByName(String name) {
|
|
public List<Enterprise> findByName(String name) {
|
|
|
return enterpriseDao.findByEnName(name);
|
|
return enterpriseDao.findByEnName(name);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|