LaborServiceDictController.java 4.1 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.labor.AbnormalRecordDTO;
import com.subsidy.dto.labor.AddProjectDTO;
import com.subsidy.dto.labor.ProjectManageDTO;
import com.subsidy.dto.labor.ProjectsDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.ProjectDO;
import com.subsidy.model.ProjectMemberMappingDO;
import com.subsidy.service.LaborServiceDictService;
import com.subsidy.vo.labor.ProjectManageVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
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 io.swagger.annotations.Api;

/**
 * <p>
 * 劳务公司字典表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-07-18
 */
@RestController
@Api(tags = "劳务公司字典表")
@RequestMapping("/laborServiceDict")
public class LaborServiceDictController {

    @Autowired
    private LaborServiceDictService laborServiceDictService;

    @PostMapping("login")
    @ApiOperation("登录 accountName  password ")
    public ResponseVO login(@RequestBody AdministerDO administerDO){
        return ResponseData.generateCreatedResponse(0,laborServiceDictService.login(administerDO));
    }

    @PostMapping("projects")
    @ApiOperation("项目列表  userId 当前用户id  projectName pageSize pageNum")
    public ResponseVO projects(@RequestBody ProjectsDTO projectsDTO){
        return ResponseData.generateCreatedResponse(0,laborServiceDictService.projects(projectsDTO));
    }

    @PostMapping("addProject")
    @ApiOperation("添加项目 userId projectName companyId laborServiceId salaryDate startDate endDate")
    public ResponseVO addProject(@RequestBody AddProjectDTO addProjectDTO){
        laborServiceDictService.addProject(addProjectDTO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("updateProject")
    @ApiOperation("修改项目  id userId projectName companyId laborServiceId salaryDate startDate endDate")
    public ResponseVO updateProject(@RequestBody AddProjectDTO addProjectDTO){
        laborServiceDictService.updateProject(addProjectDTO);
        return ResponseData.generateCreatedResponse(0);
    }


    @PostMapping("deleteProject")
    @ApiOperation("删除项目  id  userId")
    public ResponseVO deleteProject(@RequestBody AddProjectDTO addProjectDTO){
        laborServiceDictService.deleteProject(addProjectDTO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("projectManage")
    @ApiOperation("详情--项目管理   projectId 项目id  userInfo 姓名或手机号")
    public ResponseVO projectManage(@RequestBody ProjectManageDTO projectManageDTO){
        return ResponseData.generateCreatedResponse(0,laborServiceDictService.projectManage(projectManageDTO));
    }

    @PostMapping("updateJobName")
    @ApiOperation("id : projectManage接口返回的mappingId   jobName  修改职位")
    public ResponseVO updateJobName(@RequestBody ProjectMemberMappingDO projectMemberMappingDO){
        laborServiceDictService.updateJobName(projectMemberMappingDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("fireMember")
    @ApiOperation("操作离职  id : projectManage接口返回的mappingId  ")
    public ResponseVO fireMember(@RequestBody ProjectMemberMappingDO projectMemberMappingDO){
        laborServiceDictService.fireMember(projectMemberMappingDO);
        return ResponseData.generateCreatedResponse(0);
    }

    @PostMapping("abnormalRecord")
    @ApiOperation("异动记录  projectId 项目id  pageSize  pageNum userInfo 姓名或者手机号")
    public ResponseVO abnormalRecord(@RequestBody AbnormalRecordDTO abnormalRecordDTO ){
        return ResponseData.generateCreatedResponse(0,laborServiceDictService.abnormalRecord(abnormalRecordDTO));
    }


}