/** * Copyright 2018 人人开源 https://www.renren.io *

* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. *

* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *

* You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.EpidemicPreventionFormDTO; import com.epmet.dto.result.EpidemicPreventionInfoDTO; import com.epmet.dto.result.EpidemicPreventionResultDTO; import com.epmet.service.IcResiUserService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * 用户基础信息 * * @author generator generator@elink-cn.com * @since v1.0.0 2021-10-26 */ @Slf4j @RestController @RequestMapping("epidemicPrevention") public class IcEpidemicPreventionController{ @Resource private IcResiUserService icResiUserService; /** * 居民防疫信息查询 * @Param tokenDto * @Param formDTO * @Return {@link Result< PageData>} * @Author zhaoqifeng * @Date 2022/3/29 14:25 */ @PostMapping("page") @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) public Result> search(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); PageData result = icResiUserService.epidemicPreventionList(formDTO); return new Result>().ok(result); } @PostMapping("epidemicPreventionExport") public void epidemicPreventionExport(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); icResiUserService.epidemicPreventionExport(formDTO,response); } @PostMapping("user-list") public Result> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); PageData result = icResiUserService.userList(formDTO); return new Result>().ok(result); } /** * 居民防疫信息详情 * @Param formDTO * @Return {@link Result< EpidemicPreventionResultDTO>} * @Author zhaoqifeng * @Date 2022/3/29 16:13 */ @MaskResponse(fieldNames = { "showMobile", "showIdCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) @PostMapping("detail") public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO); return new Result().ok(result); } /** * 居民防疫信息-点击查看 * @param tokenDto * @param formDTO * @return */ @PostMapping("info") public Result info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO); return new Result().ok(result); } }