From 5f14fc2cf79581f44b60f0dbfd2728527625edd1 Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Tue, 9 Sep 2025 13:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=AA=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E6=9C=89=E5=A4=9A=E4=B8=AA=E6=89=93=E5=8D=A1=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RzAttendanceStatisticalController.java | 4 ++-- ...unchTheClockStrategyExchangeProcessor.java | 4 +++- .../impl/KQDeviceExchangeProcessor.java | 5 +++-- .../service/impl/RzAttendanceServiceImpl.java | 6 +++--- .../com/evo/equipment/constant/Constants.java | 2 +- .../service/impl/EqImagesServiceImpl.java | 4 ++-- .../service/impl/EqSnDetailServiceImpl.java | 19 +++++++++--------- .../impl/RzOverTimeDetailServiceImpl.java | 6 +++--- .../java/com/evo/system/domain/SysStaff.java | 9 +++++++++ .../service/impl/SysStaffServiceImpl.java | 20 ++++++++++++++++--- evo-admin/src/main/resources/application.yml | 2 +- 11 files changed, 54 insertions(+), 27 deletions(-) diff --git a/evo-admin/src/main/java/com/evo/attendance/controller/RzAttendanceStatisticalController.java b/evo-admin/src/main/java/com/evo/attendance/controller/RzAttendanceStatisticalController.java index 83530c3..fa74aac 100644 --- a/evo-admin/src/main/java/com/evo/attendance/controller/RzAttendanceStatisticalController.java +++ b/evo-admin/src/main/java/com/evo/attendance/controller/RzAttendanceStatisticalController.java @@ -78,7 +78,7 @@ public class RzAttendanceStatisticalController extends BaseController /** * 校正数据 */ - @PreAuthorize("@ss.hasPermi('attendance:statistics:correct')") + @PreAuthorize("@ss.hasPermi('attendance:statistical:correct')") @RequestMapping(value = "correct") public AjaxResult correct(@RequestBody RzAttendanceStatistical rzAttendanceStatistical) { @@ -88,7 +88,7 @@ public class RzAttendanceStatisticalController extends BaseController return rzAttendanceStatisticalService.autoCalculateTheDayBeforeAttendance(rzAttendanceStatistical.getMonth()); } - @PreAuthorize("@ss.hasPermi('attendance:statistics:import')") + @PreAuthorize("@ss.hasPermi('attendance:statistical:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file) throws Exception { diff --git a/evo-admin/src/main/java/com/evo/attendance/processor/PunchTheClockStrategyExchangeProcessor.java b/evo-admin/src/main/java/com/evo/attendance/processor/PunchTheClockStrategyExchangeProcessor.java index afa6fbd..9b59b63 100644 --- a/evo-admin/src/main/java/com/evo/attendance/processor/PunchTheClockStrategyExchangeProcessor.java +++ b/evo-admin/src/main/java/com/evo/attendance/processor/PunchTheClockStrategyExchangeProcessor.java @@ -63,7 +63,9 @@ public interface PunchTheClockStrategyExchangeProcessor { return "当前人员未注册打卡机"; } //不是特殊打卡, 并且不是公共打卡, 并且当前打卡设备不是人员绑定设备 - if(!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE) && !sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) && !sn.equals(sysStaff.getTimeClock())){ + //&& !sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) + //!sn.equals(sysStaff.getTimeClock()) + if(!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE) && !sysStaff.getTimeClockList().contains(sn)){ return "未设置当前考勤机打卡权限"; } //是特殊打卡 并且 特殊打卡人员中, 不包含当前人员 diff --git a/evo-admin/src/main/java/com/evo/attendance/processor/impl/KQDeviceExchangeProcessor.java b/evo-admin/src/main/java/com/evo/attendance/processor/impl/KQDeviceExchangeProcessor.java index f459a80..0d31dd3 100644 --- a/evo-admin/src/main/java/com/evo/attendance/processor/impl/KQDeviceExchangeProcessor.java +++ b/evo-admin/src/main/java/com/evo/attendance/processor/impl/KQDeviceExchangeProcessor.java @@ -27,7 +27,6 @@ import com.evo.system.mapper.SysStaffMapper; import com.evo.wechat.service.SendClientService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -89,7 +88,9 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP return initMessage(1,"当前人员未注册打卡机", "000000000"); } //当前设备不是公共打卡机, 并且 - if(!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) && !sn.equals(sysStaff.getTimeClock())){ + //!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) && + //!sn.equals(sysStaff.getTimeClock()) + if(!sysStaff.getTimeClockList().contains(sn)){ return initMessage(1,"未设置当前考勤机打卡权限", "000000000"); } //检查当前打卡人是不是月薪, 如果是月薪 并且当天没有打卡, 则显示上班卡, 否则显示下班卡 diff --git a/evo-admin/src/main/java/com/evo/attendance/service/impl/RzAttendanceServiceImpl.java b/evo-admin/src/main/java/com/evo/attendance/service/impl/RzAttendanceServiceImpl.java index 39a53c0..92a9754 100644 --- a/evo-admin/src/main/java/com/evo/attendance/service/impl/RzAttendanceServiceImpl.java +++ b/evo-admin/src/main/java/com/evo/attendance/service/impl/RzAttendanceServiceImpl.java @@ -105,14 +105,14 @@ public class RzAttendanceServiceImpl extends ServiceImpl 0){ - rzAttendanceDetailService.addOrUpdateDetail("fill_in", rzAttendance, rzAttendance.getRules(), sysUser.getTimeClock(), rzAttendance.getWorkStartTime(),rzAttendance.getRemark()); + rzAttendanceDetailService.addOrUpdateDetail("fill_in", rzAttendance, rzAttendance.getRules(), sysUser.getTimeClockList().get(0), rzAttendance.getWorkStartTime(),rzAttendance.getRemark()); } return 1; }else if(rzAttendance.getWorkStartTime() != null && rzAttendance.getWorkEndTime() != null){ - rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, rzAttendance.getRules(), sysUser.getTimeClock(), rzAttendance.getWorkStartTime(),rzAttendance.getRemark()); + rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, rzAttendance.getRules(), sysUser.getTimeClockList().get(0), rzAttendance.getWorkStartTime(),rzAttendance.getRemark()); if(KqUtils.workOffDutyCard(rzAttendance.getWorkEndTime(), rzAttendance.getRules(), rzAttendance)){ //此处特殊, 使用rules 记录下班卡规则, 但是不持久化 - rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, "下班卡", sysUser.getTimeClock(), rzAttendance.getWorkEndTime(),rzAttendance.getRemark()); + rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, "下班卡", sysUser.getTimeClockList().get(0), rzAttendance.getWorkEndTime(),rzAttendance.getRemark()); } return 1; } diff --git a/evo-admin/src/main/java/com/evo/equipment/constant/Constants.java b/evo-admin/src/main/java/com/evo/equipment/constant/Constants.java index 1ec8783..2a6a558 100644 --- a/evo-admin/src/main/java/com/evo/equipment/constant/Constants.java +++ b/evo-admin/src/main/java/com/evo/equipment/constant/Constants.java @@ -18,7 +18,7 @@ public class Constants */ public static final String EQ_DEVICE_CODE = "T71474"; //餐饮打卡机设备号 /*** - * 公共打卡机 + * 公共打卡机 2025-9-06, 公共打卡机装备到南区, 取消公共打卡机 */ public static final String EQ_DEVICE_PUBLIC_CODE = "ET74333"; //公共打卡机 public static final String STAFF_IMAGE_URL_OVER_TIME = "http://192.168.5.12:8088/image/";//打卡人员图片存服务器获取地址 diff --git a/evo-admin/src/main/java/com/evo/equipment/service/impl/EqImagesServiceImpl.java b/evo-admin/src/main/java/com/evo/equipment/service/impl/EqImagesServiceImpl.java index 3869cf7..f3d8f67 100644 --- a/evo-admin/src/main/java/com/evo/equipment/service/impl/EqImagesServiceImpl.java +++ b/evo-admin/src/main/java/com/evo/equipment/service/impl/EqImagesServiceImpl.java @@ -114,7 +114,7 @@ public class EqImagesServiceImpl implements IEqImagesService //定义公共打卡机 List dkj_list = new ArrayList(); dkj_list.add(Constants.EQ_DEVICE_CODE); //食堂 - dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共 +// dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共 dkj_list.add(eqImages.getTimeClock()); for (String s : dkj_list) { @@ -266,7 +266,7 @@ public class EqImagesServiceImpl implements IEqImagesService if(StringUtils.isNotNull(row)){ dkj_list = new ArrayList(); dkj_list.add(Constants.EQ_DEVICE_CODE); //食堂 - dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共 +// dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共 dkj_list.add(row.getCell(4).getStringCellValue()); cau = new StaffDto(); caud = new StaffData(); diff --git a/evo-admin/src/main/java/com/evo/equipment/service/impl/EqSnDetailServiceImpl.java b/evo-admin/src/main/java/com/evo/equipment/service/impl/EqSnDetailServiceImpl.java index bd50a49..d76d708 100644 --- a/evo-admin/src/main/java/com/evo/equipment/service/impl/EqSnDetailServiceImpl.java +++ b/evo-admin/src/main/java/com/evo/equipment/service/impl/EqSnDetailServiceImpl.java @@ -115,8 +115,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl tsSn = Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE,com.evo.equipment.constant.Constants.EQ_DEVICE_CODE,com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE); + //com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE, + static List tsSn = Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE,com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE); private List> getPhoto(List userList){ List> userPhotoList = Collections.emptyList(); @@ -141,7 +141,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl> userPhotoList = Collections.emptyList(); List userList = Collections.emptyList(); - if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) || deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) { + //deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) || + if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) { //获取所有未删除的, 没有离职的员工信息 userList = sysStaffMapper.selectList(new LambdaQueryWrapper().eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName)); } @@ -174,14 +175,14 @@ public class EqSnDetailServiceImpl extends ServiceImpl !tsSn.contains(sn)).forEach(sn ->{ //获取所有未删除的, 没有离职的员工信息 - List userList = sysStaffMapper.selectList((new LambdaQueryWrapper().eq(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName))); + List userList = sysStaffMapper.selectList((new LambdaQueryWrapper().like(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName))); snUserPhotoList.put(sn, getPhoto(userList)); }); //装载特殊的打卡机 diff --git a/evo-admin/src/main/java/com/evo/personnelMatters/service/impl/RzOverTimeDetailServiceImpl.java b/evo-admin/src/main/java/com/evo/personnelMatters/service/impl/RzOverTimeDetailServiceImpl.java index 06097cc..93f9dfa 100644 --- a/evo-admin/src/main/java/com/evo/personnelMatters/service/impl/RzOverTimeDetailServiceImpl.java +++ b/evo-admin/src/main/java/com/evo/personnelMatters/service/impl/RzOverTimeDetailServiceImpl.java @@ -77,7 +77,7 @@ public class RzOverTimeDetailServiceImpl implements IRzOverTimeDetailService jbk.setDateTime(rzOverTimeDetail.getOverTimeStart()); jbk.setDelFlag(Constants.DELETE_FLAG_0); jbk.setStaffId(rzOverTime.getUserId()); - jbk.setEquipmentCode(sysStaff.getTimeClock()); + jbk.setEquipmentCode(sysStaff.getTimeClockList().get(0)); jbk.setCreateTime(new Date()); jbk.setRemark("加班补卡生成"); rzAttendanceDetailMapper.insert(jbk); @@ -97,7 +97,7 @@ public class RzOverTimeDetailServiceImpl implements IRzOverTimeDetailService jbk.setDateTime(rzOverTimeDetail.getOverTimeEnd()); jbk.setDelFlag(Constants.DELETE_FLAG_0); jbk.setStaffId(rzOverTime.getUserId()); - jbk.setEquipmentCode(sysStaff.getTimeClock()); + jbk.setEquipmentCode(sysStaff.getTimeClockList().get(0)); jbk.setCreateTime(new Date()); jbk.setRemark("加班补卡生成"); rzAttendanceDetailMapper.insert(jbk); @@ -180,7 +180,7 @@ public class RzOverTimeDetailServiceImpl implements IRzOverTimeDetailService rzOverTimeDetail.setUpdateTime(DateUtils.getNowDate()); rzOverTimeDetail.setUpdateBy(SecurityUtils.getUsername()); //计算加班时间 - KqUtils.calculateOverTimeHours(rzOverTimeDetail, sysStaff.getUserId(), sysStaff.getTimeClock()); + KqUtils.calculateOverTimeHours(rzOverTimeDetail, sysStaff.getUserId(), sysStaff.getTimeClockList().get(0)); int i = rzOverTimeDetailMapper.updateRzOverTimeDetail(rzOverTimeDetail); if(i < 1){ diff --git a/evo-admin/src/main/java/com/evo/system/domain/SysStaff.java b/evo-admin/src/main/java/com/evo/system/domain/SysStaff.java index f4dc611..edb0339 100644 --- a/evo-admin/src/main/java/com/evo/system/domain/SysStaff.java +++ b/evo-admin/src/main/java/com/evo/system/domain/SysStaff.java @@ -198,6 +198,8 @@ public class SysStaff extends BaseEntity * 打卡位置 */ private String timeClock; + @TableField(exist = false) + private List timeClockList; /*** * 公众号的openId @@ -219,4 +221,11 @@ public class SysStaff extends BaseEntity } return subsidyList; } + + public List getTimeClockList() { + if(Collections.isEmpty(timeClockList) && StringUtils.isNotEmpty(timeClock)){ + timeClockList = Collections.asList(timeClock.split(",")).stream().collect(Collectors.toList()); + } + return timeClockList; + } } diff --git a/evo-admin/src/main/java/com/evo/system/service/impl/SysStaffServiceImpl.java b/evo-admin/src/main/java/com/evo/system/service/impl/SysStaffServiceImpl.java index f822751..f615de4 100644 --- a/evo-admin/src/main/java/com/evo/system/service/impl/SysStaffServiceImpl.java +++ b/evo-admin/src/main/java/com/evo/system/service/impl/SysStaffServiceImpl.java @@ -93,6 +93,9 @@ public class SysStaffServiceImpl extends ServiceImpl i if(StringUtils.isNotEmpty(sysStaff.getSubsidys())){ sysStaff.setSubsidyList(Collections.asList(sysStaff.getSubsidys().split(",")).stream().map(Long::valueOf).collect(Collectors.toList())); } + if(StringUtils.isNotEmpty(sysStaff.getTimeClock())){ + sysStaff.setTimeClockList(Collections.asList(sysStaff.getTimeClock().split(",")).stream().collect(Collectors.toList())); + } return sysStaff; } /** @@ -149,6 +152,10 @@ public class SysStaffServiceImpl extends ServiceImpl i if(CollectionUtils.isNotEmpty(sysStaff.getSubsidyList())){ sysStaff.setSubsidys(sysStaff.getSubsidyList().stream().map(String::valueOf).collect(Collectors.joining(","))); } + //打卡位置改为多选 + if(CollectionUtils.isNotEmpty(sysStaff.getTimeClockList())){ + sysStaff.setTimeClock(sysStaff.getTimeClockList().stream().collect(Collectors.joining(","))); + } int i = getBaseMapper().insertSysStaff(sysStaff); if(i < 1){ @@ -195,10 +202,12 @@ public class SysStaffServiceImpl extends ServiceImpl i if(upload != null){ List dkj_list = new ArrayList(); dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE); //食堂 - dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE); //公共 - dkj_list.add(sysStaff.getTimeClock()); +// dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE); //公共 + dkj_list.addAll(sysStaff.getTimeClockList()); +// dkj_list.add(sysStaff.getTimeClockList().get(1)); //下发照片 - eqSnDetailService.sendPhoto(dkj_list, Collections.asList(Collections.asMap("userId", String.valueOf(sysStaff.getUserId()), "name", sysStaff.getName(), "photoUrl", ParamUtils.getGlobalStaticUrl()+upload.getFileName(), "deptName", sysStaff.getDeptName()))); + SysDept sysDept = deptMapper.selectDeptById(sysStaff.getDeptId()); + eqSnDetailService.sendPhoto(dkj_list, Collections.asList(Collections.asMap("userId", String.valueOf(sysStaff.getUserId()), "name", sysStaff.getName(), "photoUrl", ParamUtils.getGlobalStaticUrl()+upload.getFileName(), "deptName", sysDept.getDeptName()))); } } @@ -233,6 +242,11 @@ public class SysStaffServiceImpl extends ServiceImpl i if(CollectionUtils.isNotEmpty(sysStaff.getSubsidyList())){ sysStaff.setSubsidys(sysStaff.getSubsidyList().stream().map(String::valueOf).collect(Collectors.joining(","))); } + //打卡位置改为多选 + if(CollectionUtils.isNotEmpty(sysStaff.getTimeClockList())){ + sysStaff.setTimeClock(sysStaff.getTimeClockList().stream().collect(Collectors.joining(","))); + } + //判断是否有离职时间,有则为离职 if(StringUtils.isNotNull(sysStaff.getQuitDate())){ //离职时间小于当前,说明离职了 diff --git a/evo-admin/src/main/resources/application.yml b/evo-admin/src/main/resources/application.yml index 231dd18..c8aa6aa 100644 --- a/evo-admin/src/main/resources/application.yml +++ b/evo-admin/src/main/resources/application.yml @@ -50,7 +50,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: druid + active: ${profiles.active:druid} # 文件上传 servlet: multipart: