|
@@ -12,11 +12,14 @@ import com.ruoyi.common.constant.BaseSourceConstant;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@DS(BaseSourceConstant.KD100)
|
|
|
@TenantIgnore
|
|
@@ -35,9 +38,9 @@ public class CallbackConfig {
|
|
|
*/
|
|
|
@PostMapping("/callback")
|
|
|
@DSTransactional
|
|
|
- public synchronized JSONObject callback(@RequestBody String data) {
|
|
|
+ public synchronized void callback(@RequestParam Map<String, String> inputValue, HttpServletResponse response) throws IOException {
|
|
|
// 解析回调参数
|
|
|
- JSONObject result = KD100Util.parseCallbackData(data);
|
|
|
+ JSONObject result = KD100Util.parseCallbackData(inputValue.get("param"));
|
|
|
|
|
|
handleCallback(result);
|
|
|
|
|
@@ -45,7 +48,10 @@ public class CallbackConfig {
|
|
|
returnResult.put("result", true);
|
|
|
returnResult.put("returnCode", 200);
|
|
|
returnResult.put("message", "成功");
|
|
|
- return returnResult;
|
|
|
+
|
|
|
+ //直接返回结果
|
|
|
+ response.setContentType("application/json; charset=utf-8");
|
|
|
+ response.getWriter().print(returnResult.toJSONString());
|
|
|
}
|
|
|
|
|
|
private void handleCallback(JSONObject result) {
|
|
@@ -63,7 +69,7 @@ public class CallbackConfig {
|
|
|
if (logisticsInfoList.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
for (LogisticsInfo logisticsInfo : logisticsInfoList) {
|
|
|
logisticsInfo.setState(state);
|
|
|
applicationEventPublisher.publishEvent(new Kd100CallbackEvent(this, logisticsInfo));
|