New file |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |