parent
84d7fd2a54
commit
9dc0df5868
@ -0,0 +1,103 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.salarymonth.SalaryMonthDO;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.service.salarymonth.SalaryMonthService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 所属年月工资明细")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz/salary-month")
|
||||||
|
@Validated
|
||||||
|
public class SalaryMonthController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalaryMonthService salaryMonthService;
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Operation(summary = "保存所属年月工资明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:create')")
|
||||||
|
public CommonResult<Boolean> saveSalaryMonth(@Valid @RequestBody SalaryMonthSaveReqVO updateReqVO) {
|
||||||
|
salaryMonthService.saveSalaryMonth(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建所属年月工资明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:create')")
|
||||||
|
public CommonResult<Long> createSalaryMonth(@Valid @RequestBody SalaryMonthSaveReqVO createReqVO) {
|
||||||
|
return success(salaryMonthService.createSalaryMonth(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新所属年月工资明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:update')")
|
||||||
|
public CommonResult<Boolean> updateSalaryMonth(@Valid @RequestBody SalaryMonthSaveReqVO updateReqVO) {
|
||||||
|
salaryMonthService.updateSalaryMonth(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除所属年月工资明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSalaryMonth(@RequestParam("id") Long id) {
|
||||||
|
salaryMonthService.deleteSalaryMonth(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得所属年月工资明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:query')")
|
||||||
|
public CommonResult<SalaryMonthRespVO> getSalaryMonth(@RequestParam("id") Long id) {
|
||||||
|
SalaryMonthDO salaryMonth = salaryMonthService.getSalaryMonth(id);
|
||||||
|
return success(BeanUtils.toBean(salaryMonth, SalaryMonthRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得所属年月工资明细分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:query')")
|
||||||
|
public CommonResult<PageResult<SalaryMonthRespVO>> getSalaryMonthPage(@Valid SalaryMonthPageReqVO pageReqVO) {
|
||||||
|
PageResult<SalaryMonthDO> pageResult = salaryMonthService.getSalaryMonthPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, SalaryMonthRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出所属年月工资明细 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:salary-month:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportSalaryMonthExcel(@Valid SalaryMonthPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<SalaryMonthDO> list = salaryMonthService.getSalaryMonthPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "所属年月工资明细.xls", "数据", SalaryMonthRespVO.class,
|
||||||
|
BeanUtils.toBean(list, SalaryMonthRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 所属年月工资明细分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class SalaryMonthPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "员工id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "所属年月")
|
||||||
|
private String month;
|
||||||
|
|
||||||
|
@Schema(description = "实际出勤天数")
|
||||||
|
private Integer attendanceDays;
|
||||||
|
|
||||||
|
@Schema(description = "基本工资")
|
||||||
|
private BigDecimal basicSalary;
|
||||||
|
|
||||||
|
@Schema(description = "职务津贴")
|
||||||
|
private BigDecimal jobAllowance;
|
||||||
|
|
||||||
|
@Schema(description = "五险一金补贴")
|
||||||
|
private BigDecimal fiveOneFund;
|
||||||
|
|
||||||
|
@Schema(description = "敬业限制补贴")
|
||||||
|
private BigDecimal nonCompeteSubsidy;
|
||||||
|
|
||||||
|
@Schema(description = "3天周末加班")
|
||||||
|
private String weekendWork;
|
||||||
|
|
||||||
|
@Schema(description = "加班小时")
|
||||||
|
private BigDecimal weekendWorktime;
|
||||||
|
|
||||||
|
@Schema(description = "加班金额")
|
||||||
|
private BigDecimal weekendWorkAmount;
|
||||||
|
|
||||||
|
@Schema(description = "事假小时")
|
||||||
|
private BigDecimal absenceTime;
|
||||||
|
|
||||||
|
@Schema(description = "事假金额")
|
||||||
|
private BigDecimal absenceAmount;
|
||||||
|
|
||||||
|
@Schema(description = "全勤工资")
|
||||||
|
private BigDecimal fullAttendanceSalary;
|
||||||
|
|
||||||
|
@Schema(description = "工龄奖补助")
|
||||||
|
private BigDecimal serviceExperienceAward;
|
||||||
|
|
||||||
|
@Schema(description = "夜班/其他补助")
|
||||||
|
private BigDecimal otherAward;
|
||||||
|
|
||||||
|
@Schema(description = "应发工资")
|
||||||
|
private BigDecimal grossPay;
|
||||||
|
|
||||||
|
@Schema(description = "扣退休金")
|
||||||
|
private BigDecimal retireDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣医疗金")
|
||||||
|
private BigDecimal medicalDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣失业金")
|
||||||
|
private BigDecimal unemploymentDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣个税")
|
||||||
|
private BigDecimal taxDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣水电费")
|
||||||
|
private BigDecimal waterElectricityDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣餐费")
|
||||||
|
private BigDecimal foodDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣住宿费")
|
||||||
|
private BigDecimal lodgingDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣借款/其他")
|
||||||
|
private BigDecimal loanDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "补发")
|
||||||
|
private BigDecimal reissue;
|
||||||
|
|
||||||
|
@Schema(description = "实发工资")
|
||||||
|
private BigDecimal netSalary;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 所属年月工资明细 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SalaryMonthRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("自增字段,唯一")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "员工id")
|
||||||
|
@ExcelProperty("员工id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "所属年月")
|
||||||
|
@ExcelProperty("所属年月")
|
||||||
|
private String month;
|
||||||
|
|
||||||
|
@Schema(description = "实际出勤天数")
|
||||||
|
@ExcelProperty("实际出勤天数")
|
||||||
|
private Integer attendanceDays;
|
||||||
|
|
||||||
|
@Schema(description = "基本工资")
|
||||||
|
@ExcelProperty("基本工资")
|
||||||
|
private BigDecimal basicSalary;
|
||||||
|
|
||||||
|
@Schema(description = "职务津贴")
|
||||||
|
@ExcelProperty("职务津贴")
|
||||||
|
private BigDecimal jobAllowance;
|
||||||
|
|
||||||
|
@Schema(description = "五险一金补贴")
|
||||||
|
@ExcelProperty("五险一金补贴")
|
||||||
|
private BigDecimal fiveOneFund;
|
||||||
|
|
||||||
|
@Schema(description = "敬业限制补贴")
|
||||||
|
@ExcelProperty("敬业限制补贴")
|
||||||
|
private BigDecimal nonCompeteSubsidy;
|
||||||
|
|
||||||
|
@Schema(description = "3天周末加班")
|
||||||
|
@ExcelProperty("3天周末加班")
|
||||||
|
private String weekendWork;
|
||||||
|
|
||||||
|
@Schema(description = "加班小时")
|
||||||
|
@ExcelProperty("加班小时")
|
||||||
|
private BigDecimal weekendWorktime;
|
||||||
|
|
||||||
|
@Schema(description = "加班金额")
|
||||||
|
@ExcelProperty("加班金额")
|
||||||
|
private BigDecimal weekendWorkAmount;
|
||||||
|
|
||||||
|
@Schema(description = "事假小时")
|
||||||
|
@ExcelProperty("事假小时")
|
||||||
|
private BigDecimal absenceTime;
|
||||||
|
|
||||||
|
@Schema(description = "事假金额")
|
||||||
|
@ExcelProperty("事假金额")
|
||||||
|
private BigDecimal absenceAmount;
|
||||||
|
|
||||||
|
@Schema(description = "全勤工资")
|
||||||
|
@ExcelProperty("全勤工资")
|
||||||
|
private BigDecimal fullAttendanceSalary;
|
||||||
|
|
||||||
|
@Schema(description = "工龄奖补助")
|
||||||
|
@ExcelProperty("工龄奖补助")
|
||||||
|
private BigDecimal serviceExperienceAward;
|
||||||
|
|
||||||
|
@Schema(description = "夜班/其他补助")
|
||||||
|
@ExcelProperty("夜班/其他补助")
|
||||||
|
private BigDecimal otherAward;
|
||||||
|
|
||||||
|
@Schema(description = "应发工资")
|
||||||
|
@ExcelProperty("应发工资")
|
||||||
|
private BigDecimal grossPay;
|
||||||
|
|
||||||
|
@Schema(description = "扣退休金")
|
||||||
|
@ExcelProperty("扣退休金")
|
||||||
|
private BigDecimal retireDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣医疗金")
|
||||||
|
@ExcelProperty("扣医疗金")
|
||||||
|
private BigDecimal medicalDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣失业金")
|
||||||
|
@ExcelProperty("扣失业金")
|
||||||
|
private BigDecimal unemploymentDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣个税")
|
||||||
|
@ExcelProperty("扣个税")
|
||||||
|
private BigDecimal taxDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣水电费")
|
||||||
|
@ExcelProperty("扣水电费")
|
||||||
|
private BigDecimal waterElectricityDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣餐费")
|
||||||
|
@ExcelProperty("扣餐费")
|
||||||
|
private BigDecimal foodDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣住宿费")
|
||||||
|
@ExcelProperty("扣住宿费")
|
||||||
|
private BigDecimal lodgingDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣借款/其他")
|
||||||
|
@ExcelProperty("扣借款/其他")
|
||||||
|
private BigDecimal loanDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "补发")
|
||||||
|
@ExcelProperty("补发")
|
||||||
|
private BigDecimal reissue;
|
||||||
|
|
||||||
|
@Schema(description = "实发工资")
|
||||||
|
@ExcelProperty("实发工资")
|
||||||
|
private BigDecimal netSalary;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 所属年月工资明细新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class SalaryMonthSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "员工id")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "所属年月")
|
||||||
|
private String month;
|
||||||
|
|
||||||
|
@Schema(description = "实际出勤天数")
|
||||||
|
private Integer attendanceDays;
|
||||||
|
|
||||||
|
@Schema(description = "基本工资")
|
||||||
|
private BigDecimal basicSalary;
|
||||||
|
|
||||||
|
@Schema(description = "职务津贴")
|
||||||
|
private BigDecimal jobAllowance;
|
||||||
|
|
||||||
|
@Schema(description = "五险一金补贴")
|
||||||
|
private BigDecimal fiveOneFund;
|
||||||
|
|
||||||
|
@Schema(description = "敬业限制补贴")
|
||||||
|
private BigDecimal nonCompete_subsidy;
|
||||||
|
|
||||||
|
@Schema(description = "3天周末加班")
|
||||||
|
private String weekendWork;
|
||||||
|
|
||||||
|
@Schema(description = "加班小时")
|
||||||
|
private BigDecimal weekendWorktime;
|
||||||
|
|
||||||
|
@Schema(description = "加班金额")
|
||||||
|
private BigDecimal weekendWorkAmount;
|
||||||
|
|
||||||
|
@Schema(description = "事假小时")
|
||||||
|
private BigDecimal absenceTime;
|
||||||
|
|
||||||
|
@Schema(description = "事假金额")
|
||||||
|
private BigDecimal absenceAmount;
|
||||||
|
|
||||||
|
@Schema(description = "全勤工资")
|
||||||
|
private BigDecimal fullAttendanceSalary;
|
||||||
|
|
||||||
|
@Schema(description = "工龄奖补助")
|
||||||
|
private BigDecimal serviceExperienceAward;
|
||||||
|
|
||||||
|
@Schema(description = "夜班/其他补助")
|
||||||
|
private BigDecimal otherAward;
|
||||||
|
|
||||||
|
@Schema(description = "应发工资")
|
||||||
|
private BigDecimal grossPay;
|
||||||
|
|
||||||
|
@Schema(description = "扣退休金")
|
||||||
|
private BigDecimal retireDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣医疗金")
|
||||||
|
private BigDecimal medicalDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣失业金")
|
||||||
|
private BigDecimal unemploymentDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣个税")
|
||||||
|
private BigDecimal taxDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣水电费")
|
||||||
|
private BigDecimal waterElectricityDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣餐费")
|
||||||
|
private BigDecimal foodDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣住宿费")
|
||||||
|
private BigDecimal lodgingDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "扣借款/其他")
|
||||||
|
private BigDecimal loanDeduction;
|
||||||
|
|
||||||
|
@Schema(description = "补发")
|
||||||
|
private BigDecimal reissue;
|
||||||
|
|
||||||
|
@Schema(description = "实发工资")
|
||||||
|
private BigDecimal netSalary;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.dal.mysql.salarymonth;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.salarymonth.SalaryMonthDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属年月工资明细 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SalaryMonthMapper extends BaseMapperX<SalaryMonthDO> {
|
||||||
|
|
||||||
|
default PageResult<SalaryMonthDO> selectPage(SalaryMonthPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SalaryMonthDO>()
|
||||||
|
.eqIfPresent(SalaryMonthDO::getId, reqVO.getId())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getUserId, reqVO.getUserId())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getMonth, reqVO.getMonth())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getAttendanceDays, reqVO.getAttendanceDays())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getBasicSalary, reqVO.getBasicSalary())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getJobAllowance, reqVO.getJobAllowance())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getFiveOneFund, reqVO.getFiveOneFund())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getNonCompeteSubsidy, reqVO.getNonCompeteSubsidy())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getWeekendWork, reqVO.getWeekendWork())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getWeekendWorktime, reqVO.getWeekendWorktime())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getWeekendWorkAmount, reqVO.getWeekendWorkAmount())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getAbsenceTime, reqVO.getAbsenceTime())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getAbsenceAmount, reqVO.getAbsenceAmount())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getFullAttendanceSalary, reqVO.getFullAttendanceSalary())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getServiceExperienceAward, reqVO.getServiceExperienceAward())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getOtherAward, reqVO.getOtherAward())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getGrossPay, reqVO.getGrossPay())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getRetireDeduction, reqVO.getRetireDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getMedicalDeduction, reqVO.getMedicalDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getUnemploymentDeduction, reqVO.getUnemploymentDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getTaxDeduction, reqVO.getTaxDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getWaterElectricityDeduction, reqVO.getWaterElectricityDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getFoodDeduction, reqVO.getFoodDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getLodgingDeduction, reqVO.getLodgingDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getLoanDeduction, reqVO.getLoanDeduction())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getReissue, reqVO.getReissue())
|
||||||
|
.eqIfPresent(SalaryMonthDO::getNetSalary, reqVO.getNetSalary())
|
||||||
|
.betweenIfPresent(SalaryMonthDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(SalaryMonthDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.salarymonth;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.salarymonth.SalaryMonthDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属年月工资明细 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface SalaryMonthService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建所属年月工资明细
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createSalaryMonth(@Valid SalaryMonthSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新所属年月工资明细
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSalaryMonth(@Valid SalaryMonthSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存所属年月工资明细
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void saveSalaryMonth(@Valid SalaryMonthSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除所属年月工资明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSalaryMonth(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得所属年月工资明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 所属年月工资明细
|
||||||
|
*/
|
||||||
|
SalaryMonthDO getSalaryMonth(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得所属年月工资明细分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 所属年月工资明细分页
|
||||||
|
*/
|
||||||
|
PageResult<SalaryMonthDO> getSalaryMonthPage(SalaryMonthPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.salarymonth;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.salarymonth.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.salarymonth.SalaryMonthDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.mysql.salarymonth.SalaryMonthMapper;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.biz.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属年月工资明细 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class SalaryMonthServiceImpl implements SalaryMonthService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SalaryMonthMapper salaryMonthMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createSalaryMonth(SalaryMonthSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
SalaryMonthDO salaryMonth = BeanUtils.toBean(createReqVO, SalaryMonthDO.class);
|
||||||
|
salaryMonthMapper.insert(salaryMonth);
|
||||||
|
// 返回
|
||||||
|
return salaryMonth.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSalaryMonth(SalaryMonthSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalaryMonthExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
SalaryMonthDO updateObj = BeanUtils.toBean(updateReqVO, SalaryMonthDO.class);
|
||||||
|
salaryMonthMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveSalaryMonth(SalaryMonthSaveReqVO updateReqVO) {
|
||||||
|
SalaryMonthDO salaryMonth = salaryMonthMapper.selectOne(SalaryMonthDO::getUserId,updateReqVO.getUserId(),SalaryMonthDO::getMonth,updateReqVO.getMonth());
|
||||||
|
|
||||||
|
if(salaryMonth == null){
|
||||||
|
// 插入
|
||||||
|
salaryMonthMapper.insert(BeanUtils.toBean(updateReqVO, SalaryMonthDO.class));
|
||||||
|
}else{
|
||||||
|
// 更新
|
||||||
|
salaryMonthMapper.updateById(BeanUtils.toBean(updateReqVO, SalaryMonthDO.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSalaryMonth(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateSalaryMonthExists(id);
|
||||||
|
// 删除
|
||||||
|
salaryMonthMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSalaryMonthExists(Long id) {
|
||||||
|
if (salaryMonthMapper.selectById(id) == null) {
|
||||||
|
throw exception(SALARY_MONTH_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SalaryMonthDO getSalaryMonth(Long id) {
|
||||||
|
return salaryMonthMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SalaryMonthDO> getSalaryMonthPage(SalaryMonthPageReqVO pageReqVO) {
|
||||||
|
return salaryMonthMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue