|
|
@@ -1,7 +1,7 @@
|
|
|
package com.usoftchina.smartschool.device.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.usoftchina.smartschool.device.base.Result;
|
|
|
+import com.usoftchina.smartschool.base.Result;
|
|
|
import com.usoftchina.smartschool.device.dto.AccTransDetail;
|
|
|
import com.usoftchina.smartschool.device.mapper.IcCardMapper;
|
|
|
import com.usoftchina.smartschool.device.po.Transaction;
|
|
|
@@ -9,16 +9,13 @@ import com.usoftchina.smartschool.device.service.IcCardService;
|
|
|
import com.usoftchina.smartschool.school.dto.SysSchoolDTO;
|
|
|
import com.usoftchina.smartschool.utils.ObjectUtils;
|
|
|
import com.usoftchina.smartschool.utils.http.HmacUtils;
|
|
|
+import com.usoftchina.smartschool.wechat.api.WechatApi;
|
|
|
import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.util.LinkedMultiValueMap;
|
|
|
-import org.springframework.util.MultiValueMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
-import org.springframework.web.util.DefaultUriBuilderFactory;
|
|
|
|
|
|
import java.net.URI;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
@@ -39,6 +36,9 @@ public class IcCardServiceImpl implements IcCardService {
|
|
|
@Autowired
|
|
|
private IcCardMapper icCardMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private WechatApi wechatApi;
|
|
|
+
|
|
|
@Value("${smartschool.wechat.pushUrl}")
|
|
|
private String targetURL;
|
|
|
|
|
|
@@ -82,7 +82,12 @@ public class IcCardServiceImpl implements IcCardService {
|
|
|
messageInfoList.add(messageInfo);
|
|
|
});
|
|
|
//3.传输
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
+ Result result = wechatApi.sendOutMessages(JSON.toJSONString(messageInfoList));
|
|
|
+ if (result.isSuccess()) {
|
|
|
+ String ids = "'" + sb.substring(0, sb.length() - 1).replaceAll(",", "','") + "'";
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+ /*HttpHeaders headers = new HttpHeaders();
|
|
|
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
|
|
|
requestEntity.add("data", JSON.toJSONString(messageInfoList));
|
|
|
@@ -99,7 +104,7 @@ public class IcCardServiceImpl implements IcCardService {
|
|
|
String ids = "'" + sb.substring(0, sb.length() - 1).replaceAll(",", "','") + "'";
|
|
|
return ids;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
return null;
|
|
|
}
|