src/main/java/com/ruoyi/personnelManagement/controller/EmployeeContractController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/ruoyi/personnelManagement/mapper/EmployeeContractMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/ruoyi/personnelManagement/pojo/EmployeeContract.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/ruoyi/personnelManagement/service/IEmployeeContractService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/ruoyi/personnelManagement/service/impl/EmployeeContractServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/personnelManagement/EmployeeContractMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/ruoyi/personnelManagement/controller/EmployeeContractController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,78 @@ package com.ruoyi.personnelManagement.controller; import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.other.service.TempFileService; import com.ruoyi.quality.pojo.QualityInspectFile; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.jetbrains.annotations.Contract; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.personnelManagement.pojo.EmployeeContract; import com.ruoyi.personnelManagement.service.IEmployeeContractService; import org.springframework.web.multipart.MultipartFile; /** * åå·¥ååä¿¡æ¯Controller * * @author ruoyi * @date 2025-08-08 */ @RestController @RequestMapping("/contractManagement/contract") @Api(tags = "åå·¥ååä¿¡æ¯çæ¥å£") public class EmployeeContractController extends BaseController { @Autowired private IEmployeeContractService employeeContractService; @Autowired private TempFileService tempFileService; /** * æ¥è¯¢åå·¥ååä¿¡æ¯å表 */ @GetMapping("/list") public AjaxResult contractListPage(Page page, EmployeeContract employeeContract) { return AjaxResult.success(employeeContractService.contractList(page, employeeContract)); } /** * ä¸ä¼ åå·¥åå */ @PostMapping("/upload") public AjaxResult uploadFile(@RequestBody EmployeeContract employeeContract) { return AjaxResult.success(employeeContractService.save(employeeContract)); } @DeleteMapping("/delete") public AjaxResult deleteContract(@RequestBody List<Integer> ids) { if(CollectionUtils.isEmpty(ids)){ return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); } //å é¤éä»¶ return AjaxResult.success(employeeContractService.removeBatchByIds(ids)); } } src/main/java/com/ruoyi/personnelManagement/mapper/EmployeeContractMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ package com.ruoyi.personnelManagement.mapper; import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.personnelManagement.pojo.EmployeeContract; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * åå·¥ååä¿¡æ¯Mapperæ¥å£ * * @author ruoyi * @date 2025-08-08 */ @Mapper public interface EmployeeContractMapper extends BaseMapper<EmployeeContract> { IPage<EmployeeContract> contractList(Page page,@Param("employeeContract") EmployeeContract employeeContract); } src/main/java/com/ruoyi/personnelManagement/pojo/EmployeeContract.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,68 @@ package com.ruoyi.personnelManagement.pojo; import java.io.Serializable; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.*; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.web.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; /** * åå·¥ååä¿¡æ¯å¯¹è±¡ employee_contract * * @author ruoyi * @date 2025-08-08 */ @TableName("employee_contract") @Data public class EmployeeContract implements Serializable { private static final long serialVersionUID = 1L; @TableId(type = IdType.AUTO) private Long id; /** ååç¶æï¼0-æ æï¼1-ææï¼2-å³å°å°æï¼3-å·²è¿æ */ @Excel(name = "ååç¶æï¼0-æ æï¼1-ææï¼2-å³å°å°æï¼3-å·²è¿æ") private Integer status; @ApiModelProperty(value = "æä»¶åç§°") private String name; @ApiModelProperty(value = "æä»¶è·¯å¾") private String url; @ApiModelProperty(value = "æä»¶å¤§å°") private int fileSize; @ApiModelProperty(value = "ååID") @NotBlank(message = "ååidä¸è½ä¸ºç©º!") private Long contractId; @ApiModelProperty(value = "å建æ¶é´") @TableField(fill = FieldFill.INSERT) private LocalDateTime createTime; @ApiModelProperty(value = "ä¿®æ¹æ¶é´") @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateTime; @ApiModelProperty(value = "åå»ºç¨æ·") @TableField(fill = FieldFill.INSERT) private Integer createUser; @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") @TableField(fill = FieldFill.INSERT_UPDATE) private Integer updateUser; @ApiModelProperty(value = "ç§æ·ID") @TableField(fill = FieldFill.INSERT) private Long tenantId; } src/main/java/com/ruoyi/personnelManagement/service/IEmployeeContractService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ package com.ruoyi.personnelManagement.service; import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.personnelManagement.pojo.EmployeeContract; import com.baomidou.mybatisplus.extension.service.IService; /** * åå·¥ååä¿¡æ¯Serviceæ¥å£ * * @author ruoyi * @date 2025-08-08 */ public interface IEmployeeContractService extends IService<EmployeeContract> { IPage<EmployeeContract> contractList(Page page, EmployeeContract employeeContract); int insertContract(EmployeeContract employeeContract); } src/main/java/com/ruoyi/personnelManagement/service/impl/EmployeeContractServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,39 @@ package com.ruoyi.personnelManagement.service.impl; import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.personnelManagement.mapper.EmployeeContractMapper; import com.ruoyi.personnelManagement.pojo.EmployeeContract; import com.ruoyi.personnelManagement.service.IEmployeeContractService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.Arrays; /** * åå·¥ååä¿¡æ¯Serviceä¸å¡å±å¤ç * * @author ruoyi * @date 2025-08-08 */ @Service public class EmployeeContractServiceImpl extends ServiceImpl<EmployeeContractMapper,EmployeeContract> implements IEmployeeContractService { @Autowired private EmployeeContractMapper employeeContractMapper; @Override public IPage<EmployeeContract> contractList(Page page, EmployeeContract employeeContract) { return employeeContractMapper.contractList(page, employeeContract); } @Override public int insertContract(EmployeeContract employeeContract) { return 0; } } src/main/resources/mapper/personnelManagement/EmployeeContractMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.personnelManagement.mapper.EmployeeContractMapper"> <select id="contractList" resultType="com.ruoyi.personnelManagement.pojo.EmployeeContract"> select * from employee_contract where contract_id = #{employeeContract.contractId} </select> </mapper>