|
@@ -19,9 +19,7 @@ import org.springframework.dao.EmptyResultDataAccessException;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
@@ -62,6 +60,22 @@ public class ShowDataController {
|
|
|
// StoreApi service = new StoreBindProxy();
|
|
|
// StoreClient storeClient = new StoreClient(service);
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "get sn")
|
|
|
+ @GetMapping("getSn/{fid}/{sid}")
|
|
|
+ public Map<String, Object> getSnForId(@PathVariable String fid, @PathVariable String sid) throws IOException {
|
|
|
+ String sql = "select qrcode from py_battery where f_id=" + fid + " and s_id=" + sid;
|
|
|
+ List<Map<String, Object>> snData = moyuJdbcTemplate.queryForList(sql);
|
|
|
+ List<String> snList = new ArrayList();
|
|
|
+ snData.forEach(p -> snList.add(p.get("qrcode").toString()));
|
|
|
+ String snString = "\'" + String.join("\',\'", snList) + "\'";
|
|
|
+ Map res = new HashMap<String, String>();
|
|
|
+ res.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+ res.put("snString", snString);
|
|
|
+ res.put("snList", snList);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "获取美团sn")
|
|
|
@RequestMapping(value = "/getSn", method = RequestMethod.GET)
|
|
|
public Map<String, Object> getSn() throws IOException {
|