package thyyxxk.webserver.controller.technologyArchives;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.technologyArchives.*;
import thyyxxk.webserver.service.technologyArchives.TechnologyArchivesService;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @ClassName technologyArchivesController
 * @Author hsh
 * @Date 2024/7/4 15:33
 * @Version 1.0
 * @Description 技术档案管理
 **/
@RestController
@RequestMapping("/technologyArchives")
public class TechnologyArchivesController {

    private final TechnologyArchivesService service;

    @Autowired
    public TechnologyArchivesController(TechnologyArchivesService service) {
        this.service = service;
    }

    @GetMapping("/selectEmployeeInfo")
    public ResultVo<TechnologyArchivesMain> selectEmployeeInfo(@RequestParam("text") String text){
        return service.selectEmployeeInfo(text);
    }

    @GetMapping("/selectDictInfo")
    public ResultVo<Map<String, Object>> selectDictInfo(){
        return service.selectDictInfo();
    }

    @PostMapping("/saveTechnologyArchivesMain")
    public ResultVo<Map<String, Object>> saveTechnologyArchivesMain(@RequestBody @Validated TechnologyArchivesMain tam){
        return service.saveTechnologyArchivesMain(tam);
    }

    @GetMapping("/selectTechnologyArchives1")
    public ResultVo<List<TechnologyArchives1>> selectTechnologyArchives1(){
        return service.selectTechnologyArchives1();
    }

    @GetMapping("/selectImage1")
    public ResultVo<Map<String, Object>> selectImage1(@RequestParam("socialNo") String socialNo, @RequestParam("getTime") String getTime){
        return  service.selectImage1(socialNo, getTime);
    }

    @PostMapping("/saveTechnologyArchives1")
    public ResultVo<Map<String, Object>> saveTechnologyArchives1(@RequestBody @Validated TechnologyArchives1 first){
        return service.saveTechnologyArchives1(first);
    }

    //上传图片
    @PostMapping("/putCertificateImage")
    public ResultVo<Map<String, Object>> putCertificateImage(@RequestBody MultipartFile[] file, @RequestParam("title") String title) {
        return service.putCertificateImage(file, title);
    }
    @GetMapping("/setImage1")
    public ResultVo<Map<String, Object>> setImage1(@RequestParam("socialNo") String socialNo, @RequestParam("getTime") String getTime, String url) {
        return service.setImage1(socialNo, getTime, url);
    }
    @GetMapping("/delTechnologyArchives1ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives1ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("getTime") String getTime){
        return service.delTechnologyArchives1ByCode(socialNo, getTime);
    }

    @GetMapping("/selectTechnologyArchives2")
    public ResultVo<List<TechnologyArchives2>> selectTechnologyArchives2(){
        return service.selectTechnologyArchives2();
    }

    @PostMapping("/saveTechnologyArchives2")
    public ResultVo<Map<String, Object>> saveTechnologyArchives2(@RequestBody @Validated TechnologyArchives2 second){
        return service.saveTechnologyArchives2(second);
    }

    @GetMapping("/selectImage2")
    public ResultVo<Map<String, Object>> selectImage2(@RequestParam("socialNo") String socialNo, @RequestParam("no") Integer no){
        return  service.selectImage2(socialNo, no);
    }
    @PostMapping("/putProImage")
    public ResultVo<Map<String, Object>> putProImage(@RequestBody MultipartFile[] file, @RequestParam("name") String name) {
        return service.putProImage(file, name);
    }
    @GetMapping("/setImage2")
    public ResultVo<Map<String, Object>> setImage2(@RequestParam("socialNo") String socialNo,@RequestParam("no") Integer no, String url) {
        return service.setImage2(socialNo, no, url);
    }

    @GetMapping("/delTechnologyArchives2ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives2ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("no") Integer no){
        return service.delTechnologyArchives2ByCode(socialNo, no);
    }

    @GetMapping("/selectTechnologyArchives3")
    public ResultVo<List<TechnologyArchives3>> selectTechnologyArchives3(){
        return service.selectTechnologyArchives3();
    }

    @PostMapping("/saveTechnologyArchives3")
    public ResultVo<Map<String, Object>> saveTechnologyArchives3(@RequestBody @Validated TechnologyArchives3 third){
        return service.saveTechnologyArchives3(third);
    }

    @GetMapping("/delTechnologyArchives3ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives3ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives3ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives4")
    public ResultVo<List<TechnologyArchives4>> selectTechnologyArchives4(){
        return service.selectTechnologyArchives4();
    }

