考勤,土地
This commit is contained in:
@ -97,7 +97,7 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
|
||||
#end
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#if($column.isPk==1)
|
||||
lqw.orderByAsc(${ClassName}::get$AttrName);
|
||||
lqw.orderByDesc(${ClassName}::get$AttrName);
|
||||
#end
|
||||
#end
|
||||
return lqw;
|
||||
|
@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.constant.BusProjectConstant;
|
||||
import org.dromara.project.domain.BusAttendance;
|
||||
import org.dromara.project.domain.BusAttendanceRule;
|
||||
@ -16,10 +17,7 @@ import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
||||
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
||||
import org.dromara.project.service.IBusAttendanceRuleService;
|
||||
import org.dromara.project.service.IBusAttendanceService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
||||
import org.dromara.project.service.*;
|
||||
import org.springframework.data.redis.core.Cursor;
|
||||
import org.springframework.data.redis.core.ScanOptions;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
@ -48,9 +46,16 @@ public class AttendanceJob {
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
@Resource
|
||||
private IBusLeaveService leaveService;
|
||||
|
||||
@Resource
|
||||
private ISubConstructionUserService constructionUserService;
|
||||
|
||||
|
||||
// @Scheduled(cron = "0 0/10 * * * ?")
|
||||
public void clockInMiss() {
|
||||
|
||||
log.info("执行定时任务:上班缺卡记录生成");
|
||||
|
||||
try {
|
||||
@ -76,6 +81,10 @@ public class AttendanceJob {
|
||||
|
||||
//获取当前日期
|
||||
LocalDate date = LocalDate.now();
|
||||
|
||||
//管理员关联多个项目,需要记录是否已生成缺卡记录
|
||||
HashSet<Long> manageUserIds = new HashSet<>();
|
||||
|
||||
List<BusAttendance> missList = new ArrayList<>();
|
||||
for (BusAttendanceRule rule : list) {
|
||||
LocalTime clockInTime = rule.getClockInTime();
|
||||
@ -115,16 +124,30 @@ public class AttendanceJob {
|
||||
|
||||
for (BusUserProjectRelevancy relevancy : relevancyList) {
|
||||
|
||||
if (attendanceUserIds.contains(relevancy.getUserId())) {
|
||||
if (attendanceUserIds.contains(relevancy.getUserId()) || "0".equals(relevancy.getUserType())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
BusAttendance busAttendance = new BusAttendance();
|
||||
//todo: 管理人员 项目id是0
|
||||
busAttendance.setProjectId(relevancy.getProjectId());
|
||||
// 管理人员 项目id是0
|
||||
if("2".equals(relevancy.getUserType()) && !manageUserIds.contains(relevancy.getUserId())){
|
||||
manageUserIds.add(relevancy.getUserId());
|
||||
busAttendance.setProjectId(0L);
|
||||
}
|
||||
SubConstructionUser constructionUser = constructionUserService.getBySysUserId(relevancy.getUserId());
|
||||
|
||||
busAttendance.setUserId(relevancy.getUserId());
|
||||
busAttendance.setUserName(constructionUser.getUserName());
|
||||
|
||||
busAttendance.setClockDate(date);
|
||||
busAttendance.setClockType(BusAttendanceCommuterEnum.CLOCKIN.getValue());
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.UNCLOCK.getValue());
|
||||
if(leaveService.isLeave(date, relevancy.getUserId())){
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||
}else {
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.UNCLOCK.getValue());
|
||||
}
|
||||
|
||||
missList.add(busAttendance);
|
||||
}
|
||||
@ -156,18 +179,22 @@ public class AttendanceJob {
|
||||
if (start.isAfter(end)) {
|
||||
// 跨天情况:查询时间 >= start OR 时间 < end
|
||||
list = attendanceRuleService.list(Wrappers.<BusAttendanceRule>lambdaQuery()
|
||||
.and(wrapper -> wrapper.ge(BusAttendanceRule::getClockInResultTime, start)
|
||||
.and(wrapper -> wrapper.ge(BusAttendanceRule::getClockOutResultTime, start)
|
||||
.or()
|
||||
.lt(BusAttendanceRule::getClockOutResultTime, end)));
|
||||
} else {
|
||||
// 非跨天情况:查询时间 >= start AND 时间 < end
|
||||
list = attendanceRuleService.list(Wrappers.<BusAttendanceRule>lambdaQuery()
|
||||
.ge(BusAttendanceRule::getClockInResultTime, start)
|
||||
.lt(BusAttendanceRule::getClockInResultTime, end));
|
||||
.ge(BusAttendanceRule::getClockOutResultTime, start)
|
||||
.lt(BusAttendanceRule::getClockOutResultTime, end));
|
||||
}
|
||||
|
||||
//获取当前日期
|
||||
LocalDate date = LocalDate.now();
|
||||
|
||||
//管理员关联多个项目,需要记录是否已生成缺卡记录
|
||||
HashSet<Long> manageUserIds = new HashSet<>();
|
||||
|
||||
List<BusAttendance> missList = new ArrayList<>();
|
||||
for (BusAttendanceRule rule : list) {
|
||||
|
||||
@ -209,17 +236,29 @@ public class AttendanceJob {
|
||||
|
||||
|
||||
for (BusUserProjectRelevancy relevancy : relevancyList) {
|
||||
|
||||
if (attendanceUserIds.contains(relevancy.getUserId())) {
|
||||
if (attendanceUserIds.contains(relevancy.getUserId()) || "0".equals(relevancy.getUserType())) {
|
||||
continue;
|
||||
}
|
||||
BusAttendance busAttendance = new BusAttendance();
|
||||
//todo: 管理人员 项目id是0
|
||||
// 管理人员 项目id是0
|
||||
busAttendance.setProjectId(relevancy.getProjectId());
|
||||
if("2".equals(relevancy.getUserType()) && !manageUserIds.contains(relevancy.getUserId())){
|
||||
manageUserIds.add(relevancy.getUserId());
|
||||
busAttendance.setProjectId(0L);
|
||||
}
|
||||
|
||||
SubConstructionUser constructionUser = constructionUserService.getBySysUserId(relevancy.getUserId());
|
||||
|
||||
busAttendance.setUserId(relevancy.getUserId());
|
||||
busAttendance.setUserName(constructionUser.getUserName());
|
||||
|
||||
busAttendance.setClockDate(date);
|
||||
busAttendance.setClockType(BusAttendanceCommuterEnum.CLOCKOUT.getValue());
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.UNCLOCK.getValue());
|
||||
if(leaveService.isLeave(date, relevancy.getUserId())){
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||
}else {
|
||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.UNCLOCK.getValue());
|
||||
}
|
||||
|
||||
missList.add(busAttendance);
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -52,7 +55,7 @@ public class BusLandTransferLedger extends BaseEntity {
|
||||
/**
|
||||
* 设计面积
|
||||
*/
|
||||
private String designArea;
|
||||
private BigDecimal designArea;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
@ -62,32 +65,32 @@ public class BusLandTransferLedger extends BaseEntity {
|
||||
/**
|
||||
* 预计完成时间
|
||||
*/
|
||||
private Date expectedFinishDate;
|
||||
private LocalDate expectedFinishDate;
|
||||
|
||||
/**
|
||||
* 已流转面积
|
||||
*/
|
||||
private String transferAea;
|
||||
private BigDecimal transferAea;
|
||||
|
||||
/**
|
||||
* 流转比例(百分比)
|
||||
*/
|
||||
private String transferRatio;
|
||||
private BigDecimal transferRatio;
|
||||
|
||||
/**
|
||||
* 土地租金(元)
|
||||
*/
|
||||
private Long landRent;
|
||||
private BigDecimal landRent;
|
||||
|
||||
/**
|
||||
* 青苗赔偿(元)
|
||||
*/
|
||||
private Long seedlingCompensation;
|
||||
private BigDecimal seedlingCompensation;
|
||||
|
||||
/**
|
||||
* 总金额(元)
|
||||
*/
|
||||
private Long totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 流转状态
|
||||
@ -109,5 +112,24 @@ public class BusLandTransferLedger extends BaseEntity {
|
||||
*/
|
||||
private String nextStrategy;
|
||||
|
||||
/**
|
||||
* 不签合同面积(亩)
|
||||
*/
|
||||
private BigDecimal noContractArea;
|
||||
|
||||
/**
|
||||
* 不签合同原因
|
||||
*/
|
||||
private String noContractReason;
|
||||
|
||||
/**
|
||||
* 不测量面积(亩)
|
||||
*/
|
||||
private BigDecimal noSurveyArea;
|
||||
|
||||
/**
|
||||
* 不流转原因
|
||||
*/
|
||||
private String nonTransferReason;
|
||||
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class BusEnterRoadBo extends BaseEntity {
|
||||
/**
|
||||
* 道路编号
|
||||
*/
|
||||
@NotBlank(message = "道路编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "道路编号不能为空", groups = { EditGroup.class })
|
||||
private String roadCode;
|
||||
|
||||
/**
|
||||
|
@ -8,6 +8,9 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -53,7 +56,7 @@ public class BusLandTransferLedgerBo extends BaseEntity {
|
||||
/**
|
||||
* 设计面积
|
||||
*/
|
||||
private String designArea;
|
||||
private BigDecimal designArea;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
@ -63,32 +66,32 @@ public class BusLandTransferLedgerBo extends BaseEntity {
|
||||
/**
|
||||
* 预计完成时间
|
||||
*/
|
||||
private Date expectedFinishDate;
|
||||
private LocalDate expectedFinishDate;
|
||||
|
||||
/**
|
||||
* 已流转面积
|
||||
*/
|
||||
private String transferAea;
|
||||
private BigDecimal transferAea;
|
||||
|
||||
/**
|
||||
* 流转比例(百分比)
|
||||
*/
|
||||
private String transferRatio;
|
||||
private BigDecimal transferRatio;
|
||||
|
||||
/**
|
||||
* 土地租金(元)
|
||||
*/
|
||||
private Long landRent;
|
||||
private BigDecimal landRent;
|
||||
|
||||
/**
|
||||
* 青苗赔偿(元)
|
||||
*/
|
||||
private Long seedlingCompensation;
|
||||
private BigDecimal seedlingCompensation;
|
||||
|
||||
/**
|
||||
* 总金额(元)
|
||||
*/
|
||||
private Long totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 流转状态
|
||||
@ -110,5 +113,29 @@ public class BusLandTransferLedgerBo extends BaseEntity {
|
||||
*/
|
||||
private String nextStrategy;
|
||||
|
||||
/**
|
||||
* 不签合同面积(亩)
|
||||
*/
|
||||
private BigDecimal noContractArea;
|
||||
|
||||
/**
|
||||
* 不签合同原因
|
||||
*/
|
||||
private String noContractReason;
|
||||
|
||||
/**
|
||||
* 不测量面积(亩)
|
||||
*/
|
||||
private BigDecimal noSurveyArea;
|
||||
|
||||
/**
|
||||
* 不流转原因
|
||||
*/
|
||||
private String nonTransferReason;
|
||||
|
||||
/**
|
||||
* 列表类型 1-流转 2-不流转
|
||||
*/
|
||||
private String listType;
|
||||
|
||||
}
|
||||
|
@ -6,11 +6,15 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.land.domain.BusLandTransferLedger;
|
||||
import org.dromara.land.domain.bo.UnitBo;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -47,6 +51,10 @@ public class BusLandTransferLedgerVo implements Serializable {
|
||||
@ExcelProperty(value = "土地类型")
|
||||
private String landType;
|
||||
|
||||
|
||||
@ExcelProperty(value = "土地类型")
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "landType",other = "land_type")
|
||||
private String landTypeName;
|
||||
/**
|
||||
* 地块ID
|
||||
*/
|
||||
@ -63,7 +71,7 @@ public class BusLandTransferLedgerVo implements Serializable {
|
||||
* 设计面积
|
||||
*/
|
||||
@ExcelProperty(value = "设计面积")
|
||||
private String designArea;
|
||||
private BigDecimal designArea;
|
||||
|
||||
/**
|
||||
* 责任人
|
||||
@ -75,41 +83,41 @@ public class BusLandTransferLedgerVo implements Serializable {
|
||||
* 预计完成时间
|
||||
*/
|
||||
@ExcelProperty(value = "预计完成时间")
|
||||
private Date expectedFinishDate;
|
||||
private LocalDate expectedFinishDate;
|
||||
|
||||
/**
|
||||
* 已流转面积
|
||||
*/
|
||||
@ExcelProperty(value = "已流转面积")
|
||||
private String transferAea;
|
||||
private BigDecimal transferAea;
|
||||
|
||||
/**
|
||||
* 流转比例(百分比)
|
||||
*/
|
||||
@ExcelProperty(value = "流转比例", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "百=分比")
|
||||
private String transferRatio;
|
||||
@ExcelDictFormat(readConverterExp = "百分比")
|
||||
private BigDecimal transferRatio;
|
||||
|
||||
/**
|
||||
* 土地租金(元)
|
||||
*/
|
||||
@ExcelProperty(value = "土地租金", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "元=")
|
||||
private Long landRent;
|
||||
@ExcelDictFormat(readConverterExp = "元")
|
||||
private BigDecimal landRent;
|
||||
|
||||
/**
|
||||
* 青苗赔偿(元)
|
||||
*/
|
||||
@ExcelProperty(value = "青苗赔偿", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "元=")
|
||||
private Long seedlingCompensation;
|
||||
@ExcelDictFormat(readConverterExp = "元")
|
||||
private BigDecimal seedlingCompensation;
|
||||
|
||||
/**
|
||||
* 总金额(元)
|
||||
*/
|
||||
@ExcelProperty(value = "总金额", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "元=")
|
||||
private Long totalAmount;
|
||||
@ExcelDictFormat(readConverterExp = "元")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 流转状态
|
||||
@ -117,6 +125,10 @@ public class BusLandTransferLedgerVo implements Serializable {
|
||||
@ExcelProperty(value = "流转状态")
|
||||
private String transferStatus;
|
||||
|
||||
@ExcelProperty(value = "流转状态名字")
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "transferStatus",other = "land_transfer_status")
|
||||
private String transferStatusName;
|
||||
|
||||
/**
|
||||
* 状态说明
|
||||
*/
|
||||
@ -135,6 +147,27 @@ public class BusLandTransferLedgerVo implements Serializable {
|
||||
@ExcelProperty(value = "下一步策略")
|
||||
private String nextStrategy;
|
||||
|
||||
|
||||
/**
|
||||
* 不签合同面积(亩)
|
||||
*/
|
||||
private BigDecimal noContractArea;
|
||||
|
||||
/**
|
||||
* 不签合同原因
|
||||
*/
|
||||
private String noContractReason;
|
||||
|
||||
/**
|
||||
* 不测量面积(亩)
|
||||
*/
|
||||
private BigDecimal noSurveyArea;
|
||||
|
||||
/**
|
||||
* 不流转原因
|
||||
*/
|
||||
private String nonTransferReason;
|
||||
|
||||
private String roadCode;
|
||||
|
||||
private String roadName;
|
||||
|
@ -96,7 +96,7 @@ public class BusEnterRoadServiceImpl implements IBusEnterRoadService {
|
||||
private LambdaQueryWrapper<BusEnterRoad> buildQueryWrapper(BusEnterRoadBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusEnterRoad> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusEnterRoad::getId);
|
||||
lqw.orderByDesc(BusEnterRoad::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusEnterRoad::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRoadCode()), BusEnterRoad::getRoadCode, bo.getRoadCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRoadName()), BusEnterRoad::getRoadName, bo.getRoadName());
|
||||
|
@ -93,7 +93,7 @@ public class BusLandBlockServiceImpl implements IBusLandBlockService {
|
||||
private LambdaQueryWrapper<BusLandBlock> buildQueryWrapper(BusLandBlockBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusLandBlock> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusLandBlock::getId);
|
||||
lqw.orderByDesc(BusLandBlock::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusLandBlock::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLandCode()), BusLandBlock::getLandCode, bo.getLandCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLandName()), BusLandBlock::getLandName, bo.getLandName());
|
||||
|
@ -75,7 +75,7 @@ public class BusLandBlockUnitProjectServiceImpl implements IBusLandBlockUnitProj
|
||||
private LambdaQueryWrapper<BusLandBlockUnitProject> buildQueryWrapper(BusLandBlockUnitProjectBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusLandBlockUnitProject> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusLandBlockUnitProject::getId);
|
||||
lqw.orderByDesc(BusLandBlockUnitProject::getId);
|
||||
lqw.eq(bo.getLandBlockId() != null, BusLandBlockUnitProject::getLandBlockId, bo.getLandBlockId());
|
||||
lqw.eq(bo.getUnitProjectId() != null, BusLandBlockUnitProject::getUnitProjectId, bo.getUnitProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitProjectName()), BusLandBlockUnitProject::getUnitProjectName, bo.getUnitProjectName());
|
||||
|
@ -24,10 +24,7 @@ import org.dromara.land.service.IBusLandBlockUnitProjectService;
|
||||
import org.dromara.land.service.IBusLandTransferLedgerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 项目土地流转台账Service业务层处理
|
||||
@ -142,16 +139,16 @@ public class BusLandTransferLedgerServiceImpl implements IBusLandTransferLedgerS
|
||||
private LambdaQueryWrapper<BusLandTransferLedger> buildQueryWrapper(BusLandTransferLedgerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusLandTransferLedger> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(BusLandTransferLedger::getId);
|
||||
lqw.orderByDesc(BusLandTransferLedger::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusLandTransferLedger::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLandType()), BusLandTransferLedger::getLandType, bo.getLandType());
|
||||
lqw.eq(bo.getLandBlockId() != null, BusLandTransferLedger::getLandBlockId, bo.getLandBlockId());
|
||||
lqw.eq(bo.getEnterRoadId() != null, BusLandTransferLedger::getEnterRoadId, bo.getEnterRoadId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDesignArea()), BusLandTransferLedger::getDesignArea, bo.getDesignArea());
|
||||
lqw.eq(bo.getDesignArea()!= null, BusLandTransferLedger::getDesignArea, bo.getDesignArea());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getResponsiblePerson()), BusLandTransferLedger::getResponsiblePerson, bo.getResponsiblePerson());
|
||||
lqw.eq(bo.getExpectedFinishDate() != null, BusLandTransferLedger::getExpectedFinishDate, bo.getExpectedFinishDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTransferAea()), BusLandTransferLedger::getTransferAea, bo.getTransferAea());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTransferRatio()), BusLandTransferLedger::getTransferRatio, bo.getTransferRatio());
|
||||
lqw.eq(bo.getTransferAea()!= null, BusLandTransferLedger::getTransferAea, bo.getTransferAea());
|
||||
lqw.eq(bo.getTransferRatio()!= null, BusLandTransferLedger::getTransferRatio, bo.getTransferRatio());
|
||||
lqw.eq(bo.getLandRent() != null, BusLandTransferLedger::getLandRent, bo.getLandRent());
|
||||
lqw.eq(bo.getSeedlingCompensation() != null, BusLandTransferLedger::getSeedlingCompensation, bo.getSeedlingCompensation());
|
||||
lqw.eq(bo.getTotalAmount() != null, BusLandTransferLedger::getTotalAmount, bo.getTotalAmount());
|
||||
@ -159,6 +156,8 @@ public class BusLandTransferLedgerServiceImpl implements IBusLandTransferLedgerS
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatusDescription()), BusLandTransferLedger::getStatusDescription, bo.getStatusDescription());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIssueSummary()), BusLandTransferLedger::getIssueSummary, bo.getIssueSummary());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNextStrategy()), BusLandTransferLedger::getNextStrategy, bo.getNextStrategy());
|
||||
lqw.in("1".equals(bo.getListType()),BusLandTransferLedger::getTransferStatus, Arrays.asList("0","1"));
|
||||
lqw.eq("2".equals(bo.getListType()),BusLandTransferLedger::getTransferStatus, "2");
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class OutConstructionValueServiceImpl extends ServiceImpl<OutConstruction
|
||||
private LambdaQueryWrapper<OutConstructionValue> buildQueryWrapper(OutConstructionValueBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutConstructionValue> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutConstructionValue::getId);
|
||||
lqw.orderByDesc(OutConstructionValue::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutConstructionValue::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getMatrixId() != null, OutConstructionValue::getMatrixId, bo.getMatrixId());
|
||||
lqw.eq(bo.getProgressCategoryId() != null, OutConstructionValue::getProgressCategoryId, bo.getProgressCategoryId());
|
||||
|
@ -72,7 +72,7 @@ public class OutMonthPlanAuditServiceImpl extends ServiceImpl<OutMonthPlanAuditM
|
||||
private LambdaQueryWrapper<OutMonthPlanAudit> buildQueryWrapper(OutMonthPlanAuditBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutMonthPlanAudit> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutMonthPlanAudit::getId);
|
||||
lqw.orderByDesc(OutMonthPlanAudit::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutMonthPlanAudit::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getDesignValue() != null, OutMonthPlanAudit::getDesignValue, bo.getDesignValue());
|
||||
lqw.eq(bo.getPurchaseValue() != null, OutMonthPlanAudit::getPurchaseValue, bo.getPurchaseValue());
|
||||
|
@ -103,7 +103,7 @@ public class OutMonthPlanServiceImpl extends ServiceImpl<OutMonthPlanMapper, Out
|
||||
private LambdaQueryWrapper<OutMonthPlan> buildQueryWrapper(OutMonthPlanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutMonthPlan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutMonthPlan::getId);
|
||||
lqw.orderByDesc(OutMonthPlan::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutMonthPlan::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getPlanValue() != null, OutMonthPlan::getPlanValue, bo.getPlanValue());
|
||||
lqw.eq(bo.getCompleteValue() != null, OutMonthPlan::getCompleteValue, bo.getCompleteValue());
|
||||
|
@ -73,7 +73,7 @@ public class OutSettlementValueOwnerServiceImpl extends ServiceImpl<OutSettlemen
|
||||
private LambdaQueryWrapper<OutSettlementValueOwner> buildQueryWrapper(OutSettlementValueOwnerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutSettlementValueOwner> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutSettlementValueOwner::getId);
|
||||
lqw.orderByDesc(OutSettlementValueOwner::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutSettlementValueOwner::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getSettlementValue() != null, OutSettlementValueOwner::getSettlementValue, bo.getSettlementValue());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getValueType()), OutSettlementValueOwner::getValueType, bo.getValueType());
|
||||
|
@ -79,7 +79,7 @@ public class OutSettlementValueSubcontractServiceImpl extends ServiceImpl<OutSet
|
||||
private LambdaQueryWrapper<OutSettlementValueSubcontract> buildQueryWrapper(OutSettlementValueSubcontractBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutSettlementValueSubcontract> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutSettlementValueSubcontract::getId);
|
||||
lqw.orderByDesc(OutSettlementValueSubcontract::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutSettlementValueSubcontract::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), OutSettlementValueSubcontract::getDocumentCode, bo.getDocumentCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSettlementDescribe()), OutSettlementValueSubcontract::getSettlementDescribe, bo.getSettlementDescribe());
|
||||
|
@ -72,7 +72,7 @@ public class OutValueAllocationServiceImpl extends ServiceImpl<OutValueAllocatio
|
||||
private LambdaQueryWrapper<OutValueAllocation> buildQueryWrapper(OutValueAllocationBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OutValueAllocation> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(OutValueAllocation::getId);
|
||||
lqw.orderByDesc(OutValueAllocation::getId);
|
||||
lqw.eq(bo.getProjectId() != null, OutValueAllocation::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getOwnerDesignValue() != null, OutValueAllocation::getOwnerDesignValue, bo.getOwnerDesignValue());
|
||||
lqw.eq(bo.getOwnerPurchaseValue() != null, OutValueAllocation::getOwnerPurchaseValue, bo.getOwnerPurchaseValue());
|
||||
|
@ -4,6 +4,7 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.dto.attendance.BusAttendancePunchCardByFaceReq;
|
||||
import org.dromara.project.domain.vo.BusAttendanceRuleVo;
|
||||
@ -24,8 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/app/project/attendance/app")
|
||||
public class BusAttendanceAppController {
|
||||
@RequestMapping("/app/project/attendance")
|
||||
public class BusAttendanceAppController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IBusAttendanceService attendanceService;
|
||||
|
@ -1,18 +1,27 @@
|
||||
package org.dromara.project.controller.app;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
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.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.bo.BusAttendanceBo;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveAddReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveManagerReviewReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveQueryReq;
|
||||
import org.dromara.project.domain.vo.leave.BusLeaveVo;
|
||||
import org.dromara.project.service.IBusLeaveService;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -21,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/app/project/leave")
|
||||
public class BusLeaveAppController {
|
||||
public class BusLeaveAppController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IBusLeaveService leaveService;
|
||||
@ -34,9 +43,28 @@ public class BusLeaveAppController {
|
||||
*/
|
||||
@GetMapping("/list/loginUser")
|
||||
public TableDataInfo<BusLeaveVo> listByLoginUser(BusLeaveQueryReq req, PageQuery pageQuery) {
|
||||
SubConstructionUser constructionUser = constructionUserService.getBySysUserId(LoginHelper.getUserId());
|
||||
req.setUserId(constructionUser.getId());
|
||||
return leaveService.queryPageList(req, pageQuery);
|
||||
// SubConstructionUser constructionUser = constructionUserService.getBySysUserId(LoginHelper.getUserId());
|
||||
req.setUserId(LoginHelper.getUserId());
|
||||
//管理员呢
|
||||
return leaveService.listByLoginUser(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交请假
|
||||
*/
|
||||
@Log(title = "提交请假", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@RequestBody BusLeaveAddReq req) {
|
||||
return R.ok(leaveService.add(req));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,18 +1,23 @@
|
||||
package org.dromara.project.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.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveAddReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
||||
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
||||
import org.dromara.project.service.IBusReissueCardService;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -21,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/app/project/reissueCard")
|
||||
public class BusReissueCardAppController {
|
||||
public class BusReissueCardAppController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IBusReissueCardService reissueCardService;
|
||||
@ -34,8 +39,19 @@ public class BusReissueCardAppController {
|
||||
*/
|
||||
@GetMapping("/list/loginUser")
|
||||
public TableDataInfo<BusReissueCardVo> listByLoginUser(BusReissueCardQueryReq req, PageQuery pageQuery) {
|
||||
SubConstructionUser constructionUser = constructionUserService.getBySysUserId(LoginHelper.getUserId());
|
||||
req.setUserId(constructionUser.getId());
|
||||
return reissueCardService.queryPageList(req, pageQuery);
|
||||
// SubConstructionUser constructionUser = constructionUserService.getBySysUserId(LoginHelper.getUserId());
|
||||
req.setUserId(LoginHelper.getUserId());
|
||||
return reissueCardService.listByLoginUser(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交补卡
|
||||
*/
|
||||
@Log(title = "提交补卡", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@RequestBody BusReissueCardAddReq req) {
|
||||
return R.ok(reissueCardService.add(req));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,11 @@ public class BusAttendance extends BaseEntity {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 人脸照
|
||||
*/
|
||||
@ -62,6 +67,11 @@ public class BusAttendance extends BaseEntity {
|
||||
*/
|
||||
private String clockStatus;
|
||||
|
||||
/**
|
||||
* 迟到或早退的分钟
|
||||
*/
|
||||
private Integer minuteCount;
|
||||
|
||||
/**
|
||||
* 上下班(1上班2下班)
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -47,7 +48,7 @@ public class BusLeave extends BaseEntity {
|
||||
/**
|
||||
* 请假申请时间
|
||||
*/
|
||||
private Date userTime;
|
||||
private LocalDateTime userTime;
|
||||
|
||||
/**
|
||||
* 请假类型(1事假 2病假)
|
||||
@ -57,12 +58,12 @@ public class BusLeave extends BaseEntity {
|
||||
/**
|
||||
* 请假开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 请假结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 班组长
|
||||
@ -87,7 +88,7 @@ public class BusLeave extends BaseEntity {
|
||||
/**
|
||||
* 班组长操作时间
|
||||
*/
|
||||
private Date gangerTime;
|
||||
private LocalDateTime gangerTime;
|
||||
|
||||
/**
|
||||
* 管理员id
|
||||
@ -112,7 +113,7 @@ public class BusLeave extends BaseEntity {
|
||||
/**
|
||||
* 管理员操作时间
|
||||
*/
|
||||
private Date managerTime;
|
||||
private LocalDateTime managerTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -134,4 +135,9 @@ public class BusLeave extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 请假申请状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -47,7 +48,7 @@ public class BusReissueCard extends BaseEntity {
|
||||
/**
|
||||
* 补卡申请时间
|
||||
*/
|
||||
private Date userTime;
|
||||
private LocalDateTime userTime;
|
||||
|
||||
/**
|
||||
* 班组长
|
||||
@ -72,7 +73,7 @@ public class BusReissueCard extends BaseEntity {
|
||||
/**
|
||||
* 班组长操作时间
|
||||
*/
|
||||
private Date gangerTime;
|
||||
private LocalDateTime gangerTime;
|
||||
|
||||
/**
|
||||
* 管理员id
|
||||
@ -97,7 +98,7 @@ public class BusReissueCard extends BaseEntity {
|
||||
/**
|
||||
* 管理员操作时间
|
||||
*/
|
||||
private Date managerTime;
|
||||
private LocalDateTime managerTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -124,4 +125,9 @@ public class BusReissueCard extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,11 @@ public class BusAttendanceBo extends BaseEntity {
|
||||
@NotNull(message = "人员id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 人脸照
|
||||
*/
|
||||
@ -63,6 +68,11 @@ public class BusAttendanceBo extends BaseEntity {
|
||||
*/
|
||||
private String clockStatus;
|
||||
|
||||
/**
|
||||
* 迟到或早退的分钟
|
||||
*/
|
||||
private Integer minuteCount;
|
||||
|
||||
/**
|
||||
* 上下班(1上班2下班)
|
||||
*/
|
||||
@ -83,5 +93,4 @@ public class BusAttendanceBo extends BaseEntity {
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package org.dromara.project.domain.dto.leave;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025/4/8 11:44
|
||||
*/
|
||||
@Data
|
||||
public class BusLeaveAddReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 43795533290515099L;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 申请人名字
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 请假类型(1事假 2病假)
|
||||
*/
|
||||
private String leaveType;
|
||||
|
||||
/**
|
||||
* 申请请假说明
|
||||
*/
|
||||
private String userExplain;
|
||||
|
||||
/**
|
||||
* 请假开始时间
|
||||
*/
|
||||
@NotNull(message = "请假开始时间不能为空")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 请假结束时间
|
||||
*/
|
||||
@NotNull(message = "请假结束时间不能为空")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
}
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -67,4 +68,9 @@ public class BusLeaveQueryReq implements Serializable {
|
||||
*/
|
||||
private Long teamId;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate date;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package org.dromara.project.domain.dto.reissuecard;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025/4/8 9:58
|
||||
*/
|
||||
@Data
|
||||
public class BusReissueCardAddReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3708280254564807491L;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 申请人名字
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 申请补卡说明
|
||||
*/
|
||||
private String userExplain;
|
||||
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 考勤表主键id
|
||||
*/
|
||||
private Long attendanceId;
|
||||
|
||||
/**
|
||||
* 补卡申请时间
|
||||
*/
|
||||
private LocalDateTime userTime;
|
||||
}
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -72,4 +73,10 @@ public class BusReissueCardQueryReq implements Serializable {
|
||||
*/
|
||||
private Long attendanceId;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate date;
|
||||
|
||||
|
||||
}
|
||||
|
@ -38,6 +38,11 @@ public class BusAttendanceVo implements Serializable {
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
@ -74,6 +79,12 @@ public class BusAttendanceVo implements Serializable {
|
||||
@ExcelProperty(value = "1正常,2迟到,3早退,4缺勤,5补卡,6请假,7外勤")
|
||||
private String clockStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 迟到或早退的分钟
|
||||
*/
|
||||
private Integer minuteCount;
|
||||
|
||||
/**
|
||||
* 上下班(1上班2下班)
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@ import org.dromara.project.domain.BusLeave;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -53,7 +54,7 @@ public class BusLeaveVo implements Serializable {
|
||||
* 请假申请时间
|
||||
*/
|
||||
@ExcelProperty(value = "请假申请时间")
|
||||
private Date userTime;
|
||||
private LocalDateTime userTime;
|
||||
|
||||
/**
|
||||
* 请假类型(1事假 2病假)
|
||||
@ -66,13 +67,13 @@ public class BusLeaveVo implements Serializable {
|
||||
* 请假开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "请假开始时间")
|
||||
private Date startTime;
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 请假结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "请假结束时间")
|
||||
private Date endTime;
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -117,7 +118,7 @@ public class BusLeaveVo implements Serializable {
|
||||
* 班组长操作时间
|
||||
*/
|
||||
@ExcelProperty(value = "班组长操作时间")
|
||||
private Date gangerTime;
|
||||
private LocalDateTime gangerTime;
|
||||
|
||||
/**
|
||||
* 管理员id
|
||||
@ -146,7 +147,7 @@ public class BusLeaveVo implements Serializable {
|
||||
* 管理员操作时间
|
||||
*/
|
||||
@ExcelProperty(value = "管理员操作时间")
|
||||
private Date managerTime;
|
||||
private LocalDateTime managerTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@ -157,6 +158,8 @@ public class BusLeaveVo implements Serializable {
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 请假申请状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import org.dromara.project.domain.BusReissueCard;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -53,7 +54,7 @@ public class BusReissueCardVo implements Serializable {
|
||||
* 补卡申请时间
|
||||
*/
|
||||
@ExcelProperty(value = "补卡申请时间")
|
||||
private Date userTime;
|
||||
private LocalDateTime userTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
@ -98,7 +99,7 @@ public class BusReissueCardVo implements Serializable {
|
||||
* 班组长操作时间
|
||||
*/
|
||||
@ExcelProperty(value = "班组长操作时间")
|
||||
private Date gangerTime;
|
||||
private LocalDateTime gangerTime;
|
||||
|
||||
/**
|
||||
* 管理员id
|
||||
@ -127,7 +128,7 @@ public class BusReissueCardVo implements Serializable {
|
||||
* 管理员操作时间
|
||||
*/
|
||||
@ExcelProperty(value = "管理员操作时间")
|
||||
private Date managerTime;
|
||||
private LocalDateTime managerTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@ -6,11 +6,13 @@ 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.project.domain.BusLeave;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveAddReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveGangerReviewReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveManagerReviewReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveQueryReq;
|
||||
import org.dromara.project.domain.vo.leave.BusLeaveVo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -96,4 +98,19 @@ public interface IBusLeaveService extends IService<BusLeave> {
|
||||
*/
|
||||
Page<BusLeaveVo> getVoPage(Page<BusLeave> leavePage);
|
||||
|
||||
/**
|
||||
* 查询是否请假
|
||||
*/
|
||||
Boolean isLeave(LocalDate date,Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 新增申请
|
||||
*/
|
||||
Long add(BusLeaveAddReq req);
|
||||
|
||||
/**
|
||||
* 查询当前登录用户请假申请列表
|
||||
*/
|
||||
TableDataInfo<BusLeaveVo> listByLoginUser(BusLeaveQueryReq req, PageQuery pageQuery);
|
||||
}
|
||||
|
@ -6,9 +6,11 @@ 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.project.domain.BusReissueCard;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardManagerReviewReq;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
||||
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -87,4 +89,14 @@ public interface IBusReissueCardService extends IService<BusReissueCard> {
|
||||
*/
|
||||
Page<BusReissueCardVo> getVoPage(Page<BusReissueCard> reissueCardPage);
|
||||
|
||||
|
||||
/**
|
||||
* 获取施工人员补卡申请分页列表
|
||||
*/
|
||||
TableDataInfo<BusReissueCardVo> listByLoginUser(BusReissueCardQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 新增施工人员补卡申请
|
||||
*/
|
||||
Long add(BusReissueCardAddReq req);
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
|
||||
private final IBusProjectTeamService projectTeamService;
|
||||
|
||||
private final IBusLeaveService leaveService;
|
||||
|
||||
// 出勤状态(正常、迟到、早退)
|
||||
private static final Set<String> ATTENDANCE_STATUS = new HashSet<>(Arrays.asList(BusAttendanceClockStatusEnum.NORMAL.getValue(),
|
||||
@ -248,6 +249,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
//确定考勤日期
|
||||
LocalDate localDate = calculateAttendanceDate(now, busAttendanceRuleVo);
|
||||
|
||||
if(leaveService.isLeave(localDate, userId)){
|
||||
throw new ServiceException("当前用户正在请假中", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
// 判断当前用户打卡状态
|
||||
List<BusAttendance> attendances = this.lambdaQuery()
|
||||
.eq(BusAttendance::getUserId, userId)
|
||||
@ -428,7 +433,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
*/
|
||||
private Boolean isLate(LocalDateTime checkTime, BusAttendanceRuleVo vo) {
|
||||
|
||||
long clockInSeconds = vo.getClockInTime().toSecondOfDay();
|
||||
long clockInSeconds = vo.getClockInTime().plusMinutes(1).toSecondOfDay();
|
||||
long clockInResultSeconds = vo.getClockInResultTime().toSecondOfDay();
|
||||
|
||||
|
||||
|
@ -1,11 +1,22 @@
|
||||
package org.dromara.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
@ -16,25 +27,25 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.contractor.service.ISubContractorService;
|
||||
import org.dromara.project.domain.BusAttendance;
|
||||
import org.dromara.project.domain.BusLeave;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
import org.dromara.project.domain.BusProjectTeamMember;
|
||||
import org.dromara.project.domain.*;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveAddReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveGangerReviewReq;
|
||||
import org.dromara.project.domain.enums.*;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveManagerReviewReq;
|
||||
import org.dromara.project.domain.dto.leave.BusLeaveQueryReq;
|
||||
import org.dromara.project.domain.vo.leave.BusLeaveVo;
|
||||
import org.dromara.project.mapper.BusLeaveMapper;
|
||||
import org.dromara.project.service.IBusAttendanceService;
|
||||
import org.dromara.project.service.IBusLeaveService;
|
||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.project.service.*;
|
||||
import org.dromara.workflow.domain.TestLeave;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
@ -46,6 +57,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2025-04-08
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
implements IBusLeaveService {
|
||||
|
||||
@ -65,6 +77,8 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
@Resource
|
||||
private ISubContractorService contractorService;
|
||||
|
||||
private IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||
|
||||
/**
|
||||
* 查询施工人员请假申请
|
||||
*
|
||||
@ -141,7 +155,7 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
newLeave.setId(id);
|
||||
newLeave.setGangerOpinion(gangerOpinion);
|
||||
newLeave.setGangerExplain(req.getGangerExplain());
|
||||
newLeave.setGangerTime(new Date());
|
||||
newLeave.setGangerTime(LocalDateTime.now());
|
||||
newLeave.setRemark(req.getRemark());
|
||||
boolean result = this.updateById(newLeave);
|
||||
if (!result) {
|
||||
@ -200,21 +214,21 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
leave.setManagerId(constructionUser.getId());
|
||||
leave.setManagerOpinion(managerOpinion);
|
||||
leave.setManagerExplain(req.getManagerExplain());
|
||||
leave.setManagerTime(new Date());
|
||||
leave.setManagerTime(LocalDateTime.now());
|
||||
leave.setRemark(req.getRemark());
|
||||
boolean result = this.updateById(leave);
|
||||
if (!result) {
|
||||
throw new ServiceException("更新管理员审核操作失败", HttpStatus.ERROR);
|
||||
}
|
||||
// 更新考勤表记录
|
||||
Date startTime = oldLeave.getStartTime();
|
||||
Date endTime = oldLeave.getEndTime();
|
||||
LocalDateTime startTime = oldLeave.getStartTime();
|
||||
LocalDateTime endTime = oldLeave.getEndTime();
|
||||
// 计算相差的时间
|
||||
long diffInMillis = endTime.getTime() - startTime.getTime();
|
||||
long day = TimeUnit.MILLISECONDS.toDays(diffInMillis) + 1;
|
||||
Long userId = oldLeave.getUserId();
|
||||
String userName = oldLeave.getUserName();
|
||||
Long projectId = oldLeave.getProjectId();
|
||||
// long diffInMillis = endTime.getTime() - startTime.getTime();
|
||||
// long day = TimeUnit.MILLISECONDS.toDays(diffInMillis) + 1;
|
||||
// Long userId = oldLeave.getUserId();
|
||||
// String userName = oldLeave.getUserName();
|
||||
// Long projectId = oldLeave.getProjectId();
|
||||
// 遍历每一天
|
||||
List<BusAttendance> attendanceList = new ArrayList<>();
|
||||
// for (long i = 0; i < day; i++) {
|
||||
@ -274,7 +288,7 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
}
|
||||
// 添加审核状态
|
||||
String status = BusReviewStatusEnum.getEnumByOpinionStatus(leave.getGangerOpinion(), leave.getManagerOpinion());
|
||||
leaveVo.setStatus(status);
|
||||
leaveVo.setAuditStatus(status);
|
||||
return leaveVo;
|
||||
}
|
||||
|
||||
@ -348,10 +362,152 @@ public class BusLeaveServiceImpl extends ServiceImpl<BusLeaveMapper, BusLeave>
|
||||
leaveVo.setTeamName(teamName);
|
||||
// 添加审核状态
|
||||
String status = BusReviewStatusEnum.getEnumByOpinionStatus(leave.getGangerOpinion(), leave.getManagerOpinion());
|
||||
leaveVo.setStatus(status);
|
||||
leaveVo.setAuditStatus(status);
|
||||
return leaveVo;
|
||||
}).toList();
|
||||
leaveVoPage.setRecords(leaveVoList);
|
||||
return leaveVoPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean isLeave(LocalDate date, Long userId) {
|
||||
LocalDateTime dateStart = LocalDateTime.of(date, LocalTime.MIN);
|
||||
LocalDateTime dateEnd = LocalDateTime.of(date, LocalTime.MAX);
|
||||
|
||||
LambdaQueryWrapper<BusLeave> wrappers = new LambdaQueryWrapper<>();
|
||||
wrappers.eq(BusLeave::getUserId, userId)
|
||||
.eq(BusLeave::getAuditStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
.le(BusLeave::getStartTime, dateEnd) // 请假开始时间 <= 当天结束时间
|
||||
.ge(BusLeave::getEndTime, dateStart); // 请假结束时间 >= 当天开始时间
|
||||
|
||||
return count(wrappers) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long add(BusLeaveAddReq req) {
|
||||
// 1. 转换请求对象
|
||||
BusLeave leave = new BusLeave();
|
||||
BeanUtils.copyProperties(leave, req);
|
||||
|
||||
// 2. 获取当前用户ID和时间区间
|
||||
Long userId = req.getUserId();
|
||||
LocalDateTime newStart = req.getStartTime();
|
||||
LocalDateTime newEnd = req.getEndTime();
|
||||
|
||||
// 3. 构造查询条件
|
||||
LambdaQueryWrapper<BusLeave> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper
|
||||
.eq(BusLeave::getUserId, userId)
|
||||
.le(BusLeave::getStartTime, newEnd) // 已有记录的开始时间 < 新记录的结束时间
|
||||
.ge(BusLeave::getEndTime, newStart); // 已有记录的结束时间 > 新记录的开始时间
|
||||
|
||||
// 4. 执行冲突校验
|
||||
if (count(wrapper) > 0) {
|
||||
throw new ServiceException("该时间段已存在请假申请记录", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
// 5. 保存新记录(需补充完整字段赋值)
|
||||
leave.setUserTime(LocalDateTime.now());
|
||||
this.save(leave);
|
||||
return leave.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BusLeaveVo> listByLoginUser(BusLeaveQueryReq req, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusLeave> lqw = new LambdaQueryWrapper<>();
|
||||
|
||||
lqw.eq(ObjectUtils.isNotEmpty(req.getUserId()), BusLeave::getUserId, req.getUserId());
|
||||
|
||||
List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(
|
||||
Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
||||
.eq(BusUserProjectRelevancy::getProjectId, req.getProjectId())
|
||||
.eq(BusUserProjectRelevancy::getUserId, req.getUserId()));
|
||||
|
||||
boolean b = relevancyList.stream().anyMatch(relevancy -> "2".equals(relevancy.getUserType()));
|
||||
|
||||
lqw.eq(!b, BusLeave::getProjectId, req.getProjectId());
|
||||
// 新增日期范围筛选条件
|
||||
if (req.getDate() != null) {
|
||||
LocalDateTime dateStart = LocalDateTime.of(req.getDate(), LocalTime.MIN);
|
||||
LocalDateTime dateEnd = LocalDateTime.of(req.getDate(), LocalTime.MAX);
|
||||
|
||||
lqw.and(wrapper -> wrapper
|
||||
.le(BusLeave::getStartTime, dateEnd) // 开始时间 ≤ 当天结束时间
|
||||
.ge(BusLeave::getEndTime, dateStart) // 结束时间 ≥ 当天开始时间
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Page<BusLeave> result = this.page(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("项目请假任务执行了{}", processEvent.toString());
|
||||
BusLeave busLeave = baseMapper.selectById(Convert.toLong(processEvent.getBusinessId()));
|
||||
busLeave.setAuditStatus(processEvent.getStatus());
|
||||
// 用于例如审批附件 审批意见等 存储到业务表内 自行根据业务实现存储流程
|
||||
// Map<String, Object> params = processEvent.getParams();
|
||||
// if (MapUtil.isNotEmpty(params)) {
|
||||
// // 历史任务扩展(通常为附件)
|
||||
// String hisTaskExt = Convert.toStr(params.get("hisTaskExt"));
|
||||
// // 办理人
|
||||
// String handler = Convert.toStr(params.get("handler"));
|
||||
// // 办理意见
|
||||
// String message = Convert.toStr(params.get("message"));
|
||||
// }
|
||||
if (processEvent.getSubmit()) {
|
||||
busLeave.setAuditStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
}
|
||||
baseMapper.updateById(busLeave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("项目请假任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,项目请假任务执行了{}", processDeleteEvent.toString());
|
||||
// BusLeave busLeave = baseMapper.selectById(Convert.toLong(processDeleteEvent.getBusinessId()));
|
||||
// if (ObjectUtil.isNull(busLeave)) {
|
||||
// return;
|
||||
// }
|
||||
// baseMapper.deleteById(busLeave.getId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,21 +1,27 @@
|
||||
package org.dromara.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
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.project.domain.BusAttendance;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.domain.BusProjectTeam;
|
||||
import org.dromara.project.domain.BusReissueCard;
|
||||
import org.dromara.project.domain.*;
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardAddReq;
|
||||
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
||||
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
||||
import org.dromara.project.domain.enums.BusOpinionStatusEnum;
|
||||
@ -24,14 +30,14 @@ import org.dromara.project.domain.dto.reissuecard.BusReissueCardManagerReviewReq
|
||||
import org.dromara.project.domain.dto.reissuecard.BusReissueCardQueryReq;
|
||||
import org.dromara.project.domain.vo.reissuecard.BusReissueCardVo;
|
||||
import org.dromara.project.mapper.BusReissueCardMapper;
|
||||
import org.dromara.project.service.IBusAttendanceService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.project.service.IBusProjectTeamService;
|
||||
import org.dromara.project.service.IBusReissueCardService;
|
||||
import org.dromara.project.service.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -42,6 +48,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2025-04-08
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper, BusReissueCard>
|
||||
implements IBusReissueCardService {
|
||||
|
||||
@ -53,6 +60,8 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper,
|
||||
|
||||
@Resource
|
||||
private IBusAttendanceService attendanceService;
|
||||
@Resource
|
||||
private IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||
|
||||
/**
|
||||
* 查询施工人员补卡申请
|
||||
@ -275,4 +284,111 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper,
|
||||
reissueCardVoPage.setRecords(reissueCardVoList);
|
||||
return reissueCardVoPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<BusReissueCardVo> listByLoginUser(BusReissueCardQueryReq req, PageQuery pageQuery) {
|
||||
|
||||
LambdaQueryWrapper<BusReissueCard> lqw = new LambdaQueryWrapper<>();
|
||||
|
||||
lqw.eq(ObjectUtils.isNotEmpty(req.getUserId()), BusReissueCard::getUserId, req.getUserId());
|
||||
|
||||
List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list(
|
||||
Wrappers.lambdaQuery(BusUserProjectRelevancy.class)
|
||||
.eq(BusUserProjectRelevancy::getProjectId, req.getProjectId())
|
||||
.eq(BusUserProjectRelevancy::getUserId, req.getUserId()));
|
||||
|
||||
boolean b = relevancyList.stream().anyMatch(relevancy -> "2".equals(relevancy.getUserType()));
|
||||
|
||||
lqw.eq(!b, BusReissueCard::getProjectId, req.getProjectId());
|
||||
// 新增日期范围筛选条件
|
||||
if (req.getDate() != null) {
|
||||
LocalDateTime dateStart = LocalDateTime.of(req.getDate(), LocalTime.MIN);
|
||||
LocalDateTime dateEnd = LocalDateTime.of(req.getDate(), LocalTime.MAX);
|
||||
|
||||
// 结束时间 ≥ 当天开始时间
|
||||
lqw.between(BusReissueCard::getUserTime, dateStart, dateEnd);
|
||||
}
|
||||
|
||||
Page<BusReissueCard> result = this.page(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long add(BusReissueCardAddReq req) {
|
||||
BusReissueCard bean = BeanUtil.toBean(req, BusReissueCard.class);
|
||||
|
||||
//查看是否已提交该id的申请
|
||||
List<BusReissueCard> busReissueCards = baseMapper.selectList(Wrappers.<BusReissueCard>lambdaQuery()
|
||||
.eq(BusReissueCard::getAttendanceId, bean.getAttendanceId()));
|
||||
if (CollUtil.isNotEmpty(busReissueCards)) {
|
||||
throw new ServiceException("已提交该申请");
|
||||
}
|
||||
|
||||
save(bean);
|
||||
|
||||
|
||||
return bean.getId();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("项目补卡任务执行了{}", processEvent.toString());
|
||||
BusReissueCard busReissueCard = baseMapper.selectById(Convert.toLong(processEvent.getBusinessId()));
|
||||
busReissueCard.setStatus(processEvent.getStatus());
|
||||
// 用于例如审批附件 审批意见等 存储到业务表内 自行根据业务实现存储流程
|
||||
// Map<String, Object> params = processEvent.getParams();
|
||||
// if (MapUtil.isNotEmpty(params)) {
|
||||
// // 历史任务扩展(通常为附件)
|
||||
// String hisTaskExt = Convert.toStr(params.get("hisTaskExt"));
|
||||
// // 办理人
|
||||
// String handler = Convert.toStr(params.get("handler"));
|
||||
// // 办理意见
|
||||
// String message = Convert.toStr(params.get("message"));
|
||||
// }
|
||||
if (processEvent.getSubmit()) {
|
||||
busReissueCard.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
}
|
||||
baseMapper.updateById(busReissueCard);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("项目补卡任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.startsWith('projectLeave')")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,项目补卡任务执行了{}", processDeleteEvent.toString());
|
||||
// BusLeave busLeave = baseMapper.selectById(Convert.toLong(processDeleteEvent.getBusinessId()));
|
||||
// if (ObjectUtil.isNull(busLeave)) {
|
||||
// return;
|
||||
// }
|
||||
// baseMapper.deleteById(busLeave.getId());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user