Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into dev
This commit is contained in:
commit
67acf8550a
@ -84,7 +84,7 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu
|
||||
// 发起外出申请后,判断是否是当天的外出
|
||||
if (goOut.getStartTime().toLocalDate().isEqual(LocalDate.now())) {
|
||||
// 设置外勤打卡权限
|
||||
userApi.updateFieldwork(getLoginUserId(), 1);
|
||||
userApi.updateFieldworkType(getLoginUserId(), 1);
|
||||
}
|
||||
|
||||
return goOut.getId();
|
||||
@ -103,7 +103,7 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
||||
// 发起外出申请后,设置关闭外勤打卡权限
|
||||
userApi.updateFieldwork(getLoginUserId(), 0);
|
||||
userApi.updateFieldworkType(getLoginUserId(), 0);
|
||||
}
|
||||
|
||||
goOutMapper.updateById(new BpmOAGoOutDO().setId(id).setResult(result));
|
||||
|
@ -81,7 +81,7 @@ public interface AdminUserApi {
|
||||
@Operation(summary = "修改用户外勤打卡权限")
|
||||
@Parameter(name = "userId", description = "用户id", example = "1024", required = true)
|
||||
@Parameter(name = "fieldworkFlag", description = "是否可外勤打卡 | 0否 1是", example = "1", required = true)
|
||||
void updateFieldwork(@RequestParam("userId") Long userId,
|
||||
void updateFieldworkType(@RequestParam("userId") Long userId,
|
||||
@RequestParam("fieldworkFlag") Integer fieldworkFlag);
|
||||
|
||||
@GetMapping(PREFIX + "/getUserIdsByUserNature")
|
||||
|
@ -91,9 +91,9 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFieldwork(Long userId, Integer fieldworkFlag) {
|
||||
public void updateFieldworkType(Long userId, Integer fieldworkFlag) {
|
||||
|
||||
userService.updateFieldwork(userId, fieldworkFlag);
|
||||
userService.updateFieldworkType(userId, fieldworkFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,6 +107,11 @@ public class AdminUserDO extends TenantBaseDO {
|
||||
*/
|
||||
private Integer fieldworkFlag;
|
||||
|
||||
/**
|
||||
* 许外勤打卡类型 1永久 1临时
|
||||
*/
|
||||
private Integer fieldworkType;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
* 1:公司用户 2:工厂用户
|
||||
|
@ -75,4 +75,28 @@ public class LogInstanceDO extends BaseDO {
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems ;
|
||||
|
||||
/**
|
||||
* 阅读状态, 0:未读、1:已读
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String readStatus;
|
||||
|
||||
/**
|
||||
* 评论数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer comment;
|
||||
|
||||
/**
|
||||
* 已读人数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer readCount;
|
||||
|
||||
/**
|
||||
* 未读人数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer unreadCount;
|
||||
}
|
||||
|
@ -9,8 +9,6 @@ import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.Lo
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogInstanceDO;
|
||||
import cn.iocoder.yudao.module.system.service.worklog.dto.LogReadUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -41,11 +39,32 @@ public interface LogInstanceMapper extends BaseMapperX<LogInstanceDO> {
|
||||
.in(LogInstanceDO::getTime, dateList));
|
||||
}
|
||||
|
||||
IPage<LogInstanceRespVO> selectPageResult(@Param("page") Page<LogInstanceRespVO> page,
|
||||
@Param("reqVO") LogInstancePageReqVO reqVO,
|
||||
List<LogInstanceRespVO> selectPageResult( @Param("reqVO") LogInstancePageReqVO reqVO,
|
||||
@Param("userId") Long userId,
|
||||
@Param("pagingType") Integer pagingType,
|
||||
@Param("userIds") List<Long> userIds);
|
||||
@Param("ids") List<Long> ids);
|
||||
|
||||
default PageResult<LogInstanceDO> selectPage(LogInstancePageReqVO reqVO, Long userId,
|
||||
Integer pagingType, List<Long> userIds) {
|
||||
|
||||
LambdaQueryWrapperX<LogInstanceDO> queryWrapper = new LambdaQueryWrapperX<LogInstanceDO>()
|
||||
.eqIfPresent(LogInstanceDO::getFormId, reqVO.getFormId())
|
||||
.eqIfPresent(LogInstanceDO::getDeptId, reqVO.getDeptId())
|
||||
.eqIfPresent(LogInstanceDO::getStartUserId, reqVO.getStartUserId())
|
||||
.betweenIfPresent(LogInstanceDO::getTime, reqVO.getCreateTime());
|
||||
|
||||
if (pagingType == 0) {
|
||||
queryWrapper.ne(LogInstanceDO::getStartUserId, userId);
|
||||
} else if (pagingType == 1) {
|
||||
queryWrapper.eq(LogInstanceDO::getStartUserId, userId);
|
||||
}
|
||||
|
||||
if (reqVO.getIsBoss() != null && reqVO.getIsProduce() == null) {
|
||||
queryWrapper.inIfPresent(LogInstanceDO::getStartUserId, userIds);
|
||||
}
|
||||
|
||||
return selectPage(reqVO, queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@DataPermission(enable = false)
|
||||
List<LogReadUserRespDTO> selectRaedUser(@Param("userId")Long userId, @Param("deptId")Long deptId);
|
||||
|
@ -281,7 +281,13 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
String lastKey = "holiday_" + (Integer.parseInt(year) - 1);
|
||||
stringRedisTemplate.delete(lastKey);
|
||||
}
|
||||
return (Boolean) stringRedisTemplate.opsForHash().get(key, dateStr);
|
||||
Object o = stringRedisTemplate.opsForHash().get(key, dateStr);
|
||||
log.info("返回的对象:{}",o);
|
||||
if ("true".equals(String.valueOf(o))){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,13 +221,14 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
// -- 判断是否根据节假日自动排班 - 如果是的话 - 根据排班的来
|
||||
Boolean isHolidayFlag = Constants.TRUE.equals(activationGroup.getAutoHolidaysFlag()) ?
|
||||
attendanceService.isHoliday(dto.getLocalDateTime()) : null;
|
||||
vo.setTodayNeedAttendance(Constants.TRUE);
|
||||
// -- 当前是节假日 并且是放假
|
||||
if (isHolidayFlag != null && isHolidayFlag) {
|
||||
return vo.setTodayNeedAttendance(Constants.FALSE);
|
||||
}
|
||||
//获取到当天是周几
|
||||
int week = dto.getLocalDateTime().getDayOfWeek().getValue();
|
||||
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week);
|
||||
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week-1);
|
||||
// -- 当前没有班次 - 不需要考勤
|
||||
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
|
||||
return vo.setTodayNeedAttendance(Constants.FALSE);
|
||||
@ -236,6 +237,7 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
|
||||
attendanceService.calculatePunch(dto, vo);
|
||||
vo.setAttendanceGroupId(activationGroup.getId());
|
||||
vo.setUser(dto.getUser());
|
||||
log.info("考勤页面返回:{}",vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -102,6 +102,15 @@ public interface AdminUserService {
|
||||
*/
|
||||
void updateFieldwork(Long id, Integer fieldworkFlag);
|
||||
|
||||
/**
|
||||
* 修改外勤打卡状态
|
||||
* 用于临时开启外勤打卡
|
||||
*
|
||||
* @param id 用户编号
|
||||
* @param fieldworkFlag 状态
|
||||
*/
|
||||
void updateFieldworkType(Long id, Integer fieldworkFlag);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*
|
||||
|
@ -272,9 +272,22 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
AdminUserDO updateObj = new AdminUserDO();
|
||||
updateObj.setId(id);
|
||||
updateObj.setFieldworkFlag(fieldworkFlag);
|
||||
updateObj.setFieldworkType(fieldworkFlag == 1 ? 1 : 0); //设置为 永久外勤类型
|
||||
userMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFieldworkType(Long id, Integer fieldworkFlag) {
|
||||
// 更新状态
|
||||
AdminUserDO updateObj = new AdminUserDO();
|
||||
updateObj.setId(id);
|
||||
updateObj.setFieldworkFlag(fieldworkFlag);
|
||||
updateObj.setFieldworkType(fieldworkFlag == 1 ? 2 : 0); //设置为 临时外勤类型
|
||||
userMapper.update(updateObj, new LambdaQueryWrapper<AdminUserDO>()
|
||||
.eq(AdminUserDO::getId, id)
|
||||
.ne(AdminUserDO::getFieldworkType, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteUser(Long id) {
|
||||
|
@ -244,10 +244,8 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
leaderUserIds = adminUserService.getUserByBoss();
|
||||
}
|
||||
|
||||
Page<LogInstanceRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<LogInstanceRespVO> pageList = logInstanceMapper.selectPageResult(page, pageReqVO, getLoginUserId(), pagingType, leaderUserIds);
|
||||
|
||||
List<LogInstanceRespVO> records = pageList.getRecords();
|
||||
PageResult<LogInstanceDO> pageList = logInstanceMapper.selectPage(pageReqVO, getLoginUserId(), pagingType, leaderUserIds);
|
||||
List<LogInstanceRespVO> records = logInstanceMapper.selectPageResult(pageReqVO, getLoginUserId(), convertList(pageList.getList(), LogInstanceDO::getId));
|
||||
if (!records.isEmpty()) {
|
||||
|
||||
//模版ids过滤
|
||||
@ -284,6 +282,9 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
}
|
||||
String fieldStr = fieldJson.getStr("field");
|
||||
String title = fieldJson.getStr("title");
|
||||
if (fieldStr == null || title == null) {
|
||||
continue;
|
||||
}
|
||||
String field = workLogContentJson.getStr(fieldStr);
|
||||
workLogContent.append(title).append(":").append(field).append(" ");
|
||||
}
|
||||
@ -304,7 +305,10 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
});
|
||||
}
|
||||
|
||||
return pageList;
|
||||
IPage<LogInstanceRespVO> pageListVO = new Page<>();
|
||||
pageListVO.setRecords(records);
|
||||
pageListVO.setTotal(pageList.getTotal());
|
||||
return pageListVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,6 +112,15 @@
|
||||
LEFT JOIN (SELECT work_log_id, COUNT(work_log_id) AS comment FROM work_log_comment where deleted = 0 GROUP BY work_log_id) AS b ON a.id = b.work_log_id
|
||||
<where>
|
||||
a.deleted = 0
|
||||
<if test="ids != null and ids.size > 0">
|
||||
and a.id in
|
||||
<foreach collection="ids" item="ids" open="(" close=")" separator=",">
|
||||
#{ids}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="ids == null or ids.size == 0">
|
||||
and a.id = null
|
||||
</if>
|
||||
AND a.start_user_id = userPost.user_id
|
||||
AND userPost.post_id = post.id
|
||||
AND a.dept_id = dept.id
|
||||
@ -121,38 +130,9 @@
|
||||
<if test="reqVO.isProduce == 2">
|
||||
AND dept.flag NOT LIKE '%166%'
|
||||
</if>
|
||||
<if test="reqVO.formId != null">
|
||||
and a.form_id = #{reqVO.formId}
|
||||
</if>
|
||||
<if test="reqVO.deptId != null">
|
||||
and a.dept_id = #{reqVO.deptId}
|
||||
</if>
|
||||
<if test="reqVO.startUserId != null">
|
||||
and a.start_user_id = #{reqVO.startUserId}
|
||||
</if>
|
||||
<if test="reqVO.createTime != null and reqVO.createTime.length > 0">
|
||||
<if test="reqVO.createTime[0] != null">
|
||||
and a.time >= #{reqVO.createTime[0]}
|
||||
</if>
|
||||
<if test="reqVO.createTime[1] != null">
|
||||
and a.time <= #{reqVO.createTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
<if test="reqVO.readStatus != null">
|
||||
and e.read_status = #{reqVO.readStatus}
|
||||
</if>
|
||||
<if test="pagingType == 0">
|
||||
and a.start_user_id != #{userId}
|
||||
</if>
|
||||
<if test="pagingType == 1">
|
||||
and a.start_user_id = #{userId}
|
||||
</if>
|
||||
<if test="reqVO.isBoss != null and reqVO.isProduce == null">
|
||||
and a.start_user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY a.id
|
||||
ORDER BY
|
||||
|
Loading…
Reference in New Issue
Block a user