    //上传图片
    @GetMapping("/selectTrainingImage")
    public ResultVo<Map<String, Object>> selectTrainingImage(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return  service.selectTrainingImage(socialNo, id);
    }
    @PostMapping("/putTrainingCertificateImage")
    public ResultVo<Map<String, Object>> putTrainingCertificateImage(@RequestBody MultipartFile[] file, @RequestParam("learningContent") String learningContent) {
        return service.putTrainingCertificateImage(file, learningContent);
    }
    @GetMapping("/setTrainingImage")
    public ResultVo<Map<String, Object>> setTrainingImage(@RequestParam("socialNo") String socialNo, @RequestParam("beginTime") String beginTime, String url) {
        return service.setTrainingImage(socialNo, beginTime, url);
    }

    @PostMapping("/saveTechnologyArchives4")
    public ResultVo<Map<String, Object>> saveTechnologyArchives4(@RequestBody @Validated TechnologyArchives4 fourth){
        return service.saveTechnologyArchives4(fourth);
    }

    @GetMapping("/delTechnologyArchives4ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives4ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives4ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives5")
    public ResultVo<List<TechnologyArchives5>> selectTechnologyArchives5(){
        return service.selectTechnologyArchives5();
    }

    @PostMapping("/saveTechnologyArchives5")
    public ResultVo<Map<String, Object>> saveTechnologyArchives5(@RequestBody @Validated TechnologyArchives5 fifth){
        return service.saveTechnologyArchives5(fifth);
    }

    @GetMapping("/delTechnologyArchives5ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives5ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("time") String time){
        return service.delTechnologyArchives5ByCode(socialNo, time);
    }

    @GetMapping("/selectTechnologyArchives6")
    public ResultVo<List<TechnologyArchives6>> selectTechnologyArchives6(){
        return service.selectTechnologyArchives6();
    }

    @PostMapping("/saveTechnologyArchives6")
    public ResultVo<Map<String, Object>> saveTechnologyArchives6(@RequestBody @Validated TechnologyArchives6 sixth){
        return service.saveTechnologyArchives6(sixth);
    }

    @GetMapping("/delTechnologyArchives6ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives6ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives6ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives7")
    public ResultVo<List<TechnologyArchives7>> selectTechnologyArchives7(){
        return service.selectTechnologyArchives7();
    }

    @PostMapping("/saveTechnologyArchives7")
    public ResultVo<Map<String, Object>> saveTechnologyArchives7(@RequestBody @Validated TechnologyArchives7 seventh){
        return service.saveTechnologyArchives7(seventh);
    }

    @GetMapping("/delTechnologyArchives7ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives7ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives7ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives9")
    public ResultVo<List<TechnologyArchives9>> selectTechnologyArchives9(){
        return service.selectTechnologyArchives9();
    }

    //上传图片
    @GetMapping("/selectExamineImage")
    public ResultVo<Map<String, Object>> selectExamineImage(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return  service.selectExamineImage(socialNo, id);
    }
    @PostMapping("/putExamineCertificateImage")
    public ResultVo<Map<String, Object>> putExamineImage(@RequestBody MultipartFile[] file, @RequestParam("content") String content) {
        return service.putExamineImage(file, content);
    }
    @GetMapping("/setExamineImage")
    public ResultVo<Map<String, Object>> setExamineImage(@RequestParam("socialNo") String socialNo, @RequestParam("time") String time, String url) {
        return service.setExamineImage(socialNo, time, url);
    }

    @PostMapping("/saveTechnologyArchives9")
    public ResultVo<Map<String, Object>> saveTechnologyArchives9(@RequestBody @Validated TechnologyArchives9 ninth){
        return service.saveTechnologyArchives9(ninth);
    }

    @GetMapping("/delTechnologyArchives9ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives9ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives9ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives10")
    public ResultVo<List<TechnologyArchives10>> selectTechnologyArchives10(){
        return service.selectTechnologyArchives10();
    }

    @PostMapping("/saveTechnologyArchives10")
    public ResultVo<Map<String, Object>> saveTechnologyArchives10(@RequestBody @Validated TechnologyArchives10 tenth){
        return service.saveTechnologyArchives10(tenth);
    }

    @GetMapping("/delTechnologyArchives10ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives10ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives10ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives12")
    public ResultVo<List<TechnologyArchives12>> selectTechnologyArchives12(){
        return service.selectTechnologyArchives12();
    }

    @PostMapping("/saveTechnologyArchives12")
    public ResultVo<Map<String, Object>> saveTechnologyArchives12(@RequestBody @Validated TechnologyArchives12 twelfth){
        return service.saveTechnologyArchives12(twelfth);
    }

    @GetMapping("/delTechnologyArchives12ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives12ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives12ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives13")
    public ResultVo<List<TechnologyArchives13>> selectTechnologyArchives13(){
        return service.selectTechnologyArchives13();
    }

