app
This commit is contained in:
@ -156,4 +156,5 @@ public class SubConstructionUserAppController {
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody BusProjectTeamMemberCreateReq req) {
|
||||
return R.ok(busProjectTeamMemberService.insertByBo(req));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -196,4 +196,7 @@ public class SubConstructionUser extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
private LocalDate firstDate;
|
||||
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
||||
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
||||
import org.dromara.project.domain.enums.BusConstructionUserAttendanceStatusEnum;
|
||||
import org.dromara.project.service.*;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysDictTypeService;
|
||||
@ -1196,6 +1197,11 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
||||
if (!save) {
|
||||
throw new ServiceException("施工人员信息保存失败");
|
||||
}
|
||||
//修改用户昵称
|
||||
SysUserBo sysUserBo = new SysUserBo();
|
||||
sysUserBo.setUserId(userId);
|
||||
sysUserBo.setNickName(user.getUserName());
|
||||
userService.updateUser(sysUserBo);
|
||||
return user.getId();
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.project.controller.app;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
@ -8,7 +9,11 @@ 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.domain.dto.constructionuser.SubConstructionUserQueryReq;
|
||||
import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserAppVo;
|
||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||
import org.dromara.project.domain.BusAttendance;
|
||||
import org.dromara.project.domain.BusProjectPunchrange;
|
||||
import org.dromara.project.domain.dto.attendance.AttendanceCountDto;
|
||||
import org.dromara.project.domain.dto.attendance.AttendanceUserCountDto;
|
||||
@ -26,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -42,13 +48,15 @@ public class BusAttendanceAppController extends BaseController {
|
||||
@Resource
|
||||
private IBusAttendanceService attendanceService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IBusAttendanceRuleService attendanceRuleService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectPunchrangeService projectPunchrangeService;
|
||||
|
||||
@Resource
|
||||
private ISubConstructionUserService constructionUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 人脸坐标打卡
|
||||
@ -163,8 +171,30 @@ public class BusAttendanceAppController extends BaseController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 入职和考勤天数统计
|
||||
*/
|
||||
@GetMapping("/daysCount")
|
||||
public R<DaysCountVo> daysCount() {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
|
||||
DaysCountVo daysCountVo = new DaysCountVo();
|
||||
|
||||
SubConstructionUser bySysUserId = constructionUserService.getBySysUserId(userId);
|
||||
if(bySysUserId == null || bySysUserId.getFirstDate() == null){
|
||||
daysCountVo.setEntryDays(0);
|
||||
}else{
|
||||
daysCountVo.setEntryDays(LocalDate.now().getDayOfYear() - bySysUserId.getFirstDate().getDayOfYear());
|
||||
}
|
||||
List<BusAttendance> list = attendanceService.list(Wrappers.<BusAttendance>lambdaQuery()
|
||||
.eq(BusAttendance::getUserId, userId)
|
||||
.in(BusAttendance::getClockStatus, Arrays.asList("1", "2", "3"))
|
||||
);
|
||||
long count = list.stream().map(BusAttendance::getClockDate).distinct().count();
|
||||
daysCountVo.setAttendanceDays((int)count);
|
||||
|
||||
return R.ok(daysCountVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -97,4 +97,9 @@ public class BusAttendance extends BaseEntity {
|
||||
* 规定时间
|
||||
*/
|
||||
private LocalTime ruleTime;
|
||||
|
||||
/**
|
||||
* 处理 0-未处理,1-已处理
|
||||
*/
|
||||
private String handle;
|
||||
}
|
||||
|
||||
@ -120,4 +120,9 @@ public class BusAttendanceVo implements Serializable {
|
||||
*/
|
||||
private LocalTime ruleTime;
|
||||
|
||||
/**
|
||||
* 处理 0-未处理,1-已处理
|
||||
*/
|
||||
private String handle;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package org.dromara.project.domain.vo.attendance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DaysCountVo {
|
||||
|
||||
/**
|
||||
* 入职天数
|
||||
*/
|
||||
private Integer entryDays;
|
||||
/**
|
||||
* 出勤天数
|
||||
*/
|
||||
private Integer attendanceDays;
|
||||
|
||||
}
|
||||
@ -299,6 +299,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
attendance.setProjectId(req.getProjectId());
|
||||
attendance.setClockDate(localDate);
|
||||
attendance.setClockTime(now);
|
||||
attendance.setUserName(constructionUser.getUserName());
|
||||
// 记录打卡坐标
|
||||
attendance.setLat(req.getLat());
|
||||
attendance.setLng(req.getLng());
|
||||
|
||||
@ -36,6 +36,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -152,6 +153,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
throw new ServiceException("新增项目班组下的成员失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
// 同步修改用户表的team_id字段并添加入场时间
|
||||
|
||||
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
||||
.eq(SubConstructionUser::getId, constructionUser.getId())
|
||||
.set(SubConstructionUser::getProjectId, req.getProjectId())
|
||||
@ -159,7 +161,9 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
.set(SubConstructionUser::getTeamName, projectTeam.getTeamName())
|
||||
.set(SubConstructionUser::getEntryDate, new Date())
|
||||
.set(SubConstructionUser::getLeaveDate, null)
|
||||
.set(SubConstructionUser::getExitStatus, "0");
|
||||
.set(SubConstructionUser::getExitStatus, "0")
|
||||
.set(constructionUser.getFirstDate()!=null,SubConstructionUser::getFirstDate, LocalDate.now())
|
||||
;
|
||||
constructionUserService.update(constructionUserLuw);
|
||||
|
||||
|
||||
|
||||
@ -359,8 +359,11 @@ public class BusReissueCardServiceImpl extends ServiceImpl<BusReissueCardMapper,
|
||||
if (CollUtil.isNotEmpty(busReissueCards)) {
|
||||
throw new ServiceException("已提交该申请");
|
||||
}
|
||||
|
||||
save(bean);
|
||||
//修改为已处理
|
||||
attendanceService.update(Wrappers.<BusAttendance>lambdaUpdate()
|
||||
.eq(BusAttendance::getId, bean.getAttendanceId())
|
||||
.set(BusAttendance::getHandle, "1"));
|
||||
return bean.getId();
|
||||
}
|
||||
|
||||
|
||||
@ -48,4 +48,10 @@ public class QltQualityInspectionQueryReq implements Serializable {
|
||||
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 巡检标题
|
||||
*/
|
||||
private String inspectionHeadline;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -36,9 +36,15 @@ public class QltQualityInspectionVo implements Serializable {
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Translation(type = TransConstant.PROJECT_ID_TO_NAME, mapper = "projectId")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
|
||||
@ -343,6 +343,7 @@ public class QltQualityInspectionServiceImpl extends ServiceImpl<QltQualityInspe
|
||||
lqw.eq(ObjectUtils.isNotEmpty(rectificationId), QltQualityInspection::getRectificationId, rectificationId);
|
||||
lqw.eq(req.getCorrectorId() != null, QltQualityInspection::getCorrectorId, req.getCorrectorId());
|
||||
lqw.eq(req.getCreateBy() != null, QltQualityInspection::getCreateBy, req.getCreateBy());
|
||||
lqw.like(StringUtils.isNotBlank(req.getInspectionHeadline()), QltQualityInspection::getInspectionHeadline, req.getInspectionHeadline());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.dromara.safety.domain.dto.safetyinspection;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@ -78,6 +79,7 @@ public class HseSafetyInspectionCreateReq implements Serializable {
|
||||
/**
|
||||
* 检查时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user