人员工资、退场,巡检工单

This commit is contained in:
lcj
2025-09-04 17:05:00 +08:00
parent 43d249d68a
commit 4e61a4afe9
58 changed files with 2085 additions and 71 deletions

View File

@ -13,7 +13,7 @@ spring.boot.admin.client:
--- # snail-job 配置
snail-job:
enabled: true
enabled: false
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
group: "ruoyi_group"
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
@ -53,13 +53,13 @@ spring:
username: xinnengyuandev
password: StRWCZdZirysNSs2
# 从库数据源
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username: zmkgdev
# password: JhYxREf25AXdy3h8
# slave:
# lazy: true
# type: ${spring.datasource.type}
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username: zmkgdev
# password: JhYxREf25AXdy3h8
# oracle:
# type: ${spring.datasource.type}
# driverClassName: oracle.jdbc.OracleDriver

View File

@ -1,9 +1,12 @@
package org.dromara.test;
import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.contractor.domain.SubConstructionUser;
import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.design.service.IDesTechnicalStandardService;
import org.dromara.facility.domain.FacMatrix;
import org.dromara.facility.service.IFacMatrixService;
@ -12,8 +15,6 @@ import org.dromara.progress.service.IPgsProgressCategoryService;
import org.dromara.progress.service.IPgsProgressCategoryTemplateService;
import org.dromara.project.service.IBusProjectService;
import org.dromara.system.service.ISysDeptService;
import org.dromara.tender.domain.bo.TenderSupplierInputBo;
import org.dromara.tender.domain.vo.TenderSupplierInputVo;
import org.dromara.tender.service.impl.TenderSupplierInputServiceImpl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +54,9 @@ public class DemoTest {
@Autowired
private TenderSupplierInputServiceImpl tenderSupplierInputService;
@Resource
private ISubConstructionUserService constructionUserService;
@Test
void test() {
Boolean result = photovoltaicPanelPartsService
@ -108,8 +112,12 @@ public class DemoTest {
}*/
@Test
void tenderExport(){
void tenderExport() {
// 同步修改用户表的team_id字段并添加入场时间
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
.in(SubConstructionUser::getId, 1961446214960435201L, 1963077776210710529L, 1963080543771832321L, 1963151975159324673L)
.set(SubConstructionUser::getEntryDate, new Date());
constructionUserService.update(constructionUserLuw);
}
}

View File

@ -376,4 +376,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
}
}
/**
* 校验日期范围
*
* @param startDate 开始日期
* @param endDate 结束日期
* @return true 表示日期范围有效false 表示日期范围无效
*/
public static boolean isValidDateRange(LocalDate startDate, LocalDate endDate) {
try {
return !startDate.isAfter(endDate); // start <= end
} catch (DateTimeParseException e) {
return false; // 格式非法
}
}
}

View File

@ -71,7 +71,7 @@ public class MybatisPlusConfig {
public PaginationInnerInterceptor paginationInnerInterceptor() {
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
// 分页合理化
paginationInnerInterceptor.setOverflow(true);
paginationInnerInterceptor.setOverflow(false);
return paginationInnerInterceptor;
}

View File

@ -0,0 +1,80 @@
package org.dromara.contractor.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodCreateReq;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodQueryReq;
import org.dromara.contractor.domain.vo.salaryperiod.SubSalaryPeriodVo;
import org.dromara.contractor.service.ISubSalaryPeriodService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 工资结算周期
*
* @author lilemy
* @date 2025-09-04
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/contractor/salaryPeriod")
public class SubSalaryPeriodController extends BaseController {
private final ISubSalaryPeriodService subSalaryPeriodService;
/**
* 查询工资结算周期列表
*/
@SaCheckPermission("contractor:salaryPeriod:list")
@GetMapping("/list")
public TableDataInfo<SubSalaryPeriodVo> list(SubSalaryPeriodQueryReq req, PageQuery pageQuery) {
return subSalaryPeriodService.queryPageList(req, pageQuery);
}
/**
* 导出工资结算周期列表
*/
@SaCheckPermission("contractor:salaryPeriod:export")
@Log(title = "工资结算周期", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(SubSalaryPeriodQueryReq req, HttpServletResponse response) {
List<SubSalaryPeriodVo> list = subSalaryPeriodService.queryList(req);
ExcelUtil.exportExcel(list, "工资结算周期", SubSalaryPeriodVo.class, response);
}
/**
* 获取工资结算周期详细信息
*
* @param id 主键
*/
@SaCheckPermission("contractor:salaryPeriod:query")
@GetMapping("/{id}")
public R<SubSalaryPeriodVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(subSalaryPeriodService.queryById(id));
}
/**
* 新增工资结算周期
*/
@SaCheckPermission("contractor:salaryPeriod:add")
@Log(title = "工资结算周期", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated @RequestBody SubSalaryPeriodCreateReq req) {
return toAjax(subSalaryPeriodService.insertByBo(req));
}
}

View File

@ -0,0 +1,68 @@
package org.dromara.contractor.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq;
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
import org.dromara.contractor.service.ISubUserSalaryDetailService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 员工每日工资
*
* @author lilemy
* @date 2025-09-04
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/contractor/userSalaryDetail")
public class SubUserSalaryDetailController extends BaseController {
private final ISubUserSalaryDetailService subUserSalaryDetailService;
/**
* 查询员工每日工资列表
*/
@SaCheckPermission("contractor:userSalaryDetail:list")
@GetMapping("/list")
public TableDataInfo<SubUserSalaryDetailVo> list(SubUserSalaryDetailQueryReq req, PageQuery pageQuery) {
return subUserSalaryDetailService.queryPageList(req, pageQuery);
}
/**
* 导出员工每日工资列表
*/
@SaCheckPermission("contractor:userSalaryDetail:export")
@Log(title = "员工每日工资", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(SubUserSalaryDetailQueryReq req, HttpServletResponse response) {
List<SubUserSalaryDetailVo> list = subUserSalaryDetailService.queryList(req);
ExcelUtil.exportExcel(list, "员工每日工资", SubUserSalaryDetailVo.class, response);
}
/**
* 获取员工每日工资详细信息
*
* @param id 主键
*/
@SaCheckPermission("contractor:userSalaryDetail:query")
@GetMapping("/{id}")
public R<SubUserSalaryDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(subUserSalaryDetailService.queryById(id));
}
}

View File

@ -5,6 +5,7 @@ import jakarta.validation.constraints.NotNull;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
import org.dromara.contractor.domain.vo.contractor.SubManagerVo;
import org.dromara.contractor.service.ISubContractorService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -36,4 +37,13 @@ public class SubContractorAppController extends BaseController {
@PathVariable Long projectId) {
return R.ok(contractorService.queryManagerListByProjectId(projectId));
}
/**
* 根据分包方id查询分包方管理人员信息列表
*/
@GetMapping("/listManagerById/{id}")
public R<List<SubManagerVo>> listManagerById(@NotNull(message = "分包方主键不能为空")
@PathVariable Long id) {
return R.ok(contractorService.queryManagerListById(id));
}
}

View File

@ -0,0 +1,38 @@
package org.dromara.contractor.controller.app;
import jakarta.annotation.Resource;
import org.dromara.common.core.domain.R;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.web.core.BaseController;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodCreateReq;
import org.dromara.contractor.service.ISubSalaryPeriodService;
import org.springframework.validation.annotation.Validated;
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;
/**
* @author lilemy
* @date 2025-09-04 14:13
*/
@Validated
@RestController
@RequestMapping("/app/contractor/salaryPeriod")
public class SubSalaryPeriodAppController extends BaseController {
@Resource
private ISubSalaryPeriodService salaryPeriodService;
/**
* 新增工资结算周期
*/
@Log(title = "工资结算周期", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated @RequestBody SubSalaryPeriodCreateReq req) {
return toAjax(salaryPeriodService.insertByBo(req));
}
}

View File

@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
@ -102,12 +104,12 @@ public class SubConstructionUser extends BaseEntity {
/**
* 身份证有效开始期
*/
private String sfzStart;
private LocalDate sfzStart;
/**
* 身份证有效结束期
*/
private String sfzEnd;
private LocalDate sfzEnd;
/**
* 身份证地址
@ -117,7 +119,7 @@ public class SubConstructionUser extends BaseEntity {
/**
* 身份证出生日期
*/
private String sfzBirth;
private LocalDate sfzBirth;
/**
* 籍贯
@ -177,13 +179,18 @@ public class SubConstructionUser extends BaseEntity {
/**
* 薪水
*/
private Long salary;
private BigDecimal salary;
/**
* 用户角色
*/
private String userRole;
/**
* 退场状态(0未退场 1退场未提交材料 2已退场)
*/
private String exitStatus;
/**
* 备注
*/

View File

@ -0,0 +1,73 @@
package org.dromara.contractor.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 工资结算周期对象 sub_salary_period
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sub_salary_period")
public class SubSalaryPeriod extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id")
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 班组id
*/
private Long teamId;
/**
* 开始日期
*/
private LocalDate startDate;
/**
* 结束日期
*/
private LocalDate endDate;
/**
* 总天数
*/
private Long totalDays;
/**
* 总工资
*/
private BigDecimal totalWage;
/**
* 状态 0-未开始 1-进行中 2-已完成
*/
private String status;
/**
* 备注
*/
private String remark;
}

