| | |
| | | |
| | | DROP PROCEDURE xgdl_hrm_attendance_add_column_20261024; |
| | | |
| | | -- 对é½èå¤è§å䏿塿鮿éç ï¼ç¡®ä¿ Web å APP æ®éè§è²å¯ä»¥ææä½¿ç¨ã |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:query' WHERE `id` = 60131; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:create' WHERE `id` = 60132; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:update' WHERE `id` = 60133; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:delete' WHERE `id` = 60134; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:export' WHERE `id` = 60135; |
| | | -- 对é½èå¤è§åæé®æéç å° Controller å®é
使ç¨ç hrm:attendance-rule:*ã |
| | | -- 60131~60135 æ¯ hrm_attendance_supplement.sql åå»ºçæ¢ææé®è¡ï¼è¿éåªæ¹æéæ è¯ï¼ä¿çèå ID 䏿¢æè§è²ææã |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:query' WHERE `id` = 60131 AND `deleted` = b'0'; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:create' WHERE `id` = 60132 AND `deleted` = b'0'; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:update' WHERE `id` = 60133 AND `deleted` = b'0'; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:delete' WHERE `id` = 60134 AND `deleted` = b'0'; |
| | | UPDATE `system_menu` SET `permission` = 'hrm:attendance-rule:export' WHERE `id` = 60135 AND `deleted` = b'0'; |
| | | |
| | | -- menu_permission_consistency_patch.sql å¯è½å·²ä¸ºåæ ·çæéæ è¯æå
¥è¿æ°èåè¡ï¼ |
| | | -- è¥å
æ§è¡è¿è¯¥è¡¥ä¸ï¼ä¸é¢ 5 æ¡ UPDATE ä¼é æâä¸ä¸ªæé对åºå¤ä¸ªèåâçé夿é®ï¼è¿éæ¸
çæé 60131~60135 çéå¤è¡ã |
| | | UPDATE `system_menu` dup |
| | | JOIN `system_menu` canonical |
| | | ON canonical.`permission` = dup.`permission` |
| | | AND canonical.`id` IN (60131, 60132, 60133, 60134, 60135) |
| | | AND canonical.`deleted` = b'0' |
| | | SET dup.`deleted` = b'1', dup.`updater` = '1', dup.`update_time` = NOW() |
| | | WHERE dup.`id` NOT IN (60131, 60132, 60133, 60134, 60135) |
| | | AND dup.`deleted` = b'0' |
| | | AND dup.`permission` IN ('hrm:attendance-rule:query', 'hrm:attendance-rule:create', |
| | | 'hrm:attendance-rule:update', 'hrm:attendance-rule:delete', |
| | | 'hrm:attendance-rule:export'); |
| | | |
| | | INSERT INTO `system_menu` |
| | | (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, |
| | |
| | | VALUES (6013, 'èå¤è§å', '', 2, 0, 6010, 'rule', 'ep:setting', 'hrm/attendance/rule/index', 'HrmAttendanceRule', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60131, 'èå¤è§åæ¥è¯¢', 'hrm:attendance:query', 3, 1, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60131, 'èå¤è§åæ¥è¯¢', 'hrm:attendance-rule:query', 3, 1, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60132, 'èå¤è§åæ°å¢', 'hrm:attendance:create', 3, 2, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60132, 'èå¤è§åæ°å¢', 'hrm:attendance-rule:create', 3, 2, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60133, 'èå¤è§åä¿®æ¹', 'hrm:attendance:update', 3, 3, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60133, 'èå¤è§åä¿®æ¹', 'hrm:attendance-rule:update', 3, 3, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60134, 'èå¤è§åå é¤', 'hrm:attendance:delete', 3, 4, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60134, 'èå¤è§åå é¤', 'hrm:attendance-rule:delete', 3, 4, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60135, 'èå¤è§å导åº', 'hrm:attendance:export', 3, 5, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60135, 'èå¤è§å导åº', 'hrm:attendance-rule:export', 3, 5, 6013, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- 3.2 è忥é
ç½®èå |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | |
| | | |
| | | -- 3.4 æå¡æé |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (60114, 'æå¡', 'hrm:attendance:clock', 3, 4, 6011, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | VALUES (60114, 'å®ä½æå¡', 'hrm:attendance-record:clock', 3, 4, 6011, '', '', '', NULL, 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- ============================================= |
| | | -- 4. è§è²èåå
³è |
| | |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.framework.operatelog.core.util.OperateLogUtils; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceClockReqVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceClockRespVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceMyStatusRespVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceRecordImportExcelVO; |
| | | import cn.iocoder.yudao.module.hrm.controller.admin.attendance.vo.HrmAttendanceRecordImportReqVO; |
| | |
| | | |
| | | @PostMapping("/clock-in") |
| | | @Operation(summary = "ä¸çæå¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | @ApiAccessLog(requestEnable = false) |
| | | public CommonResult<HrmAttendanceClockRespVO> clockIn( |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockIn( |
| | | @Valid @RequestBody(required = false) HrmAttendanceClockReqVO reqVO, |
| | | @RequestParam(value = "location", required = false) String legacyLocation) { |
| | | Long loginUserId = getLoginUserId(); |
| | |
| | | } |
| | | HrmAttendanceClockResult result = attendanceRecordService.clockIn( |
| | | employee.getId(), LocalDateTime.now(), reqVO, legacyLocation); |
| | | return success(buildClockResultVO(result, employee)); |
| | | return success(buildClockRespVO(result.record(), employee)); |
| | | } |
| | | |
| | | @PostMapping("/clock-out") |
| | | @Operation(summary = "ä¸çæå¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | @ApiAccessLog(requestEnable = false) |
| | | public CommonResult<HrmAttendanceClockRespVO> clockOut( |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockOut( |
| | | @Valid @RequestBody(required = false) HrmAttendanceClockReqVO reqVO, |
| | | @RequestParam(value = "location", required = false) String legacyLocation) { |
| | | Long loginUserId = getLoginUserId(); |
| | |
| | | } |
| | | HrmAttendanceClockResult result = attendanceRecordService.clockOut( |
| | | employee.getId(), LocalDateTime.now(), reqVO, legacyLocation); |
| | | return success(buildClockResultVO(result, employee)); |
| | | return success(buildClockRespVO(result.record(), employee)); |
| | | } |
| | | |
| | | @GetMapping("/my-status") |
| | | @Operation(summary = "è·å¾å½åç»å½äººçèå¤ç¶æ") |
| | | @Parameter(name = "date", description = "è夿¥æï¼æ ¼å¼ yyyy-MM-ddï¼é»è®¤æå¡å¨å½å¤©", example = "2026-10-17") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | public CommonResult<HrmAttendanceMyStatusRespVO> getMyStatus( |
| | | @RequestParam(value = "date", required = false) |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) LocalDate date) { |
| | |
| | | if (dept != null) { |
| | | respVO.setDeptName(dept.getName()); |
| | | } |
| | | } |
| | | return respVO; |
| | | } |
| | | |
| | | private HrmAttendanceClockRespVO buildClockResultVO(HrmAttendanceClockResult result, |
| | | HrmEmployeeDO employee) { |
| | | HrmAttendanceClockRespVO respVO = new HrmAttendanceClockRespVO(); |
| | | respVO.setRecord(buildClockRespVO(result.record(), employee)); |
| | | respVO.setLocationName(result.rule().getLocationName()); |
| | | if (Boolean.TRUE.equals(result.rule().getLocationRequired())) { |
| | | respVO.setDistanceMeters(result.distanceMeters()); |
| | | respVO.setRadiusMeters(result.rule().getRadiusMeters()); |
| | | respVO.setWithinRange(true); |
| | | } |
| | | return respVO; |
| | | } |
| | |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.*; |
| | |
| | | |
| | | /** |
| | | * å¹´æï¼æ ¼å¼ï¼yyyy-MM |
| | | * |
| | | * YEAR_MONTH å¨ MySQL 8 䏿¯ä¿çå
³é®åï¼æ¥æåä½ï¼ï¼ |
| | | * ä¸å åå¼å·ä¼å¯¼è´ MyBatis-Plus çæç SQL æ¥ 1064 è¯æ³éè¯¯ï¼ |
| | | * å æ¤è¿éæ¾å¼æå®å¸¦åå¼å·çååã |
| | | */ |
| | | @TableField("`year_month`") |
| | | private String yearMonth; |
| | | |
| | | /** |
| | |
| | | <artifactId>yudao-spring-boot-starter-excel</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- PDF åºä»¶ï¼æå¡ç«¯è°ç¨ Chromium ææ¥å HTML æå°æ PDF --> |
| | | <!-- PDF åºä»¶ï¼æå¡ç«¯è°ç¨ Chromium ææ¥å HTML æå°æ PDFã |
| | | å¿
é¡»ä¿æé»è®¤ compile ä½ç¨åï¼PdfRenderService / BrowserManager çæ¹æ³ç¾åç´æ¥å¼ç¨ |
| | | Playwright ç±»åï¼Spring å建 bean æ¶å
çæ¹æ³ç¾åä¼å¼ºå¶å è½½è¿äºç±»ã |
| | | 䏿¦ provided æä¸è¿ jarï¼å¯å¨å³æ¥ NoClassDefFoundErrorï¼ä¸ pdf.enabled æ å
³ï¼ã |
| | | 代价ï¼playwright 带å
¥ driver-bundle 约 194MBï¼jar 约 490MBã --> |
| | | <dependency> |
| | | <groupId>com.microsoft.playwright</groupId> |
| | | <artifactId>playwright</artifactId> |
| | |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:10000/mom-chdl?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | url: jdbc:mysql://172.17.0.1:9000/mom-chdl?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | username: root |
| | | password: xd@123456.. |
| | | password: changhui@123456.. |
| | | |
| | | # Redis é
ç½®ãRedisson é»è®¤çé
置足å¤ä½¿ç¨ï¼ä¸è¬ä¸éè¦è¿è¡è°ä¼ |
| | | data: |
| | | redis: |
| | | host: 172.17.0.1 # å°å |
| | | port: 9999 # ç«¯å£ |
| | | port: 6379 # 端å£ï¼å®¿ä¸»æº 6379 -> å®¹å¨ 6379ï¼ |
| | | database: 5 # æ°æ®åºç´¢å¼ |
| | | # password: dev # å¯ç ï¼å»ºè®®ç产ç¯å¢å¼å¯ |
| | | |
| | |
| | | storage: # æä»¶ä¸ä¼ é
ç½® |
| | | path: /data/javaWork/mom/file # æä»¶å卿 ¹ç®å½ |
| | | url-prefix: /admin-api/system/storage-blob # URLè·¯å¾åç¼ |
| | | domain: http://36.213.150.237:9003 # åååç¼ï¼æå®é
ååé
ç½®ï¼ï¼å端é
置好åä¸å¤ªå¯¹ç°å¨æ¯ç´è¿åç«¯ï¼ææè¦åç«¯ç«¯å£ |
| | | domain: http://101.245.92.159:9006 # åååç¼ï¼æå®é
ååé
ç½®ï¼ï¼å端é
置好åä¸å¤ªå¯¹ç°å¨æ¯ç´è¿åç«¯ï¼ææè¦åç«¯ç«¯å£ |
| | | expired: 120 # tokenè¿ææ¶é´ï¼åéï¼ |
| | | use-limit: 10 # tokenä½¿ç¨æ¬¡æ°ä¸é |
| | | jwt-secret: abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG # JWTå¯é¥ |
| | |
| | | # 2) 䏿åä½ï¼æ¥åæ£ææ¯ä¸æï¼ç¼º CJK åä½ä¼æææ¹æ¡ï¼éè£
fonts-wqy-zenhei / Noto Sans CJK |
| | | # 3) 以 root è¿è¡ï¼Chromium ä¸å --no-sandbox ä¼ç´æ¥æç»å¯å¨ï¼å®¹å¨ /dev/shm é»è®¤ä»
64Mï¼ |
| | | # è¿é --disable-dev-shm-usageï¼å¦å渲æå¤§æ¥åæ¶ä¼éæºå´© |
| | | enabled: true # å
³æåå¯¼åºæ¥å£ä¼æç¡®æ¥ãæªå¯ç¨ãï¼è䏿¯æ 500 |
| | | enabled: false # å
³æåå¯¼åºæ¥å£ä¼æç¡®æ¥ãæªå¯ç¨ãï¼è䏿¯æ 500ãé¿è¾éåææªå
ç½® Chromiumï¼å
å
³é |
| | | channel: '' # çç©ºï¼æ¹ç±ä¸é¢ç executable-path æå®éåå
ç chromium |
| | | executable-path: /usr/local/bin/chromium # éåå
chromium çåºå®ä½ç½®ï¼ç± Dockerfile 建软é¾ä¿è¯ |
| | | concurrency: 2 # åæ¶è¿è¡ç PDF 渲æä¸éï¼Chromium å¾åå
åï¼ä¸è¦æ¾å¼ |
| | |
| | | max-xlsx-rows: 300 # Excel å表æå¤è¯»åçè¡æ° |
| | | database-backup: # æ°æ®åºå¤ä»½é
ç½® |
| | | host: 172.17.0.1 # å¤ä»½ç®æ MySQL 主æºï¼ç空èªå¨ä»æ°æ®æº JDBC URL è§£æ |
| | | port: 9002 # å¤ä»½ç®æ MySQL 端å£ï¼ç空èªå¨ä»æ°æ®æº JDBC URL è§£æ |
| | | port: 9000 # å¤ä»½ç®æ MySQL 端å£ï¼ç空èªå¨ä»æ°æ®æº JDBC URL è§£æ |
| | | database: mom-chdl # å¤ä»½ç®æ æ°æ®åºï¼ç空èªå¨ä»æ°æ®æº JDBC URL è§£æ |
| | | username: root # å¤ä»½è´¦å·ï¼çç©ºä½¿ç¨æ°æ®æºè´¦å· |
| | | password: 'xd@123456..' # å¤ä»½å¯ç ï¼çç©ºä½¿ç¨æ°æ®æºå¯ç |
| | | password: 'changhui@123456..' # å¤ä»½å¯ç ï¼çç©ºä½¿ç¨æ°æ®æºå¯ç |
| | | command: # mysqldump å½ä»¤ï¼ç空èªå¨æ£æµé¨ç½²ç¯å¢ï¼æ¬æº mysqldump æ Docker MySQL 容å¨ï¼ï¼å¯æå¨æå®ï¼å¦ï¼docker exec mysql8 mysqldump |