CompanyDictController.java 3.36 KB
package com.laowu.controller;


import com.laowu.dto.company.AddCompanyDTO;
import com.laowu.dto.company.CompanyDTO;
import com.laowu.dto.company.DeleteCompanyDTO;
import com.laowu.dto.company.StationCompanyDTO;
import com.laowu.model.CompanyDictDO;
import com.laowu.model.WorkstationDictDO;
import com.laowu.service.CompanyDictService;
import com.laowu.util.ResponseData;
import com.laowu.util.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

/**
 * <p>
 * 企业管理表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2023-02-16
 */
@RestController
@Api(tags = "企业管理表")
@RequestMapping("/companyDict")
public class CompanyDictController {

    @Autowired
    private CompanyDictService companyDictService;

    @PostMapping("/company")
    @ApiOperation("获取所有企业 pageSize pageNum province city  county  companyName")
    public ResponseVO company(@RequestBody CompanyDTO companyDTO){
        return ResponseData.generateCreatedResponse(0,companyDictService.company(companyDTO));
    }

    @PostMapping("deleteCompany")
    @ApiOperation("删除某个企业  userId  module id")
    public ResponseVO deleteCompany(@RequestBody DeleteCompanyDTO deleteCompanyDTO){
        return ResponseData.generateCreatedResponse(0,companyDictService.deleteCompany(deleteCompanyDTO));
    }

    @PostMapping("addCompany")
    @ApiOperation("添加企业   userId  module 模块 companyName companyLogo  province city  county  positionId  companyCode account companyDesc companyOrigin companyPhotoDOS[ photo] companyLabelDOS[ label] 关联业务 stationId")
    public ResponseVO addCompany(@RequestBody AddCompanyDTO addCompanyDTO){
        return ResponseData.generateCreatedResponse(0,companyDictService.addCompany(addCompanyDTO));
    }

    @PostMapping("updateCompany")
    @ApiOperation("更新企业 userId  module id  companyName companyLogo  province city  county  positionId  companyCode account companyDesc companyOrigin companyPhotoDOS[ photo]  companyLabelDOS[ label] 关联业务 stationId")
    public ResponseVO updateCompany(@RequestBody AddCompanyDTO addCompanyDTO){
        return ResponseData.generateCreatedResponse(0,companyDictService.updateCompany(addCompanyDTO));
    }

    @PostMapping("oneCompany")
    @ApiOperation("查询一个企业 id")
    public ResponseVO oneCompany(@RequestBody CompanyDictDO companyDictDO){
        return ResponseData.generateCreatedResponse(0,companyDictService.oneCompany(companyDictDO));
    }

    @PostMapping("totalCount")
    @ApiOperation("查看某个省某个工作站的企业数  id  工作站id")
    public ResponseVO totalCount(@RequestBody WorkstationDictDO workstationDictDO){
        return ResponseData.generateCreatedResponse(0,companyDictService.totalCount(workstationDictDO));
    }

    @PostMapping("stationCompany")
    @ApiOperation("查看工作站下的企业  id 工作站id")
    public ResponseVO stationCompany(@RequestBody StationCompanyDTO stationCompanyDTO){
        return ResponseData.generateCreatedResponse(0,companyDictService.stationCompany(stationCompanyDTO));
    }

}