|
@@ -0,0 +1,38 @@
|
|
|
|
|
+package com.uas.platform.b2b.erp.listen.controller;
|
|
|
|
|
+
|
|
|
|
|
+import com.uas.platform.b2b.erp.listen.dao.ListenDao;
|
|
|
|
|
+import com.uas.platform.b2b.erp.listen.model.Listen;
|
|
|
|
|
+import com.uas.platform.b2b.erp.listen.service.ListenService;
|
|
|
|
|
+import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
|
|
+import java.net.URLDecoder;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @Author: huj
|
|
|
|
|
+ * @Date: Created in 16:04 2018/11/27.
|
|
|
|
|
+ */
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/erp/listen")
|
|
|
|
|
+public class ListenController {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ ListenService listenService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 更新erp轮询状态
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(method = RequestMethod.POST)
|
|
|
|
|
+ public void save(@RequestParam("data") String data) throws UnsupportedEncodingException {
|
|
|
|
|
+ String jsonStr = URLDecoder.decode(data, "UTF-8");
|
|
|
|
|
+ List<Listen> listens = FlexJsonUtils.fromJsonArray(jsonStr, Listen.class);
|
|
|
|
|
+ listenService.save(listens);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|