New file |
| | |
| | | package cn.huge.module.grid.controller.web; |
| | | |
| | | import cn.huge.base.common.bo.R; |
| | | import cn.huge.base.common.utils.AesUtils; |
| | | 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.CasePersonDTO; |
| | | import cn.huge.module.grid.domain.dto.GridCompanyDTO; |
| | | import cn.huge.module.grid.domain.vo.GridCompanyVo; |
| | | import cn.huge.module.grid.service.GridCompanyService; |
| | | import cn.huge.module.mediate.constant.CaseBaseConstsEnum; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/web/grid/company") |
| | | public class GridCompanyWebController { |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Resource |
| | | private GridCompanyService gridCompanyService; |
| | | |
| | | /** |
| | | * 条件分页查询 |
| | | * @url {ctx}/api/web/grid/company/pageQuery |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/pageQuery") |
| | | public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { |
| | | try { |
| | | GridCompanyVo gridCompanyVo = new GridCompanyVo(); |
| | | String integratedQuery = request.getParameter("integratedQuery"); |
| | | gridCompanyVo.setIntegratedQuery(integratedQuery); |
| | | gridCompanyVo.setPage(page); |
| | | gridCompanyVo.setPageSize(size); |
| | | gridCompanyVo.setNeedCount(true); |
| | | List<CasePersonDTO> content = new ArrayList<>(); |
| | | Page<GridCompanyDTO.UnitDTO> unitDTOPage = gridCompanyService.pageQuery(gridCompanyVo); |
| | | for (GridCompanyDTO.UnitDTO unitDTO: unitDTOPage){ |
| | | CasePersonDTO casePersonDTO = new CasePersonDTO(); |
| | | casePersonDTO.setCompanyId(unitDTO.getId()); |
| | | casePersonDTO.setTrueName(unitDTO.getName()); |
| | | casePersonDTO.setOrgaCode(unitDTO.getSocialCreditCode()); |
| | | casePersonDTO.setAddr(unitDTO.getBusinessRegAddress()); |
| | | casePersonDTO.setDeputy(unitDTO.getLegalRepresent()); |
| | | casePersonDTO.setMobile(unitDTO.getLegalPersonTelephone()); |
| | | content.add(casePersonDTO); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(new PageImpl<>(content, unitDTOPage.getPageable(), unitDTOPage.getTotalElements())); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[GridCompanyController.pageQuery]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | } |