package com.chinaweal.aiccs.crgs.movein.controller;


import com.chinaweal.aiccs.common.base.controller.BaseController;
import com.chinaweal.aiccs.crgs.movein.service.TbZcEntityMoveinService;
import com.chinaweal.aicorg.model.AICUser;
import com.chinaweal.youfool.framework.springboot.mybatis.plus.page.PageRequestDto;
import com.chinaweal.youfool.framework.springboot.rest.RestResult;
import org.springframework.beans.factory.annotation.Autowired;
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.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021-10-19
 */
@RestController
@RequestMapping("/ent/move")
public class TbZcEntityMoveinController extends BaseController {

    @Autowired
    private TbZcEntityMoveinService tbZcEntityMoveinService;

    /**
     * 查询迁入企业
     * @param pageRequestDto    分页参数
     * @return  分页结果
     * @author lroyia
     * @since  2021年10月19日 14:37:50
     */
    @PostMapping("in/search")
    public RestResult<?> moveInSearch(@RequestBody PageRequestDto pageRequestDto, HttpServletRequest request){
        AICUser loginUser = getLoginUser(request);
//        loginUser.
        return RestResult.ok(tbZcEntityMoveinService.searchPageWithBaseInfo(loginUser, pageRequestDto));
    }

    @PostMapping("in/queryDetails")
    public RestResult<?> queryDetails(String pripid,String miid){
        return RestResult.ok(tbZcEntityMoveinService.queryDetails(pripid,miid));
    }

    /**
     * 查询行政处罚信息
     * @param caseid
     * @return
     */
    @PostMapping("queryCaseInfo")
    public RestResult<?> queryCaseInfo(String caseid){
        return RestResult.ok(tbZcEntityMoveinService.queryCaseInfo(caseid));
    }

    /**
     * 查询年报信息
     * @param ancheid
     * @return
     */
    @PostMapping("queryAnInfo")
    public RestResult<?> queryAnInfo(String ancheid){
        return RestResult.ok(tbZcEntityMoveinService.queryAnInfo(ancheid));
    }
}