View File

@ -0,0 +1,68 @@
package org.dromara.contractor.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 员工每日工资对象 sub_user_salary_detail
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sub_user_salary_detail")
public class SubUserSalaryDetail extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id")
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 班组id
*/
private Long teamId;
/**
* 用户id
*/
private Long userId;
/**
* 用户名字
*/
private String userName;
/**
* 日报日期
*/
private LocalDate reportDate;
/**
* 当日工资
*/
private BigDecimal dailySalary;
/**
* 备注
*/
private String remark;
}

View File

@ -0,0 +1,62 @@
package org.dromara.contractor.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 员工工资周期对象 sub_user_salary_period
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sub_user_salary_period")
public class SubUserSalaryPeriod extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id")
private Long id;
/**
* 项目id
*/
private Long projectId;
/**
* 工资周期id
*/
private Long periodId;
/**
* 用户id
*/
private Long userId;
/**
* 出勤天数
*/
private Long workDays;
/**
* 总工资
*/
private BigDecimal totalWage;
/**
* 备注
*/
private String remark;
}

View File

@ -1,10 +1,12 @@
package org.dromara.contractor.domain.dto.constructionuser;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lilemy
@ -66,14 +68,14 @@ public class SubConstructionUserAuthenticationReq implements Serializable {
/**
* 身份证有效开始期
*/
@NotBlank(message = "身份证有效开始期不能为空")
private String sfzStart;
@NotNull(message = "身份证有效开始期不能为空")
private LocalDate sfzStart;
/**
* 身份证有效结束期
*/
@NotBlank(message = "身份证有效结束期不能为空")
private String sfzEnd;
@NotNull(message = "身份证有效结束期不能为空")
private LocalDate sfzEnd;
/**
* 身份证地址
@ -84,8 +86,8 @@ public class SubConstructionUserAuthenticationReq implements Serializable {
/**
* 身份证出生日期
*/
@NotBlank(message = "身份证出生日期不能为空")
private String sfzBirth;
@NotNull(message = "身份证出生日期不能为空")
private LocalDate sfzBirth;
/**
* 籍贯

View File

@ -4,6 +4,8 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* @author lilemy
@ -73,12 +75,12 @@ public class SubConstructionUserCreateReq implements Serializable {
/**
* 身份证有效开始期
*/
private String sfzStart;
private LocalDate sfzStart;
/**
* 身份证有效结束期
*/
private String sfzEnd;
private LocalDate sfzEnd;
/**
* 身份证地址
@ -88,7 +90,7 @@ public class SubConstructionUserCreateReq implements Serializable {
/**
* 身份证出生日期
*/
private String sfzBirth;
private LocalDate sfzBirth;
/**
* 籍贯
@ -138,7 +140,7 @@ public class SubConstructionUserCreateReq implements Serializable {
/**
* 薪水
*/
private Long salary;
private BigDecimal salary;
/**
* 备注

View File

@ -4,7 +4,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lilemy
@ -87,8 +86,13 @@ public class SubConstructionUserQueryReq implements Serializable {
private String notUserRole;
/**
* 场时间
* 场时间(枚举)
*/
private LocalDate entryDate;
private String entryDate;
/**
* 工作状态(枚举)
*/
private String workStatus;
}

View File

@ -5,6 +5,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lilemy
@ -90,7 +91,7 @@ public class SubConstructionUserUpdateReq implements Serializable {
/**
* 薪水
*/
private Long salary;
private BigDecimal salary;
/**
* 备注

View File

@ -5,6 +5,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lilemy
@ -25,6 +26,6 @@ public class SubConstructionUserUpdateSalaryReq implements Serializable {
/**
* 薪水
*/
private Long salary;
private BigDecimal salary;
}

View File

@ -0,0 +1,44 @@
package org.dromara.contractor.domain.dto.salaryperiod;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lilemy
* @date 2025-09-04 11:29
*/
@Data
public class SubSalaryPeriodCreateReq implements Serializable {
@Serial
private static final long serialVersionUID = -728942003745404575L;
/**
* 项目id
*/
@NotNull(message = "项目id不能为空")
private Long projectId;
/**
* 班组id
*/
@NotNull(message = "班组id不能为空")
private Long teamId;
/**
* 开始日期
*/
@NotNull(message = "开始日期不能为空")
private LocalDate startDate;
/**
* 结束日期
*/
@NotNull(message = "结束日期不能为空")
private LocalDate endDate;
}

View File

@ -0,0 +1,49 @@
package org.dromara.contractor.domain.dto.salaryperiod;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lilemy
* @date 2025-09-04 11:29
*/
@Data
public class SubSalaryPeriodQueryReq implements Serializable {
@Serial
private static final long serialVersionUID = -1693221222192776848L;
/**
* 项目id
*/
private Long projectId;
/**
* 班组id
*/
private Long teamId;
/**
* 开始日期
*/
private LocalDate startDate;
/**
* 结束日期
*/
private LocalDate endDate;
/**
* 日期
*/
private LocalDate date;
/**
* 状态 0-未开始 1-进行中 2-已完成
*/
private String status;
}

View File

@ -0,0 +1,43 @@
package org.dromara.contractor.domain.dto.usersalarydetail;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author lilemy
* @date 2025-09-04 10:32
*/
@Data
public class SubUserSalaryDetailQueryReq implements Serializable {
@Serial
private static final long serialVersionUID = -2689628817091015362L;
/**
* 项目id
*/
private Long projectId;
/**
* 班组id
*/
private Long teamId;
/**
* 用户id
*/
private Long userId;
/**
* 用户名字
*/
private String userName;
/**
* 日报日期
*/
private LocalDate reportDate;
}

View File

@ -0,0 +1,32 @@
package org.dromara.contractor.domain.dto.usersalaryperiod;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* @author lilemy
* @date 2025-09-04 12:32
*/
@Data
public class SubUserSalaryPeriodQueryReq implements Serializable {
@Serial
private static final long serialVersionUID = 8523127366299970220L;
/**
* 项目id
*/
private Long projectId;
/**
* 工资周期id
*/
private Long periodId;
/**
* 用户id
*/
private Long userId;
}

View File

