package com.mosty.hczx.controller;

import com.mosty.base.model.dto.hczx.TbHcBpcryInsertDto;
import com.mosty.base.model.dto.hczx.TbHcSydjQueryDto;
import com.mosty.base.model.dto.hczx.TbHcSydjSaveDto;
import com.mosty.base.model.entity.hczx.TbHcSydj;
import com.mosty.base.model.vo.hczx.TbHcSydjVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.hczx.service.TbHcBpcryService;
import com.mosty.hczx.service.TbHcSydjServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Api(tags = "核查中心-涉疫登记接口")
@RestController
@AllArgsConstructor
@RequestMapping("/tbHcRytzbq")
public class TbHcSydjController {

    private final TbHcSydjServer tbHcSydjServer;

    @ApiOperation("保存或者修改涉疫登记信息")
    @PostMapping("/sydjSaveOrEdit")
    @Log(title = "保存或者修改涉疫登记信息", businessType = BusinessType.INSERT)
    @JwtSysUser
    public ResponseResult<Void> sydjSaveOrEdit(@RequestBody TbHcSydjSaveDto dto) {
        this.tbHcSydjServer.sydjSaveOrEdit(dto);
        return ResponseResult.success();
    }

    @ApiOperation("修改涉疫登记信息")
    @PostMapping("/editSydj")
    @Log(title = "修改涉疫登记信息", businessType = BusinessType.INSERT)
    @JwtSysUser
    public ResponseResult<Void> editSydj(@RequestBody TbHcSydjSaveDto dto) {
        this.tbHcSydjServer.editSydj(dto);
        return ResponseResult.success();
    }


    @ApiOperation("根据身份证号码和盘查Id查询人员涉疫登记信息")
    @PostMapping("/getRySydjInfo")
    @Log(title = "根据身份证号码和盘查Id查询人员涉疫登记信息", businessType = BusinessType.OTHER)
    @JwtSysUser
    public ResponseResult<TbHcSydjVo> getRySydjInfo(@RequestBody TbHcSydjQueryDto dto) {
        return ResponseResult.success(this.tbHcSydjServer.getRySydjInfo(dto));
    }






}
