From ad1be7289d5e0858b49951efaa7088e3a656c82b Mon Sep 17 00:00:00 2001 From: yaowanxin <3588231647@qq.com> Date: 星期一, 25 八月 2025 18:00:58 +0800 Subject: [PATCH] 人力资源模块 --- main-business/src/main/java/com/ruoyi/business/entity/CompensationPerformance.java | 230 ++++++++ main-business/src/main/java/com/ruoyi/business/annotation/DataScope.java | 29 + main-business/src/main/java/com/ruoyi/business/service/impl/CompensationPerformanceServiceImpl.java | 30 + main-business/src/main/java/com/ruoyi/business/entity/StaffJoinLeaveRecord.java | 156 ++++++ main-business/pom.xml | 13 main-business/src/main/java/com/ruoyi/business/entity/StaffOnJob.java | 148 +++++ main-business/src/main/java/com/ruoyi/business/mapper/StaffJoinLeaveRecordMapper.java | 22 main-business/src/main/java/com/ruoyi/business/controller/StaffJoinLeaveRecordController.java | 90 +++ main-business/src/main/java/com/ruoyi/business/annotation/Excel.java | 198 +++++++ main-business/src/main/java/com/ruoyi/business/service/IStaffJoinLeaveRecordService.java | 23 main-business/src/main/resources/mapper/CompensationPerformanceMapper.xml | 16 main-business/src/main/java/com/ruoyi/business/controller/CompensationPerformanceController.java | 64 ++ main-business/src/main/java/com/ruoyi/business/service/impl/StaffJoinLeaveRecordServiceImpl.java | 168 ++++++ main-business/src/main/java/com/ruoyi/business/service/impl/StaffOnJobServiceImpl.java | 71 ++ main-business/src/main/java/com/ruoyi/business/controller/StaffOnJobController.java | 78 +++ main-business/src/main/java/com/ruoyi/business/dto/DateQueryDto.java | 24 main-business/src/main/java/com/ruoyi/business/annotation/Anonymous.java | 15 main-business/src/main/resources/mapper/StaffOnJobMapper.xml | 34 + main-business/src/main/java/com/ruoyi/business/service/CompensationPerformanceService.java | 22 main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml | 39 + main-business/src/main/java/com/ruoyi/business/mapper/StaffOnJobMapper.java | 19 main-business/src/main/java/com/ruoyi/business/service/IStaffOnJobService.java | 27 + main-business/src/main/java/com/ruoyi/business/annotation/Excels.java | 18 main-business/src/main/java/com/ruoyi/business/mapper/CompensationPerformanceMapper.java | 23 24 files changed, 1,557 insertions(+), 0 deletions(-) diff --git a/main-business/pom.xml b/main-business/pom.xml index 18ff099..e4f1bce 100644 --- a/main-business/pom.xml +++ b/main-business/pom.xml @@ -16,6 +16,19 @@ <groupId>com.ruoyi</groupId> <artifactId>ruoyi-common</artifactId> </dependency> + <!-- 闃叉杩涘叆swagger椤甸潰鎶ョ被鍨嬭浆鎹㈤敊璇紝鎺掗櫎3.0.0涓殑寮曠敤锛屾墜鍔ㄥ鍔�1.6.2鐗堟湰 --> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-models</artifactId> + <version>1.6.2</version> + </dependency> + <!-- excel宸ュ叿 --> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + <version>5.2.3</version> + </dependency> + <!-- 鏍稿績妯″潡--> <dependency> diff --git a/main-business/src/main/java/com/ruoyi/business/annotation/Anonymous.java b/main-business/src/main/java/com/ruoyi/business/annotation/Anonymous.java new file mode 100644 index 0000000..54654e2 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/annotation/Anonymous.java @@ -0,0 +1,15 @@ +package com.ruoyi.business.annotation; + +import java.lang.annotation.*; + +/** + * 鍖垮悕璁块棶涓嶉壌鏉冩敞瑙� + * + * @author ruoyi + */ +@Target({ ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Anonymous +{ +} diff --git a/main-business/src/main/java/com/ruoyi/business/annotation/DataScope.java b/main-business/src/main/java/com/ruoyi/business/annotation/DataScope.java new file mode 100644 index 0000000..3c790d9 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/annotation/DataScope.java @@ -0,0 +1,29 @@ +package com.ruoyi.business.annotation; + +import java.lang.annotation.*; + +/** + * 鏁版嵁鏉冮檺杩囨护娉ㄨВ + * + * @author ruoyi + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface DataScope +{ + /** + * 閮ㄩ棬琛ㄧ殑鍒悕 + */ + public String deptAlias() default ""; + + /** + * 鐢ㄦ埛琛ㄧ殑鍒悕 + */ + public String userAlias() default ""; + + /** + * 鏉冮檺瀛楃锛堢敤浜庡涓鑹插尮閰嶇鍚堣姹傜殑鏉冮檺锛夐粯璁ゆ牴鎹潈闄愭敞瑙ss鑾峰彇锛屽涓潈闄愮敤閫楀彿鍒嗛殧寮�鏉� + */ + public String permission() default ""; +} diff --git a/main-business/src/main/java/com/ruoyi/business/annotation/Excel.java b/main-business/src/main/java/com/ruoyi/business/annotation/Excel.java new file mode 100644 index 0000000..958cdd6 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/annotation/Excel.java @@ -0,0 +1,198 @@ +package com.ruoyi.business.annotation; + +import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.math.BigDecimal; + +/** + * 鑷畾涔夊鍑篍xcel鏁版嵁娉ㄨВ + * + * @author ruoyi + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Excel +{ + /** + * 瀵煎嚭鏃跺湪excel涓帓搴� + */ + public int sort() default Integer.MAX_VALUE; + + /** + * 瀵煎嚭鍒癊xcel涓殑鍚嶅瓧. + */ + public String name() default ""; + + /** + * 鏃ユ湡鏍煎紡, 濡�: yyyy-MM-dd + */ + public String dateFormat() default ""; + + /** + * 濡傛灉鏄瓧鍏哥被鍨嬶紝璇疯缃瓧鍏哥殑type鍊� (濡�: sys_user_sex) + */ + public String dictType() default ""; + + /** + * 璇诲彇鍐呭杞〃杈惧紡 (濡�: 0=鐢�,1=濂�,2=鏈煡) + */ + public String readConverterExp() default ""; + + /** + * 鍒嗛殧绗︼紝璇诲彇瀛楃涓茬粍鍐呭 + */ + public String separator() default ","; + + /** + * BigDecimal 绮惧害 榛樿:-1(榛樿涓嶅紑鍚疊igDecimal鏍煎紡鍖�) + */ + public int scale() default -1; + + /** + * BigDecimal 鑸嶅叆瑙勫垯 榛樿:BigDecimal.ROUND_HALF_EVEN + */ + public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; + + /** + * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勯珮搴� + */ + public double height() default 14; + + /** + * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勫搴� + */ + public double width() default 16; + + /** + * 鏂囧瓧鍚庣紑,濡�% 90 鍙樻垚90% + */ + public String suffix() default ""; + + /** + * 褰撳�间负绌烘椂,瀛楁鐨勯粯璁ゅ�� + */ + public String defaultValue() default ""; + + /** + * 鎻愮ず淇℃伅 + */ + public String prompt() default ""; + + /** + * 鏄惁鍏佽鍐呭鎹㈣ + */ + public boolean wrapText() default false; + + /** + * 璁剧疆鍙兘閫夋嫨涓嶈兘杈撳叆鐨勫垪鍐呭. + */ + public String[] combo() default {}; + + /** + * 鏄惁浠庡瓧鍏歌鏁版嵁鍒癱ombo,榛樿涓嶈鍙�,濡傝鍙栭渶瑕佽缃甦ictType娉ㄨВ. + */ + public boolean comboReadDict() default false; + + /** + * 鏄惁闇�瑕佺旱鍚戝悎骞跺崟鍏冩牸,搴斿闇�姹�:鍚湁list闆嗗悎鍗曞厓鏍�) + */ + public boolean needMerge() default false; + + /** + * 鏄惁瀵煎嚭鏁版嵁,搴斿闇�姹�:鏈夋椂鎴戜滑闇�瑕佸鍑轰竴浠芥ā鏉�,杩欐槸鏍囬闇�瑕佷絾鍐呭闇�瑕佺敤鎴锋墜宸ュ~鍐�. + */ + public boolean isExport() default true; + + /** + * 鍙︿竴涓被涓殑灞炴�у悕绉�,鏀寔澶氱骇鑾峰彇,浠ュ皬鏁扮偣闅斿紑 + */ + public String targetAttr() default ""; + + /** + * 鏄惁鑷姩缁熻鏁版嵁,鍦ㄦ渶鍚庤拷鍔犱竴琛岀粺璁℃暟鎹�诲拰 + */ + public boolean isStatistics() default false; + + /** + * 瀵煎嚭绫诲瀷锛�0鏁板瓧 1瀛楃涓� 2鍥剧墖锛� + */ + public ColumnType cellType() default ColumnType.STRING; + + /** + * 瀵煎嚭鍒楀ご鑳屾櫙棰滆壊 + */ + public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT; + + /** + * 瀵煎嚭鍒楀ご瀛椾綋棰滆壊 + */ + public IndexedColors headerColor() default IndexedColors.WHITE; + + /** + * 瀵煎嚭鍗曞厓鏍艰儗鏅鑹� + */ + public IndexedColors backgroundColor() default IndexedColors.WHITE; + + /** + * 瀵煎嚭鍗曞厓鏍煎瓧浣撻鑹� + */ + public IndexedColors color() default IndexedColors.BLACK; + + /** + * 瀵煎嚭瀛楁瀵归綈鏂瑰紡 + */ + public HorizontalAlignment align() default HorizontalAlignment.CENTER; + + /** + * 鑷畾涔夋暟鎹鐞嗗櫒 + */ + public Class<?> handler() default ExcelHandlerAdapter.class; + + /** + * 鑷畾涔夋暟鎹鐞嗗櫒鍙傛暟 + */ + public String[] args() default {}; + + /** + * 瀛楁绫诲瀷锛�0锛氬鍑哄鍏ワ紱1锛氫粎瀵煎嚭锛�2锛氫粎瀵煎叆锛� + */ + Type type() default Type.ALL; + + public enum Type + { + ALL(0), EXPORT(1), IMPORT(2); + private final int value; + + Type(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } + + public enum ColumnType + { + NUMERIC(0), STRING(1), IMAGE(2), TEXT(3); + private final int value; + + ColumnType(int value) + { + this.value = value; + } + + public int value() + { + return this.value; + } + } +} \ No newline at end of file diff --git a/main-business/src/main/java/com/ruoyi/business/annotation/Excels.java b/main-business/src/main/java/com/ruoyi/business/annotation/Excels.java new file mode 100644 index 0000000..be7eb67 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/annotation/Excels.java @@ -0,0 +1,18 @@ +package com.ruoyi.business.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Excel娉ㄨВ闆� + * + * @author ruoyi + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Excels +{ + public Excel[] value(); +} diff --git a/main-business/src/main/java/com/ruoyi/business/controller/CompensationPerformanceController.java b/main-business/src/main/java/com/ruoyi/business/controller/CompensationPerformanceController.java new file mode 100644 index 0000000..ba31763 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/controller/CompensationPerformanceController.java @@ -0,0 +1,64 @@ +package com.ruoyi.business.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.business.entity.CompensationPerformance; +import com.ruoyi.business.service.CompensationPerformanceService; +import com.ruoyi.common.core.domain.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author :yys + * @date : 2025/8/8 9:56 + */ +@RestController +@Api(tags = "钖叕缁╂晥") +@AllArgsConstructor +@RequestMapping("/compensationPerformance") +public class CompensationPerformanceController{ + + @Autowired + private CompensationPerformanceService compensationPerformanceService; + + @GetMapping("/listPage") + @ApiOperation("钖叕缁╂晥-鍒嗛〉鏌ヨ") + public R listPage(Page page, CompensationPerformance compensationPerformance){ + IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, compensationPerformance); + return R.ok(listPage); + } + + @PostMapping("/add") + @ApiOperation("钖叕缁╂晥-娣诲姞") + @Transactional(rollbackFor = Exception.class) + public R add(@RequestBody CompensationPerformance compensationPerformance){ + boolean save = compensationPerformanceService.save(compensationPerformance); + return save ? R.ok("娣诲姞鎴愬姛") : R.fail("娣诲姞澶辫触"); + } + + @PostMapping("/update") + @ApiOperation("钖叕缁╂晥-淇敼") + @Transactional(rollbackFor = Exception.class) + public R update(@RequestBody CompensationPerformance compensationPerformance){ + boolean update = compensationPerformanceService.updateById(compensationPerformance); + return update ? R.ok("淇敼鎴愬姛") : R.fail("淇敼澶辫触"); + } + + @DeleteMapping("/delete") + @ApiOperation("钖叕缁╂晥-鍒犻櫎") + @Transactional(rollbackFor = Exception.class) + public R delete(@RequestBody List<Long> ids){ + if(CollectionUtils.isEmpty(ids)) return R.fail("璇蜂紶鍏ヨ鍒犻櫎鐨処D"); + boolean delete = compensationPerformanceService.removeBatchByIds(ids); + return delete ? R.ok("鍒犻櫎鎴愬姛") : R.fail("鍒犻櫎澶辫触"); + } + + +} diff --git a/main-business/src/main/java/com/ruoyi/business/controller/StaffJoinLeaveRecordController.java b/main-business/src/main/java/com/ruoyi/business/controller/StaffJoinLeaveRecordController.java new file mode 100644 index 0000000..18ef0dc --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/controller/StaffJoinLeaveRecordController.java @@ -0,0 +1,90 @@ +package com.ruoyi.business.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import com.ruoyi.business.service.IStaffJoinLeaveRecordService; +import com.ruoyi.common.core.domain.AjaxResult; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 鏂板鍏ヨ亴/绂昏亴 + */ +@RestController +@RequestMapping("/staff/staffJoinLeaveRecord") +public class StaffJoinLeaveRecordController { + + @Resource + private IStaffJoinLeaveRecordService staffJoinLeaveRecordService; + + /** + * 鏂板鍏ヨ亴/绂昏亴 + * @param staffJoinLeaveRecord + * @return + */ + @PostMapping("/add") + public AjaxResult add(@RequestBody StaffJoinLeaveRecord staffJoinLeaveRecord) { + return AjaxResult.success(staffJoinLeaveRecordService.add(staffJoinLeaveRecord)); + } + + /** + * 鍒犻櫎鍏ヨ亴/绂昏亴 + * @param ids + * @return + */ + @DeleteMapping("/del") + public AjaxResult delStaffJoinLeaveRecord(@RequestBody List<Integer> ids) { + if(CollectionUtils.isEmpty(ids)){ + return AjaxResult.error("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�"); + } + return AjaxResult.success(staffJoinLeaveRecordService.delStaffJoinLeaveRecord(ids)); + } + + /** + * 鍏ヨ亴/绂昏亴璇︽儏 + * @param id + * @return + */ + @GetMapping("/{id}") + public AjaxResult staffJoinLeaveRecordDetail(@PathVariable("id") Integer id) { + return AjaxResult.success(staffJoinLeaveRecordService.getById(id)); + } + + /** + * 鍏ヨ亴/绂昏亴淇敼 + * @param staffJoinLeaveRecord + * @return + */ + @PostMapping("/update") + public AjaxResult update(@RequestBody StaffJoinLeaveRecord staffJoinLeaveRecord) { + return AjaxResult.success(staffJoinLeaveRecordService.updateStaffJoinLeaveRecord(staffJoinLeaveRecord)); + } + + /** + * 鍏ヨ亴/绂昏亴鍒嗛〉鏌ヨ + * @param page + * @param staffJoinLeaveRecord + * @return + */ + @GetMapping("/listPage") + public AjaxResult staffJoinLeaveRecordListPage(Page page, StaffJoinLeaveRecord staffJoinLeaveRecord) { + return AjaxResult.success(staffJoinLeaveRecordService.staffJoinLeaveRecordListPage(page, staffJoinLeaveRecord)); + } + + /** + * 鍏ヨ亴/绂昏亴瀵煎嚭 + * @param response + * @param staffJoinLeaveRecord + */ + @PostMapping("/export") + public void staffJoinLeaveRecordExport(HttpServletResponse response, StaffJoinLeaveRecord staffJoinLeaveRecord) { + staffJoinLeaveRecordService.staffJoinLeaveRecordExport(response, staffJoinLeaveRecord); + } + + +} diff --git a/main-business/src/main/java/com/ruoyi/business/controller/StaffOnJobController.java b/main-business/src/main/java/com/ruoyi/business/controller/StaffOnJobController.java new file mode 100644 index 0000000..a5a6347 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/controller/StaffOnJobController.java @@ -0,0 +1,78 @@ +package com.ruoyi.business.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.ruoyi.business.entity.StaffOnJob; +import com.ruoyi.business.service.IStaffOnJobService; +import com.ruoyi.common.core.domain.AjaxResult; +import jakarta.annotation.Resource; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + + + +/** + * 鍛樺伐鍙拌处/鍚堝悓绠$悊 + */ +@RestController +@RequestMapping("/staff/staffOnJob") +public class StaffOnJobController { + + @Resource + private IStaffOnJobService staffOnJobService; + + + /** + * 鍦ㄨ亴鍛樺伐鍙拌处鍒嗛〉鏌ヨ + * @param page + * @param staffOnJob + * @return + */ + @GetMapping("/listPage") + public AjaxResult staffOnJobListPage(Page page, StaffOnJob staffOnJob) { + return AjaxResult.success(staffOnJobService.staffOnJobListPage(page, staffOnJob)); + } + + /** + * 鍦ㄨ亴鍛樺伐涓嬫媺(鏂板绂昏亴鐢�) + * @return + */ + @GetMapping("/list") + public AjaxResult staffOnJobList() { + return AjaxResult.success(staffOnJobService.staffOnJobList()); + } + + /** + * 鍦ㄨ亴鍛樺伐璇︽儏 + * @param staffNo + * @return + */ + @GetMapping("/staffNo") + public AjaxResult staffOnJobDetail(String staffNo) { + return AjaxResult.success(staffOnJobService.staffOnJobDetail(staffNo)); + } + /** + * 鍦ㄨ亴鍛樺伐瀵煎叆 + */ + @PostMapping("/import") + public AjaxResult importData(@RequestPart("file") MultipartFile file) { + Boolean b = staffOnJobService.importData(file); + if (b) { + return AjaxResult.success("瀵煎叆鎴愬姛"); + } + return AjaxResult.error("瀵煎叆澶辫触"); + } + + /** + * 鍦ㄨ亴鍛樺伐瀵煎嚭 + * @param response + * @param staffOnJob + */ + @PostMapping("/export") + public void staffOnJobExport(HttpServletResponse response, StaffOnJob staffOnJob) { + staffOnJobService.staffOnJobExport(response, staffOnJob); + } + + +} diff --git a/main-business/src/main/java/com/ruoyi/business/dto/DateQueryDto.java b/main-business/src/main/java/com/ruoyi/business/dto/DateQueryDto.java new file mode 100644 index 0000000..4e9cc1f --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/dto/DateQueryDto.java @@ -0,0 +1,24 @@ +package com.ruoyi.business.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author :yys + * @date : 2025/7/23 11:31 + */ +@Data +@ApiModel +public class DateQueryDto { + + @ApiModelProperty(value = "寮�濮嬫椂闂�") + @TableField(exist = false) + private String entryDateStart; + + @ApiModelProperty(value = "缁撴潫鏃堕棿") + @TableField(exist = false) + private String entryDateEnd; + +} diff --git a/main-business/src/main/java/com/ruoyi/business/entity/CompensationPerformance.java b/main-business/src/main/java/com/ruoyi/business/entity/CompensationPerformance.java new file mode 100644 index 0000000..cbebb54 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/entity/CompensationPerformance.java @@ -0,0 +1,230 @@ +package com.ruoyi.business.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.business.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * @author :yys + * @date : 2025/8/8 9:40 + */ +@Data +@TableName("compensation_performance") +@ApiModel +public class CompensationPerformance { + + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 鍛樺伐id + */ + @ApiModelProperty("鍛樺伐id") + @Excel(name = "鍛樺伐id") + private Long staffId; + + /** + * 濮撳悕 + */ + @ApiModelProperty("濮撳悕") + @Excel(name = "濮撳悕") + private String name; + + /** + * 钖祫鏈堜唤(鏌ヨ) + */ + @ApiModelProperty("钖祫鏈堜唤(鏌ヨ)") + @TableField(exist = false) + private String payDateStr; + + /** + * 钖祫鏈堜唤 + */ + @ApiModelProperty("钖祫鏈堜唤") + @Excel(name = "钖祫鏈堜唤", dateFormat = "yyyy-MM", width = 30) + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM") + private Date payDate; + + + /** + * 搴斿嚭鍕ゅぉ鏁� + */ + @ApiModelProperty("搴斿嚭鍕ゅぉ鏁�") + @Excel(name = "搴斿嚭鍕ゅぉ鏁�") + private BigDecimal shouldAttendedNum; + + /** + * 瀹為檯鍑哄嫟澶╂暟 + */ + @ApiModelProperty("瀹為檯鍑哄嫟澶╂暟") + @Excel(name = "瀹為檯鍑哄嫟澶╂暟") + private BigDecimal actualAttendedNum; + + + /** + * 鍩烘湰宸ヨ祫 + */ + @ApiModelProperty("鍩烘湰宸ヨ祫") + @Excel(name = "鍩烘湰宸ヨ祫") + private BigDecimal basicSalary; + + /** + * 宀椾綅宸ヨ祫 + */ + @ApiModelProperty("宀椾綅宸ヨ祫") + @Excel(name = "宀椾綅宸ヨ祫") + private BigDecimal postSalary; + + /** + * 鍏ョ鑱岀己鍕ゆ墸娆� + */ + @ApiModelProperty("鍏ョ鑱岀己鍕ゆ墸娆�") + @Excel(name = "鍏ョ鑱岀己鍕ゆ墸娆�") + private BigDecimal deductionAbsenteeism; + + + /** + * 鐥呭亣鎵f + */ + @ApiModelProperty("鐥呭亣鎵f") + @Excel(name = "鐥呭亣鎵f") + private BigDecimal sickLeaveDeductions; + + /** + * 浜嬪亣鎵f + */ + @ApiModelProperty("浜嬪亣鎵f") + @Excel(name = "浜嬪亣鎵f") + private BigDecimal deductionPersonalLeave; + /** + * 蹇樿鎵撳崱鎵f + */ + @ApiModelProperty("蹇樿鎵撳崱鎵f") + @Excel(name = "蹇樿鎵撳崱鎵f") + private BigDecimal forgetClockDeduct; + + /** + * 缁╂晥寰楀垎 + */ + @ApiModelProperty("缁╂晥寰楀垎") + @Excel(name = "缁╂晥寰楀垎") + private BigDecimal performanceScore; + + /** + * 缁╂晥宸ヨ祫 + */ + @ApiModelProperty("缁╂晥宸ヨ祫") + @Excel(name = "缁╂晥宸ヨ祫") + private BigDecimal performancePay; + + + /** + * 搴斿彂鍚堣 + */ + @ApiModelProperty("搴斿彂鍚堣") + @Excel(name = "搴斿彂鍚堣") + private BigDecimal payableWages; + + /** + * 绀句繚涓汉 + */ + @ApiModelProperty("绀句繚涓汉") + @Excel(name = "绀句繚涓汉") + private BigDecimal socialSecurityIndividuals; + /** + * 绀句繚鍏徃 + */ + @ApiModelProperty("绀句繚鍏徃") + @Excel(name = "绀句繚鍏徃") + private BigDecimal socialSecurityCompanies; + + /** + * 绀句繚鍚堣 + */ + @ApiModelProperty("绀句繚鍚堣") + @Excel(name = "绀句繚鍚堣") + private BigDecimal socialSecurityTotal; + + /** + * 鍏Н閲戝悎璁� + */ + @ApiModelProperty("鍏Н閲戝悎璁�") + @Excel(name = "鍏Н閲戝悎璁�") + private BigDecimal providentFundTotal; + /** + * 鍏Н閲戝叕鍙� + */ + @ApiModelProperty("鍏Н閲戝叕鍙�") + @Excel(name = "鍏Н閲戝叕鍙�") + private BigDecimal providentFundCompany; + + /** + * 鍏Н閲戜釜浜� + */ + @ApiModelProperty("鍏Н閲戜釜浜�") + @Excel(name = "鍏Н閲戜釜浜�") + private BigDecimal providentFundIndividuals; + + /** + * 搴旂◣宸ヨ祫 + */ + @ApiModelProperty("搴旂◣宸ヨ祫") + @Excel(name = "搴旂◣宸ヨ祫") + private BigDecimal taxableWaget; + /** + * 涓汉鎵�寰楃◣ + */ + @ApiModelProperty("涓汉鎵�寰楃◣") + @Excel(name = "涓汉鎵�寰楃◣") + private BigDecimal personalIncomeTax; + + /** + * 瀹炲彂宸ヨ祫 + */ + @ApiModelProperty("瀹炲彂宸ヨ祫") + @Excel(name = "瀹炲彂宸ヨ祫") + private BigDecimal actualWages; + + /** + * 鍒涘缓鑰� + */ + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + /** + * 鍒涘缓鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 淇敼鑰� + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + /** + * 淇敼鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 绉熸埛ID + */ + @TableField(fill = FieldFill.INSERT) + private Long tenantId; + +} diff --git a/main-business/src/main/java/com/ruoyi/business/entity/StaffJoinLeaveRecord.java b/main-business/src/main/java/com/ruoyi/business/entity/StaffJoinLeaveRecord.java new file mode 100644 index 0000000..38b8366 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/entity/StaffJoinLeaveRecord.java @@ -0,0 +1,156 @@ +package com.ruoyi.business.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.business.annotation.Excel; +import com.ruoyi.business.dto.DateQueryDto; +import io.swagger.annotations.ApiModelProperty; +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 浜哄憳绠$悊--鏂板鍏ヨ亴/绂昏亴 + * staff_join_leave_record + */ +@TableName(value = "staff_join_leave_record") +@Data +public class StaffJoinLeaveRecord extends DateQueryDto implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 搴忓彿 + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 鐘舵��(0:绂昏亴;1:鍏ヨ亴) + */ + @NotBlank(message = "鍛樺伐鐘舵�佷笉鑳戒负绌�!!!!!!!!") + @Excel(name = "鐘舵��",readConverterExp = "0=绂昏亴,1=鍏ヨ亴") + private Integer staffState; + + /** + * 鍛樺伐缂栧彿 + */ + @Excel(name = "鍛樺伐缂栧彿") + private String staffNo; + + /** + * 鍛樺伐濮撳悕 + */ + @Excel(name = "鍛樺伐濮撳悕") + private String staffName; + + /** + * 鎬у埆 + */ + @Excel(name = "鎬у埆") + private String sex; + + /** + * 绫嶈疮 + */ + @Excel(name = "绫嶈疮") + private String nativePlace; + + /** + * 宀椾綅 + */ + @Excel(name = "宀椾綅") + private String postJob; + + /** + * 瀹跺涵浣忓潃 + */ + @Excel(name = "瀹跺涵浣忓潃") + private String adress; + + /** + * 绗竴瀛﹀巻 + */ + @Excel(name = "绗竴瀛﹀巻") + private String firstStudy; + + /** + * 涓撲笟 + */ + @Excel(name = "涓撲笟") + private String profession; + + /** + * 韬唤璇佸彿鐮� + */ + @Excel(name = "韬唤璇佸彿鐮�") + private String identityCard; + + /** + * 骞撮緞 + */ + @Excel(name = "骞撮緞") + private String age; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Excel(name = "鑱旂郴鐢佃瘽") + private String phone; + + /** + * 绱ф�ヨ仈绯讳汉 + */ + @Excel(name = "绱ф�ヨ仈绯讳汉") + private String emergencyContact; + + /** + * 绱ф�ヨ仈绯讳汉鐢佃瘽 + */ + @Excel(name = "绱ф�ヨ仈绯讳汉鐢佃瘽") + private String emergencyContactPhone; + + /** + * 鍚堝悓骞撮檺 + */ + @Excel(name = "鍚堝悓骞撮檺") + private String contractTerm; + + /** + * 鍚堝悓寮�濮嬫棩鏈� + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "鍚堝悓寮�濮嬫棩鏈�", width = 30, dateFormat = "yyyy-MM-dd") + private Date contractStartTime; + + /** + * 鍚堝悓缁撴潫鏃ユ湡 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "鍚堝悓缁撴潫鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd") + private Date contractEndTime; + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + @ApiModelProperty(value = "鍒涘缓鐢ㄦ埛") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + @ApiModelProperty(value = "淇敼鐢ㄦ埛") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "绉熸埛ID") + @TableField(fill = FieldFill.INSERT) + private Long tenantId; + + +} diff --git a/main-business/src/main/java/com/ruoyi/business/entity/StaffOnJob.java b/main-business/src/main/java/com/ruoyi/business/entity/StaffOnJob.java new file mode 100644 index 0000000..ff472a9 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/entity/StaffOnJob.java @@ -0,0 +1,148 @@ +package com.ruoyi.business.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.business.dto.DateQueryDto; +import com.ruoyi.business.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 浜哄憳绠$悊--鍛樺伐鍙拌处/鍚堝悓绠$悊 + * staff_on_job + */ +@TableName(value = "staff_on_job") +@Data +public class StaffOnJob extends DateQueryDto implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 搴忓彿 + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 鐘舵��(0:绂昏亴;1:鍦ㄨ亴) + */ + @Excel(name = "鐘舵��",readConverterExp = "0=绂昏亴,1=鍦ㄨ亴") + private Integer staffState; + + /** + * 鍛樺伐缂栧彿 + */ + @Excel(name = "鍛樺伐缂栧彿", type = Excel.Type.EXPORT, cellType = Excel.ColumnType.STRING) + private String staffNo; + + /** + * 鍛樺伐濮撳悕 + */ + @Excel(name = "鍛樺伐濮撳悕") + private String staffName; + + /** + * 鎬у埆 + */ + @Excel(name = "鎬у埆") + private String sex; + + /** + * 绫嶈疮 + */ + @Excel(name = "绫嶈疮") + private String nativePlace; + + /** + * 宀椾綅 + */ + @Excel(name = "宀椾綅") + private String postJob; + + /** + * 瀹跺涵浣忓潃 + */ + @Excel(name = "瀹跺涵浣忓潃") + private String adress; + + /** + * 绗竴瀛﹀巻 + */ + @Excel(name = "绗竴瀛﹀巻") + private String firstStudy; + + /** + * 涓撲笟 + */ + @Excel(name = "涓撲笟") + private String profession; + + /** + * 韬唤璇佸彿鐮� + */ + @Excel(name = "韬唤璇佸彿鐮�") + private String identityCard; + + /** + * 骞撮緞 + */ + @Excel(name = "骞撮緞") + private String age; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Excel(name = "鑱旂郴鐢佃瘽") + private String phone; + + /** + * 绱ф�ヨ仈绯讳汉 + */ + @Excel(name = "绱ф�ヨ仈绯讳汉") + private String emergencyContact; + + /** + * 绱ф�ヨ仈绯讳汉鐢佃瘽 + */ + @Excel(name = "绱ф�ヨ仈绯讳汉鐢佃瘽") + private String emergencyContactPhone; + + /** + * 鍚堝悓骞撮檺 + */ + @Excel(name = "鍚堝悓骞撮檺") + private String contractTerm; + + /** + * 鍚堝悓鍒版湡鏃ユ湡 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "鍚堝悓鍒版湡鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd") + private Date contractExpireTime; + + + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + @ApiModelProperty(value = "鍒涘缓鐢ㄦ埛") + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + @ApiModelProperty(value = "淇敼鏃堕棿") + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + @ApiModelProperty(value = "淇敼鐢ㄦ埛") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + @ApiModelProperty(value = "绉熸埛ID") + @TableField(fill = FieldFill.INSERT) + private Long tenantId; + + +} diff --git a/main-business/src/main/java/com/ruoyi/business/mapper/CompensationPerformanceMapper.java b/main-business/src/main/java/com/ruoyi/business/mapper/CompensationPerformanceMapper.java new file mode 100644 index 0000000..1eb56d8 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/mapper/CompensationPerformanceMapper.java @@ -0,0 +1,23 @@ +package com.ruoyi.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.business.entity.CompensationPerformance; +import org.apache.ibatis.annotations.Param; + +/** + * @author :yys + * @date : 2025/8/8 9:54 + */ +public interface CompensationPerformanceMapper extends BaseMapper<CompensationPerformance> { + + /** + * 鍒嗛〉鏌ヨ + * + * @param page + * @param compensationPerformance + * @return + */ + IPage<CompensationPerformance> listPage(Page page,@Param("req") CompensationPerformance compensationPerformance); +} diff --git a/main-business/src/main/java/com/ruoyi/business/mapper/StaffJoinLeaveRecordMapper.java b/main-business/src/main/java/com/ruoyi/business/mapper/StaffJoinLeaveRecordMapper.java new file mode 100644 index 0000000..055d6bf --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/mapper/StaffJoinLeaveRecordMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface StaffJoinLeaveRecordMapper extends BaseMapper<StaffJoinLeaveRecord> { + + IPage<StaffJoinLeaveRecord> staffJoinLeaveRecordListPage(Page page, @Param("staffJoinLeaveRecord") StaffJoinLeaveRecord staffJoinLeaveRecord); + + List<StaffJoinLeaveRecord> staffJoinLeaveRecordList(@Param("staffJoinLeaveRecord") StaffJoinLeaveRecord staffJoinLeaveRecord); + + List<StaffJoinLeaveRecord> staffOnJobList(); + +} diff --git a/main-business/src/main/java/com/ruoyi/business/mapper/StaffOnJobMapper.java b/main-business/src/main/java/com/ruoyi/business/mapper/StaffOnJobMapper.java new file mode 100644 index 0000000..4366dbb --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/mapper/StaffOnJobMapper.java @@ -0,0 +1,19 @@ +package com.ruoyi.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.ruoyi.business.entity.StaffOnJob; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface StaffOnJobMapper extends BaseMapper<StaffOnJob> { + + IPage<StaffOnJob> staffOnJobListPage(Page page, @Param("staffOnJob") StaffOnJob staffOnJob); + + List<StaffOnJob> staffOnJobList(@Param("staffOnJob") StaffOnJob staffOnJob); +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/CompensationPerformanceService.java b/main-business/src/main/java/com/ruoyi/business/service/CompensationPerformanceService.java new file mode 100644 index 0000000..c490860 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/CompensationPerformanceService.java @@ -0,0 +1,22 @@ +package com.ruoyi.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.business.entity.CompensationPerformance; + +/** + * @author :yys + * @date : 2025/8/8 9:55 + */ +public interface CompensationPerformanceService extends IService<CompensationPerformance> { + + /** + * 鍒嗛〉鏌ヨ + * + * @param page + * @param compensationPerformance + * @return + */ + IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance); +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/IStaffJoinLeaveRecordService.java b/main-business/src/main/java/com/ruoyi/business/service/IStaffJoinLeaveRecordService.java new file mode 100644 index 0000000..948de4a --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/IStaffJoinLeaveRecordService.java @@ -0,0 +1,23 @@ +package com.ruoyi.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import jakarta.servlet.http.HttpServletResponse; + +import java.util.List; + +public interface IStaffJoinLeaveRecordService extends IService<StaffJoinLeaveRecord> { + + + IPage<StaffJoinLeaveRecord> staffJoinLeaveRecordListPage(Page page, StaffJoinLeaveRecord staffJoinLeaveRecord); + + void staffJoinLeaveRecordExport(HttpServletResponse response, StaffJoinLeaveRecord staffJoinLeaveRecord); + + int add(StaffJoinLeaveRecord staffJoinLeaveRecord); + + int delStaffJoinLeaveRecord(List<Integer> ids); + + int updateStaffJoinLeaveRecord(StaffJoinLeaveRecord staffJoinLeaveRecord); +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/IStaffOnJobService.java b/main-business/src/main/java/com/ruoyi/business/service/IStaffOnJobService.java new file mode 100644 index 0000000..12f9dbc --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/IStaffOnJobService.java @@ -0,0 +1,27 @@ +package com.ruoyi.business.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import com.ruoyi.business.entity.StaffOnJob; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.multipart.MultipartFile; + + +import java.util.List; + +public interface IStaffOnJobService extends IService<StaffOnJob> { + + + IPage<StaffOnJob> staffOnJobListPage(Page page, StaffOnJob staffOnJob); + + List<StaffJoinLeaveRecord> staffOnJobDetail(String staffNo); + + void staffOnJobExport(HttpServletResponse response, StaffOnJob staffOnJob); + + List<StaffJoinLeaveRecord> staffOnJobList(); + + Boolean importData(MultipartFile file); +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/impl/CompensationPerformanceServiceImpl.java b/main-business/src/main/java/com/ruoyi/business/service/impl/CompensationPerformanceServiceImpl.java new file mode 100644 index 0000000..6fd11d3 --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/impl/CompensationPerformanceServiceImpl.java @@ -0,0 +1,30 @@ +package com.ruoyi.business.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.business.mapper.CompensationPerformanceMapper; +import com.ruoyi.business.entity.CompensationPerformance; +import com.ruoyi.business.service.CompensationPerformanceService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author :yys + * @date : 2025/8/8 9:55 + */ +@Service +@Slf4j +public class CompensationPerformanceServiceImpl extends ServiceImpl<CompensationPerformanceMapper, CompensationPerformance> implements CompensationPerformanceService { + + @Autowired + private CompensationPerformanceMapper compensationPerformanceMapper; + + + @Override + public IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance) { + IPage<CompensationPerformance> compensationPerformanceIPage = compensationPerformanceMapper.listPage(page, compensationPerformance); + return compensationPerformanceIPage; + } +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/impl/StaffJoinLeaveRecordServiceImpl.java b/main-business/src/main/java/com/ruoyi/business/service/impl/StaffJoinLeaveRecordServiceImpl.java new file mode 100644 index 0000000..c43c45d --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/impl/StaffJoinLeaveRecordServiceImpl.java @@ -0,0 +1,168 @@ +package com.ruoyi.business.service.impl; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import com.ruoyi.business.entity.StaffOnJob; +import com.ruoyi.business.mapper.StaffJoinLeaveRecordMapper; +import com.ruoyi.business.mapper.StaffOnJobMapper; +import com.ruoyi.business.service.IStaffJoinLeaveRecordService; +import com.ruoyi.common.exception.base.BaseException; +import com.ruoyi.common.utils.poi.ExcelUtil; +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + + +import java.util.Comparator; +import java.util.List; +import java.util.Optional; + +@Service +@AllArgsConstructor +@Transactional(rollbackFor = Exception.class) +public class StaffJoinLeaveRecordServiceImpl extends ServiceImpl<StaffJoinLeaveRecordMapper, StaffJoinLeaveRecord> implements IStaffJoinLeaveRecordService { + + private StaffJoinLeaveRecordMapper staffJoinLeaveRecordMapper; + private StaffOnJobMapper staffOnJobMapper; + + + //鍒嗛〉鏌ヨ + @Override + public IPage<StaffJoinLeaveRecord> staffJoinLeaveRecordListPage(Page page, StaffJoinLeaveRecord staffJoinLeaveRecord) { + return staffJoinLeaveRecordMapper.staffJoinLeaveRecordListPage(page,staffJoinLeaveRecord); + } + + //瀵煎嚭 + @Override + public void staffJoinLeaveRecordExport(HttpServletResponse response, StaffJoinLeaveRecord staffJoinLeaveRecord) { + List<StaffJoinLeaveRecord> staffJoinLeaveRecords =staffJoinLeaveRecordMapper.staffJoinLeaveRecordList(staffJoinLeaveRecord); + ExcelUtil<StaffJoinLeaveRecord> util = new ExcelUtil<StaffJoinLeaveRecord>(StaffJoinLeaveRecord.class); + util.exportExcel(response, staffJoinLeaveRecords, staffJoinLeaveRecord.getStaffState()==0?"鍛樺伐绂昏亴":"鍛樺伐鍏ヨ亴"+"瀵煎嚭"); + } + + //鏂板鍏ヨ亴/绂昏亴 + @Override + public int add(StaffJoinLeaveRecord staffJoinLeaveRecord) { + String[] ignoreProperties = {"id"};//鎺掗櫎id灞炴�� + List<StaffOnJob> staffOnJobs = staffOnJobMapper.selectList(Wrappers.<StaffOnJob>lambdaQuery().eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo())); + if (staffJoinLeaveRecord.getStaffState()==1){ + /*鍏ヨ亴*/ + //(鏍规嵁鍛樺伐缂栧彿鍒ゆ柇鏄惁宸茬粡鏂板鍒板湪鑱岃〃閲岄潰,濡傛灉宸茬粡鏈夊氨鏇存柊,娌℃湁灏辨柊澧�) + if (staffOnJobs.size()>0){ + StaffOnJob staffOnJob = staffOnJobs.get(0); + //鍏堟瘮杈冨埌鏈熸棩鏈�,杩欓噷閫夌敤鍒版湡鏃ユ湡鏈�涔呯殑 + if (staffJoinLeaveRecord.getContractEndTime().compareTo(staffOnJob.getContractExpireTime())>0) { + BeanUtils.copyProperties(staffJoinLeaveRecord,staffOnJob,ignoreProperties); + staffOnJobMapper.updateById(staffOnJob); + } + }else { + StaffOnJob staffOnJob = new StaffOnJob(); + BeanUtils.copyProperties(staffJoinLeaveRecord,staffOnJob,ignoreProperties); + staffOnJob.setContractExpireTime(staffJoinLeaveRecord.getContractEndTime()); + staffOnJobMapper.insert(staffOnJob); + } + }else { + /*绂昏亴*/ + //鏍规嵁鍛樺伐缂栧彿鎵惧埌瀵瑰簲鐨勬暟鎹皢鐘舵�佸彉鏇� + if (staffOnJobs.size()>0){ + StaffOnJob staffOnJob = staffOnJobs.get(0); + staffOnJob.setStaffState(staffJoinLeaveRecord.getStaffState()); + staffOnJobMapper.updateById(staffOnJob); + }else { + throw new BaseException("娌℃湁鎵惧埌"+staffJoinLeaveRecord.getStaffNo()+"缂栧彿鐨勫憳宸�,鏃犳硶鏂板绂昏亴!!!"); + } + } + return staffJoinLeaveRecordMapper.insert(staffJoinLeaveRecord); + } + + + //鍒犻櫎鍏ヨ亴/绂昏亴 + @Override + public int delStaffJoinLeaveRecord(List<Integer> ids) { + List<StaffJoinLeaveRecord> staffJoinLeaveRecords = staffJoinLeaveRecordMapper.selectBatchIds(ids); + for (StaffJoinLeaveRecord staffJoinLeaveRecord : staffJoinLeaveRecords) { + //鍏堝垽鏂槸鍏ヨ亴杩樻槸绂昏亴 + if (staffJoinLeaveRecord.getStaffState()==1){ + /*鍏ヨ亴*/ + //濡傛灉鏄叆鑱�,闇�瑕佸厛鏍规嵁鍛樺伐缂栧彿鍒ゆ柇璇ュ憳宸ユ槸鍚﹁繕鏈夊叾浠栧叆鑱屼俊鎭� + List<StaffJoinLeaveRecord> joinLeaveRecords = staffJoinLeaveRecordMapper.selectList(Wrappers.<StaffJoinLeaveRecord>lambdaQuery() + .eq(StaffJoinLeaveRecord::getStaffState, 1) + .eq(StaffJoinLeaveRecord::getStaffNo, staffJoinLeaveRecord.getStaffNo()) + .ne(StaffJoinLeaveRecord::getId, staffJoinLeaveRecord.getId())); + if (joinLeaveRecords.size()>0){ + //杩橀渶瑕佸垽鏂鍛樺伐鏄惁鏈夌鑱屼俊鎭� + List<StaffJoinLeaveRecord> leaveRecords = staffJoinLeaveRecordMapper.selectList(Wrappers.<StaffJoinLeaveRecord>lambdaQuery() + .eq(StaffJoinLeaveRecord::getStaffState, 0) + .eq(StaffJoinLeaveRecord::getStaffNo, staffJoinLeaveRecord.getStaffNo())); + // 濡傛灉鏈夐偅鍦ㄨ亴琛ㄤ粎鍋氭洿鏂颁笉鍒犻櫎,濡傛灉娌℃湁鍏朵粬鍏ヨ亴淇℃伅,閭d箞鍦ㄨ亴琛ㄩ渶鍚屾鍒犻櫎 + if (leaveRecords.size()>0){ + //濡傛灉鏈夌鑱屼俊鎭�,鍒ゆ柇绂昏亴鏁伴噺鍜屽叆鑱屾暟閲忔瘯绔�,濡傛灉鍏ヨ亴鏁伴噺澶т簬绂昏亴 + if (joinLeaveRecords.size()>leaveRecords.size()){ + //璇ュ憳宸ュ氨杩樻槸鍦ㄨ亴 + //鍏堟瘮杈冨埌鏈熸棩鏈�,杩欓噷閫夌敤鍒版湡鏃ユ湡鏈�涔呯殑 + Optional<StaffJoinLeaveRecord> max = joinLeaveRecords.stream().max(Comparator.comparing(StaffJoinLeaveRecord::getContractEndTime)); + staffOnJobMapper.update(null,Wrappers.<StaffOnJob>lambdaUpdate() + .eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo()) + .set(StaffOnJob::getContractTerm, max.get().getContractTerm()) + .set(StaffOnJob::getContractExpireTime, max.get().getContractEndTime())); + }else { + //璇ュ憳宸ュ睘浜庣鑱� + staffOnJobMapper.update(null,Wrappers.<StaffOnJob>lambdaUpdate() + .eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo()) + .set(StaffOnJob::getStaffState, 0)); + } + }else { + //濡傛灉娌℃湁绂昏亴淇℃伅閭d箞灏辨瘮杈冨埌鏈熸棩鏈�,杩欓噷閫夌敤鍒版湡鏃ユ湡鏈�涔呯殑 + Optional<StaffJoinLeaveRecord> max = joinLeaveRecords.stream().max(Comparator.comparing(StaffJoinLeaveRecord::getContractEndTime)); + staffOnJobMapper.update(null,Wrappers.<StaffOnJob>lambdaUpdate() + .eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo()) + .set(StaffOnJob::getContractTerm, max.get().getContractTerm()) + .set(StaffOnJob::getContractExpireTime, max.get().getContractEndTime())); + } + }else { + staffOnJobMapper.delete(Wrappers.<StaffOnJob>lambdaQuery().eq(StaffOnJob::getStaffNo,staffJoinLeaveRecord.getStaffNo())); + } + }else { + /*绂昏亴*/ + //鍏堟煡璇㈠湪鑱岃〃鏄惁鏈夎繖涓�,濡傛灉鏈�,灏卞皢璇ュ憳宸ョ殑鐘舵�佸彉鏇翠负鍦ㄨ亴 + List<StaffOnJob> staffOnJobs = staffOnJobMapper.selectList(Wrappers.<StaffOnJob>lambdaQuery().eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo())); + if (staffOnJobs.size()>0){ + StaffOnJob staffOnJob = staffOnJobs.get(0); + staffOnJob.setStaffState(1); + staffOnJobMapper.updateById(staffOnJob); + }else { + throw new BaseException("娌℃湁鎵惧埌"+staffJoinLeaveRecord.getStaffNo()+"缂栧彿鐨勫憳宸�,璇锋鏌ユ槸鍚︽湁鑴忔暟鎹�!!!"); + } + } + staffJoinLeaveRecordMapper.deleteById(staffJoinLeaveRecord); + } + return 0; + } + + //淇敼鍏ヨ亴/绂昏亴 + @Override + public int updateStaffJoinLeaveRecord(StaffJoinLeaveRecord staffJoinLeaveRecord) { + String[] ignoreProperties = {"id"};//鎺掗櫎id灞炴�� + List<StaffOnJob> staffOnJobs = staffOnJobMapper.selectList(Wrappers.<StaffOnJob>lambdaQuery().eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo())); + if (staffJoinLeaveRecord.getStaffState()==1){ + /*鍏ヨ亴*/ + StaffOnJob job = staffOnJobMapper.selectList(Wrappers.<StaffOnJob>lambdaQuery() + .eq(StaffOnJob::getStaffNo, staffJoinLeaveRecord.getStaffNo())).get(0); + //濡傛灉鏇存敼鐨勫悎鍚屽埌鏈熸椂闂存洿涔呭垯鏇存柊,濡傛灉娌℃湁灏变笉鐢ㄦ洿鏂� + if (staffJoinLeaveRecord.getContractEndTime().compareTo(job.getContractExpireTime())>0) { + BeanUtils.copyProperties(staffJoinLeaveRecord,job,ignoreProperties); + staffOnJobMapper.updateById(job); + } + }else { + /*绂昏亴*/ + //绂昏亴鐨勭紪杈戜笉浼氬奖鍝嶅湪鑱岃〃 + } + return staffJoinLeaveRecordMapper.updateById(staffJoinLeaveRecord); + } +} diff --git a/main-business/src/main/java/com/ruoyi/business/service/impl/StaffOnJobServiceImpl.java b/main-business/src/main/java/com/ruoyi/business/service/impl/StaffOnJobServiceImpl.java new file mode 100644 index 0000000..9a0b4cd --- /dev/null +++ b/main-business/src/main/java/com/ruoyi/business/service/impl/StaffOnJobServiceImpl.java @@ -0,0 +1,71 @@ +package com.ruoyi.business.service.impl; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.business.entity.StaffJoinLeaveRecord; +import com.ruoyi.business.entity.StaffOnJob; +import com.ruoyi.business.mapper.StaffJoinLeaveRecordMapper; +import com.ruoyi.business.mapper.StaffOnJobMapper; +import com.ruoyi.business.service.IStaffOnJobService; +import com.ruoyi.common.utils.poi.ExcelUtil; + +import jakarta.servlet.http.HttpServletResponse; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +@AllArgsConstructor +@Service +public class StaffOnJobServiceImpl extends ServiceImpl<StaffOnJobMapper, StaffOnJob> implements IStaffOnJobService { + + + private StaffOnJobMapper staffOnJobMapper; + + private StaffJoinLeaveRecordMapper staffJoinLeaveRecordMapper; + + //鍦ㄨ亴鍛樺伐鍙拌处鍒嗛〉鏌ヨ + @Override + public IPage<StaffOnJob> staffOnJobListPage(Page page, StaffOnJob staffOnJob) { + return staffOnJobMapper.staffOnJobListPage(page,staffOnJob); + } + + //鍦ㄨ亴鍛樺伐璇︽儏 + @Override + public List<StaffJoinLeaveRecord> staffOnJobDetail(String staffNo) { + return staffJoinLeaveRecordMapper.selectList(Wrappers.<StaffJoinLeaveRecord>lambdaQuery() + .eq(StaffJoinLeaveRecord::getStaffState,1) + .eq(StaffJoinLeaveRecord::getStaffNo,staffNo)); + } + + //鍦ㄨ亴鍛樺伐瀵煎嚭 + @Override + public void staffOnJobExport(HttpServletResponse response, StaffOnJob staffOnJob) { + List<StaffOnJob> staffOnJobs = staffOnJobMapper.staffOnJobList(staffOnJob); + ExcelUtil<StaffOnJob> util = new ExcelUtil<StaffOnJob>(StaffOnJob.class); + util.exportExcel(response, staffOnJobs, "鍦ㄨ亴鍛樺伐鍙拌处瀵煎嚭"); + } + + @Override + public List<StaffJoinLeaveRecord> staffOnJobList() { + return staffJoinLeaveRecordMapper.staffOnJobList(); + } + + @Override + public Boolean importData(MultipartFile file) { + try { + ExcelUtil<StaffOnJob> util = new ExcelUtil<>(StaffOnJob.class); + List<StaffOnJob> staffOnJobs = util.importExcel(file.getInputStream()); + return saveOrUpdateBatch(staffOnJobs); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + +} diff --git a/main-business/src/main/resources/mapper/CompensationPerformanceMapper.xml b/main-business/src/main/resources/mapper/CompensationPerformanceMapper.xml new file mode 100644 index 0000000..9b64c66 --- /dev/null +++ b/main-business/src/main/resources/mapper/CompensationPerformanceMapper.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.business.mapper.CompensationPerformanceMapper"> + + <select id="listPage" resultType="com.ruoyi.business.entity.CompensationPerformance"> + select * from compensation_performance + <where> + <if test="req.name != null and req.name != ''"> + and `name` like concat('%',#{req.name},'%') + </if> + <if test="req.payDateStr != null and req.payDateStr != ''"> + and pay_date like concat('%',#{req.payDateStr},'%') + </if> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml b/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml new file mode 100644 index 0000000..6a266ad --- /dev/null +++ b/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml @@ -0,0 +1,39 @@ +<?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.business.mapper.StaffJoinLeaveRecordMapper"> + <select id="staffJoinLeaveRecordListPage" resultType="com.ruoyi.business.entity.StaffJoinLeaveRecord"> + SELECT + * + FROM staff_join_leave_record + where + staff_state = #{staffJoinLeaveRecord.staffState} + <if test="staffJoinLeaveRecord.staffName != null and staffJoinLeaveRecord.staffName != '' "> + AND staff_name LIKE CONCAT('%',#{staffJoinLeaveRecord.staffName},'%') + </if> + <if test="staffJoinLeaveRecord.entryDateStart != null and staffJoinLeaveRecord.entryDateStart != '' "> + and contract_start_time like concat('%',#{staffJoinLeaveRecord.entryDateStart},'%') + </if> + <if test="staffJoinLeaveRecord.entryDateEnd != null and staffJoinLeaveRecord.entryDateEnd != '' "> + and contract_end_time like concat('%',#{staffJoinLeaveRecord.entryDateEnd},'%') + </if> + </select> + <select id="staffJoinLeaveRecordList" resultType="com.ruoyi.business.entity.StaffJoinLeaveRecord"> + SELECT + * + FROM staff_join_leave_record + where + staff_state = #{staffJoinLeaveRecord.staffState} + <if test="staffJoinLeaveRecord.staffName != null and staffJoinLeaveRecord.staffName != '' "> + AND staff_name LIKE CONCAT('%',#{staffJoinLeaveRecord.staffName},'%') + </if> + </select> + <select id="staffOnJobList" resultType="com.ruoyi.business.entity.StaffJoinLeaveRecord"> + select * + from (select *, + ROW_NUMBER() over (PARTITION BY staff_no ORDER BY create_time DESC ) as rn + from staff_join_leave_record + where staff_state = 1) t + where rn = 1 + + </select> +</mapper> diff --git a/main-business/src/main/resources/mapper/StaffOnJobMapper.xml b/main-business/src/main/resources/mapper/StaffOnJobMapper.xml new file mode 100644 index 0000000..0f6b71b --- /dev/null +++ b/main-business/src/main/resources/mapper/StaffOnJobMapper.xml @@ -0,0 +1,34 @@ +<?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.business.mapper.StaffOnJobMapper"> + <select id="staffOnJobListPage" resultType="com.ruoyi.business.entity.StaffOnJob"> + SELECT + * + FROM staff_on_job + where 1=1 + <if test="staffOnJob.staffState != null and staffOnJob.staffState != '' "> + AND staff_state = #{staffOnJob.staffState} + </if> + <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> + AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') + </if> + <if test="staffOnJob.entryDateStart != null and staffOnJob.entryDateStart != '' "> + AND contract_expire_time >= to_date(#{staffOnJob.entryDateStart},'YYYY-MM-DD') + </if> + <if test="staffOnJob.entryDateEnd != null and staffOnJob.entryDateEnd != '' "> + AND contract_expire_time <= to_date(#{staffOnJob.entryDateEnd},'YYYY-MM-DD') + </if> + </select> + <select id="staffOnJobList" resultType="com.ruoyi.business.entity.StaffOnJob"> + SELECT + * + FROM staff_on_job + where 1=1 + <if test="staffOnJob.staffState != null and staffOnJob.staffState != '' "> + AND staff_state = #{staffOnJob.staffState} + </if> + <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> + AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') + </if> + </select> +</mapper> -- Gitblit v1.9.3