You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.6 KiB

package com.eco.plugin.wink.hrzdmsg.dsdd.dsdd;
import com.eco.plugin.wink.hrzdmsg.config.PluginSimpleConfig;
import com.eco.plugin.wink.hrzdmsg.controller.ControllerSelf;
import com.eco.plugin.wink.hrzdmsg.utils.FRUtils;
import com.fr.decision.authority.data.User;
import com.fr.json.JSONObject;
import com.fr.schedule.feature.output.OutputActionHandler;
import java.util.Map;
public class TsHandler extends OutputActionHandler<TsBean>{
@Override
public void doAction(TsBean tsBean, Map<String, Object> map){
//获取参数
String username = String.valueOf(map.get("username"));
User user = FRUtils.getFRUserByUserName(username);
String mobile = user.getMobile();
String businessCode = tsBean.getBusinessCode();
String content = tsBean.getContent();
String secretKey = tsBean.getSecretKey();
String source = tsBean.getSource();
String sourceNote = tsBean.getSourceNote();
//封装参数
JSONObject param = new JSONObject();
param.put("mobile",mobile);
param.put("businessCode",businessCode);
param.put("secretKey",secretKey);
param.put("source",source);
param.put("sourceNote",sourceNote);
JSONObject contentJson = new JSONObject();
String[] contents = content.split(",");
for(int i=0;i<contents.length;i++){
String[] contentEach = contents[i].split(":");
contentJson.put(contentEach[0],contentEach[1]);
}
param.put("content",contentJson);
//调用发送短信接口
ControllerSelf.sendMsg(param, PluginSimpleConfig.getInstance());
}
}