zhitong.yu
2024-05-11 b72f8f8d58417eb6fb29672d8ac17cfafa46775c
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
package com.hxzk.controller;
 
import com.hxzk.deo.TbPersonAndDepartment;
import com.hxzk.pojo.TbPerson;
import com.hxzk.pojo.tb_realpositoin;
import com.hxzk.service.PersonService;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
 
@RestController
@RequestMapping("/")
public class SanWeiController {
    @Autowired
    PersonService personService;
 
    private Map<String, String[]> persons = new HashMap();
 
    @RequestMapping(value = {"/getRealPositionsan2.do"}, method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public List<TbPersonAndDepartment> getRealPositionsan2(HttpServletRequest request) {
        List<TbPersonAndDepartment> realLocationList = personService.findSanWeiOnline();
        return realLocationList;
    }
 
 
 
    @RequestMapping(value = {"/getRealPositionsan3.do"}, method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public List<TbPersonAndDepartment> getRealPositionsan3(HttpServletRequest request) {
        List<TbPersonAndDepartment> realLocationList = personService.findSanWeiOffOnline();
        return realLocationList;
    }
 
    public String gettime(){
        Date now = new Date();
        // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm"
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        // 格式化日期对象,输出字符串结果
        String formattedDate = sdf.format(now);
        return formattedDate;
    }
}