@ -9,10 +9,11 @@ import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.contractor.domain.SubConstructionUser;
import org.dromara.contractor.domain.vo.contractor.SubContractorVo;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
@ -72,9 +73,9 @@ public class SubConstructionUserVo implements Serializable {
private Long contractorId;
/**
* 分包公司
* 分包名称
*/
private SubContractorVo contractorVo;
private String contractorName;
/**
* 班组id
@ -148,13 +149,13 @@ public class SubConstructionUserVo implements Serializable {
* 身份证有效开始期
*/
@ExcelProperty(value = "身份证有效开始期")
private String sfzStart;
private LocalDate sfzStart;
/**
* 身份证有效结束期
*/
@ExcelProperty(value = "身份证有效结束期")
private String sfzEnd;
private LocalDate sfzEnd;
/**
* 身份证地址
@ -166,7 +167,12 @@ public class SubConstructionUserVo implements Serializable {
* 身份证出生日期
*/
@ExcelProperty(value = "身份证出生日期")
private String sfzBirth;
private LocalDate sfzBirth;
/**
* 年龄
*/
private Integer age;
/**
* 籍贯
@ -246,13 +252,13 @@ public class SubConstructionUserVo implements Serializable {
* 标准薪水
*/
@ExcelProperty(value = "标准薪水")
private Long standardSalary;
private BigDecimal standardSalary;
/**
* 薪水
*/
@ExcelProperty(value = "薪水")
private Long salary;
private BigDecimal salary;
/**
* 用户角色
@ -266,6 +272,11 @@ public class SubConstructionUserVo implements Serializable {
@ExcelDictFormat(dictType = "user_file_status_type")
private String fileUploadStatus;
/**
* 退场状态(0未退场 1退场未提交材料 2已退场)
*/
private String exitStatus;
/**
* 备注
*/

View File

@ -0,0 +1,83 @@
package org.dromara.contractor.domain.vo.salaryperiod;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.contractor.domain.SubSalaryPeriod;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 工资结算周期视图对象 sub_salary_period
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = SubSalaryPeriod.class)
public class SubSalaryPeriodVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@ExcelProperty(value = "主键id")
private Long id;
/**
* 项目id
*/
@ExcelProperty(value = "项目id")
private Long projectId;
/**
* 班组id
*/
@ExcelProperty(value = "班组id")
private Long teamId;
/**
* 开始日期
*/
@ExcelProperty(value = "开始日期")
private LocalDate startDate;
/**
* 结束日期
*/
@ExcelProperty(value = "结束日期")
private LocalDate endDate;
/**
* 总天数
*/
@ExcelProperty(value = "总天数")
private Long totalDays;
/**
* 总工资
*/
@ExcelProperty(value = "总工资")
private BigDecimal totalWage;
/**
* 状态 0-未开始 1-进行中 2-已完成
*/
@ExcelProperty(value = "状态 0-未开始 1-进行中 2-已完成")
private String status;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,77 @@
package org.dromara.contractor.domain.vo.usersalarydetail;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.contractor.domain.SubUserSalaryDetail;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 员工每日工资视图对象 sub_user_salary_detail
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = SubUserSalaryDetail.class)
public class SubUserSalaryDetailVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@ExcelProperty(value = "主键id")
private Long id;
/**
* 项目id
*/
@ExcelProperty(value = "项目id")
private Long projectId;
/**
* 班组id
*/
@ExcelProperty(value = "班组id")
private Long teamId;
/**
* 用户id
*/
@ExcelProperty(value = "用户id")
private Long userId;
/**
* 用户名字
*/
@ExcelProperty(value = "用户名字")
private String userName;
/**
* 日报日期
*/
@ExcelProperty(value = "日报日期")
private LocalDate reportDate;
/**
* 当日工资
*/
@ExcelProperty(value = "当日工资")
private BigDecimal dailySalary;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,70 @@
package org.dromara.contractor.domain.vo.usersalaryperiod;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.contractor.domain.SubUserSalaryPeriod;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 员工工资周期视图对象 sub_user_salary_period
*
* @author lilemy
* @date 2025-09-04
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = SubUserSalaryPeriod.class)
public class SubUserSalaryPeriodVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@ExcelProperty(value = "主键id")
private Long id;
/**
* 项目id
*/
@ExcelProperty(value = "项目id")
private Long projectId;
/**
* 工资周期id
*/
@ExcelProperty(value = "工资周期id")
private Long periodId;
/**
* 用户id
*/
@ExcelProperty(value = "用户id")
private Long userId;
/**
* 出勤天数
*/
@ExcelProperty(value = "出勤天数")
private Long workDays;
/**
* 总工资
*/
@ExcelProperty(value = "总工资")
private BigDecimal totalWage;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,15 @@
package org.dromara.contractor.mapper;
import org.dromara.contractor.domain.SubSalaryPeriod;
import org.dromara.contractor.domain.vo.salaryperiod.SubSalaryPeriodVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 工资结算周期Mapper接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface SubSalaryPeriodMapper extends BaseMapperPlus<SubSalaryPeriod, SubSalaryPeriodVo> {
}

View File

@ -0,0 +1,15 @@
package org.dromara.contractor.mapper;
import org.dromara.contractor.domain.SubUserSalaryDetail;
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 员工每日工资Mapper接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface SubUserSalaryDetailMapper extends BaseMapperPlus<SubUserSalaryDetail, SubUserSalaryDetailVo> {
}

View File

@ -0,0 +1,15 @@
package org.dromara.contractor.mapper;
import org.dromara.contractor.domain.SubUserSalaryPeriod;
import org.dromara.contractor.domain.vo.usersalaryperiod.SubUserSalaryPeriodVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 员工工资周期Mapper接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface SubUserSalaryPeriodMapper extends BaseMapperPlus<SubUserSalaryPeriod, SubUserSalaryPeriodVo> {
}

View File

@ -11,6 +11,7 @@ import org.dromara.contractor.domain.dto.contractor.SubContractorQueryReq;
import org.dromara.contractor.domain.dto.contractor.SubContractorUpdateReq;
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
import org.dromara.contractor.domain.vo.contractor.SubContractorVo;
import org.dromara.contractor.domain.vo.contractor.SubManagerVo;
import java.util.Collection;
import java.util.List;
@ -104,4 +105,12 @@ public interface ISubContractorService extends IService<SubContractor> {
* @return 分包公司经理列表
*/
List<SubContractorManagerVo> queryManagerListByProjectId(Long projectId);
/**
* 获取分包方管理员列表
*
* @param id 分包方id
* @return 分包方管理员列表
*/
List<SubManagerVo> queryManagerListById(Long id);
}

View File

