You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

115 lines
4.7 KiB

/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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<EpidemicPreventionResultDTO>>}
* @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<PageData<EpidemicPreventionResultDTO>> search(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.epidemicPreventionList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().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<PageData<EpidemicPreventionResultDTO>> userList(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
PageData<EpidemicPreventionResultDTO> result = icResiUserService.userList(formDTO);
return new Result<PageData<EpidemicPreventionResultDTO>>().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<EpidemicPreventionResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionResultDTO result = icResiUserService.getEpidemicPreventionDetail(formDTO);
return new Result<EpidemicPreventionResultDTO>().ok(result);
}
/**
* 居民防疫信息-点击查看
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("info")
public Result<EpidemicPreventionInfoDTO> info(@LoginUser TokenDto tokenDto, @RequestBody EpidemicPreventionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
EpidemicPreventionInfoDTO result = icResiUserService.getEpidemicPreventionInfo(formDTO);
return new Result<EpidemicPreventionInfoDTO>().ok(result);
}
}