Compare commits
6 Commits
aebc13aee1
...
5cd5935e2f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5cd5935e2f | ||
![]() |
3ceabc2e7c | ||
![]() |
f8a0845c6e | ||
![]() |
2cc51d9b4b | ||
![]() |
08df74e4d7 | ||
![]() |
de49d148b1 |
@ -4,11 +4,10 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.BpmOALeaveRpcVO;
|
import cn.iocoder.yudao.module.bpm.api.oa.vo.BpmOALeaveRpcVO;
|
||||||
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
|
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -18,9 +17,9 @@ public interface BpmOALeaveApi {
|
|||||||
|
|
||||||
String PREFIX = ApiConstants.PREFIX + "/oa/leave";
|
String PREFIX = ApiConstants.PREFIX + "/oa/leave";
|
||||||
|
|
||||||
@GetMapping(PREFIX + "/leaveListByTime")
|
|
||||||
@Operation(summary = "根据时间获取请假列表")
|
@PostMapping(PREFIX + "/getLeaveListByIds")
|
||||||
@Parameter(name = "time", description = "时间格式yyyy-MM-dd", required = true, example = "2024-05-11")
|
@Operation(summary = "根据请假ids获取请假列表")
|
||||||
CommonResult<List<BpmOALeaveRpcVO>> getLeaveListByTime(@RequestParam(name = "time") String time);
|
CommonResult<List<BpmOALeaveRpcVO>> getLeaveListByIds(@RequestBody List<Long> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,74 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.api.oa.vo;
|
package cn.iocoder.yudao.module.bpm.api.oa.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class BpmOALeaveRpcVO {
|
public class BpmOALeaveRpcVO {
|
||||||
@Schema(description = "请假表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
/**
|
||||||
|
* 请假表单主键
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
@Schema(description = "用户id")
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
* <p>
|
||||||
|
* 关联 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
@Schema(description = "请假的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
/**
|
||||||
@NotNull(message = "开始时间不能为空")
|
* 假期设置id
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
*/
|
||||||
|
private Long holidaySettingId;
|
||||||
|
/**
|
||||||
|
* 原因
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
/**
|
||||||
|
* 假期名称
|
||||||
|
*/
|
||||||
|
private String leaveName;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
private LocalDateTime startTime;
|
private LocalDateTime startTime;
|
||||||
@Schema(description = "请假的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
/**
|
||||||
@NotNull(message = "结束时间不能为空")
|
* 结束时间
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
*/
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
@Schema(description = "请假类型-参见 bpm_oa_leave_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "请假类型不能为空")
|
/**
|
||||||
private Integer type;
|
* 请假时长(单位根据请假最小单位来 按天or按半天 单位为天 按小时单位为小时)
|
||||||
|
*/
|
||||||
|
private BigDecimal duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间额外字段 根据请假最小单位来 1按天则为空 2按半天则1为上午 2为下午 3按小时则 格式为 HH:mm
|
||||||
|
*/
|
||||||
|
private String startTimeExtraFields;
|
||||||
|
/**
|
||||||
|
* 结束时间额外字段 根据请假最小单位来 1按天则为空 2按半天则1为上午 2为下午 3按小时则 格式为 HH:mm
|
||||||
|
*/
|
||||||
|
private String endTimeExtraFields;
|
||||||
|
/**
|
||||||
|
* 请假最小单位 1按天 2按半天 3按小时
|
||||||
|
*/
|
||||||
|
private Integer minUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假的结果
|
||||||
|
* <p>
|
||||||
|
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||||
|
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的流程编号
|
||||||
|
* <p>
|
||||||
|
* 关联 ProcessInstance 的 id 属性
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ public class BpmOALeaveApiImpl implements BpmOALeaveApi {
|
|||||||
@Resource
|
@Resource
|
||||||
private BpmOALeaveService leaveService;
|
private BpmOALeaveService leaveService;
|
||||||
|
|
||||||
@Override
|
|
||||||
public CommonResult<List<BpmOALeaveRpcVO>> getLeaveListByTime(String time) {
|
|
||||||
return success(leaveService.getLeaveListByTime(time));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<BpmOALeaveRpcVO>> getLeaveListByIds(List<Long> ids) {
|
||||||
|
return CommonResult.success(leaveService.getLeaveListByIds(ids));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,10 +29,4 @@ public interface BpmOALeaveMapper extends BaseMapperX<BpmOALeaveDO> {
|
|||||||
.orderByDesc(BpmOALeaveDO::getId));
|
.orderByDesc(BpmOALeaveDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param time
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<BpmOALeaveRpcVO> getLeaveListByTime(@Param("time") String time);
|
|
||||||
}
|
}
|
||||||
|
@ -58,14 +58,6 @@ public interface BpmOALeaveService {
|
|||||||
*/
|
*/
|
||||||
PageResult<BpmOALeaveDO> getLeavePage(Long userId, BpmOALeavePageReqVO pageReqVO);
|
PageResult<BpmOALeaveDO> getLeavePage(Long userId, BpmOALeavePageReqVO pageReqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据时间获取请假列表
|
|
||||||
*
|
|
||||||
* @param time
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<BpmOALeaveRpcVO> getLeaveListByTime(String time);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得指定请假申请
|
* 获得指定请假申请
|
||||||
*
|
*
|
||||||
@ -82,4 +74,12 @@ public interface BpmOALeaveService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BigDecimal calculateAndVerifyTheNumberOfLeaveDays(Long loginUserId, CalculateAndVerifyLeaveDTO dto);
|
BigDecimal calculateAndVerifyTheNumberOfLeaveDays(Long loginUserId, CalculateAndVerifyLeaveDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据请假ids获取请假列表
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BpmOALeaveRpcVO> getLeaveListByIds(List<Long> ids);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
@ -524,10 +525,6 @@ public class BpmOALeaveServiceImpl extends BpmOABaseService implements BpmOALeav
|
|||||||
return leaveMapper.selectPage(userId, pageReqVO);
|
return leaveMapper.selectPage(userId, pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BpmOALeaveRpcVO> getLeaveListByTime(String time) {
|
|
||||||
return leaveMapper.getLeaveListByTime(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BpmOALeaveDO getByProcessInstanceId(String processInstanceId) {
|
public BpmOALeaveDO getByProcessInstanceId(String processInstanceId) {
|
||||||
@ -545,4 +542,13 @@ public class BpmOALeaveServiceImpl extends BpmOABaseService implements BpmOALeav
|
|||||||
this.builderLeaveTime(leave);
|
this.builderLeaveTime(leave);
|
||||||
return this.calculateAndVerifyTheNumberOfLeaveDays(leave);
|
return this.calculateAndVerifyTheNumberOfLeaveDays(leave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BpmOALeaveRpcVO> getLeaveListByIds(List<Long> ids) {
|
||||||
|
if (CollUtil.isEmpty(ids)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<BpmOALeaveDO> bpmOALeaveDOS = leaveMapper.selectBatchIds(ids);
|
||||||
|
return BeanUtil.copyToList(bpmOALeaveDOS, BpmOALeaveRpcVO.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,15 +9,4 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<select id="getLeaveListByTime" resultType="cn.iocoder.yudao.module.bpm.api.oa.vo.BpmOALeaveRpcVO">
|
|
||||||
SELECT
|
|
||||||
*
|
|
||||||
FROM
|
|
||||||
bpm_oa_leave
|
|
||||||
<where>
|
|
||||||
result = 2
|
|
||||||
AND DATE_FORMAT( end_time, '%Y-%m-%d' ) >= #{time}
|
|
||||||
AND DATE_FORMAT( start_time, '%Y-%m-%d') <= #{time}
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -161,7 +161,9 @@ public class CrmAchievementServiceImpl implements CrmAchievementService {
|
|||||||
AdminUserPageApiDTO userPageReqVO = new AdminUserPageApiDTO();
|
AdminUserPageApiDTO userPageReqVO = new AdminUserPageApiDTO();
|
||||||
userPageReqVO.setPageNo(pageReqVO.getPageNo());
|
userPageReqVO.setPageNo(pageReqVO.getPageNo());
|
||||||
userPageReqVO.setPageSize(pageReqVO.getPageSize());
|
userPageReqVO.setPageSize(pageReqVO.getPageSize());
|
||||||
PageResult<AdminUserApiVO> pageResult = adminUserApi.getUserPage(userPageReqVO).getCheckedData();
|
// -- 这里固定查询销售的
|
||||||
|
userPageReqVO.setRoleCode("sale");
|
||||||
|
PageResult<AdminUserApiVO> pageResult = adminUserApi.getUserBringDeptPage(userPageReqVO).getCheckedData();
|
||||||
PageResult<UserAchieveRespVO> pageResult1 = BeanUtils.toBean(pageResult, UserAchieveRespVO.class);
|
PageResult<UserAchieveRespVO> pageResult1 = BeanUtils.toBean(pageResult, UserAchieveRespVO.class);
|
||||||
List<Long> typeIds = new ArrayList<>();
|
List<Long> typeIds = new ArrayList<>();
|
||||||
for (UserAchieveRespVO vo : pageResult1.getList()) {
|
for (UserAchieveRespVO vo : pageResult1.getList()) {
|
||||||
|
@ -116,4 +116,8 @@ public interface AdminUserApi {
|
|||||||
@GetMapping(PREFIX + "/getUserListBySubordinateIds")
|
@GetMapping(PREFIX + "/getUserListBySubordinateIds")
|
||||||
@Operation(summary = "获取当前部门以及下级部门所有人员(负责人)")
|
@Operation(summary = "获取当前部门以及下级部门所有人员(负责人)")
|
||||||
CommonResult<List<Long>> getUserListBySubordinateIds(@RequestParam(name = "adminId") Long adminId);
|
CommonResult<List<Long>> getUserListBySubordinateIds(@RequestParam(name = "adminId") Long adminId);
|
||||||
|
|
||||||
|
@PostMapping(PREFIX + "/getUserBringDeptPage")
|
||||||
|
@Operation(summary = "获取用户分页列表通过条件")
|
||||||
|
CommonResult<PageResult<AdminUserApiVO>> getUserBringDeptPage(@RequestBody AdminUserPageApiDTO userPageReqVO);
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,7 @@ public class AdminUserPageApiDTO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "考勤组ids", example = "1024")
|
@Schema(description = "考勤组ids", example = "1024")
|
||||||
private List<Long> groupIds;
|
private List<Long> groupIds;
|
||||||
|
|
||||||
|
@Schema(description = "角色code", example = "1")
|
||||||
|
private String roleCode;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.template.vo.MsgData;
|
|||||||
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
|
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
|
||||||
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
|
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
|
||||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
||||||
@ -33,20 +32,26 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi {
|
|||||||
@Resource
|
@Resource
|
||||||
private SocialClientService socialClientService;
|
private SocialClientService socialClientService;
|
||||||
|
|
||||||
@SneakyThrows
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Long> sendMaMsg(SubscribeMessageReqDTO reqDTO) {
|
public CommonResult<Long> sendMaMsg(SubscribeMessageReqDTO reqDTO) {
|
||||||
|
try {
|
||||||
//发送审批结果通知
|
//发送审批结果通知
|
||||||
socialClientService.getWxMaService(reqDTO.getSocialType()).getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
socialClientService.getWxMaService(reqDTO.getSocialType()).getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送小程序订阅消息失败:{}", e.getMessage());
|
||||||
|
}
|
||||||
return success(1L);
|
return success(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SneakyThrows
|
|
||||||
public CommonResult<Long> sendMpMsg(SubscribeMessageReqDTO reqDTO) {
|
public CommonResult<Long> sendMpMsg(SubscribeMessageReqDTO reqDTO) {
|
||||||
// -- 公众号 点击 跳转 小程序 - 需要获取到小程序appId
|
// -- 公众号 点击 跳转 小程序 - 需要获取到小程序appId
|
||||||
// 判断是否需要跳转小程序 - 通过
|
// 判断是否需要跳转小程序 - 通过
|
||||||
|
try {
|
||||||
socialClientService.getWxMpService().getTemplateMsgService().sendTemplateMsg(initWxMpSubscribeMessage(reqDTO));
|
socialClientService.getWxMpService().getTemplateMsgService().sendTemplateMsg(initWxMpSubscribeMessage(reqDTO));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送公众号消息失败:{}", e.getMessage());
|
||||||
|
}
|
||||||
return success(1L);
|
return success(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,4 +145,13 @@ public class AdminUserApiImpl implements AdminUserApi {
|
|||||||
return success(ids);
|
return success(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<PageResult<AdminUserApiVO>> getUserBringDeptPage(AdminUserPageApiDTO dto) {
|
||||||
|
PageResult<AdminUserApiVO> vo = new PageResult<>();
|
||||||
|
UserPageReqVO userPageReqVO = BeanUtil.copyProperties(dto, UserPageReqVO.class);
|
||||||
|
PageResult<AdminUserDO> pageResult = userService.getUserBringDeptPage(userPageReqVO);
|
||||||
|
BeanUtil.copyProperties(pageResult, vo);
|
||||||
|
return success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,4 +45,7 @@ public class UserPageReqVO extends PageParam {
|
|||||||
@Schema(description = "考勤组ids", example = "1024")
|
@Schema(description = "考勤组ids", example = "1024")
|
||||||
private List<Long> groupIds;
|
private List<Long> groupIds;
|
||||||
|
|
||||||
|
@Schema(description = "角色编码", example = "1024")
|
||||||
|
private String roleCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, FactoryInfoApi.class, BpmModelApi.class, BpmOAGoOutApi.class, BpmOAEntryApi.class, ConfigApi.class,
|
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, FactoryInfoApi.class, BpmModelApi.class, BpmOAGoOutApi.class, BpmOAEntryApi.class, ConfigApi.class,
|
||||||
BpmOAEvectionApi.class, BpmOAReplacementCardApi.class, BpmOARefundApi.class})
|
BpmOAEvectionApi.class, BpmOAReplacementCardApi.class, BpmOARefundApi.class, BpmOALeaveApi.class})
|
||||||
public class RpcConfiguration {
|
public class RpcConfiguration {
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,11 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|||||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
import cn.iocoder.yudao.framework.common.util.distance.GeoUtil;
|
import cn.iocoder.yudao.framework.common.util.distance.GeoUtil;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.oa.BpmOALeaveApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.oa.BpmOAReplacementCardApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.oa.vo.BpmOALeaveRpcVO;
|
||||||
import cn.iocoder.yudao.module.system.api.attendance.dto.AttendanceTimeRangeInfoDTO;
|
import cn.iocoder.yudao.module.system.api.attendance.dto.AttendanceTimeRangeInfoDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.attendance.vo.AttendanceTimeRangeInfoVO;
|
import cn.iocoder.yudao.module.system.api.attendance.vo.AttendanceTimeRangeInfoVO;
|
||||||
import cn.iocoder.yudao.module.bpm.api.oa.BpmOAReplacementCardApi;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.dto.*;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.attendance.vo.*;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.punchrecord.vo.AttendancePunchRecordSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.punchrecord.vo.AttendancePunchRecordSaveReqVO;
|
||||||
@ -28,7 +30,6 @@ import cn.iocoder.yudao.module.system.dal.dataobject.attendance.groupshiftitem.A
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.punchrecord.AttendancePunchRecordDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.punchrecord.AttendancePunchRecordDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.attendance.group.AttendanceGroupMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.attendance.group.AttendanceGroupMapper;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.attendance.punchrecord.AttendancePunchRecordMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.attendance.punchrecord.AttendancePunchRecordMapper;
|
||||||
@ -117,7 +118,8 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BpmOAReplacementCardApi replacementCardApi;
|
private BpmOAReplacementCardApi replacementCardApi;
|
||||||
|
@Resource
|
||||||
|
private BpmOALeaveApi leaveApi;
|
||||||
|
|
||||||
// 定义一些常量以提高代码的可读性和可维护性
|
// 定义一些常量以提高代码的可读性和可维护性
|
||||||
/**
|
/**
|
||||||
@ -1224,9 +1226,11 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
List<List<String>> data = new ArrayList<>();
|
List<List<String>> data = new ArrayList<>();
|
||||||
// -- 根据部门分组 - 根据考勤组分组
|
// -- 根据部门分组 - 根据考勤组分组
|
||||||
Map<Long, List<AttendancePunchRecordDO>> userPunchMap = list.stream().collect(Collectors.groupingBy(AttendancePunchRecordDO::getUserId));
|
Map<Long, List<AttendancePunchRecordDO>> userPunchMap = list.stream().collect(Collectors.groupingBy(AttendancePunchRecordDO::getUserId));
|
||||||
List<DictDataDO> bpmOaLeaveType = dictDataService.getDictDataList(CommonStatusEnum.ENABLE.getStatus(), "bpm_oa_leave_type");
|
// 获取到这段时间请假的Ids
|
||||||
//根据字典值分组
|
List<Long> leaveIds = list.stream().map(AttendancePunchRecordDO::getLeaveId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||||
Map<String, String> leaveTypeMap = bpmOaLeaveType.stream().collect(Collectors.toMap(DictDataDO::getValue, DictDataDO::getLabel));
|
List<BpmOALeaveRpcVO> leaveRpcVOS = leaveApi.getLeaveListByIds(leaveIds).getCheckedData();
|
||||||
|
Map<Long, String> leaveTypeMap = leaveRpcVOS.stream().collect(Collectors.toMap(BpmOALeaveRpcVO::getId, BpmOALeaveRpcVO::getLeaveName));
|
||||||
|
//
|
||||||
// -- 先计算下要循环几次 - 一个用户一个部门一个考勤组一个班次一个日期 最大的打卡次数 -
|
// -- 先计算下要循环几次 - 一个用户一个部门一个考勤组一个班次一个日期 最大的打卡次数 -
|
||||||
Map<String, List<AttendancePunchRecordDO>> map = list.stream().collect(Collectors.groupingBy(
|
Map<String, List<AttendancePunchRecordDO>> map = list.stream().collect(Collectors.groupingBy(
|
||||||
a -> a.getUserId() + "_"
|
a -> a.getUserId() + "_"
|
||||||
@ -1275,7 +1279,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|||||||
for (Map.Entry<Long, List<AttendancePunchRecordDO>> groupShiftItemEntry : workMap.entrySet()) {
|
for (Map.Entry<Long, List<AttendancePunchRecordDO>> groupShiftItemEntry : workMap.entrySet()) {
|
||||||
for (AttendancePunchRecordDO attendancePunchRecordDO : groupShiftItemEntry.getValue()) {
|
for (AttendancePunchRecordDO attendancePunchRecordDO : groupShiftItemEntry.getValue()) {
|
||||||
row.add(attendancePunchRecordDO.getPunchTime() == null ? "/" : attendancePunchRecordDO.getPunchTime().format(Constants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
|
row.add(attendancePunchRecordDO.getPunchTime() == null ? "/" : attendancePunchRecordDO.getPunchTime().format(Constants.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
|
||||||
String statusStr = attendancePunchRecordDO.getStatus().equals(AttendanceOnTheDayDTO.ASK_FOR_LEAVE) ? "请假-" + leaveTypeMap.get(attendancePunchRecordDO.getLeaveType()) : this.statusToStr(attendancePunchRecordDO.getStatus());
|
String statusStr = attendancePunchRecordDO.getStatus().equals(AttendanceOnTheDayDTO.ASK_FOR_LEAVE) ? "请假-" + leaveTypeMap.get(attendancePunchRecordDO.getLeaveId()) : this.statusToStr(attendancePunchRecordDO.getStatus());
|
||||||
row.add(statusStr);
|
row.add(statusStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public interface AdminOauthUserOtherInfoService {
|
|||||||
*/
|
*/
|
||||||
void checkInsert(Long userId, String appId, String openId, Integer socialType);
|
void checkInsert(Long userId, String appId, String openId, Integer socialType);
|
||||||
|
|
||||||
AdminOauthUserOtherInfoDO getByCondition(Long userId, String appId, String openId, Integer socialType);
|
AdminOauthUserOtherInfoDO getByCondition(Long userId, Integer socialType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过社交类型+用户状态获取用户社交信息
|
* 通过社交类型+用户状态获取用户社交信息
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.service.auth;
|
package cn.iocoder.yudao.module.system.service.auth;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.auth.AdminOauthUserOtherInfoDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.auth.AdminOauthUserOtherInfoDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.auth.AdminOauthUserOtherInfoMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.auth.AdminOauthUserOtherInfoMapper;
|
||||||
import cn.iocoder.yudao.module.system.service.auth.dto.AdminOauthUserOtherInfoDTO;
|
import cn.iocoder.yudao.module.system.service.auth.dto.AdminOauthUserOtherInfoDTO;
|
||||||
@ -8,6 +9,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,22 +26,24 @@ public class AdminOauthUserOtherInfoServiceImpl implements AdminOauthUserOtherIn
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkInsert(Long userId, String appId, String openId, Integer socialType) {
|
public void checkInsert(Long userId, String appId, String openId, Integer socialType) {
|
||||||
AdminOauthUserOtherInfoDO adminOauthUserOtherInfoDOS = this.getByCondition(userId, appId, openId, socialType);
|
AdminOauthUserOtherInfoDO adminOauthUserOtherInfoDOS = this.getByCondition(userId, socialType);
|
||||||
if (adminOauthUserOtherInfoDOS == null) {
|
if (adminOauthUserOtherInfoDOS == null) {
|
||||||
adminOauthUserOtherInfoMapper.insert(new AdminOauthUserOtherInfoDO()
|
adminOauthUserOtherInfoMapper.insert(new AdminOauthUserOtherInfoDO()
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
.setAppId(appId)
|
.setAppId(appId)
|
||||||
.setOpenId(openId)
|
.setOpenId(openId)
|
||||||
.setSocialType(socialType));
|
.setSocialType(socialType));
|
||||||
|
} else {
|
||||||
|
if (!adminOauthUserOtherInfoDOS.getOpenId().equals(openId)) {
|
||||||
|
adminOauthUserOtherInfoMapper.updateById(adminOauthUserOtherInfoDOS.setOpenId(openId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdminOauthUserOtherInfoDO getByCondition(Long userId, String appId, String openId, Integer socialType) {
|
public AdminOauthUserOtherInfoDO getByCondition(Long userId, Integer socialType) {
|
||||||
return adminOauthUserOtherInfoMapper.selectOne(new LambdaQueryWrapper<AdminOauthUserOtherInfoDO>()
|
return adminOauthUserOtherInfoMapper.selectOne(new LambdaQueryWrapper<AdminOauthUserOtherInfoDO>()
|
||||||
.eq(AdminOauthUserOtherInfoDO::getUserId, userId)
|
.eq(AdminOauthUserOtherInfoDO::getUserId, userId)
|
||||||
.eq(AdminOauthUserOtherInfoDO::getAppId, appId)
|
|
||||||
.eq(AdminOauthUserOtherInfoDO::getOpenId, openId)
|
|
||||||
.eq(AdminOauthUserOtherInfoDO::getSocialType, socialType));
|
.eq(AdminOauthUserOtherInfoDO::getSocialType, socialType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#{deptId}
|
#{deptId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.userIds != null and dto.userIds() > 0">
|
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
||||||
and b.id in
|
and b.id in
|
||||||
<foreach collection="dto.userIds" item="userId" open="(" close=")" separator=",">
|
<foreach collection="dto.userIds" item="userId" open="(" close=")" separator=",">
|
||||||
#{userId}
|
#{userId}
|
||||||
|
@ -129,6 +129,10 @@
|
|||||||
<if test="vo.groupIds != null and vo.groupIds.size() > 0">
|
<if test="vo.groupIds != null and vo.groupIds.size() > 0">
|
||||||
left join kq_attendance_group_user c on a.id = c.user_id
|
left join kq_attendance_group_user c on a.id = c.user_id
|
||||||
</if>
|
</if>
|
||||||
|
<if test="vo.roleCode != null and vo.roleCode != ''">
|
||||||
|
left join system_user_role as d on a.id = d.user_id AND d.deleted = 0
|
||||||
|
left join system_role as e on d.role_id = e.id AND e.deleted = 0
|
||||||
|
</if>
|
||||||
<where>
|
<where>
|
||||||
a.deleted = 0
|
a.deleted = 0
|
||||||
and a.user_type = 1
|
and a.user_type = 1
|
||||||
@ -166,6 +170,9 @@
|
|||||||
#{groupId}
|
#{groupId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="vo.roleCode != null and vo.roleCode != ''">
|
||||||
|
and e.code = #{vo.roleCode}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectListByCondition"
|
<select id="selectListByCondition"
|
||||||
@ -201,4 +208,6 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user