@ -0,0 +1,80 @@
package org.dromara.contractor.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubSalaryPeriod;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodCreateReq;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodQueryReq;
import org.dromara.contractor.domain.vo.salaryperiod.SubSalaryPeriodVo;
import java.util.List;
/**
* 工资结算周期Service接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface ISubSalaryPeriodService extends IService<SubSalaryPeriod> {
/**
* 查询工资结算周期
*
* @param id 主键
* @return 工资结算周期
*/
SubSalaryPeriodVo queryById(Long id);
/**
* 分页查询工资结算周期列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 工资结算周期分页列表
*/
TableDataInfo<SubSalaryPeriodVo> queryPageList(SubSalaryPeriodQueryReq req, PageQuery pageQuery);
/**
* 查询符合条件的工资结算周期列表
*
* @param req 查询条件
* @return 工资结算周期列表
*/
List<SubSalaryPeriodVo> queryList(SubSalaryPeriodQueryReq req);
/**
* 新增工资结算周期
*
* @param req 工资结算周期
* @return 是否新增成功
*/
Boolean insertByBo(SubSalaryPeriodCreateReq req);
/**
* 获取员工每日工资对视图
*
* @param salaryPeriod 员工每日工资对
* @return 员工每日工资对视图
*/
SubSalaryPeriodVo getVo(SubSalaryPeriod salaryPeriod);
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
LambdaQueryWrapper<SubSalaryPeriod> buildQueryWrapper(SubSalaryPeriodQueryReq req);
/**
* 获取员工每日工资对分页视图
*
* @param salaryPeriodPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
Page<SubSalaryPeriodVo> getVoPage(Page<SubSalaryPeriod> salaryPeriodPage);
}

View File

@ -0,0 +1,81 @@
package org.dromara.contractor.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubUserSalaryDetail;
import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq;
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
import java.time.LocalDate;
import java.util.List;
/**
* 员工每日工资Service接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface ISubUserSalaryDetailService extends IService<SubUserSalaryDetail> {
/**
* 查询员工每日工资
*
* @param id 主键
* @return 员工每日工资
*/
SubUserSalaryDetailVo queryById(Long id);
/**
* 分页查询员工每日工资列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 员工每日工资分页列表
*/
TableDataInfo<SubUserSalaryDetailVo> queryPageList(SubUserSalaryDetailQueryReq req, PageQuery pageQuery);
/**
* 查询符合条件的员工每日工资列表
*
* @param req 查询条件
* @return 员工每日工资列表
*/
List<SubUserSalaryDetailVo> queryList(SubUserSalaryDetailQueryReq req);
/**
* 根据考勤新增员工每日工资
*
* @param userId 用户id
* @param reportDate 日报日期
* @return 是否新增成功
*/
Boolean insertByAttendance(Long userId, LocalDate reportDate);
/**
* 获取员工每日工资对视图
*
* @param userSalaryDetail 员工每日工资对
* @return 员工每日工资对视图
*/
SubUserSalaryDetailVo getVo(SubUserSalaryDetail userSalaryDetail);
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
LambdaQueryWrapper<SubUserSalaryDetail> buildQueryWrapper(SubUserSalaryDetailQueryReq req);
/**
* 获取员工每日工资对分页视图
*
* @param userSalaryDetailPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
Page<SubUserSalaryDetailVo> getVoPage(Page<SubUserSalaryDetail> userSalaryDetailPage);
}

View File

@ -0,0 +1,70 @@
package org.dromara.contractor.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubUserSalaryPeriod;
import org.dromara.contractor.domain.dto.usersalaryperiod.SubUserSalaryPeriodQueryReq;
import org.dromara.contractor.domain.vo.usersalaryperiod.SubUserSalaryPeriodVo;
import java.util.List;
/**
* 员工工资周期Service接口
*
* @author lilemy
* @date 2025-09-04
*/
public interface ISubUserSalaryPeriodService extends IService<SubUserSalaryPeriod> {
/**
* 查询员工工资周期
*
* @param id 主键
* @return 员工工资周期
*/
SubUserSalaryPeriodVo queryById(Long id);
/**
* 分页查询员工工资周期列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 员工工资周期分页列表
*/
TableDataInfo<SubUserSalaryPeriodVo> queryPageList(SubUserSalaryPeriodQueryReq req, PageQuery pageQuery);
/**
* 查询符合条件的员工工资周期列表
*
* @param req 查询条件
* @return 员工工资周期列表
*/
List<SubUserSalaryPeriodVo> queryList(SubUserSalaryPeriodQueryReq req);
/**
* 获取员工每日工资对视图
*
* @param userSalaryPeriod 员工每日工资对
* @return 员工每日工资对视图
*/
SubUserSalaryPeriodVo getVo(SubUserSalaryPeriod userSalaryPeriod);
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
LambdaQueryWrapper<SubUserSalaryPeriod> buildQueryWrapper(SubUserSalaryPeriodQueryReq req);
/**
* 获取员工每日工资对分页视图
*
* @param userSalaryPeriodPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
Page<SubUserSalaryPeriodVo> getVoPage(Page<SubUserSalaryPeriod> userSalaryPeriodPage);
}

View File

@ -63,10 +63,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;
import java.time.YearMonth;
import java.util.*;
import java.util.stream.Collectors;
@ -280,7 +282,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
BusConstructionUserExportVo constructionUserExportVo = new BusConstructionUserExportVo();
BeanUtils.copyProperties(constructionUserVo, constructionUserExportVo);
// 关联分包公司信息
constructionUserExportVo.setContractorName(constructionUserVo.getContractorVo().getName());
constructionUserExportVo.setContractorName(constructionUserVo.getContractorName());
// 关联项目信息
Long projectId = constructionUserVo.getProjectId();
String projectName = null;
@ -389,7 +391,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
@Override
public Boolean updateSalary(SubConstructionUserUpdateSalaryReq req) {
Long id = req.getId();
Long salary = req.getSalary();
BigDecimal salary = req.getSalary();
// 判断对应施工人员是否存在
SubConstructionUser oldConstructionUser = this.getById(id);
if (oldConstructionUser == null) {
@ -401,7 +403,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
SubConstructionUser constructionUser = new SubConstructionUser();
constructionUser.setId(id);
// 修改薪水
constructionUser.setSalary(Objects.requireNonNullElse(salary, 0L));
constructionUser.setSalary(Objects.requireNonNullElse(salary, BigDecimal.ZERO));
// 操作数据库
return this.updateById(constructionUser);
}
@ -674,7 +676,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
// 关联查询分包公司信息信息
Long contractorId = constructionUser.getContractorId();
if (contractorId != null) {
constructionUserVo.setContractorVo(contractorService.queryById(contractorId));
constructionUserVo.setContractorName(contractorService.getById(contractorId).getName());
}
// 关联查询用户头像url
String facePic = constructionUser.getFacePic();
@ -714,6 +716,12 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
String hideBank = DesensitizedUtil.bankCard(constructionUserVo.getYhkNumber());
constructionUserVo.setYhkNumber(hideBank);
}
// 计算年龄
LocalDate sfzBirth = constructionUser.getSfzBirth();
if (sfzBirth != null) {
Integer age = Math.max(Period.between(sfzBirth, LocalDate.now()).getYears(), 0);
constructionUserVo.setAge(age);
}
return constructionUserVo;
}
@ -744,7 +752,8 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
String clock = req.getClock();
String userRole = req.getUserRole();
String notUserRole = req.getNotUserRole();
LocalDate entryDate = req.getEntryDate();
String entryDate = req.getEntryDate();
String workStatus = req.getWorkStatus();
// 模糊查询
lqw.like(StringUtils.isNotBlank(userName), SubConstructionUser::getUserName, userName);
lqw.like(StringUtils.isNotBlank(nation), SubConstructionUser::getNation, nation);
@ -759,6 +768,13 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
lqw.eq(ObjectUtils.isNotEmpty(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
lqw.eq(ObjectUtils.isNotEmpty(clock), SubConstructionUser::getClock, clock);
lqw.eq(StringUtils.isNotBlank(userRole), SubConstructionUser::getUserRole, userRole);
if (StringUtils.isNotBlank(workStatus)) {
if (workStatus.equals("0")) {
lqw.isNotNull(SubConstructionUser::getTeamId).ne(SubConstructionUser::getTeamId, "");
} else if (workStatus.equals("1")) {
lqw.isNull(SubConstructionUser::getTeamId);
}
}
// 精准查询,不等于
if (ObjectUtils.isNotEmpty(notTeamId)) {
lqw.and(wrapper -> wrapper
@ -774,7 +790,33 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
}
}
lqw.ne(StringUtils.isNotBlank(notUserRole), SubConstructionUser::getUserRole, notUserRole);
lqw.le(ObjectUtils.isNotEmpty(entryDate), SubConstructionUser::getEntryDate, entryDate);
if (StringUtils.isNotBlank(entryDate)) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime beginTime = null;
switch (entryDate) {
case "0": // 最近一周
beginTime = now.minusWeeks(1);
break;
case "1": // 最近一个月
beginTime = now.minusMonths(1);
break;
case "2": // 最近三个月
beginTime = now.minusMonths(3);
break;
case "3": // 最近六个月
beginTime = now.minusMonths(6);
break;
case "4": // 最近一年
beginTime = now.minusYears(1);
break;
default:
break;
}
if (beginTime != null) {
lqw.ge(SubConstructionUser::getEntryDate, beginTime)
.le(SubConstructionUser::getEntryDate, now);
}
}
return lqw;
}
@ -804,7 +846,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
.in(BusWorkWage::getProjectId, constructionUserList.stream().map(SubConstructionUser::getProjectId).toList())
.in(BusWorkWage::getWorkType, constructionUserList.stream().map(SubConstructionUser::getTypeOfWork).toList())
.in(BusWorkWage::getWageMeasureUnit, constructionUserList.stream().map(SubConstructionUser::getWageMeasureUnit).toList());
Map<String, Long> workWageMap = workWageService.list(workWageLqw).stream().collect(Collectors.toMap(
Map<String, BigDecimal> workWageMap = workWageService.list(workWageLqw).stream().collect(Collectors.toMap(
workWage -> workWage.getWorkType() + "_" + workWage.getWageMeasureUnit(),
BusWorkWage::getWage,
(wage1, wage2) -> wage1
@ -827,11 +869,11 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
BeanUtils.copyProperties(constructionUser, constructionUserVo);
// 关联分包公司信息
Long contractorId = constructionUser.getContractorId();
SubContractorVo contractor = null;
SubContractorVo contractor;
if (contractorIdContractorMap.containsKey(contractorId)) {
contractor = contractorService.getVo(contractorIdContractorMap.get(contractorId).getFirst());
constructionUserVo.setContractorName(contractor.getName());
}
constructionUserVo.setContractorVo(contractor);
// 关联工资标准
// 构造相应的 key
String key = constructionUser.getTypeOfWork() + "_" + constructionUser.getWageMeasureUnit();
@ -861,6 +903,12 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
// 隐藏银行卡号
String hideBank = DesensitizedUtil.bankCard(constructionUserVo.getYhkNumber());
constructionUserVo.setYhkNumber(hideBank);
// 计算年龄
LocalDate sfzBirth = constructionUser.getSfzBirth();
if (sfzBirth != null) {
Integer age = Math.max(Period.between(sfzBirth, LocalDate.now()).getYears(), 0);
constructionUserVo.setAge(age);
}
return constructionUserVo;
}).toList();
constructionUserVoPage.setRecords(constructionUserVoList);
@ -1115,8 +1163,8 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
if (StringUtils.isNotEmpty(sfzNumber) && !IdcardUtil.isValidCard(sfzNumber)) {
throw new ServiceException("身份证号码格式不正确", HttpStatus.BAD_REQUEST);
}
String sfzStart = req.getSfzStart();
String sfzEnd = req.getSfzEnd();
LocalDate sfzStart = req.getSfzStart();
LocalDate sfzEnd = req.getSfzEnd();
if (!DateUtils.isValidDateRange(sfzStart, sfzEnd)) {
throw new ServiceException("身份证有效期格式错误", HttpStatus.BAD_REQUEST);
}

View File

@ -350,4 +350,31 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
return vo;
}).toList();
}
/**
* 获取分包方管理员列表
*
* @param id 分包方id
* @return 分包方管理员列表
*/
@Override
public List<SubManagerVo> queryManagerListById(Long id) {
SubContractor contractor = this.getById(id);
if (contractor == null) {
throw new ServiceException("分包方不存在", HttpStatus.NOT_FOUND);
}
List<SubConstructionUser> adminUserList = constructionUserService.lambdaQuery()
.eq(SubConstructionUser::getContractorId, id)
.eq(SubConstructionUser::getUserRole, SubConstructionUserRoleEnum.ADMIN.getValue())
.list();
if (CollUtil.isEmpty(adminUserList)) {
return List.of();
}
return adminUserList.stream().map(user -> {
SubManagerVo managerVo = new SubManagerVo();
managerVo.setManagerId(user.getSysUserId());
managerVo.setManagerName(user.getUserName());
return managerVo;
}).distinct().toList();
}
}

