广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
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
package cn.huge.module.grid.controller.wechat;
 
import cn.huge.base.common.bo.R;
import cn.huge.base.common.utils.ObjectUtils;
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.module.grid.domain.dto.GridCompanyDTO;
import cn.huge.module.grid.domain.vo.GridCompanyVo;
import cn.huge.module.grid.service.GridCompanyService;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
 
@Slf4j
@RestController
@RequestMapping("/api/wechat/company")
public class GridCompanyWechatController {
    @Autowired(required = false)
    private HttpServletRequest request;
 
    @Resource
    private GridCompanyService gridCompanyService;
 
    @PostMapping("/get-company-list")
    public R<GridCompanyDTO> getCompanyList(@RequestBody GridCompanyVo gridCompanyVo) throws Exception {
        return gridCompanyService.getCompanyList(gridCompanyVo);
    }
 
    /**
     * 条件分页查询
     * @url {ctx}/api/wechat/company/pageQuery
     * @param page 页码
     * @param size 每页数量
     * @return Object
     */
    @GetMapping("/pageQuery")
    public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) {
        try {
            Map<String, Object> terms = Maps.newHashMap();
            GridCompanyVo gridCompanyVo = new GridCompanyVo();
            String integratedQuery = request.getParameter("integratedQuery");
            gridCompanyVo.setIntegratedQuery(integratedQuery);
            String state = request.getParameter("state");
            if(ObjectUtils.isNotEmpty(state)){
                gridCompanyVo.setState(Integer.valueOf(state));
            }
            String gridCode = request.getParameter("gridCode");
            gridCompanyVo.setGridCode(gridCode);
            gridCompanyVo.setPage(page);
            gridCompanyVo.setPageSize(size);
            gridCompanyVo.setNeedCount(true);
            return ReturnSucUtils.getRepInfo( "处理成功", gridCompanyService.pageQuery(gridCompanyVo));
        } catch (Exception e) {
            log.error("Controller接口[GridCompanyController.pageQuery]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo();
        }
    }
}