    @GetMapping("/selectAppointmentImage")
    public ResultVo<Map<String, Object>> selectAppointmentImage(@RequestParam("socialNo") String socialNo, @RequestParam("name") String name) {
        return service.selectAppointmentImage(socialNo, name);
    }
    @PostMapping("/putAppointmentImage")
    public ResultVo<Map<String, Object>> putAppointmentImage(@RequestBody MultipartFile[] file, @RequestParam("name") String name) {
        return service.putAppointmentImage(file, name);
    }
    @GetMapping("/setAppointmentImage")
    public ResultVo<Map<String, Object>> setAppointmentImage(@RequestParam("socialNo") String socialNo, @RequestParam("name") String name, String url) {
        return service.setAppointmentImage(socialNo, name, url);
    }

    @PostMapping("/saveTechnologyArchives13")
    public ResultVo<Map<String, Object>> saveTechnologyArchives13(@RequestBody @Validated TechnologyArchives13 thirteenth){
        return service.saveTechnologyArchives13(thirteenth);
    }

    @GetMapping("/delTechnologyArchives13ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives13ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives13ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives14")
    public ResultVo<List<TechnologyArchives14>> selectTechnologyArchives14(){
        return service.selectTechnologyArchives14();
    }

    @PostMapping("/saveTechnologyArchives14")
    public ResultVo<Map<String, Object>> saveTechnologyArchives14(@RequestBody @Validated TechnologyArchives14 fourteenth){
        return service.saveTechnologyArchives14(fourteenth);
    }

    @GetMapping("/delTechnologyArchives14ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives14ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives14ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives8")
    public ResultVo<List<TechnologyArchives8>> selectTechnologyArchives8(){
        return service.selectTechnologyArchives8();
    }

    @PostMapping("/saveTechnologyArchives8")
    public ResultVo<Map<String, Object>> saveTechnologyArchives8(@RequestBody @Validated TechnologyArchives8 eighth){
        return service.saveTechnologyArchives8(eighth);
    }

    @GetMapping("/delTechnologyArchives8ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives8ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives8ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives11")
    public ResultVo<List<TechnologyArchives11>> selectTechnologyArchives11(){
        return service.selectTechnologyArchives11();
    }

    @PostMapping("/saveTechnologyArchives11")
    public ResultVo<Map<String, Object>> saveTechnologyArchives11(@RequestBody @Validated TechnologyArchives11 eleventh){
        return service.saveTechnologyArchives11(eleventh);
    }

    @GetMapping("/delTechnologyArchives11ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives11ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives11ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives15")
    public ResultVo<List<TechnologyArchives15>> selectTechnologyArchives15(){
        return service.selectTechnologyArchives15();
    }

    @PostMapping("/saveTechnologyArchives15")
    public ResultVo<Map<String, Object>> saveTechnologyArchives15(@RequestBody @Validated TechnologyArchives15 fifteenth){
        return service.saveTechnologyArchives15(fifteenth);
    }

    @GetMapping("/delTechnologyArchives15ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives15ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives15ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchives16")
    public ResultVo<List<TechnologyArchives16>> selectTechnologyArchives16(){
        return service.selectTechnologyArchives16();
    }

    @PostMapping("/saveTechnologyArchives16")
    public ResultVo<Map<String, Object>> saveTechnologyArchives16(@RequestBody @Validated TechnologyArchives16 sixteenth){
        return service.saveTechnologyArchives16(sixteenth);
    }

    @GetMapping("/delTechnologyArchives16ByCode")
    public ResultVo<Map<String, Object>> delTechnologyArchives16ByCode(@RequestParam("socialNo") String socialNo, @RequestParam("id") Integer id){
        return service.delTechnologyArchives16ByCode(socialNo, id);
    }

    @GetMapping("/selectTechnologyArchivesType")
    public ResultVo<Map<String, Object>> selectTechnologyArchivesType(@RequestParam("type") String type){
        return service.selectTechnologyArchivesType(type);
    }

    @PostMapping("/selectTechnologyArchivesInfo")
    public ResultVo<Map<String, Object>> selectTechnologyArchivesInfo(@RequestBody @Validated TechnologyArchivesVo vo){
        return service.selectTechnologyArchivesInfo(vo);
    }

    @PostMapping("/exportTechnologyArchivesInfo")
    public ResultVo<Map<String, Object>> exportTechnologyArchivesInfo(HttpServletResponse response, @RequestBody @Validated TechnologyArchivesVo vo){
        return service.exportTechnologyArchivesInfo(response, vo);
    }

    @GetMapping("/selectTechnologyArchivesMainDict")
    public ResultVo<List<Map<String, Object>>> selectTechnologyArchivesMainDict(){
        return service.selectTechnologyArchivesMainDict();
    }

    @PostMapping("/exportMultiTechnologyArchives")
    public ResultVo<Map<String, Object>> exportMultiTechnologyArchives(HttpServletResponse response, @RequestBody @Validated TechnologyArchivesMultiVo vo){
        return service.exportMultiTechnologyArchives(response, vo);
    }

}