View File

@ -0,0 +1,249 @@
package org.dromara.contractor.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.dromara.common.core.constant.HttpStatus;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubSalaryPeriod;
import org.dromara.contractor.domain.SubUserSalaryDetail;
import org.dromara.contractor.domain.SubUserSalaryPeriod;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodCreateReq;
import org.dromara.contractor.domain.dto.salaryperiod.SubSalaryPeriodQueryReq;
import org.dromara.contractor.domain.vo.salaryperiod.SubSalaryPeriodVo;
import org.dromara.contractor.mapper.SubSalaryPeriodMapper;
import org.dromara.contractor.service.ISubSalaryPeriodService;
import org.dromara.contractor.service.ISubUserSalaryDetailService;
import org.dromara.contractor.service.ISubUserSalaryPeriodService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 工资结算周期Service业务层处理
*
* @author lilemy
* @date 2025-09-04
*/
@Service
public class SubSalaryPeriodServiceImpl extends ServiceImpl<SubSalaryPeriodMapper, SubSalaryPeriod>
implements ISubSalaryPeriodService {
@Resource
private ISubUserSalaryDetailService userSalaryDetailService;
@Resource
private ISubUserSalaryPeriodService userSalaryPeriodService;
/**
* 查询工资结算周期
*
* @param id 主键
* @return 工资结算周期
*/
@Override
public SubSalaryPeriodVo queryById(Long id) {
SubSalaryPeriod salaryPeriod = this.getById(id);
if (salaryPeriod == null) {
throw new ServiceException("工资结算周期数据不存在", HttpStatus.NOT_FOUND);
}
return this.getVo(salaryPeriod);
}
/**
* 分页查询工资结算周期列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 工资结算周期分页列表
*/
@Override
public TableDataInfo<SubSalaryPeriodVo> queryPageList(SubSalaryPeriodQueryReq req, PageQuery pageQuery) {
LambdaQueryWrapper<SubSalaryPeriod> lqw = buildQueryWrapper(req);
Page<SubSalaryPeriod> result = this.page(pageQuery.build(), lqw);
return TableDataInfo.build(this.getVoPage(result));
}
/**
* 查询符合条件的工资结算周期列表
*
* @param req 查询条件
* @return 工资结算周期列表
*/
@Override
public List<SubSalaryPeriodVo> queryList(SubSalaryPeriodQueryReq req) {
LambdaQueryWrapper<SubSalaryPeriod> lqw = buildQueryWrapper(req);
return this.list(lqw).stream().map(this::getVo).toList();
}
/**
* 新增工资结算周期
*
* @param req 工资结算周期
* @return 是否新增成功
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean insertByBo(SubSalaryPeriodCreateReq req) {
LocalDate startDate = req.getStartDate();
LocalDate endDate = req.getEndDate();
Long projectId = req.getProjectId();
Long teamId = req.getTeamId();
// 校验时间
if (startDate.isAfter(endDate)) {
throw new ServiceException("开始时间不能大于结束时间", HttpStatus.BAD_REQUEST);
}
// 判断当前时间段是否和之前的时间段有冲突
Long count = this.lambdaQuery()
.eq(SubSalaryPeriod::getProjectId, projectId)
.eq(SubSalaryPeriod::getTeamId, teamId)
.le(SubSalaryPeriod::getStartDate, endDate)
.ge(SubSalaryPeriod::getEndDate, startDate)
.count();
if (count > 0) {
throw new ServiceException("当前选择时间段中,存在重复时间", HttpStatus.BAD_REQUEST);
}
// 计算天数
long days = ChronoUnit.DAYS.between(startDate, endDate);
// 计算总工资
List<SubUserSalaryDetail> detailList = userSalaryDetailService.lambdaQuery()
.eq(SubUserSalaryDetail::getProjectId, projectId)
.eq(SubUserSalaryDetail::getTeamId, teamId)
.ge(SubUserSalaryDetail::getReportDate, startDate)
.le(SubUserSalaryDetail::getReportDate, endDate)
.list();
BigDecimal totalWage = BigDecimal.ZERO;
List<SubUserSalaryPeriod> periodList = new ArrayList<>();
if (CollUtil.isNotEmpty(detailList)) {
Map<Long, List<SubUserSalaryDetail>> userDetailMap = detailList.stream()
.collect(Collectors.groupingBy(SubUserSalaryDetail::getUserId));
for (Map.Entry<Long, List<SubUserSalaryDetail>> entry : userDetailMap.entrySet()) {
List<SubUserSalaryDetail> value = entry.getValue();
SubUserSalaryPeriod period = new SubUserSalaryPeriod();
// 计算当前用户工资
BigDecimal total = value.stream()
.map(SubUserSalaryDetail::getDailySalary)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
period.setProjectId(projectId);
period.setUserId(entry.getKey());
period.setWorkDays((long) value.size());
period.setTotalWage(total);
// 汇总
totalWage = totalWage.add(total);
periodList.add(period);
}
}
// 封装新增数据
SubSalaryPeriod salaryPeriod = new SubSalaryPeriod();
salaryPeriod.setProjectId(projectId);
salaryPeriod.setTeamId(teamId);
salaryPeriod.setStartDate(startDate);
salaryPeriod.setEndDate(endDate);
salaryPeriod.setTotalDays(days);
salaryPeriod.setTotalWage(totalWage);
// 新增
boolean save = this.save(salaryPeriod);
if (!save) {
throw new ServiceException("新增工资结算周期失败", HttpStatus.ERROR);
}
// 批量新增员工工资结算周期
if (CollUtil.isNotEmpty(periodList)) {
periodList.forEach(period -> period.setPeriodId(salaryPeriod.getId()));
boolean saveBatch = userSalaryPeriodService.saveBatch(periodList);
if (!saveBatch) {
throw new ServiceException("批量新增员工工资结算周期失败", HttpStatus.ERROR);
}
}
return true;
}
/**
* 获取员工每日工资对视图
*
* @param salaryPeriod 员工每日工资对
* @return 员工每日工资对视图
*/
@Override
public SubSalaryPeriodVo getVo(SubSalaryPeriod salaryPeriod) {
// 封装对象
SubSalaryPeriodVo salaryPeriodVo = new SubSalaryPeriodVo();
if (salaryPeriod == null) {
return salaryPeriodVo;
}
BeanUtils.copyProperties(salaryPeriod, salaryPeriodVo);
return salaryPeriodVo;
}
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
@Override
public LambdaQueryWrapper<SubSalaryPeriod> buildQueryWrapper(SubSalaryPeriodQueryReq req) {
LambdaQueryWrapper<SubSalaryPeriod> lqw = new LambdaQueryWrapper<>();
if (req == null) {
return lqw;
}
Long projectId = req.getProjectId();
Long teamId = req.getTeamId();
LocalDate startDate = req.getStartDate();
LocalDate endDate = req.getEndDate();
LocalDate date = req.getDate();
String status = req.getStatus();
lqw.eq(ObjectUtils.isNotEmpty(projectId), SubSalaryPeriod::getProjectId, projectId);
lqw.eq(ObjectUtils.isNotEmpty(teamId), SubSalaryPeriod::getTeamId, teamId);
lqw.eq(ObjectUtils.isNotEmpty(startDate), SubSalaryPeriod::getStartDate, startDate);
lqw.eq(ObjectUtils.isNotEmpty(endDate), SubSalaryPeriod::getEndDate, endDate);
// date 在 startDate 和 endDate 之间
if (date != null) {
lqw.le(SubSalaryPeriod::getStartDate, date)
.ge(SubSalaryPeriod::getEndDate, date);
}
lqw.eq(StringUtils.isNotBlank(status), SubSalaryPeriod::getStatus, status);
return lqw;
}
/**
* 获取员工每日工资对分页视图
*
* @param salaryPeriodPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
@Override
public Page<SubSalaryPeriodVo> getVoPage(Page<SubSalaryPeriod> salaryPeriodPage) {
List<SubSalaryPeriod> salaryPeriodList = salaryPeriodPage.getRecords();
Page<SubSalaryPeriodVo> salaryPeriodVoPage = new Page<>(
salaryPeriodPage.getCurrent(),
salaryPeriodPage.getSize(),
salaryPeriodPage.getTotal()
);
if (CollUtil.isEmpty(salaryPeriodList)) {
return salaryPeriodVoPage;
}
List<SubSalaryPeriodVo> salaryPeriodVoList = salaryPeriodList.stream().map(entity -> {
SubSalaryPeriodVo salaryPeriodVo = new SubSalaryPeriodVo();
BeanUtils.copyProperties(entity, salaryPeriodVo);
return salaryPeriodVo;
}).toList();
salaryPeriodVoPage.setRecords(salaryPeriodVoList);
return salaryPeriodVoPage;
}
}

View File

@ -0,0 +1,200 @@
package org.dromara.contractor.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.constant.HttpStatus;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubConstructionUser;
import org.dromara.contractor.domain.SubUserSalaryDetail;
import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq;
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
import org.dromara.contractor.mapper.SubUserSalaryDetailMapper;
import org.dromara.contractor.service.ISubConstructionUserService;
import org.dromara.contractor.service.ISubUserSalaryDetailService;
import org.dromara.project.domain.BusWorkWage;
import org.dromara.project.service.IBusWorkWageService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
/**
* 员工每日工资Service业务层处理
*
* @author lilemy
* @date 2025-09-04
*/
@RequiredArgsConstructor
@Service
public class SubUserSalaryDetailServiceImpl extends ServiceImpl<SubUserSalaryDetailMapper, SubUserSalaryDetail>
implements ISubUserSalaryDetailService {
@Resource
private IBusWorkWageService workWageService;
@Resource
private ISubConstructionUserService constructionUserService;
/**
* 查询员工每日工资
*
* @param id 主键
* @return 员工每日工资
*/
@Override
public SubUserSalaryDetailVo queryById(Long id) {
SubUserSalaryDetail userSalaryDetail = this.getById(id);
if (userSalaryDetail == null) {
throw new ServiceException("员工每日工资数据不存在", HttpStatus.NOT_FOUND);
}
return this.getVo(userSalaryDetail);
}
/**
* 分页查询员工每日工资列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 员工每日工资分页列表
*/
@Override
public TableDataInfo<SubUserSalaryDetailVo> queryPageList(SubUserSalaryDetailQueryReq req, PageQuery pageQuery) {
LambdaQueryWrapper<SubUserSalaryDetail> lqw = this.buildQueryWrapper(req);
Page<SubUserSalaryDetail> result = this.page(pageQuery.build(), lqw);
return TableDataInfo.build(this.getVoPage(result));
}
/**
* 查询符合条件的员工每日工资列表
*
* @param req 查询条件
* @return 员工每日工资列表
*/
@Override
public List<SubUserSalaryDetailVo> queryList(SubUserSalaryDetailQueryReq req) {
LambdaQueryWrapper<SubUserSalaryDetail> lqw = buildQueryWrapper(req);
return this.list(lqw).stream().map(this::getVo).toList();
}
/**
* 根据考勤新增员工每日工资
*
* @param userId 用户id
* @param reportDate 日报日期
* @return 是否新增成功
*/
@Override
public Boolean insertByAttendance(Long userId, LocalDate reportDate) {
SubConstructionUser constructionUser = constructionUserService.getBySysUserId(userId);
// 获取工资
BigDecimal salary = constructionUser.getSalary();
if (salary == null || salary.compareTo(BigDecimal.ZERO) == 0) {
String typeOfWork = constructionUser.getTypeOfWork();
String wageMeasureUnit = constructionUser.getWageMeasureUnit();
if (StringUtils.isNotEmpty(typeOfWork) && StringUtils.isNotEmpty(wageMeasureUnit)) {
BusWorkWage workWage = workWageService.lambdaQuery()
.eq(BusWorkWage::getProjectId, constructionUser.getProjectId())
.eq(BusWorkWage::getWorkType, typeOfWork)
.eq(BusWorkWage::getWageMeasureUnit, wageMeasureUnit)
.one();
if (workWage != null) {
salary = workWage.getWage();
} else {
salary = BigDecimal.ZERO;
}
} else {
salary = BigDecimal.ZERO;
}
}
// 保存当日工资
SubUserSalaryDetail save = new SubUserSalaryDetail();
save.setProjectId(constructionUser.getProjectId());
save.setTeamId(constructionUser.getTeamId());
save.setUserId(userId);
save.setUserName(constructionUser.getUserName());
save.setReportDate(reportDate);
save.setDailySalary(salary);
save.setRemark(salary.compareTo(BigDecimal.ZERO) == 0 ? "当前人员未设置工资" : null);
return this.save(save);
}
/**
* 获取员工每日工资对视图
*
* @param userSalaryDetail 员工每日工资对
* @return 员工每日工资对视图
*/
@Override
public SubUserSalaryDetailVo getVo(SubUserSalaryDetail userSalaryDetail) {
// 对象转封装类
SubUserSalaryDetailVo userSalaryDetailVo = new SubUserSalaryDetailVo();
if (userSalaryDetail == null) {
return userSalaryDetailVo;
}
BeanUtils.copyProperties(userSalaryDetail, userSalaryDetailVo);
return userSalaryDetailVo;
}
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
@Override
public LambdaQueryWrapper<SubUserSalaryDetail> buildQueryWrapper(SubUserSalaryDetailQueryReq req) {
LambdaQueryWrapper<SubUserSalaryDetail> lqw = new LambdaQueryWrapper<>();
if (req == null) {
return lqw;
}
Long projectId = req.getProjectId();
Long teamId = req.getTeamId();
Long userId = req.getUserId();
String userName = req.getUserName();
LocalDate reportDate = req.getReportDate();
lqw.like(StringUtils.isNotBlank(userName), SubUserSalaryDetail::getUserName, userName);
lqw.eq(ObjectUtils.isNotEmpty(projectId), SubUserSalaryDetail::getProjectId, projectId);
lqw.eq(ObjectUtils.isNotEmpty(teamId), SubUserSalaryDetail::getTeamId, teamId);
lqw.eq(ObjectUtils.isNotEmpty(userId), SubUserSalaryDetail::getUserId, userId);
lqw.eq(ObjectUtils.isNotEmpty(reportDate), SubUserSalaryDetail::getReportDate, reportDate);
return lqw;
}
/**
* 获取员工每日工资对分页视图
*
* @param userSalaryDetailPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
@Override
public Page<SubUserSalaryDetailVo> getVoPage(Page<SubUserSalaryDetail> userSalaryDetailPage) {
List<SubUserSalaryDetail> userSalaryDetailList = userSalaryDetailPage.getRecords();
Page<SubUserSalaryDetailVo> userSalaryDetailVoPage = new Page<>(
userSalaryDetailPage.getCurrent(),
userSalaryDetailPage.getSize(),
userSalaryDetailPage.getTotal()
);
if (CollUtil.isEmpty(userSalaryDetailList)) {
return userSalaryDetailVoPage;
}
List<SubUserSalaryDetailVo> userSalaryDetailVoList = userSalaryDetailList.stream().map(entity -> {
SubUserSalaryDetailVo userSalaryDetailVo = new SubUserSalaryDetailVo();
BeanUtils.copyProperties(entity, userSalaryDetailVo);
return userSalaryDetailVo;
}).toList();
userSalaryDetailVoPage.setRecords(userSalaryDetailVoList);
return userSalaryDetailVoPage;
}
}

View File

@ -0,0 +1,137 @@
package org.dromara.contractor.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.dromara.common.core.constant.HttpStatus;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.contractor.domain.SubUserSalaryPeriod;
import org.dromara.contractor.domain.dto.usersalaryperiod.SubUserSalaryPeriodQueryReq;
import org.dromara.contractor.domain.vo.usersalaryperiod.SubUserSalaryPeriodVo;
import org.dromara.contractor.mapper.SubUserSalaryPeriodMapper;
import org.dromara.contractor.service.ISubUserSalaryPeriodService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 员工工资周期Service业务层处理
*
* @author lilemy
* @date 2025-09-04
*/
@Service
public class SubUserSalaryPeriodServiceImpl extends ServiceImpl<SubUserSalaryPeriodMapper, SubUserSalaryPeriod>
implements ISubUserSalaryPeriodService {
/**
* 查询员工工资周期
*
* @param id 主键
* @return 员工工资周期
*/
@Override
public SubUserSalaryPeriodVo queryById(Long id) {
SubUserSalaryPeriod userSalaryPeriod = this.getById(id);
if (userSalaryPeriod == null) {
throw new ServiceException("员工工资周期数据不存在", HttpStatus.NOT_FOUND);
}
return this.getVo(userSalaryPeriod);
}
/**
* 分页查询员工工资周期列表
*
* @param req 查询条件
* @param pageQuery 分页参数
* @return 员工工资周期分页列表
*/
@Override
public TableDataInfo<SubUserSalaryPeriodVo> queryPageList(SubUserSalaryPeriodQueryReq req, PageQuery pageQuery) {
LambdaQueryWrapper<SubUserSalaryPeriod> lqw = this.buildQueryWrapper(req);
Page<SubUserSalaryPeriod> result = this.page(pageQuery.build(), lqw);
return TableDataInfo.build(this.getVoPage(result));
}
/**
* 查询符合条件的员工工资周期列表
*
* @param req 查询条件
* @return 员工工资周期列表
*/
@Override
public List<SubUserSalaryPeriodVo> queryList(SubUserSalaryPeriodQueryReq req) {
LambdaQueryWrapper<SubUserSalaryPeriod> lqw = buildQueryWrapper(req);
return this.list(lqw).stream().map(this::getVo).toList();
}
/**
* 获取员工每日工资对视图
*
* @param userSalaryPeriod 员工每日工资对
* @return 员工每日工资对视图
*/
@Override
public SubUserSalaryPeriodVo getVo(SubUserSalaryPeriod userSalaryPeriod) {
// 对象转封装类
SubUserSalaryPeriodVo userSalaryPeriodVo = new SubUserSalaryPeriodVo();
if (userSalaryPeriod == null) {
return userSalaryPeriodVo;
}
BeanUtils.copyProperties(userSalaryPeriod, userSalaryPeriodVo);
return userSalaryPeriodVo;
}
/**
* 获取员工每日工资对象查询条件封装
*
* @param req 查询条件
* @return 查询条件封装
*/
@Override
public LambdaQueryWrapper<SubUserSalaryPeriod> buildQueryWrapper(SubUserSalaryPeriodQueryReq req) {
LambdaQueryWrapper<SubUserSalaryPeriod> lqw = new LambdaQueryWrapper<>();
if (req == null) {
return lqw;
}
Long projectId = req.getProjectId();
Long periodId = req.getPeriodId();
Long userId = req.getUserId();
lqw.eq(ObjectUtils.isNotEmpty(projectId), SubUserSalaryPeriod::getProjectId, projectId);
lqw.eq(ObjectUtils.isNotEmpty(periodId), SubUserSalaryPeriod::getPeriodId, periodId);
lqw.eq(ObjectUtils.isNotEmpty(userId), SubUserSalaryPeriod::getUserId, userId);
return lqw;
}
/**
* 获取员工每日工资对分页视图
*
* @param userSalaryPeriodPage 员工每日工资对分页
* @return 员工每日工资对分页视图
*/
@Override
public Page<SubUserSalaryPeriodVo> getVoPage(Page<SubUserSalaryPeriod> userSalaryPeriodPage) {
List<SubUserSalaryPeriod> userSalaryPeriodList = userSalaryPeriodPage.getRecords();
Page<SubUserSalaryPeriodVo> userSalaryPeriodVoPage = new Page<>(
userSalaryPeriodPage.getCurrent(),
userSalaryPeriodPage.getSize(),
userSalaryPeriodPage.getTotal()
);
if (CollUtil.isEmpty(userSalaryPeriodList)) {
return userSalaryPeriodVoPage;
}
List<SubUserSalaryPeriodVo> userSalaryPeriodVoList = userSalaryPeriodList.stream().map(entity -> {
SubUserSalaryPeriodVo userSalaryPeriodVo = new SubUserSalaryPeriodVo();
BeanUtils.copyProperties(entity, userSalaryPeriodVo);
return userSalaryPeriodVo;
}).toList();
userSalaryPeriodVoPage.setRecords(userSalaryPeriodVoList);
return userSalaryPeriodVoPage;
}
}

View File

@ -1,15 +1,17 @@
package org.dromara.project.controller.app;
import cn.dev33.satoken.annotation.SaCheckPermission;
import jakarta.annotation.Resource;
import org.dromara.common.core.domain.R;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.web.core.BaseController;
import org.dromara.project.domain.dto.projectteammember.BusProjectTeamMemberExitReq;
import org.dromara.project.domain.dto.projectteammember.BusProjectTeamMemberQueryReq;
import org.dromara.project.domain.vo.projectteammember.BusProjectTeamMemberVo;
import org.dromara.project.service.IBusProjectTeamMemberService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -35,4 +37,13 @@ public class BusProjectTeamMemberAppController extends BaseController {
List<BusProjectTeamMemberVo> list = projectTeamMemberService.queryList(req);
return R.ok(list);
}
/**
* 施工人员退场
*/
@Log(title = "项目班组下的成员", businessType = BusinessType.DELETE)
@DeleteMapping("/")
public R<Void> remove(@RequestBody BusProjectTeamMemberExitReq req) {
return toAjax(projectTeamMemberService.deleteById(req));
}
}

View File

@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 工种薪水对象 bus_work_wage
@ -51,7 +52,7 @@ public class BusWorkWage extends BaseEntity {
/**
* 工资标准
*/
private Long wage;
private BigDecimal wage;
/**
* 工资计量单位

View File

@ -0,0 +1,42 @@
package org.dromara.project.domain.dto.constructionuserexit;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* @author lilemy
* @date 2025-09-04 16:44
*/
@Data
public class BusConstructionUserExitUpdateReq implements Serializable {
@Serial
private static final long serialVersionUID = 6818895534694076391L;
/**
* 主键
*/
@NotNull(message = "主键不能为空")
private Long id;
/**
* 工资发放凭证
*/
@NotBlank(message = "工资发放凭证不能为空")
private String salaryVoucherFile;
/**
* 工资结算确认书
*/
@NotBlank(message = "工资结算确认书不能为空")
private String salaryConfirmationFile;
/**
* 备注
*/
private String remark;
}

View File

@ -1,5 +1,6 @@
package org.dromara.project.domain.dto.projectteammember;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
@ -18,6 +19,7 @@ public class BusProjectTeamMemberExitReq implements Serializable {
/**
* 主键id
*/
@NotNull(message = "主键id不能为空")
private Long id;
/**

View File

@ -5,6 +5,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lilemy
@ -43,7 +44,7 @@ public class BusWorkWageCreateReq implements Serializable {
* 工资标准
*/
@NotNull(message = "工资标准不能为空")
private Long wage;
private BigDecimal wage;
/**
* 备注

View File

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lilemy
@ -43,7 +44,7 @@ public class BusWorkWageQueryReq implements Serializable {
/**
* 工资标准
*/
private Long wage;
private BigDecimal wage;
/**
* 工资计量单位

View File

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lilemy
@ -33,7 +34,7 @@ public class BusWorkWageUpdateReq implements Serializable {
/**
* 工资标准
*/
private Long wage;
private BigDecimal wage;
/**
* 备注

View File

@ -10,6 +10,7 @@ import org.dromara.project.domain.BusWorkWage;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -64,7 +65,7 @@ public class BusWorkWageVo implements Serializable {
* 工资标准
*/
@ExcelProperty(value = "工资标准")
private Long wage;
private BigDecimal wage;
/**
* 工资计量单位

View File

@ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.project.domain.BusConstructionUserExit;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitCreateReq;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitQueryReq;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitUpdateReq;
import org.dromara.project.domain.vo.constructionuserexit.BusConstructionUserExitVo;
import java.util.List;
@ -76,4 +77,12 @@ public interface IBusConstructionUserExitService extends IService<BusConstructio
* @return 新增结果
*/
Boolean addRecord(BusConstructionUserExitCreateReq req);
/**
* 补充施工人员入场退场记录信息
*
* @param req 修改参数
* @return 修改结果
*/
Boolean updateRecord(BusConstructionUserExitUpdateReq req);
}

View File

@ -19,6 +19,7 @@ import org.dromara.project.domain.BusConstructionUserExit;
import org.dromara.project.domain.BusProjectTeamMember;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitCreateReq;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitQueryReq;
import org.dromara.project.domain.dto.constructionuserexit.BusConstructionUserExitUpdateReq;
import org.dromara.project.domain.vo.constructionuserexit.BusConstructionUserExitVo;
import org.dromara.project.mapper.BusConstructionUserExitMapper;
import org.dromara.project.service.IBusConstructionUserExitService;
@ -184,9 +185,6 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
public Boolean addRecord(BusConstructionUserExitCreateReq req) {
String salaryVoucherFile = req.getSalaryVoucherFile();
String salaryConfirmationFile = req.getSalaryConfirmationFile();
if (StringUtils.isAnyBlank(salaryVoucherFile, salaryConfirmationFile)) {
throw new ServiceException("请上传退场文件", HttpStatus.BAD_REQUEST);
}
Long userId = req.getUserId();
BusProjectTeamMember projectTeamMember = projectTeamMemberService.lambdaQuery()
.eq(BusProjectTeamMember::getMemberId, userId)
@ -219,6 +217,11 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
.eq(SubConstructionUser::getId, constructionUser.getId())
.set(SubConstructionUser::getTeamId, null)
.set(SubConstructionUser::getLeaveDate, new Date());
if (StringUtils.isNotBlank(salaryVoucherFile) && StringUtils.isNotBlank(salaryConfirmationFile)) {
constructionUserLuw.set(SubConstructionUser::getExitStatus, "2");
} else {
constructionUserLuw.set(SubConstructionUser::getExitStatus, "1");
}
boolean update = constructionUserService.update(constructionUserLuw);
if (!update) {
throw new ServiceException("施工人员退场失败,数据库异常", HttpStatus.ERROR);
@ -226,4 +229,38 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
return true;
}
/**
* 补充施工人员入场退场记录信息
*
* @param req 修改参数
* @return 修改结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateRecord(BusConstructionUserExitUpdateReq req) {
Long id = req.getId();
BusConstructionUserExit constructionUserExit = this.getById(id);
if (constructionUserExit == null) {
throw new ServiceException("施工人员入场退场记录不存在", HttpStatus.NOT_FOUND);
}
BusConstructionUserExit update = new BusConstructionUserExit();
update.setId(id);
update.setSalaryVoucherFile(req.getSalaryVoucherFile());
update.setSalaryConfirmationFile(req.getSalaryConfirmationFile());
update.setRemark(req.getRemark());
boolean result = this.updateById(update);
if (!result) {
throw new ServiceException("施工人员入场退场记录修改失败", HttpStatus.ERROR);
}
// 同步修改用户表信息
SubConstructionUser user = new SubConstructionUser();
user.setId(constructionUserExit.getUserId());
user.setExitStatus("2");
boolean resultUser = constructionUserService.updateById(user);
if (!resultUser) {
throw new ServiceException("施工人员入场退场记录修改失败", HttpStatus.ERROR);
}
return true;
}
}

View File

@ -152,7 +152,8 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
.set(SubConstructionUser::getTeamId, projectTeamMember.getTeamId())
.set(SubConstructionUser::getTeamName, projectTeam.getTeamName())
.set(SubConstructionUser::getEntryDate, new Date())
.set(SubConstructionUser::getLeaveDate, null);
.set(SubConstructionUser::getLeaveDate, null)
.set(SubConstructionUser::getExitStatus, "0");
constructionUserService.update(constructionUserLuw);
return projectTeamMember.getId();
}

View File

@ -13,10 +13,10 @@ import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.project.domain.BusWorkWage;
import org.dromara.project.domain.enums.BusWageMeasureUnitEnum;
import org.dromara.project.domain.dto.workwage.BusWorkWageCreateReq;
import org.dromara.project.domain.dto.workwage.BusWorkWageQueryReq;
import org.dromara.project.domain.dto.workwage.BusWorkWageUpdateReq;
import org.dromara.project.domain.enums.BusWageMeasureUnitEnum;
import org.dromara.project.domain.vo.workwage.BusWorkWageVo;
import org.dromara.project.mapper.BusWorkWageMapper;
import org.dromara.project.service.IBusProjectService;
@ -25,6 +25,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
@ -219,7 +220,7 @@ public class BusWorkWageServiceImpl extends ServiceImpl<BusWorkWageMapper, BusWo
String workType = req.getWorkType();
String isSpecialType = req.getIsSpecialType();
String wageCalculationType = req.getWageCalculationType();
Long wage = req.getWage();
BigDecimal wage = req.getWage();
String wageMeasureUnit = req.getWageMeasureUnit();
String remark = req.getRemark();
// 模糊查询

View File

@ -59,6 +59,11 @@ public class HseTeamMeeting extends BaseEntity {
*/
private String participantId;
/**
* 班会主题
*/
private String meetingTheme;
/**
* 班会内容
*/

View File

@ -43,6 +43,12 @@ public class HseTeamMeetingCreateReq implements Serializable {
@NotNull(message = "开会时间不能为空")
private LocalDateTime meetingDate;
/**
* 班会主题
*/
@NotBlank(message = "班会主题不能为空")
private String meetingTheme;
/**
* 宣讲人
*/

View File

@ -37,6 +37,11 @@ public class HseSafetyInspectionVo implements Serializable {
*/
private String checkType;
/**
* 检查项目
*/
private String checkProject;
/**
* 违章类型
*/

View File

@ -64,6 +64,11 @@ public class HseTeamMeetingVo implements Serializable {
*/
private String contractorName;
/**
* 班会主题
*/
private String meetingTheme;
/**
* 开会时间
*/
@ -108,6 +113,7 @@ public class HseTeamMeetingVo implements Serializable {
/**
* 班会图片列表
*/
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "picture")
private List<String> pictureUrlList;
/**

View File

@ -32,7 +32,6 @@ import org.dromara.project.service.IBusProjectTeamService;
import org.dromara.safety.constant.HseSafetyConstant;
import org.dromara.safety.domain.HseSafetyInspection;
import org.dromara.safety.domain.HseTeamMeeting;
import org.dromara.safety.domain.HseViolationRecord;
import org.dromara.safety.domain.dto.safetyinspection.*;
import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum;
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
@ -328,8 +327,14 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
lqw.eq(StringUtils.isNotBlank(checkType), HseSafetyInspection::getCheckType, checkType);
lqw.eq(StringUtils.isNotBlank(violationType), HseSafetyInspection::getViolationType, violationType);
lqw.eq(StringUtils.isNotBlank(rectificationUnit), HseSafetyInspection::getRectificationUnit, rectificationUnit);
lqw.eq(StringUtils.isNotBlank(status), HseSafetyInspection::getStatus, status);
lqw.eq(StringUtils.isNotBlank(reviewType), HseSafetyInspection::getReviewType, reviewType);
if (StringUtils.isNotBlank(status)) {
if (status.contains(",")) {
lqw.in(HseSafetyInspection::getStatus, StringUtils.splitList(status));
} else {
lqw.eq(HseSafetyInspection::getStatus, status);
}
}
return lqw;
}

View File

@ -0,0 +1,7 @@
<?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="org.dromara.contractor.mapper.SubSalaryPeriodMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?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="org.dromara.contractor.mapper.SubUserSalaryDetailMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?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="org.dromara.contractor.mapper.SubUserSalaryPeriodMapper">
</mapper>

View File

@ -1811,3 +1811,67 @@ create table mat_materials_use_record
index `idx_project_id` (`project_id` asc) using btree comment '项目ID',
index `idx_inventory_id` (`inventory_id` asc) using btree comment '库存ID'
) comment '材料使用登记' collate = utf8mb4_unicode_ci;
drop table if exists sub_user_salary_detail;
create table sub_user_salary_detail
(
`id` bigint not null auto_increment comment '主键id',
`project_id` bigint not null comment '项目id',
`team_id` bigint null comment '班组id',
`user_id` bigint not null comment '用户id',
`user_name` varchar(50) not null comment '用户名字',
`report_date` date not null comment '日报日期',
`daily_salary` decimal(10, 2) default 0.00 not null comment '当日工资',
`remark` varchar(255) null comment '备注',
`create_by` bigint null comment '创建者',
`update_by` bigint null comment '更新者',
`create_dept` bigint null comment '创建部门',
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
primary key (`id`) using btree,
index `idx_project_id` (`project_id` asc) using btree comment '项目ID',
index `idx_team_id` (`team_id` asc) using btree comment '班组ID',
index `idx_user_id` (`user_id` asc) using btree comment '用户ID'
) comment '员工每日工资' collate = utf8mb4_unicode_ci;
drop table if exists sub_salary_period;
create table sub_salary_period
(
`id` bigint not null auto_increment comment '主键id',
`project_id` bigint not null comment '项目id',
`team_id` bigint null comment '班组id',
`start_date` date not null comment '开始日期',
`end_date` date not null comment '结束日期',
`total_days` int default 0 not null comment '总天数',
`total_wage` decimal(12, 2) default 0.00 not null comment '总工资',
`status` char(1) default '0' not null comment '状态 0-未开始 1-进行中 2-已完成',
`remark` varchar(255) null comment '备注',
`create_by` bigint null comment '创建者',
`update_by` bigint null comment '更新者',
`create_dept` bigint null comment '创建部门',
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
primary key (`id`) using btree,
index `idx_project_id` (`project_id` asc) using btree comment '项目ID',
index `idx_team_id` (`team_id` asc) using btree comment '班组ID'
) comment '工资结算周期' collate = utf8mb4_unicode_ci;
drop table if exists sub_user_salary_period;
create table sub_user_salary_period
(
`id` bigint not null auto_increment comment '主键id',
`project_id` bigint not null comment '项目id',
`period_id` bigint not null comment '工资周期id',
`user_id` bigint not null comment '用户id',
`work_days` int default 0 not null comment '出勤天数',
`total_wage` decimal(12, 2) default 0.00 not null comment '总工资',
`remark` varchar(255) null comment '备注',
`create_by` bigint null comment '创建者',
`update_by` bigint null comment '更新者',
`create_dept` bigint null comment '创建部门',
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
primary key (`id`) using btree,
index `idx_project_id` (`project_id` asc) using btree comment '项目ID',
index `idx_period_id` (`period_id` asc) using btree comment '工资周期ID'
) comment '员工工资周期表' collate = utf8mb4_unicode_ci;