|
|
@ -7,6 +7,9 @@ import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
|
|
|
import com.weaver.em.msg.api.rest.OaRest;
|
|
|
|
import com.weaver.em.msg.api.rest.OaRest;
|
|
|
|
import com.weaver.framework.remote.client.rest.RestClient;
|
|
|
|
import com.weaver.framework.remote.client.rest.RestClient;
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
|
|
|
|
import com.weaver.mc.api.async.AsyncSystemMessageRest;
|
|
|
|
|
|
|
|
import com.weaver.mc.api.entity.*;
|
|
|
|
|
|
|
|
import com.weaver.mc.api.rest.SystemMessageRest;
|
|
|
|
import com.weaver.seconddev.jcldoor.util.DatabaseUtils;
|
|
|
|
import com.weaver.seconddev.jcldoor.util.DatabaseUtils;
|
|
|
|
import com.weaver.seconddev.jcldoor.util.JucailinPortalUtils;
|
|
|
|
import com.weaver.seconddev.jcldoor.util.JucailinPortalUtils;
|
|
|
|
import com.weaver.teams.blog.domain.RemoteBlogInfoService;
|
|
|
|
import com.weaver.teams.blog.domain.RemoteBlogInfoService;
|
|
|
@ -69,6 +72,12 @@ public class HrmSelfHelpController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private JucailinPortalUtils jucailinPortalUtils;
|
|
|
|
private JucailinPortalUtils jucailinPortalUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private AsyncSystemMessageRest asyncSystemMessageRest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RpcReference
|
|
|
|
|
|
|
|
SystemMessageRest systemMessageRest;
|
|
|
|
|
|
|
|
|
|
|
|
public String tenant_key = "t7akvdnf84" ;
|
|
|
|
public String tenant_key = "t7akvdnf84" ;
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/testSapi10")
|
|
|
|
@GetMapping("/testSapi10")
|
|
|
@ -1184,5 +1193,65 @@ public class HrmSelfHelpController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/testSapi100")
|
|
|
|
|
|
|
|
@WeaPermission(publicPermission = true)
|
|
|
|
|
|
|
|
public WeaResult<Object> testSapi100(HttpServletRequest request){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<String,Object>();
|
|
|
|
|
|
|
|
dataMap.put("test","testSapi90");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
|
|
|
log.error("employee:"+employee.getEmployeeId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SendMessageEntity smg = null;
|
|
|
|
|
|
|
|
// WeaResult<Long> result =asyncSystemMessageRest.sendMsg(smg);
|
|
|
|
|
|
|
|
// log.info("{}",result);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResult<Long> data = sendBaseMsg("生日快乐",employee);
|
|
|
|
|
|
|
|
long data2 = data.getData();
|
|
|
|
|
|
|
|
int code = data.getCode();
|
|
|
|
|
|
|
|
String msg = data.getMsg();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataMap.put("data2",data2);
|
|
|
|
|
|
|
|
dataMap.put("code",code);
|
|
|
|
|
|
|
|
dataMap.put("msg",msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("testSapi10:"+e);
|
|
|
|
|
|
|
|
dataMap.put("count","-1");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return WeaResult.success(dataMap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SendMessageEntity getSmsMsg(String content, SimpleEmployee simpleEmployee) {
|
|
|
|
|
|
|
|
SendMessageEntity smg = new SendMessageEntity();
|
|
|
|
|
|
|
|
smg.setModule(MessageModule.SYSTEM_REMIND);
|
|
|
|
|
|
|
|
smg.setEvent(MessageEvent.NOTIFY);
|
|
|
|
|
|
|
|
smg.setSender(UserEntity.WORK_FLOW_ROBOT);
|
|
|
|
|
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
|
|
|
|
|
params.put("content", content);
|
|
|
|
|
|
|
|
smg.setDynamicParams(params);
|
|
|
|
|
|
|
|
smg.setReceivers(Collections.singletonList((new UserEntity()).setPhone(simpleEmployee.getTelephone()).setTenantKey(simpleEmployee.getTenantKey4Im()).setEmployeeId(simpleEmployee.getEmployeeId().longValue()).setEmail(simpleEmployee.getEmail()).setLanguage(6)));
|
|
|
|
|
|
|
|
Set<MessageChannelEnum> set = new HashSet<>();
|
|
|
|
|
|
|
|
set.add(MessageChannelEnum.SMS);
|
|
|
|
|
|
|
|
smg.setChannels(set);
|
|
|
|
|
|
|
|
return smg;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public WeaResult<Long> sendBaseMsg(String content, SimpleEmployee simpleEmployee) {
|
|
|
|
|
|
|
|
SendMessageEntity smg = getSmsMsg(content, simpleEmployee);
|
|
|
|
|
|
|
|
WeaResult<Long> result = systemMessageRest.sendMsg(smg);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|