|
|
@@ -23,6 +23,7 @@ import com.java110.job.msgNotify.IMsgNotify;
|
|
|
import com.java110.utils.cache.MappingCache;
|
|
|
import com.java110.utils.util.Assert;
|
|
|
import com.java110.utils.util.DateUtil;
|
|
|
+import com.java110.utils.util.ListUtil;
|
|
|
import com.java110.utils.util.StringUtil;
|
|
|
import com.java110.vo.ResultVo;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -449,7 +450,7 @@ public class AliMsgNotifyImpl implements IMsgNotify {
|
|
|
UserDto userDto = new UserDto();
|
|
|
userDto.setUserId(userId);
|
|
|
List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
|
|
|
- if (userDtos == null || userDtos.size() < 1) {
|
|
|
+ if (ListUtil.isNull(userDtos)) {
|
|
|
throw new IllegalArgumentException("员工不存在");
|
|
|
}
|
|
|
|
|
|
@@ -475,6 +476,72 @@ public class AliMsgNotifyImpl implements IMsgNotify {
|
|
|
request.putQueryParameter("TemplateCode", templateCode);
|
|
|
|
|
|
|
|
|
+ JSONObject param = new JSONObject();
|
|
|
+ param.put("orderId", content.getString("orderId"));
|
|
|
+ request.putQueryParameter("TemplateParam", param.toString());
|
|
|
+
|
|
|
+ String resParam = "";
|
|
|
+ try {
|
|
|
+ CommonResponse response = client.getCommonResponse(request);
|
|
|
+ logger.debug("发送验证码信息:{}", response.getData());
|
|
|
+ resParam = response.getData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ resParam = e.getMessage();
|
|
|
+ throw new IllegalArgumentException("短信工单失败" + e.getMessage());
|
|
|
+ } finally {
|
|
|
+ LogFactory.saveOutLog("SMS", param.toString(), new ResponseEntity(resParam, HttpStatus.OK));
|
|
|
+ }
|
|
|
+ return new ResultVo(ResultVo.CODE_OK, "成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 投诉通知员工
|
|
|
+ *
|
|
|
+ * @param communityId 小区
|
|
|
+ * @param userId 用户
|
|
|
+ * @param content {
|
|
|
+ * complainName,
|
|
|
+ * orderId
|
|
|
+ * }
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultVo sendComplaintMsg(String communityId, String userId, JSONObject content) {
|
|
|
+ if (StringUtil.isEmpty(userId) || userId.startsWith("-")) {
|
|
|
+ throw new IllegalArgumentException("员工不存在,userId = " + userId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ UserDto userDto = new UserDto();
|
|
|
+ userDto.setUserId(userId);
|
|
|
+ List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto);
|
|
|
+ if (ListUtil.isNull(userDtos)) {
|
|
|
+ throw new IllegalArgumentException("员工不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ String accessKeyId = CommunitySettingFactory.getValue(communityId, "ALI_ACCESS_KEY_ID");
|
|
|
+ String accessSecret = CommunitySettingFactory.getValue(communityId, "ALI_ACCESS_SECRET");
|
|
|
+ String region = CommunitySettingFactory.getValue(communityId, "ALI_REGION");
|
|
|
+ String signName = CommunitySettingFactory.getValue(communityId, "ALI_SIGN_NAME");
|
|
|
+ String templateCode = CommunitySettingFactory.getValue(communityId, "ALI_COMPLAINT_TEMPLATE_CODE");
|
|
|
+ DefaultProfile profile = DefaultProfile.getProfile(region,
|
|
|
+ accessKeyId,
|
|
|
+ accessSecret);
|
|
|
+ IAcsClient client = new DefaultAcsClient(profile);
|
|
|
+
|
|
|
+ CommonRequest request = new CommonRequest();
|
|
|
+ request.setSysMethod(MethodType.POST);
|
|
|
+ request.setSysDomain("dysmsapi.aliyuncs.com");
|
|
|
+ request.setSysVersion("2017-05-25");
|
|
|
+ request.setSysAction("SendSms");
|
|
|
+ request.putQueryParameter("RegionId", region);
|
|
|
+ request.putQueryParameter("PhoneNumbers", userDtos.get(0).getTel());
|
|
|
+ request.putQueryParameter("SignName", signName);
|
|
|
+ request.putQueryParameter("TemplateCode", templateCode);
|
|
|
+
|
|
|
+
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("orderId", content.getString("orderId"));
|
|
|
request.putQueryParameter("TemplateParam", param.toString());
|