jiazx0107@163.com
2024-01-15 814b453961763bf1b60af85f9f3bdc4682659ae8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package com.fzzy.web;
 
import com.alibaba.fastjson2.JSONObject;
import com.bstek.dorado.util.DateUtils;
import com.fzzy.api.data.ApiParam;
import com.fzzy.async.fzzy30.Fzzy30SyncService12;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
 
/**
 * @author vince.xu
 * @Title: TestController
 * @ProjectName igds-api
 * @Description: TODO
 * @date 2022-9-2512:50
 */
@Slf4j
@Controller
@RequestMapping
public class TestController {
    @Autowired
    private Fzzy30SyncService12 fzzySyncService12;
 
    /**
     *
     */
    @RequestMapping(value = "test", method = RequestMethod.GET)
    public String test(@RequestParam(name = "kqdm") String kqdm, @RequestParam(name = "deptId") String deptId, @RequestParam(name = "start") String start, @RequestParam(name = "end") String end) {
        try {
            ApiParam apiParam = new ApiParam();
            apiParam.setKqdm(kqdm);
            apiParam.setDeptId(deptId);
            apiParam.setStart(DateUtils.parse("yyyy-MM-dd HH:mm:ss", start));
            apiParam.setEnd(DateUtils.parse("yyyy-MM-dd HH:mm:ss", end));
            fzzySyncService12.syncData(apiParam);
 
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            e.printStackTrace();
        }
        return "";
    }
 
 
    /**
     * 测试读取身份证
     *
     * @return
     */
    @RequestMapping("/test/IDCARD")
    public @ResponseBody
    JSONObject testIdCard(@RequestParam(value = "callback", required = false) String callback,
                          @RequestParam(value = "waitTime", required = false) int waitTime) {
 
        log.debug("============testIdCard==========={}", callback);
 
 
        JSONObject json = new JSONObject();
        json.put("cnName", "风正致远");
        json.put("idNum", "100000000000000001");
        json.put("address", "郑州市高新区国家大学科技园1号楼502");
 
        //   return "fnCallback" + "(" + json.toJSONString() + ")";
 
        return json;
    }
 
 
    /**
     * 测试读取身份证
     * JSONP测试
     *
     * @return
     */
    @RequestMapping("/test/IDCARD2")
    public @ResponseBody
    String testIdCard2(@RequestParam(value = "callback") String callback) {
 
        log.debug("============testIdCard==========={}", callback);
 
 
        JSONObject json = new JSONObject();
 
        JSONObject result = new JSONObject();
        result.put("idCardName", "TEST");
        result.put("idCardNo", "100000000000000001");
        result.put("idCardAddress", "郑州市高新区国家大学科技园1号楼502");
        json.put("properties", result);
 
 
        json.put("message", "成功");
        json.put("status", 0);
        json.put("code", 200);
        json.put("timestamp", System.currentTimeMillis());
 
        return callback + "(" + json + ")";
 
    }
 
 
    @RequestMapping("/test/http")
    public ModelAndView testHttp() {
        ModelAndView view = new ModelAndView();
        view.setViewName("test/demo");
        return view;
    }
 
}