| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #åå·¥èå¤è¡¨ |
| | | drop table if exists personal_attendance_records; |
| | | create table personal_attendance_records |
| | | ( |
| | | id bigint auto_increment primary key, |
| | | staff_on_job_id bigint not null default 0 comment 'åå·¥å¨èid', |
| | | date date not null comment 'æ¥æ', |
| | | work_start_at datetime null comment 'å·¥ä½å¼å§æ¶é´', |
| | | work_end_at datetime null comment 'å·¥ä½ç»ææ¶é´', |
| | | work_hours decimal(5,2) null comment '工使¶é¿', |
| | | status tinyint not null default 0 comment 'ç¶æ 0æ£å¸¸ 1è¿å° 2æ©é', |
| | | remark text null comment '夿³¨', |
| | | tenant_id bigint not null comment 'ç§æ·id', |
| | | create_time datetime null comment 'å½å
¥æ¶é´', |
| | | update_time datetime null comment 'æ´æ°æ¶é´', |
| | | index idx_staff_on_job_id (staff_on_job_id) |
| | | ); |
| | |
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-starter-parent</artifactId>
|
| | | <version>2.5.15</version>
|
| | | <relativePath />
|
| | | <relativePath/>
|
| | | </parent>
|
| | |
|
| | | <properties>
|
| | |
| | | <spring-security.version>5.7.12</spring-security.version>
|
| | | <spring-framework.version>5.3.39</spring-framework.version>
|
| | | <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
| | | <getui-sdk.version>1.0.7.0</getui-sdk.version>
|
| | | </properties>
|
| | |
|
| | | <dependencies>
|
| | |
| | | </dependency>
|
| | |
|
| | |
|
| | |
|
| | | <!-- minio -->
|
| | | <dependency>
|
| | | <groupId>io.minio</groupId>
|
| | |
| | | <artifactId>easyexcel</artifactId>
|
| | | <version>4.0.3</version>
|
| | | </dependency>
|
| | | |
| | | <dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.google.zxing</groupId>
|
| | | <artifactId>core</artifactId>
|
| | | <version>3.3.3</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.getui.push</groupId>
|
| | | <artifactId>restful-sdk</artifactId>
|
| | | <version>${getui-sdk.version}</version>
|
| | | <scope>compile</scope>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| | | </plugin>
|
| | | <build>
|
| | | <finalName>${project.artifactId}</finalName>
|
| | | <plugins>
|
| | | <plugin>
|
| | | <groupId>org.springframework.boot</groupId>
|
| | | <artifactId>spring-boot-maven-plugin</artifactId>
|
| | | <configuration>
|
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ -->
|
| | | </configuration>
|
| | | </plugin>
|
| | | </plugins>
|
| | | </build>
|
| | | </build>
|
| | |
|
| | | <repositories>
|
| | | <repository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | </repositories>
|
| | | <repositories>
|
| | | <repository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | </repositories>
|
| | |
|
| | | <pluginRepositories>
|
| | | <pluginRepository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | <snapshots>
|
| | | <enabled>false</enabled>
|
| | | </snapshots>
|
| | | </pluginRepository>
|
| | | </pluginRepositories>
|
| | | <pluginRepositories>
|
| | | <pluginRepository>
|
| | | <id>public</id>
|
| | | <name>aliyun nexus</name>
|
| | | <url>https://maven.aliyun.com/repository/public</url>
|
| | | <releases>
|
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | <snapshots>
|
| | | <enabled>false</enabled>
|
| | | </snapshots>
|
| | | </pluginRepository>
|
| | | </pluginRepositories>
|
| | |
|
| | | </project>
|
| | |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue())); |
| | | record.setCommonFileList(commonFiles); |
| | | // éè´å®¡æ¹æ¥è¯¢éè´éä»¶ |
| | | if (approveProcess.getApproveType() == 5) { |
| | | List<CommonFile> commonFiles1 = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASE.getValue())); |
| | | record.setCommonFileList(commonFiles1); |
| | | } |
| | | // åè´§å®¡æ¹æ¥è¯¢åè´§éä»¶ |
| | | if (approveProcess.getApproveType() == 7) { |
| | | List<CommonFile> commonFiles1 = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.SHIP.getValue())); |
| | | record.setCommonFileList(commonFiles1); |
| | | } |
| | | } |
| | | return approveProcessIPage; |
| | | } |
| | |
| | | @Autowired |
| | | private CompensationPerformanceService compensationPerformanceService; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "èªé
¬ç»©æ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("èªé
¬ç»©æ-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, CompensationPerformance compensationPerformance){ |
| | | IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, compensationPerformance); |
| | | public AjaxResult listPage(Page page, String staffName, String payDateStr) { |
| | | IPage<CompensationPerformance> listPage = compensationPerformanceService.listPage(page, staffName, payDateStr); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | |
| | | @Log(title = "èªé
¬ç»©æ-æ·»å ", businessType = BusinessType.INSERT) |
| | | @ApiOperation("èªé
¬ç»©æ-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CompensationPerformance compensationPerformance){ |
| | | public AjaxResult add(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean save = compensationPerformanceService.save(compensationPerformance); |
| | | return save ? AjaxResult.success("æ·»å æå") : AjaxResult.error("æ·»å 失败"); |
| | | } |
| | |
| | | @Log(title = "èªé
¬ç»©æ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("èªé
¬ç»©æ-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody CompensationPerformance compensationPerformance){ |
| | | public AjaxResult update(@RequestBody CompensationPerformance compensationPerformance) { |
| | | boolean update = compensationPerformanceService.updateById(compensationPerformance); |
| | | return update ? AjaxResult.success("ä¿®æ¹æå") : AjaxResult.error("ä¿®æ¹å¤±è´¥"); |
| | | } |
| | |
| | | @Log(title = "èªé
¬ç»©æ-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("èªé
¬ç»©æ-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | boolean delete = compensationPerformanceService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "导åºèªèµç®¡çå表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response ) { |
| | | public void export(HttpServletResponse response) { |
| | | List<CompensationPerformance> list = compensationPerformanceService.list(); |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<CompensationPerformance>(CompensationPerformance.class); |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<>(CompensationPerformance.class); |
| | | util.exportExcel(response, list, "导åºèªèµç®¡çå表"); |
| | | } |
| | | |
| | |
| | | util.exportExcel(response, list, "ä¸è½½èªèµç®¡çå表模æ¿"); |
| | | } |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Log(title = "导å
¥èªèµç®¡çå表", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<>(CompensationPerformance.class); |
| | | List<CompensationPerformance> list = util.importExcel(file.getInputStream()); |
| | | list.forEach(item->{ |
| | | SysUser staffOnJob = sysUserMapper.selectUserByNickName(item.getName()); |
| | | if(staffOnJob!=null){ |
| | | item.setStaffId(staffOnJob.getUserId()); |
| | | list.forEach(item -> { |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectStaffByNickName(item.getStaffName()); |
| | | if (staffOnJob != null) { |
| | | item.setStaffId(staffOnJob.getId()); |
| | | } |
| | | }); |
| | | boolean b = compensationPerformanceService.saveBatch(list); |
| | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param compensationPerformance |
| | | * @param page å页 |
| | | * @param staffName åå·¥å§å |
| | | * @param payDateStr èªèµæ¥æ |
| | | * @return |
| | | */ |
| | | IPage<CompensationPerformance> listPage(Page page,@Param("req") CompensationPerformance compensationPerformance); |
| | | IPage<CompensationPerformance> listPage(Page page, @Param("staffName") String staffName, @Param("payDateStr") String payDateStr); |
| | | } |
| | |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * èªé
¬ç»©ææç» |
| | | * |
| | | * @author :yys |
| | | * @date : 2025/8/8 9:40 |
| | | * @date : 2025/8/8 |
| | | */ |
| | | @Data |
| | | @TableName("compensation_performance") |
| | | @ApiModel |
| | | public class CompensationPerformance { |
| | | |
| | | @ApiModel("èªé
¬ç»©ææç»") |
| | | public class CompensationPerformance implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty("主é®") |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¨æ·id |
| | | * åå·¥id |
| | | */ |
| | | @ApiModelProperty("ç¨æ·id") |
| | | @ApiModelProperty("åå·¥id") |
| | | private Long staffId; |
| | | |
| | | /** |
| | | * å§å |
| | | * åå·¥å§å |
| | | */ |
| | | @ApiModelProperty("å§å") |
| | | @Excel(name = "å§å") |
| | | private String name; |
| | | @ApiModelProperty("åå·¥å§å") |
| | | @Excel(name = "åå·¥å§å") |
| | | @TableField(exist = false) |
| | | private String staffName; |
| | | |
| | | /** |
| | | * èªèµæä»½(æ¥è¯¢) |
| | | * å²ä½åç§° |
| | | */ |
| | | @ApiModelProperty("èªèµæä»½(æ¥è¯¢)") |
| | | @ApiModelProperty("å²ä½åç§°") |
| | | @Excel(name = "å²ä½åç§°") |
| | | @TableField(exist = false) |
| | | private String payDateStr; |
| | | private String postName; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @ApiModelProperty("é¨é¨åç§°") |
| | | @Excel(name = "é¨é¨åç§°") |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | /** |
| | | * èªèµæä»½ |
| | | */ |
| | | @ApiModelProperty("èªèµæä»½") |
| | | @Excel(name = "èªèµæä»½", dateFormat = "yyyy-MM", width = 30) |
| | | @Excel(name = "æä»½", dateFormat = "yyyy-MM", width = 20) |
| | | @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM") |
| | | private Date payDate; |
| | | |
| | | |
| | | /** |
| | | * åºåºå¤å¤©æ° |
| | | */ |
| | | @ApiModelProperty("åºåºå¤å¤©æ°") |
| | | // @Excel(name = "åºåºå¤å¤©æ°") |
| | | private BigDecimal shouldAttendedNum; |
| | | |
| | | /** |
| | | * å®é
åºå¤å¤©æ° |
| | | */ |
| | | @ApiModelProperty("å®é
åºå¤å¤©æ°") |
| | | // @Excel(name = "å®é
åºå¤å¤©æ°") |
| | | private BigDecimal actualAttendedNum; |
| | | |
| | | |
| | | /** |
| | | * åºæ¬å·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºæ¬å·¥èµ") |
| | | // @Excel(name = "åºæ¬å·¥èµ") |
| | | @Excel(name = "åºæ¬å·¥èµ") |
| | | private BigDecimal basicSalary; |
| | | |
| | | /** |
| | | * å²ä½å·¥èµ |
| | | * è®¡ä»¶å·¥èµ |
| | | */ |
| | | @ApiModelProperty("å²ä½å·¥èµ") |
| | | // @Excel(name = "å²ä½å·¥èµ") |
| | | private BigDecimal postSalary; |
| | | @ApiModelProperty("计件工èµ") |
| | | @Excel(name = "计件工èµ") |
| | | private BigDecimal pieceworkSalary; |
| | | |
| | | /** |
| | | * å
¥ç¦»èç¼ºå¤æ£æ¬¾ |
| | | * 计æ¶å·¥èµ |
| | | */ |
| | | @ApiModelProperty("å
¥ç¦»èç¼ºå¤æ£æ¬¾") |
| | | // @Excel(name = "å
¥ç¦»èç¼ºå¤æ£æ¬¾") |
| | | private BigDecimal deductionAbsenteeism; |
| | | |
| | | @ApiModelProperty("计æ¶å·¥èµ") |
| | | @Excel(name = "计æ¶å·¥èµ") |
| | | private BigDecimal hourlySalary; |
| | | |
| | | /** |
| | | * ç
åæ£æ¬¾ |
| | | * å
¶ä»æ¶å
¥ |
| | | */ |
| | | @ApiModelProperty("ç
åæ£æ¬¾") |
| | | // @Excel(name = "ç
åæ£æ¬¾") |
| | | private BigDecimal sickLeaveDeductions; |
| | | |
| | | /** |
| | | * äºåæ£æ¬¾ |
| | | */ |
| | | @ApiModelProperty("äºåæ£æ¬¾") |
| | | // @Excel(name = "äºåæ£æ¬¾") |
| | | private BigDecimal deductionPersonalLeave; |
| | | /** |
| | | * å¿è®°æå¡æ£æ¬¾ |
| | | */ |
| | | @ApiModelProperty("å¿è®°æå¡æ£æ¬¾") |
| | | // @Excel(name = "å¿è®°æå¡æ£æ¬¾") |
| | | private BigDecimal forgetClockDeduct; |
| | | |
| | | /** |
| | | * 绩æå¾å |
| | | */ |
| | | @ApiModelProperty("绩æå¾å") |
| | | // @Excel(name = "绩æå¾å") |
| | | private BigDecimal performanceScore; |
| | | |
| | | /** |
| | | * 绩æå·¥èµ |
| | | */ |
| | | @ApiModelProperty("绩æå·¥èµ") |
| | | // @Excel(name = "绩æå·¥èµ") |
| | | private BigDecimal performancePay; |
| | | |
| | | |
| | | /** |
| | | * åºåå计 |
| | | */ |
| | | @ApiModelProperty("åºåå计") |
| | | // @Excel(name = "åºåå计") |
| | | private BigDecimal payableWages; |
| | | @ApiModelProperty("å
¶ä»æ¶å
¥") |
| | | @Excel(name = "å
¶ä»æ¶å
¥") |
| | | private BigDecimal otherIncome; |
| | | |
| | | /** |
| | | * 社ä¿ä¸ªäºº |
| | | */ |
| | | @ApiModelProperty("社ä¿ä¸ªäºº") |
| | | // @Excel(name = "社ä¿ä¸ªäºº") |
| | | @Excel(name = "社ä¿ä¸ªäºº") |
| | | private BigDecimal socialSecurityIndividuals; |
| | | /** |
| | | * 社ä¿å
¬å¸ |
| | | */ |
| | | @ApiModelProperty("社ä¿å
¬å¸") |
| | | // @Excel(name = "社ä¿å
¬å¸") |
| | | private BigDecimal socialSecurityCompanies; |
| | | |
| | | /** |
| | | * 社ä¿å计 |
| | | */ |
| | | @ApiModelProperty("社ä¿å计") |
| | | // @Excel(name = "社ä¿å计") |
| | | private BigDecimal socialSecurityTotal; |
| | | |
| | | /** |
| | | * å
¬ç§¯éå计 |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯éå计") |
| | | // @Excel(name = "å
¬ç§¯éå计") |
| | | private BigDecimal providentFundTotal; |
| | | /** |
| | | * å
¬ç§¯éå
¬å¸ |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯éå
¬å¸") |
| | | // @Excel(name = "å
¬ç§¯éå
¬å¸") |
| | | private BigDecimal providentFundCompany; |
| | | |
| | | /** |
| | | * å
¬ç§¯é个人 |
| | | */ |
| | | @ApiModelProperty("å
¬ç§¯é个人") |
| | | // @Excel(name = "å
¬ç§¯é个人") |
| | | @Excel(name = "å
¬ç§¯é个人") |
| | | private BigDecimal providentFundIndividuals; |
| | | |
| | | /** |
| | | * åºç¨å·¥èµ |
| | | * å·¥èµä¸ªç¨ |
| | | */ |
| | | @ApiModelProperty("åºç¨å·¥èµ") |
| | | // @Excel(name = "åºç¨å·¥èµ") |
| | | private BigDecimal taxableWaget; |
| | | /** |
| | | * 个人æå¾ç¨ |
| | | */ |
| | | @ApiModelProperty("个人æå¾ç¨") |
| | | // @Excel(name = "个人æå¾ç¨") |
| | | @ApiModelProperty("å·¥èµä¸ªç¨") |
| | | @Excel(name = "å·¥èµä¸ªç¨") |
| | | private BigDecimal personalIncomeTax; |
| | | |
| | | /** |
| | | * å
¶ä»æ¯åº |
| | | */ |
| | | @ApiModelProperty("å
¶ä»æ¯åº") |
| | | @Excel(name = "å
¶ä»æ¯åº") |
| | | private BigDecimal otherDeductions; |
| | | |
| | | /** |
| | | * åºåå·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºåå·¥èµ") |
| | | @Excel(name = "åºåå·¥èµ") |
| | | private BigDecimal payableWages; |
| | | |
| | | /** |
| | | * åºæ£å·¥èµ |
| | | */ |
| | | @ApiModelProperty("åºæ£å·¥èµ") |
| | | @Excel(name = "åºæ£å·¥èµ") |
| | | private BigDecimal deductibleWages; |
| | | |
| | | /** |
| | | * å®åå·¥èµ |
| | | */ |
| | | @ApiModelProperty("å®åå·¥èµ") |
| | | @Excel(name = "å®åå·¥èµ", width = 30) |
| | | @Excel(name = "å®åå·¥èµ") |
| | | private BigDecimal actualWages; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * å建è
|
| | |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| | | } |
| | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param compensationPerformance |
| | | * @param page å页æä»¶ |
| | | * @param staffName åå·¥å§å |
| | | * @param payDateStr èªèµæ¥æ |
| | | * @return |
| | | */ |
| | | IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance); |
| | | IPage<CompensationPerformance> listPage(Page page, String staffName, String payDateStr); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance) { |
| | | IPage<CompensationPerformance> compensationPerformanceIPage = compensationPerformanceMapper.listPage(page, compensationPerformance); |
| | | return compensationPerformanceIPage; |
| | | public IPage<CompensationPerformance> listPage(Page page, String staffName, String payDateStr) { |
| | | return compensationPerformanceMapper.listPage(page, staffName, payDateStr); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.mapper.AccountIncomeMapper; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | |
| | | // 彿çç»ææ¥æï¼æ¯ææåä¸å¤©ï¼ |
| | | LocalDate monthEnd = currentMonth.withDayOfMonth(currentMonth.lengthOfMonth()); |
| | | |
| | | // æå»ºå½æçæ¥è¯¢æ¡ä»¶ï¼å¦ææ³ä¸æ¬¡æ§æ¥å
¨4ä¸ªææ°æ®åå
åçéï¼å¯ä¼å为å
æ¥å
¨å循ç¯çéï¼ |
| | | // æå»ºå½æçæ¥è¯¢æ¡ä»¶ |
| | | LambdaQueryWrapper<QualityInspect> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.ge(QualityInspect::getCheckTime, monthStart) |
| | | .le(QualityInspect::getCheckTime, monthEnd); // çéå½ææ°æ® |
| | | queryWrapper.ge(QualityInspect::getCheckTime, monthStart.toString()) |
| | | .le(QualityInspect::getCheckTime, monthEnd.toString()); |
| | | List<QualityInspect> monthInspects = qualityStatisticsMapper.selectList(queryWrapper); |
| | | BigDecimal reduce = monthInspects.stream() |
| | | .filter(inspect -> inspect.getInspectType().equals(0)) |
| | |
| | | LocalDate startDate = range[0]; |
| | | LocalDate endDate = range[1]; |
| | | |
| | | String startStr = startDate.atStartOfDay() |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | String endStr = endDate.atTime(LocalTime.MAX) |
| | | .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | String startStr = startDate.toString(); |
| | | String endStr = endDate.toString(); |
| | | |
| | | List<QualityInspect> list = qualityInspectMapper.selectList( |
| | | new LambdaQueryWrapper<QualityInspect>() |
| | |
| | | |
| | | @Override |
| | | public QualityInspectionCountDto qualityInspectionCount() { |
| | | // è·åä»å¤©çå¼å§åç»ææ¥æ,å
嫿¶åç§ |
| | | LocalDateTime todayStart = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); |
| | | LocalDateTime todayEnd = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).withNano(0); |
| | | // è·ååä¸å¤©çå¼å§åç»ææ¥æ,å
嫿¶åç§ |
| | | LocalDateTime prevStart = todayStart.minusDays(1); |
| | | LocalDateTime prevEnd = todayEnd.minusDays(1); |
| | | String todayStr = LocalDate.now().toString(); |
| | | String prevDayStr = LocalDate.now().minusDays(1).toString(); |
| | | // æ¥è¯¢åºæªæ¢ä»æ¥çæ»æ£éªæ° |
| | | List<QualityInspect> todayList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | // .eq(QualityInspect::getInspectState, 1) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .le(QualityInspect::getCheckTime, todayStr)); |
| | | // æ¥è¯¢åºæªæ¢åä¸å¤©çæ»æ£éªæ° |
| | | List<QualityInspect> prevList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | // .eq(QualityInspect::getInspectState, 1) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .le(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»æ¥çæ»æ£éªæ° |
| | | BigDecimal todayCount = todayList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | // 计ç®ä»å¤©çå¾
宿æ°é |
| | | List<QualityInspect> todayPendingList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 0) |
| | | .ge(QualityInspect::getCheckTime, todayStart) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .eq(QualityInspect::getCheckTime, todayStr)); |
| | | |
| | | // 计ç®åä¸å¤©çå¾
宿æ°é |
| | | List<QualityInspect> prevPendingList = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 0) |
| | | .ge(QualityInspect::getCheckTime, prevStart) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .eq(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»å¤©çå¾
宿æ°é |
| | | BigDecimal todayPendingCount = todayPendingList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | List<QualityInspect> todayCompletedList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, todayStart) |
| | | .le(QualityInspect::getCheckTime, todayEnd)); |
| | | .eq(QualityInspect::getCheckTime, todayStr)); |
| | | // 计ç®åä¸å¤©ç已宿æ°é |
| | | List<QualityInspect> prevCompletedList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, prevStart) |
| | | .le(QualityInspect::getCheckTime, prevEnd)); |
| | | .eq(QualityInspect::getCheckTime, prevDayStr)); |
| | | // 计ç®ä»å¤©ç已宿æ°é |
| | | BigDecimal todayCompletedCount = todayCompletedList.stream() |
| | | .map(QualityInspect::getQuantity) |
| | |
| | | |
| | | @Override |
| | | public NonComplianceWarningDto nonComplianceWarning() { |
| | | |
| | | // è¿ä¸å¤©æ¶é´åºé´ |
| | | LocalDateTime[] range = lastSevenDaysRange(); |
| | | LocalDateTime startTime = range[0]; |
| | | LocalDateTime endTime = range[1]; |
| | | String[] range = lastSevenDaysDateRange(); |
| | | String startStr = range[0]; |
| | | String endStr = range[1]; |
| | | |
| | | // æ¥è¯¢è¿ä¸å¤©å·²å¤çä¸åæ ¼æ°æ® |
| | | List<QualityUnqualified> list = qualityUnqualifiedMapper.selectList( |
| | | new LambdaQueryWrapper<QualityUnqualified>() |
| | | .eq(QualityUnqualified::getInspectState, 1) |
| | | .ge(QualityUnqualified::getCheckTime, startTime) |
| | | .le(QualityUnqualified::getCheckTime, endTime)); |
| | | .ge(QualityUnqualified::getCheckTime, startStr) |
| | | .le(QualityUnqualified::getCheckTime, endStr)); |
| | | |
| | | NonComplianceWarningDto dto = new NonComplianceWarningDto(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åè¿ä¸å¤©çæ¶é´åºé´ï¼å
å«ä»å¤©ï¼ |
| | | * è·åè¿ä¸å¤©çæ¥æåºé´ï¼ä»
å«å¹´ææ¥ï¼ |
| | | */ |
| | | public static LocalDateTime[] lastSevenDaysRange() { |
| | | public static String[] lastSevenDaysDateRange() { |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | LocalDateTime startTime = today.minusDays(6).atStartOfDay(); |
| | | LocalDateTime endTime = today.atTime(23, 59, 59); |
| | | |
| | | return new LocalDateTime[] { startTime, endTime }; |
| | | return new String[] { today.minusDays(6).toString(), today.toString() }; |
| | | } |
| | | |
| | | @Override |
| | | public List<CompletedInspectionCountDto> completedInspectionCount() { |
| | | // è¿ä¸å¤©æ¶é´åºé´ |
| | | LocalDateTime[] range = lastSevenDaysRange(); |
| | | LocalDateTime startTime = range[0]; |
| | | LocalDateTime endTime = range[1]; |
| | | String[] range = lastSevenDaysDateRange(); |
| | | String startStr = range[0]; |
| | | String endStr = range[1]; |
| | | |
| | | // æ¥è¯¢è¿ä¸å¤©å·²å®æçæ£éªæ°æ® |
| | | List<QualityInspect> list = qualityInspectMapper.selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .eq(QualityInspect::getInspectState, 1) |
| | | .ge(QualityInspect::getCheckTime, startTime) |
| | | .le(QualityInspect::getCheckTime, endTime)); |
| | | .ge(QualityInspect::getCheckTime, startStr) |
| | | .le(QualityInspect::getCheckTime, endStr)); |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd"); |
| | | |
| | |
| | | |
| | | List<QualityInspect> qualityInspectList = qualityInspectMapper |
| | | .selectList(new LambdaQueryWrapper<QualityInspect>() |
| | | .ge(QualityInspect::getCheckTime, startDate) |
| | | .le(QualityInspect::getCheckTime, endDate) |
| | | .ge(QualityInspect::getCheckTime, startDate.toString()) |
| | | .le(QualityInspect::getCheckTime, endDate.toString()) |
| | | .eq(QualityInspect::getInspectState, 1)); |
| | | |
| | | QualityStatisticsDto dto = new QualityStatisticsDto(); |
| | |
| | | dto.setProcessNum(sumQuantity(qualityInspectList, 1)); // è¿ç¨ |
| | | dto.setFactoryNum(sumQuantity(qualityInspectList, 2)); // åºå |
| | | |
| | | // å设 qualityInspectList æ¯ä¸ä¸ª List<QualityInspect> ç±»åçéå |
| | | Map<String, List<QualityInspect>> groupedByCheckResult = qualityInspectList.stream() |
| | | .collect(Collectors.groupingBy(QualityInspect::getCheckResult)); |
| | | List<QualityInspect> qualityInspects = groupedByCheckResult.get("ä¸åæ ¼"); |
| | | if(ObjectUtils.isNull(qualityInspects) || qualityInspects.size()==0){ |
| | | return null; |
| | | } |
| | | // 4. å¤çå¾è¡¨é¡¹ (Item) |
| | | List<QualityStatisticsItem> itemList = new ArrayList<>(); |
| | | |
| | |
| | | i -> i.getCheckTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate())); |
| | | if (type == 3) { |
| | | // å£åº¦æ¨¡å¼ï¼ææåç» |
| | | Map<String, List<QualityInspect>> groupByMonth = qualityInspectList.stream() |
| | | Map<String, List<QualityInspect>> groupByMonth = qualityInspects.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | |
| | | } |
| | | } else { |
| | | // å¨æææ¨¡å¼ï¼æå¤©åç» |
| | | Map<String, List<QualityInspect>> groupByDay = qualityInspectList.stream() |
| | | Map<String, List<QualityInspect>> groupByDay = qualityInspects.stream() |
| | | .collect(Collectors.groupingBy(i -> { |
| | | LocalDate ld = dateMap.get(i); |
| | | return ld.format(DateTimeFormatter.ofPattern("MM/dd")); |
| | |
| | | |
| | | return productProcessMapper.calculateProductionStatistics(startDateTime, endDateTime, userId, processIds); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.controller; |
| | | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.GetuiConfig; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * ç¨æ·å®å设å¤ç®¡çæ§å¶å± |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Api(tags = "ç¨æ·è®¾å¤ç»å®") |
| | | @RestController |
| | | @RequestMapping("/system/client") |
| | | public class SysUserClientController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SysUserClientService sysUserClientService; |
| | | |
| | | /** |
| | | * æ·»å /æ´æ°ç¨æ·cid |
| | | */ |
| | | @PostMapping("/addOrUpdateClientId") |
| | | @ApiOperation("æ·»å /æ´æ°ç¨æ·cid") |
| | | public AjaxResult addOrUpdateClientId(@RequestBody SysUserClient sysUserClient) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | sysUserClient.setUserId(userId); |
| | | boolean result = sysUserClientService.addOrUpdateClientId(sysUserClient); |
| | | return result ? success() : error("设å¤ç»å®å¤±è´¥"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.domain; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä¸ªæ¨ (Unipush v2) æ¶æ¯æ¨éé
置类 |
| | | * </p> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Data |
| | | @Component |
| | | @ConfigurationProperties(prefix = "ruoyi.getui") |
| | | public class GetuiConfig { |
| | | |
| | | /** |
| | | * AppID |
| | | */ |
| | | private String appId; |
| | | |
| | | /** |
| | | * AppKey |
| | | */ |
| | | private String appKey; |
| | | |
| | | /** |
| | | * MasterSecret |
| | | */ |
| | | private String masterSecret; |
| | | |
| | | /** |
| | | * ä¸ªæ¨ RESTful API ååå°å |
| | | */ |
| | | private String domain; |
| | | |
| | | /** |
| | | * 离线æ¨é Intent ç®æ ç»ä»¶å |
| | | * æ ¼å¼: å
å/å
¥å£Activityå |
| | | */ |
| | | private String intentComponent; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³è对象 sys_user_client |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("sys_user_client") |
| | | public class SysUserClient implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | @TableId(type = IdType.INPUT) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 个æ¨è®¾å¤æ è¯ (CID) |
| | | */ |
| | | private String cid; |
| | | |
| | | /** |
| | | * æåæ´»è·æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | } |
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
| | |
|
| | | /**
|
| | | * æ ¹æ®è·¯ç±å°åæ¥è¯¢èå
|
| | | *
|
| | | * @param lastSegment è·¯ç±å°å
|
| | | * @return èå
|
| | | */
|
| | | SysMenu selectMenuByPath(String lastSegment);
|
| | | }
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³èmapper |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | |
| | | public interface SysUserClientMapper extends BaseMapper<SysUserClient> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | |
| | | /** |
| | | * <br> |
| | | * ç¨æ·å®å设å¤å
³èæ¥å£ |
| | | * </br> |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | |
| | | public interface SysUserClientService extends IService<SysUserClient> { |
| | | |
| | | boolean addOrUpdateClientId(SysUserClient sysUserClient); |
| | | } |
| | |
| | | @Lazy
|
| | | private ISysNoticeService sysNoticeService;
|
| | |
|
| | | @Autowired
|
| | | private UnipushService unipushService;
|
| | |
|
| | | /**
|
| | | * æ¥è¯¢å
¬åä¿¡æ¯
|
| | | *
|
| | |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId();
|
| | | List<SysNotice> sysNotices = consigneeId.stream().map(it -> convertSysNotice(title, message, it,tenantId, jumpPath, userId)).collect(Collectors.toList());
|
| | | sysNoticeService.saveBatch(sysNotices);
|
| | | try {
|
| | | unipushService.sendClientMessage(sysNotices);
|
| | | } catch (Exception e) {
|
| | | log.error("APPæ¨ééç¥å¤±è´¥ï¼åå : {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | .collect(Collectors.toList());
|
| | |
|
| | | sysNoticeService.saveBatch(collect);
|
| | | try {
|
| | | unipushService.sendClientMessage(collect);
|
| | | } catch (Exception e) {
|
| | | log.error("APPæ¨ééç¥å¤±è´¥ï¼åå : {}", e);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.mapper.SysUserClientMapper; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¨æ·å®å设å¤å
³èæ¥å£å®ç°ç±» |
| | | * |
| | | * @author deslrey |
| | | * @version 1.0 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Service |
| | | public class SysUserClientServiceImpl extends ServiceImpl<SysUserClientMapper, SysUserClient> implements SysUserClientService { |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addOrUpdateClientId(SysUserClient sysUserClient) { |
| | | if (sysUserClient == null || sysUserClient.getUserId() == null || StringUtils.isEmpty(sysUserClient.getCid())) { |
| | | return false; |
| | | } |
| | | |
| | | String cid = sysUserClient.getCid(); |
| | | Long userId = sysUserClient.getUserId(); |
| | | |
| | | remove(new LambdaQueryWrapper<SysUserClient>().eq(SysUserClient::getCid, cid).ne(SysUserClient::getUserId, userId)); |
| | | |
| | | SysUserClient userClient = new SysUserClient(); |
| | | userClient.setUserId(userId); |
| | | userClient.setCid(cid); |
| | | userClient.setUpdateTime(new Date()); |
| | | |
| | | return saveOrUpdate(userClient); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.project.system.service.impl; |
| | | |
| | | import com.getui.push.v2.sdk.ApiHelper; |
| | | import com.getui.push.v2.sdk.GtApiConfiguration; |
| | | import com.getui.push.v2.sdk.api.PushApi; |
| | | import com.getui.push.v2.sdk.common.ApiResult; |
| | | import com.getui.push.v2.sdk.dto.req.Audience; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushChannel; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushDTO; |
| | | import com.getui.push.v2.sdk.dto.req.message.PushMessage; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification; |
| | | import com.getui.push.v2.sdk.dto.req.message.android.Ups; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.GetuiConfig; |
| | | import com.ruoyi.project.system.domain.SysMenu; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.project.system.domain.SysUserClient; |
| | | import com.ruoyi.project.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.project.system.service.SysUserClientService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * APPæ¶æ¯æ¨éæå¡ |
| | | * |
| | | * @author deslrey |
| | | * @version 1.4 |
| | | * @since 2026/2/9 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class UnipushService { |
| | | |
| | | @Autowired |
| | | private SysMenuMapper sysMenuMapper; |
| | | |
| | | @Autowired |
| | | private GetuiConfig getuiConfig; |
| | | |
| | | @Autowired |
| | | private SysUserClientService userClientService; |
| | | |
| | | private PushApi pushApi; |
| | | |
| | | private static final String DEFAULT_APP_PAGE = "pages/index"; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | GtApiConfiguration config = new GtApiConfiguration(); |
| | | config.setAppId(getuiConfig.getAppId()); |
| | | config.setAppKey(getuiConfig.getAppKey()); |
| | | config.setMasterSecret(getuiConfig.getMasterSecret()); |
| | | config.setDomain(getuiConfig.getDomain()); |
| | | ApiHelper apiHelper = ApiHelper.build(config); |
| | | this.pushApi = apiHelper.creatApi(PushApi.class); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåééç¥å
¬åå°ç§»å¨ç«¯ |
| | | */ |
| | | @Async |
| | | public void sendClientMessage(List<SysNotice> sysNoticeList) { |
| | | if (sysNoticeList == null || sysNoticeList.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (SysNotice sysNotice : sysNoticeList) { |
| | | SysUserClient client = userClientService.getById(sysNotice.getConsigneeId()); |
| | | if (client == null || StringUtils.isEmpty(client.getCid())) { |
| | | log.warn("ç¨æ· {} æªç»å®ç§»å¨ç«¯ CID,è·³è¿æ¨é", sysNotice.getConsigneeId()); |
| | | continue; |
| | | } |
| | | |
| | | // 转æ¢è·¯å¾ |
| | | String appPath = convertWebPathToAppPath(sysNotice.getJumpPath()); |
| | | |
| | | // æ¨é |
| | | sendRoutingPush( |
| | | client.getCid(), |
| | | sysNotice.getNoticeTitle(), |
| | | sysNotice.getRemark() != null ? sysNotice.getRemark() : sysNotice.getNoticeContent(), |
| | | appPath |
| | | ); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å° Web 端åå±å
¨è·¯å¾è½¬æ¢ä¸º App 端ç»ä»¶è·¯ç± |
| | | */ |
| | | private String convertWebPathToAppPath(String webPath) { |
| | | if (StringUtils.isEmpty(webPath)) { |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | String pathOnly = webPath; |
| | | String queryString = ""; |
| | | if (webPath.contains("?")) { |
| | | int index = webPath.indexOf("?"); |
| | | pathOnly = webPath.substring(0, index); |
| | | queryString = webPath.substring(index); |
| | | } |
| | | |
| | | String lastSegment; |
| | | int lastSlashIndex = pathOnly.lastIndexOf("/"); |
| | | if (lastSlashIndex != -1) { |
| | | lastSegment = pathOnly.substring(lastSlashIndex + 1); |
| | | } else { |
| | | lastSegment = pathOnly; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(lastSegment)) { |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | SysMenu menu = sysMenuMapper.selectMenuByPath(lastSegment); |
| | | |
| | | if (menu != null && StringUtils.isNotEmpty(menu.getAppComponent())) { |
| | | String appPath = menu.getAppComponent(); |
| | | |
| | | if (appPath.startsWith("/")) { |
| | | appPath = appPath.substring(1); |
| | | } |
| | | |
| | | // æ¼æ¥ Web 端åå§åæ°å¹¶è¿å |
| | | return appPath + queryString; |
| | | } |
| | | |
| | | return DEFAULT_APP_PAGE; |
| | | } |
| | | |
| | | /** |
| | | * åéåäººè·¯ç±æ¨é |
| | | */ |
| | | private void sendRoutingPush(String cid, String title, String content, String targetPath) { |
| | | log.info("å夿¨éæ¶æ¯: CID={}, Title={}, TargetPath={}", cid, title, targetPath); |
| | | |
| | | PushDTO<Audience> pushDTO = new PushDTO<>(); |
| | | pushDTO.setRequestId("REQ_" + System.currentTimeMillis()); |
| | | |
| | | // å¨çº¿éä¼ å
容 |
| | | PushMessage pushMessage = new PushMessage(); |
| | | String transmissionContent = String.format( |
| | | "{\"title\":\"%s\",\"content\":\"%s\",\"payload\":\"%s\"}", |
| | | title, content, targetPath |
| | | ); |
| | | pushMessage.setTransmission(transmissionContent); |
| | | pushDTO.setPushMessage(pushMessage); |
| | | |
| | | // æ¥æ¶äºº |
| | | Audience audience = new Audience(); |
| | | audience.addCid(cid); |
| | | pushDTO.setAudience(audience); |
| | | |
| | | // 离线æ¨ééé |
| | | pushDTO.setPushChannel(getPushChannel(title, content, targetPath)); |
| | | |
| | | try { |
| | | ApiResult<Map<String, Map<String, String>>> result = pushApi.pushToSingleByCid(pushDTO); |
| | | if (result.isSuccess()) { |
| | | log.info("Unipush æ¨éæå: CID={}", cid); |
| | | } else { |
| | | log.error("Unipush æ¨é失败: CID={}, Code={}, Msg={}", cid, result.getCode(), result.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("Unipush æ¨éå¼å¸¸: ", e); |
| | | } |
| | | } |
| | | |
| | | @NotNull |
| | | private PushChannel getPushChannel(String title, String content, String targetPath) { |
| | | PushChannel pushChannel = new PushChannel(); |
| | | AndroidDTO androidDTO = new AndroidDTO(); |
| | | Ups ups = new Ups(); |
| | | ThirdNotification thirdNotification = new ThirdNotification(); |
| | | thirdNotification.setTitle(title); |
| | | thirdNotification.setBody(content); |
| | | thirdNotification.setClickType("intent"); |
| | | |
| | | String intent = "intent:#Intent;launchFlags=0x04000000;" |
| | | + "component=" + getuiConfig.getIntentComponent() + ";" |
| | | + "S.UP-OL-P9=true;" |
| | | + "S.path=" + targetPath + ";" |
| | | + "S.payload=" + targetPath + ";" |
| | | + "end"; |
| | | thirdNotification.setIntent(intent); |
| | | |
| | | ups.setNotification(thirdNotification); |
| | | androidDTO.setUps(ups); |
| | | pushChannel.setAndroid(androidDTO); |
| | | return pushChannel; |
| | | } |
| | | } |
| | |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(purchaseLedger.getId(), productList, purchaseLedgerDto.getType()); |
| | | } |
| | | //æ°å¢åæææ£éª |
| | | if (productList != null) { |
| | | for (SalesLedgerProduct saleProduct : productList) { |
| | | //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å |
| | | if (saleProduct.getIsChecked()) { |
| | | addQualityInspect(purchaseLedger, saleProduct); |
| | | } |
| | | } |
| | | } |
| | | //æ°å¢åæææ£éª 审æ¹ä¹åæçææ£éª |
| | | // if (productList != null) { |
| | | // for (SalesLedgerProduct saleProduct : productList) { |
| | | // //æ¯å¦æ¨éè´¨æ£ï¼å¦ætrue就添å |
| | | // if (saleProduct.getIsChecked()) { |
| | | // addQualityInspect(purchaseLedger, saleProduct); |
| | | // } |
| | | // } |
| | | // } |
| | | // 5. è¿ç§»ä¸´æ¶æä»¶å°æ£å¼ç®å½ |
| | | if (purchaseLedgerDto.getTempFileIds() != null && !purchaseLedgerDto.getTempFileIds().isEmpty()) { |
| | | migrateTempFilesToFormal(purchaseLedger.getId(), purchaseLedgerDto.getTempFileIds()); |
| | |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult QualityUnqualifiedDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(qualityUnqualifiedService.getById(id)); |
| | | return AjaxResult.success(qualityUnqualifiedService.getUnqualified(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | IPage<QualityUnqualified> qualityUnqualifiedListPage(Page page, @Param("qualityUnqualified") QualityUnqualified qualityUnqualified); |
| | | |
| | | List<QualityUnqualified> qualityUnqualifiedExport(@Param("qualityUnqualified") QualityUnqualified qualityUnqualified); |
| | | |
| | | QualityUnqualified getUnqualified(@Param("id") Integer id); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("å
³èæ£æµid") |
| | | private Long inspectId; |
| | | |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¸åæ ¼å¤çèªå·±æ°å¢") |
| | | @TableField(exist = false) |
| | | private Boolean method; |
| | | } |
| | |
| | | |
| | | int deal(QualityUnqualified qualityUnqualified); |
| | | |
| | | QualityUnqualified getUnqualified(Integer id); |
| | | } |
| | |
| | | public int deal(QualityUnqualified qualityUnqualified) { |
| | | QualityUnqualified unqualified = qualityUnqualifiedMapper.selectById(qualityUnqualified.getId()); |
| | | QualityInspect qualityInspect = qualityInspectService.getById(unqualified.getInspectId()); |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType()!=0) { |
| | | if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType() != 0) { |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "è¿ä¿®": |
| | | case "è¿å·¥": |
| | |
| | | } |
| | | } |
| | | // çæå®æ´çå·¥åå· |
| | | String workOrderNoStr ="FG" +String.format("%s%03d", datePrefix, sequenceNumber); |
| | | String workOrderNoStr = "FG" + String.format("%s%03d", datePrefix, sequenceNumber); |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(order.getId()); |
| | |
| | | default: |
| | | break; |
| | | } |
| | | } else { |
| | | switch (qualityUnqualified.getDealResult()) { |
| | | case "æ¥åº": |
| | | //è°ç¨ä¸åæ ¼åºåæ¥å£ å
¥ä¸åæ ¼åº |
| | | stockUtils.addUnStock(Long.valueOf(unqualified.getModel()), unqualified.getQuantity(), StockInUnQualifiedRecordTypeEnum.DEFECTIVE_SCRAP.getCode(), unqualified.getId()); |
| | | break; |
| | | case "è®©æ¥æ¾è¡": |
| | | //è°ç¨æäº¤åæ ¼çæ¥å£ |
| | | stockUtils.addStock(Long.valueOf(unqualified.getModel()), unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | } |
| | | qualityUnqualified.setInspectState(1);//å·²å¤ç |
| | | return qualityUnqualifiedMapper.updateById(qualityUnqualified); |
| | | } |
| | | |
| | | @Override |
| | | public QualityUnqualified getUnqualified(Integer id) { |
| | | return qualityUnqualifiedMapper.getUnqualified(id); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @AllArgsConstructor |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/personalAttendanceRecords") |
| | | @RequestMapping("/personalAttendanceRecords") |
| | | public class PersonalAttendanceRecordsController { |
| | | @Autowired |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | /** |
| | | * 个人èå¤è®°å½å页æ¥è¯¢ |
| | | */ |
| | | |
| | | // æ°å¢ |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecords personalAttendanceRecord){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.add(personalAttendanceRecord)); |
| | | } |
| | | |
| | | // å表æ¥è¯¢ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult personalAttendanceRecordsListPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecords)); |
| | | public AjaxResult listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecordsDto)); |
| | | } |
| | | /** |
| | | * æ°å¢ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.save(personalAttendanceRecords)); |
| | | } |
| | | /** |
| | | * ä¿®æ¹ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.updateById(personalAttendanceRecords)); |
| | | } |
| | | /** |
| | | * å é¤ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.removeById(id)); |
| | | |
| | | @GetMapping("/today") |
| | | public AjaxResult todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto){ |
| | | return AjaxResult.success(personalAttendanceRecordsService.todayInfo(personalAttendanceRecordsDto)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PersonalAttendanceRecordsDto extends PersonalAttendanceRecords { |
| | | private String staffName; |
| | | private String staffNo; |
| | | private String deptName; |
| | | private Long deptId; |
| | | } |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Mapper |
| | | public interface PersonalAttendanceRecordsMapper extends BaseMapper<PersonalAttendanceRecords> { |
| | | IPage<PersonalAttendanceRecordsDto> listPage(Page page, @Param("params") PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | } |
| | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æ¥æçå¨èåå·¥æ° |
| | | * |
| | | * @param date æ¥æ |
| | | * @return å¨èåå·¥æ° |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½çæ°å
¥èåå·¥æ° |
| | | * |
| | | * @param monthStart æä»½å¼å§æ¥æ |
| | | * @param monthEnd æä»½ç»ææ¥æ |
| | | * @param monthEnd æä»½ç»ææ¥æ |
| | | * @return æ°å
¥èåå·¥æ° |
| | | */ |
| | | Integer countNewHireByMonth(@Param("monthStart") LocalDate monthStart, @Param("monthEnd") LocalDate monthEnd); |
| | | |
| | | /** |
| | | * æ ¹æ®åå·¥å§åæ¥è¯¢åå·¥ä¿¡æ¯ |
| | | * |
| | | * @param staffName åå·¥å§å |
| | | * @return åå·¥æ°æ® |
| | | */ |
| | | StaffOnJob selectStaffByNickName(String staffName); |
| | | } |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("personal_attendance_records") |
| | | @ApiModel(value = "PersonalAttendanceRecords对象", description = "") |
| | | public class PersonalAttendanceRecords implements Serializable { |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * æ¥æ |
| | | */ |
| | | |
| | | @ApiModelProperty("åå·¥å¨èid") |
| | | private Long staffOnJobId; |
| | | |
| | | @ApiModelProperty("æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate date; |
| | | /** |
| | | * ç¾å°æ¶é´ |
| | | */ |
| | | |
| | | @ApiModelProperty("å·¥ä½å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkIn; |
| | | /** |
| | | * ç¾éæ¶é´ |
| | | */ |
| | | private LocalDateTime workStartAt; |
| | | |
| | | @ApiModelProperty("å·¥ä½ç»ææ¶é´") |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkOut; |
| | | /** |
| | | * 工使¶é¿ |
| | | */ |
| | | private String workHours; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | private LocalDateTime workEndAt; |
| | | |
| | | @ApiModelProperty("工使¶é¿") |
| | | private BigDecimal workHours; |
| | | |
| | | @ApiModelProperty("ç¶æ 0æ£å¸¸ 1è¿å° 2æ©é") |
| | | private Byte status; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty("å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | private Integer sysDeptId; |
| | | private Long sysDeptId; |
| | | |
| | | /** |
| | | * å®¶åºä½å |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | public interface PersonalAttendanceRecordsService extends IService<PersonalAttendanceRecords> { |
| | | IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords); |
| | | IPage<PersonalAttendanceRecordsDto> listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | |
| | | int add(PersonalAttendanceRecords personalAttendanceRecords); |
| | | |
| | | PersonalAttendanceRecordsDto todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.service.ISysDictDataService; |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-02-09 01:20:07 |
| | | */ |
| | | @Service |
| | | public class PersonalAttendanceRecordsServiceImpl extends ServiceImpl<PersonalAttendanceRecordsMapper, PersonalAttendanceRecords> implements PersonalAttendanceRecordsService { |
| | | @Autowired |
| | | private PersonalAttendanceRecordsMapper personalAttendanceRecordsMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Override |
| | | public IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | // return personalAttendanceRecordsMapper.ListPage(page, personalAttendanceRecords); |
| | | return baseMapper.selectPage(page, new QueryWrapper<>(personalAttendanceRecords)); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int add(PersonalAttendanceRecords personalAttendanceRecords) { |
| | | // å½åæ¶é´ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | | // é¦å
æ ¹æ®ç¨æ·IDæ¥è¯¢åå·¥ä¿¡æ¯ |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | if (staffOnJob == null) { |
| | | throw new BaseException("å½åç¨æ·æ²¡æå¯¹åºçå工信æ¯"); |
| | | } |
| | | |
| | | // æ ¹æ®åå·¥IDåå½åæ¥ææ¥è¯¢æå¡è®°å½ |
| | | QueryWrapper<PersonalAttendanceRecords> attendanceQueryWrapper = new QueryWrapper<>(); |
| | | attendanceQueryWrapper.eq("staff_on_job_id", staffOnJob.getId()) |
| | | .eq("date", currentDate); |
| | | PersonalAttendanceRecords attendanceRecord = personalAttendanceRecordsMapper.selectOne(attendanceQueryWrapper); |
| | | DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm"); |
| | | // æ ¹æ®åå
¸è®¾ç½®çè夿¶é´å¤æè¿å°æ©é |
| | | if (attendanceRecord == null) { |
| | | // ä¸å卿å¡è®°å½ï¼å建æ°è®°å½ |
| | | personalAttendanceRecords.setStaffOnJobId(staffOnJob.getId()); |
| | | personalAttendanceRecords.setDate(currentDate); |
| | | personalAttendanceRecords.setWorkStartAt(LocalDateTime.now()); |
| | | personalAttendanceRecords.setStatus(determineAttendanceStatus(personalAttendanceRecords.getWorkStartAt(), true)); |
| | | personalAttendanceRecords.setRemark(personalAttendanceRecords.getRemark()); |
| | | personalAttendanceRecords.setTenantId(staffOnJob.getTenantId()); |
| | | return personalAttendanceRecordsMapper.insert(personalAttendanceRecords); |
| | | } else { |
| | | if (attendanceRecord.getWorkEndAt() == null) { |
| | | // æ´æ°å·¥ä½ç»ææ¶é´å工使¶é¿ |
| | | attendanceRecord.setWorkEndAt(LocalDateTime.now()); |
| | | // 计ç®å·¥ä½æ¶é¿ï¼ç²¾ç¡®å°åéï¼ä¿ç2ä½å°æ°ï¼ |
| | | LocalDateTime startTime = attendanceRecord.getWorkStartAt(); |
| | | LocalDateTime endTime = attendanceRecord.getWorkEndAt(); |
| | | // 计ç®ä¸¤ä¸ªæ¶é´ä¹é´çåéæ° |
| | | long totalMinutes = java.time.Duration.between(startTime, endTime).toMinutes(); |
| | | BigDecimal workHours = BigDecimal.valueOf(totalMinutes) |
| | | .divide(BigDecimal.valueOf(60), 2, RoundingMode.HALF_UP); |
| | | attendanceRecord.setWorkHours(workHours); |
| | | // æ´æ°èå¤ç¶æ |
| | | attendanceRecord.setStatus(determineAttendanceStatus(attendanceRecord.getWorkEndAt(), false)); |
| | | return personalAttendanceRecordsMapper.updateById(attendanceRecord); |
| | | } else { |
| | | throw new BaseException("æ¨å·²ç»æè¿å¡äº,æ éé夿å¡!!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ ¹æ®å®é
æ¶é´åæ¯å¦ä¸çæ¶é´å¤æèå¤ç¶æ |
| | | // 0 æ£å¸¸ 1 è¿å° 2 æ©é |
| | | private byte determineAttendanceStatus(LocalDateTime actualTime, boolean isStart) { |
| | | try { |
| | | // è·åè夿¶é´é
ç½® |
| | | String dictType = "sys_work_time"; // è夿¶é´åå
¸ç±»å |
| | | String timeConfig; |
| | | |
| | | if (isStart) { |
| | | // ä¸çæ¶é´é
ç½®ï¼é»è®¤ä¸º09:00 |
| | | timeConfig = dictDataService.selectDictLabel(dictType, "work_start_time"); |
| | | if (timeConfig == null || timeConfig.trim().isEmpty()) { |
| | | timeConfig = "09:00"; |
| | | } |
| | | } else { |
| | | // ä¸çæ¶é´é
ç½®ï¼é»è®¤ä¸º18:00 |
| | | timeConfig = dictDataService.selectDictLabel(dictType, "work_end_time"); |
| | | if (timeConfig == null || timeConfig.trim().isEmpty()) { |
| | | timeConfig = "18:00"; |
| | | } |
| | | } |
| | | |
| | | // è§£ææ åæ¶é´ |
| | | String[] timeParts = timeConfig.split(":"); |
| | | int standardHour = Integer.parseInt(timeParts[0]); |
| | | int standardMinute = Integer.parseInt(timeParts[1]); |
| | | |
| | | // è·åå®é
æ¶é´çæ¶å |
| | | int actualHour = actualTime.getHour(); |
| | | int actualMinute = actualTime.getMinute(); |
| | | |
| | | // å¤æç¶æ |
| | | if (isStart) { |
| | | // ä¸çæå¡ï¼è¶
è¿æ åæ¶é´ç®è¿å° |
| | | if (actualHour > standardHour || (actualHour == standardHour && actualMinute > standardMinute)) { |
| | | return 1; // è¿å° |
| | | } |
| | | } else { |
| | | // ä¸çæå¡ï¼æ©äºæ åæ¶é´ç®æ©é |
| | | if (actualHour < standardHour || (actualHour == standardHour && actualMinute < standardMinute)) { |
| | | return 2; // æ©é |
| | | } |
| | | } |
| | | |
| | | return 0; // æ£å¸¸ |
| | | |
| | | } catch (Exception e) { |
| | | // 妿è·åé
置失败ï¼é»è®¤è¿åæ£å¸¸ç¶æ |
| | | log.warn("è·åè夿¶é´é
置失败ï¼ä½¿ç¨é»è®¤ç¶æï¼" + e.getMessage()); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PersonalAttendanceRecordsDto> listPage(Page page, PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | return personalAttendanceRecordsMapper.listPage(page,personalAttendanceRecordsDto); |
| | | } |
| | | |
| | | @Override |
| | | public PersonalAttendanceRecordsDto todayInfo(PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | // è·åå½åæ¥æ |
| | | LocalDate currentDate = LocalDate.now(); |
| | | |
| | | // é¦å
æ ¹æ®ç¨æ·IDæ¥è¯¢åå·¥ä¿¡æ¯ |
| | | QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>(); |
| | | staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername()); |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper); |
| | | |
| | | if (staffOnJob == null) { |
| | | return null; // å½åç¨æ·æ²¡æå¯¹åºçåå·¥ä¿¡æ¯ |
| | | } |
| | | |
| | | // æ ¹æ®åå·¥IDåå½åæ¥ææ¥è¯¢æå¡è®°å½ |
| | | QueryWrapper<PersonalAttendanceRecords> attendanceQueryWrapper = new QueryWrapper<>(); |
| | | attendanceQueryWrapper.eq("staff_on_job_id", staffOnJob.getId()) |
| | | .eq("date", currentDate); |
| | | PersonalAttendanceRecords attendanceRecord = personalAttendanceRecordsMapper.selectOne(attendanceQueryWrapper); |
| | | |
| | | // è¿ååæ° |
| | | PersonalAttendanceRecordsDto resultDto = new PersonalAttendanceRecordsDto(); |
| | | |
| | | if (attendanceRecord != null) { |
| | | // 妿ææå¡è®°å½ï¼å¤å¶æå¡è®°å½ä¿¡æ¯ |
| | | BeanUtils.copyProperties(attendanceRecord, resultDto); |
| | | } |
| | | |
| | | // åå·¥ç¸å
³ä¿¡æ¯ |
| | | resultDto.setStaffName(staffOnJob.getStaffName()); |
| | | resultDto.setStaffNo(staffOnJob.getStaffNo()); |
| | | resultDto.setDeptId(staffOnJob.getSysDeptId() != null ? staffOnJob.getSysDeptId() : null); |
| | | SysDept dept = sysDeptMapper.selectDeptById(staffOnJob.getSysDeptId()); |
| | | resultDto.setDeptName(dept != null ? dept.getDeptName() : null); |
| | | |
| | | return resultDto; |
| | | } |
| | | } |
| | |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: DEV |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEW |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | |
| | | <mapper namespace="com.ruoyi.compensationperformance.mapper.CompensationPerformanceMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.compensationperformance.pojo.CompensationPerformance"> |
| | | select * from compensation_performance |
| | | SELECT |
| | | cp.*, |
| | | soj.staff_name AS staffName, |
| | | sp.post_name AS postName, |
| | | sd.dept_name AS deptName |
| | | FROM compensation_performance cp |
| | | LEFT JOIN staff_on_job soj ON soj.id = cp.staff_id |
| | | LEFT JOIN sys_post sp ON sp.post_id = soj.sys_post_id |
| | | LEFT JOIN sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | <where> |
| | | <if test="req.name != null and req.name != ''"> |
| | | and `name` like concat('%',#{req.name},'%') |
| | | <if test="staffName != null and staffName != ''"> |
| | | AND soj.staff_name LIKE CONCAT('%', #{staffName}, '%') |
| | | </if> |
| | | <if test="req.payDateStr != null and req.payDateStr != ''"> |
| | | and pay_date like concat('%',#{req.payDateStr},'%') |
| | | <if test="payDateStr != null and payDateStr != ''"> |
| | | AND DATE_FORMAT(cp.pay_date, '%Y-%m') = #{payDateStr} |
| | | </if> |
| | | </where> |
| | | ORDER BY cp.pay_date DESC, cp.id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="calculateProductionStatistics" resultType="com.ruoyi.home.dto.processDataProductionStatisticsDto"> |
| | | SELECT |
| | | pp.name AS processName, |
| | | SUM((ppo.quantity + ppo.scrap_qty) * pp.salary_quota) AS totalInput, |
| | | SUM(ppo.scrap_qty * pp.salary_quota) AS totalScrap, |
| | | SUM(ppo.quantity * pp.salary_quota) AS totalOutput |
| | | SUM(pi.quantity) AS totalInput, |
| | | SUM(distinct ppo.scrap_qty) AS totalScrap, |
| | | SUM(distinct (ppo.quantity - ppo.scrap_qty)) AS totalOutput |
| | | FROM |
| | | production_product_output ppo |
| | | INNER JOIN production_product_main ppm ON ppo.product_main_id = ppm.id |
| | | INNER JOIN product_process_route_item ppri ON ppm.product_process_route_item_id = ppri.id |
| | | INNER JOIN product_process pp ON ppri.process_id = pp.id |
| | | INNER JOIN production_product_input pi ON pi.product_main_id = ppm.id |
| | | <where> |
| | | <if test="startDateTime != null"> |
| | | AND ppo.create_time >= #{startDateTime} |
| | |
| | | <select id="selectDailyOutputStats" resultType="java.util.Map"> |
| | | SELECT |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') as date, |
| | | SUM(quantity) as quantity |
| | | SUM(quantity-scrap_qty) as quantity |
| | | FROM |
| | | production_product_output |
| | | WHERE |
| | |
| | | <mapper namespace="com.ruoyi.quality.mapper.QualityUnqualifiedMapper"> |
| | | <select id="qualityUnqualifiedListPage" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | | * |
| | | FROM quality_unqualified |
| | | qu.id, |
| | | qu.inspect_type, |
| | | qu.inspect_state, |
| | | qu.check_time, |
| | | qu.check_name, |
| | | qu.product_id, |
| | | qu.product_name, |
| | | qu.unit, |
| | | qu.quantity, |
| | | qu.defective_phenomena, |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | | ELSE qu.model |
| | | END AS model, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN true |
| | | ELSE false |
| | | END AS method |
| | | FROM quality_unqualified qu |
| | | LEFT JOIN product_model pm ON qu.model = pm.id |
| | | where |
| | | 1=1 |
| | | <if test="qualityUnqualified.inspectType != null "> |
| | |
| | | AND product_name = #{qualityUnqualified.productName} |
| | | </if> |
| | | </select> |
| | | <select id="getUnqualified" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | | qu.id, |
| | | qu.inspect_type, |
| | | qu.inspect_state, |
| | | qu.check_time, |
| | | qu.check_name, |
| | | qu.product_id, |
| | | qu.product_name, |
| | | qu.unit, |
| | | qu.quantity, |
| | | qu.defective_phenomena, |
| | | qu.deal_result, |
| | | qu.deal_name, |
| | | qu.deal_time, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN pm.model |
| | | ELSE qu.model |
| | | END AS model, |
| | | CASE |
| | | WHEN qu.model = pm.id THEN true |
| | | ELSE false |
| | | END AS method |
| | | FROM quality_unqualified qu |
| | | LEFT JOIN product_model pm ON qu.model = pm.id |
| | | where |
| | | 1=1 |
| | | and qu.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | SELECT |
| | | T1.*, |
| | | CASE |
| | | WHEN t2.qualitity > T1.quantity THEN 1 |
| | | WHEN t2.qualitity-t2.locked_quantity >= T1.quantity THEN 1 |
| | | ELSE 0 |
| | | END as has_sufficient_stock |
| | | FROM |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.PersonalAttendanceRecords"> |
| | | <id column="id" property="id" /> |
| | | <result column="staff_on_job_id" property="staffOnJobId" /> |
| | | <result column="date" property="date" /> |
| | | <result column="work_start_at" property="workStartAt" /> |
| | | <result column="work_end_at" property="workEndAt" /> |
| | | <result column="work_hours" property="workHours" /> |
| | | <result column="status" property="status" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | |
| | | </mapper> |
| | | <select id="listPage" resultType="com.ruoyi.staff.dto.PersonalAttendanceRecordsDto"> |
| | | SELECT |
| | | personal_attendance_records.*, |
| | | soj.staff_name as staffName, |
| | | soj.staff_no as staffNo, |
| | | sd.dept_name as deptName |
| | | FROM personal_attendance_records |
| | | LEFT JOIN |
| | | staff_on_job soj ON soj.id = personal_attendance_records.staff_on_job_id |
| | | LEFT JOIN |
| | | sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | where 1=1 |
| | | <if test="params.deptId != null and params.deptId > 0"> |
| | | AND sys_dept.dept_id = #{params.deptId} |
| | | </if> |
| | | <if test="params.date != null"> |
| | | AND personal_attendance_records.date = DATE_FORMAT(#{params.date},'%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | sys_dept sd ON sd.dept_id = staff_on_job.sys_dept_id |
| | | where 1=1 |
| | | <if test="staffOnJob.staffState != null"> |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | </if> |
| | | <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> |
| | | AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') |
| | |
| | | AND contract_expire_time >= DATE_FORMAT(#{staffOnJob.entryDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="staffOnJob.entryDateEnd != null and staffOnJob.entryDateEnd != '' "> |
| | | AND contract_expire_time <= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d') |
| | | AND contract_expire_time <= DATE_FORMAT(#{staffOnJob.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | </select> |
| | | <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto"> |
| | |
| | | SELECT COUNT(*) |
| | | FROM staff_on_job |
| | | WHERE staff_state = 1 |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{date} |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{date} |
| | | </select> |
| | | |
| | | <!-- ç»è®¡æå®æä»½çæ°å
¥èåå·¥æ° --> |
| | |
| | | SELECT COUNT(*) |
| | | FROM staff_on_job |
| | | WHERE staff_state = 1 |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') BETWEEN #{monthStart} AND #{monthEnd} |
| | | AND DATE_FORMAT(create_time, '%Y-%m-%d') BETWEEN #{monthStart} AND #{monthEnd} |
| | | </select> |
| | | |
| | | <select id="selectStaffByNickName" resultType="com.ruoyi.staff.pojo.StaffOnJob" parameterType="java.lang.String"> |
| | | SELECT |
| | | id |
| | | nick_name AS staffName |
| | | FROM staff_on_job |
| | | WHERE del_flag = '0' |
| | | <choose> |
| | | <when test="staffName != null and staffName != ''"> |
| | | AND nick_name = #{staffName} |
| | | </when> |
| | | <otherwise> |
| | | AND 1 = 0 |
| | | </otherwise> |
| | | </choose> |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMenuListByRoleId" resultType="Long"> |
| | | select m.menu_id |
| | | from sys_menu m |
| | |
| | | <include refid="selectMenuVo"/> |
| | | where menu_name=#{menuName} and parent_id = #{parentId} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMenuByPath" resultType="com.ruoyi.project.system.domain.SysMenu" parameterType="java.lang.String"> |
| | | SELECT menu_id, menu_name, parent_id, path, app_component, status |
| | | FROM sys_menu |
| | | WHERE path = #{path} |
| | | AND status = '0' LIMIT 1 |
| | | </select> |
| | | |
| | | <update id="updateMenu" parameterType="com.ruoyi.project.system.domain.SysMenu"> |
| | | update sys_menu |
| | | <set> |