¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.pojo.Seal; |
| | | import com.ruoyi.basic.service.SealService; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å°ç« 管ç(SealController)表æ§å¶å± |
| | | */ |
| | | @Api(tags = "å°ç« 管ç") |
| | | |
| | | @RestController |
| | | @RequestMapping("/sealScope") |
| | | public class SealController { |
| | | |
| | | @Resource |
| | | private SealService sealService; |
| | | |
| | | @ApiOperation(value = "æ·»å å°ç« åæ°") |
| | | @PostMapping("/addSeal") |
| | | public Result addSeal(@RequestBody Seal seal) { |
| | | int i = sealService.addSeal(seal); |
| | | if(i>0){ |
| | | Integer labId = seal.getLabId(); |
| | | List<Laboratory> laboratory = sealService.Laboratory(labId); |
| | | return Result.success(laboratory); |
| | | }else{ |
| | | return Result.fail(); |
| | | } |
| | | |
| | | } |
| | | @ApiOperation(value="æ¥è¯¢å°ç« å表") |
| | | @PostMapping("/selectSeal") |
| | | public Result selectSeal(Page page,Seal seal) { |
| | | return Result.success(sealService.selectSeal(page,seal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.pojo.Seal; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface SealMapper extends BaseMapper<Seal> { |
| | | IPage<Seal>selectSeal(Page page, @Param("ew") QueryWrapper<Seal> ew); |
| | | List<Laboratory> selectLaboratory (Integer labId); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * å°ç« 管ç(Laboratory)表对象 |
| | | */ |
| | | |
| | | @TableName(value = "seal") |
| | | @Data |
| | | public class Seal implements Serializable { |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å®éªå®¤id") |
| | | private Integer labId; |
| | | |
| | | @TableField(exist=false) |
| | | @ApiModelProperty(value = "å®éªå®¤åç§°") |
| | | private String laboratoryName; |
| | | |
| | | @ApiModelProperty(value = "å°ç« å¾ç") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "å°ç« ç±»å") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | |
| | | 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.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.pojo.Seal; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface SealService extends IService<Seal> { |
| | | |
| | | //æ°å¢ |
| | | int addSeal(Seal seal); |
| | | |
| | | //æ¥è¯¢ |
| | | IPage<Seal> selectSeal(Page page, Seal seal); |
| | | |
| | | List<Laboratory> Laboratory(Integer id); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | 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.basic.mapper.SealMapper; |
| | | import com.ruoyi.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.pojo.Seal; |
| | | import com.ruoyi.basic.service.SealService; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class SealServiceImpl extends ServiceImpl<SealMapper, Seal> implements SealService { |
| | | private SealMapper sealMapper; |
| | | |
| | | |
| | | @Override |
| | | public int addSeal(Seal seal) { |
| | | return sealMapper.insert(seal); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<Seal> selectSeal(Page page, Seal seal) { |
| | | return sealMapper.selectSeal(page, QueryWrappers.queryWrappers(seal)); |
| | | } |
| | | @Override |
| | | public List<Laboratory> Laboratory(Integer labId) { |
| | | return sealMapper.selectLaboratory(labId); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.basic.mapper.SealMapper"> |
| | | <select id="selectSeal" resultType="com.ruoyi.basic.pojo.Seal"> |
| | | select l.id,s.lab_id,l.laboratory_name ,s.address, s.type as Type,s.create_time |
| | | from seal s LEFT JOIN laboratory l on s.lab_id=l.id |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | |
| | | </select> |
| | | <select id="selectLaboratory" resultType="com.ruoyi.basic.pojo.Laboratory"> |
| | | SELECT * |
| | | from laboratory |
| | | WHERE id = #{labId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="insItems != ''"> |
| | | and inspection_item_subclass = #{insItems} |
| | | </if> |
| | | group by spl.id |
| | | order by p.id |
| | | group by spl.id |
| | | </select> |
| | | <select id="getOne" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | |
| | | |
| | | <artifactId>inspect-server</artifactId> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-system</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>ruoyi</artifactId> |
| | | <groupId>com.ruoyi</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>performance-server</artifactId> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-system</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | </properties> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.excel.AuxiliaryCorrectionHoursListener; |
| | | import com.ruoyi.performance.service.AuxiliaryCorrectionHoursService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-29 02:38:19 |
| | | */ |
| | | @Api(tags = "å·¥æ¶ç»è®¡-ä¿®æ£å·¥æ¶") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/auxiliaryCorrectionHours") |
| | | public class AuxiliaryCorrectionHoursController { |
| | | |
| | | @Resource |
| | | AuxiliaryCorrectionHoursService auxiliaryCorrectionHoursService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ä¿®æ£å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryCorrectionHours") |
| | | public Result selectAuxiliaryCorrectionHours(Page page,AuxiliaryCorrectionHoursDto entity) throws Exception { |
| | | return Result.success(auxiliaryCorrectionHoursService.selectAuxiliaryCorrectionHours(page, entity)); |
| | | } |
| | | |
| | | /** |
| | | * excelä¸ä¼ |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导å
¥ä¿®æ£å·¥æ¶") |
| | | @PostMapping("/upload") |
| | | public Result upload(@RequestParam("file") MultipartFile file) { |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), AuxiliaryCorrectionHoursDto.class, new AuxiliaryCorrectionHoursListener(auxiliaryCorrectionHoursService)).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto; |
| | | import com.ruoyi.performance.service.AuxiliaryOriginalHoursService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | @Api(tags = "å·¥æ¶ç»è®¡-åå§å·¥æ¶") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/auxiliaryOriginalHours") |
| | | public class AuxiliaryOriginalHoursController { |
| | | |
| | | @Resource |
| | | AuxiliaryOriginalHoursService auxiliaryOriginalHoursService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢åå§å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryOriginalHours") |
| | | public Result selectAuxiliaryOriginalHours(Page page, AuxiliaryOriginalHoursLookDto entity) throws Exception { |
| | | return Result.success(auxiliaryOriginalHoursService.selectAuxiliaryOriginalHours(page, entity)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºåå§å·¥æ¶") |
| | | @PostMapping("/exportOriginalHours") |
| | | public void exportOriginalHours(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims,HttpServletResponse response) throws IOException { |
| | | auxiliaryOriginalHoursService.exportWorkingHours(month,name,departLims,response); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æä»½å
¨é¨å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryAllByMonth") |
| | | public Result selectAuxiliaryAllByMonth(@RequestBody AuxiliaryOriginalHoursLookDto dto){ |
| | | return Result.success(auxiliaryOriginalHoursService.selectAuxiliaryAllByMonth(dto)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto; |
| | | import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡çç产éå·¥æ¶ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 03:48:48 |
| | | */ |
| | | @Api(tags = "æ¥å·¥æ¶ç®¡ç-产éå·¥æ¶") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/auxiliaryOutputWorkingHours") |
| | | public class AuxiliaryOutputWorkingHoursController { |
| | | |
| | | @Resource |
| | | private AuxiliaryOutputWorkingHoursService auxiliaryOutputWorkingHoursService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢äº§éå·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryOutputWorkingHours") |
| | | public Result selectAuxiliaryOutputWorkingHours(Page page,AuxiliaryOutputWorkingHoursDto entity) throws Exception { |
| | | return Result.success(auxiliaryOutputWorkingHoursService.selectAuxiliaryOutputWorkingHours(page, entity)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç»è®¡äº§éå·¥æ¶æ±æ»åè¾
å©å·¥æ¶æ±æ»") |
| | | @PostMapping("/collectWorkingHours") |
| | | public Result collectWorkingHours(@RequestBody Map<String, Object> data)throws Exception{ |
| | | AuxiliaryOutputWorkingHoursDto entity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), AuxiliaryOutputWorkingHoursDto.class); |
| | | return Result.success(auxiliaryOutputWorkingHoursService.collectWorkingHours(entity)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "导åºäº§éå·¥æ¶+è¾
å©å·¥æ¶") |
| | | @GetMapping("/exportWorkingHours") |
| | | public void exportWorkingHours(HttpServletResponse response) throws IOException { |
| | | auxiliaryOutputWorkingHoursService.exportWorkingHours(response); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç»é¿æé") |
| | | @PostMapping("/leader") |
| | | public Result leader() { |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºäº§éå·¥æ¶ |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | @ApiOperation(value = "导åºäº§éå·¥æ¶") |
| | | @PostMapping("/exportOutputHours") |
| | | public void exportOutputHours(@RequestBody Map<String, Object> data, HttpServletResponse response) throws Exception { |
| | | AuxiliaryOutputWorkingHoursDto entity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), AuxiliaryOutputWorkingHoursDto.class); |
| | | auxiliaryOutputWorkingHoursService.exportOutputHours(entity, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHours; |
| | | import com.ruoyi.performance.service.AuxiliaryWorkingHoursService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * è¾
å©å·¥æ¶ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-09 06:58:31 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-è¾
å©å·¥æ¶è®¾ç½®") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/auxiliaryWorkingHours") |
| | | public class AuxiliaryWorkingHoursController { |
| | | @Resource |
| | | private AuxiliaryWorkingHoursService auxiliaryWorkingHoursService; |
| | | |
| | | @ApiOperation(value="æ¥è¯¢è¾
å©å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryWorkingHours") |
| | | public Result selectAuxiliaryWorkingHours(Page page,AuxiliaryWorkingHours entity) throws Exception { |
| | | return Result.success(auxiliaryWorkingHoursService.selectAuxiliaryWorkingHours(page,entity)); |
| | | } |
| | | |
| | | @ApiOperation(value="å é¤è¾
å©å·¥æ¶") |
| | | @PostMapping("/deleteAuxiliaryWorkingHours") |
| | | public Result deleteAuxiliaryWorkingHours(Integer id){ |
| | | return Result.success(auxiliaryWorkingHoursService.deleteAuxiliaryWorkingHours(id)); |
| | | } |
| | | |
| | | @ApiOperation(value="ä¿®æ¹è¾
å©å·¥æ¶") |
| | | @PostMapping("/upAuxiliaryWorkingHours") |
| | | public Result upAuxiliaryWorkingHours(@RequestBody AuxiliaryWorkingHours auxiliaryWorkingHours){ |
| | | return Result.success(auxiliaryWorkingHoursService.upAuxiliaryWorkingHours(auxiliaryWorkingHours)); |
| | | } |
| | | |
| | | @ApiOperation(value="æ°å¢è¾
å©å·¥æ¶") |
| | | @PostMapping("/insertAuxiliaryWorkingHours") |
| | | public Result insertAuxiliaryWorkingHours(@RequestBody AuxiliaryWorkingHours auxiliaryWorkingHours){ |
| | | return Result.success(auxiliaryWorkingHoursService.insertAuxiliaryWorkingHours(auxiliaryWorkingHours)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.ruoyi.performance.dto.HoursDay; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import com.ruoyi.performance.service.AuxiliaryWorkingHoursDayService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 02:22:19 |
| | | */ |
| | | @Api(tags = "æ¥å·¥æ¶ç®¡ç-è¾
å©å·¥æ¶") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/auxiliaryWorkingHoursDay") |
| | | public class AuxiliaryWorkingHoursDayController { |
| | | |
| | | @Resource |
| | | private AuxiliaryWorkingHoursDayService auxiliaryWorkingHoursDayService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/selectAuxiliaryWorkingHoursDay") |
| | | public Result selectAuxiliaryWorkingHoursDay(Page page,AuxiliaryWorkingHoursDayDto entity) throws Exception { |
| | | return Result.success(auxiliaryWorkingHoursDayService.selectAuxiliaryWorkingHoursDay(page, entity)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®ç¼å·æ¥è¯¢è¾
å©å·¥æ¶é
置信æ¯") |
| | | @PostMapping("/selectAuxiliaryWorkingHoursByNumber") |
| | | public Result selectAuxiliaryWorkingHoursByNumber(String number) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.selectAuxiliaryWorkingHoursByNumber(number)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®ç¼å·å½åç¨æ·ä¿¡æ¯æ¥è¯¢æå¨ç次") |
| | | @PostMapping("/selectshiftByUser") |
| | | public Result selectshiftByUser(LocalDateTime dateTime) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.selectshiftByUser(dateTime)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å½å
¥æ°æ®(å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶)") |
| | | @PostMapping("/insertAuxiliaryWorkingHoursDay") |
| | | public Result insertAuxiliaryWorkingHoursDay(@RequestBody AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.insertAuxiliaryWorkingHoursDay(auxiliaryWorkingHoursDay)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹åå·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/approve") |
| | | public Result approve(@RequestBody HoursDay hoursDay ) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(hoursDay)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å®¡æ ¸å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/check") |
| | | public Result check(@RequestBody HoursDay hoursDay ) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(hoursDay)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¼è¾å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/updateAuxiliaryWorkingHoursDay") |
| | | public Result updateAuxiliaryWorkingHoursDay(@RequestBody AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.updateAuxiliaryWorkingHoursDay(auxiliaryWorkingHoursDay)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/deleteAuxiliaryWorkingHoursDay") |
| | | public Result deleteAuxiliaryWorkingHoursDay(Integer id) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.deleteAuxiliaryWorkingHoursDay(id)); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¾
å©å·¥æ¶ |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | @ApiOperation(value = "导åºè¾
å©å·¥æ¶") |
| | | @PostMapping("/exportAssistantHours") |
| | | public void exportAssistantHours(@RequestBody Map<String, Object> data, HttpServletResponse response) throws Exception { |
| | | AuxiliaryWorkingHoursDayDto entity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), AuxiliaryWorkingHoursDayDto.class); |
| | | auxiliaryWorkingHoursDayService.exportWorkingHours(entity, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | import com.ruoyi.performance.service.PerformanceShiftService; |
| | | import com.ruoyi.performance.utils.StyleMonthUtils; |
| | | import com.ruoyi.performance.utils.StyleYearUtils; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import com.ruoyi.system.service.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.time.temporal.WeekFields; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * 绩æç®¡ç-çæ¬¡ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-08 09:12:04 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-çæ¬¡") |
| | | @RestController |
| | | @RequestMapping("/performanceShift") |
| | | public class PerformanceShiftController { |
| | | |
| | | @Autowired |
| | | private PerformanceShiftService performanceShiftService; |
| | | |
| | | @Resource |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "æç") |
| | | @PostMapping("add") |
| | | public Result<?> performanceShiftAdd(@RequestBody PerformanceShiftAddDto performanceShiftAddDto) { |
| | | performanceShiftService.performanceShiftAdd(performanceShiftAddDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æä»½å页æ¥è¯¢") |
| | | @PostMapping("page") |
| | | public Result<?> performanceShiftPage(Integer size, Integer current, String time, String userName, String laboratory) { |
| | | return Result.success(performanceShiftService.performanceShiftPage(new Page<>(current, size), time, userName, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "年份å页æ¥è¯¢") |
| | | @PostMapping("pageYear") |
| | | public Result<?> performanceShiftPageYear(Integer size, Integer current, String time, String userName, String laboratory) { |
| | | return Result.success(performanceShiftService.performanceShiftPageYear(new Page<>(current, size), time, userName, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "çæ¬¡ç¶æä¿®æ¹") |
| | | @PutMapping("update") |
| | | public Result<?> performanceShiftUpdate(@RequestBody PerformanceShift performanceShift) { |
| | | performanceShiftService.performanceShiftUpdate(performanceShift); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åº") |
| | | @GetMapping("export") |
| | | public void exportToExcel(@NotNull(message = "æ¶é´ä¸è½ä¸ºç©ºï¼") String time, String userName, String laboratory, Boolean isMonth, HttpServletResponse response) throws Exception { |
| | | Map<Object, Object> data; |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setHeader("requestType","excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "requestType"); |
| | | if (!isMonth) { |
| | | data = performanceShiftService.exportToYearExcel(time, userName, laboratory); |
| | | // 设置åå
æ ¼æ ·å¼ |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleYearUtils.getHeadStyle(), StyleYearUtils.getContentStyle()); |
| | | // ä¿åå°ç¬¬ä¸ä¸ªsheetä¸ |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head((List<List<String>>) data.get("header")) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // èªéåºå宽 |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .sheet("年度") |
| | | .doWrite((Collection<?>) data.get("data")); |
| | | } else { |
| | | data = performanceShiftService.exportToMonthExcel(time, userName, laboratory); |
| | | // 设置åå
æ ¼æ ·å¼ |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleMonthUtils.getHeadStyle(), StyleMonthUtils.getContentStyle()); |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head((List<List<String>>) data.get("header")) |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .sheet("æåº¦") |
| | | .doWrite((Collection<?>) data.get("data")); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¸´æ¶æ¥å£-æ·»å 7æä»½8æä»½çæ°æ®") |
| | | @GetMapping("temporaryInterface") |
| | | public void temporaryInterface() { |
| | | System.out.println("å¼å§ç»æ¯ä¸ªäººè¿è¡æç,é»è®¤æ©ç======start"); |
| | | // TODO ç»æ¯ä¸ªäººé½è¿è¡æç(é»è®¤æ©ç) |
| | | PerformanceShiftAddDto performanceShiftAddDto = new PerformanceShiftAddDto(); |
| | | //çæ¬¡--æ©(æ¥è¯¢åå
¸) |
| | | List<SysDictData> shiftType = dictTypeService.selectDictDataByName("çæ¬¡ç±»å"); |
| | | List<String> collect = shiftType.stream().filter(enums -> enums.getDictLabel().equals("æ©")).map(enums -> enums.getDictValue()).collect(Collectors.toList()); |
| | | performanceShiftAddDto.setShift(collect.get(0)); |
| | | //人å--ææäºº |
| | | String userIds = userService.list().stream().map(user -> user.getId().toString()).distinct().collect(Collectors.joining(",")); |
| | | performanceShiftAddDto.setUserId(userIds); |
| | | //卿¬¡--å½æææ |
| | | // è·åå½åæ¥æ |
| | | LocalDate today = LocalDate.of(2024, 8, 15); |
| | | // è·åæ¬æç第ä¸å¤©åæåä¸å¤© |
| | | LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth()); |
| | | // è·åå¨å段信æ¯ï¼æ ¹æ®åºåè®¾ç½®ï¼ |
| | | WeekFields weekFields = WeekFields.of(Locale.getDefault()); |
| | | // è·åæ¬æç¬¬ä¸å¤©çå¨ä¸ |
| | | LocalDate startOfWeek = firstDayOfMonth.with(TemporalAdjusters.previousOrSame(weekFields.getFirstDayOfWeek())); |
| | | // éåæ¬æææå¤©æ°ï¼æ¾åºæ¯å¨ç第ä¸å¤©åæåä¸å¤© |
| | | LocalDate endOfWeek; |
| | | while (startOfWeek.isBefore(firstDayOfMonth.plusMonths(1))) { |
| | | endOfWeek = startOfWeek.plusDays(6); |
| | | LocalDateTime startDateTime = LocalDateTime.of(startOfWeek, LocalTime.MIDNIGHT); |
| | | LocalDateTime endDateTime = LocalDateTime.of(endOfWeek, LocalTime.MIDNIGHT); |
| | | System.out.println("Week starts on " + startDateTime + " and ends on " + endDateTime); |
| | | performanceShiftAddDto.setStartWeek(startDateTime); |
| | | performanceShiftAddDto.setEndWeek(endDateTime); |
| | | performanceShiftService.performanceShiftAdd(performanceShiftAddDto); |
| | | startOfWeek = startOfWeek.plusWeeks(1); |
| | | } |
| | | |
| | | System.out.println("æçç»æ======end"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.performance.pojo.ShiftTime; |
| | | import com.ruoyi.performance.service.ShiftTimeService; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * çæ¬¡å¯¹åºçæ¶é´ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-07-24 11:22:17 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-çæ¬¡æç") |
| | | @RestController |
| | | @RequestMapping("/shiftTime") |
| | | public class ShiftTimeController { |
| | | |
| | | @Autowired |
| | | private ShiftTimeService shiftTimeService; |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
ç½®") |
| | | @PostMapping("add") |
| | | public Result<?> shiftTimeAdd(@RequestBody ShiftTime shiftTime) { |
| | | shiftTimeService.shiftTimeAdd(shiftTime); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
ç½®æ¥è¯¢") |
| | | @PostMapping("list") |
| | | public Result<?> shiftTimeList() { |
| | | return Result.success(shiftTimeService.shiftTimeList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
ç½®å é¤") |
| | | @PostMapping("remove") |
| | | public Result<?> shiftTimeRemove(Long id) { |
| | | return Result.success(shiftTimeService.removeById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
置修æ¹") |
| | | @PostMapping("update") |
| | | public Result<?> shiftTimeUpdate(@RequestBody ShiftTime shiftTime) { |
| | | return Result.success(shiftTimeService.updateById(shiftTime)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * å·¥æ¶ç»è®¡å表 |
| | | * |
| | | * @Author zhuo |
| | | * @Date 2024/10/25 |
| | | */ |
| | | @Data |
| | | public class AuxiliaryAllDto { |
| | | |
| | | @ApiModelProperty("产éå·¥æ¶") |
| | | private BigDecimal yieldHour; |
| | | |
| | | @ApiModelProperty("è¾
å©å·¥æ¶") |
| | | private BigDecimal subsidiaryHour; |
| | | |
| | | @ApiModelProperty("æ»å·¥æ¶") |
| | | private BigDecimal totalHour; |
| | | |
| | | @ApiModelProperty("人åid") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("å§å") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("æä»½") |
| | | private String month; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class AuxiliaryCorrectionHoursDto extends AuxiliaryCorrectionHours { |
| | | |
| | | @ApiModelProperty("å§å") |
| | | @ExcelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("é¨é¨") |
| | | private String departLims; |
| | | |
| | | @ApiModelProperty("æ»å·¥æ¶") |
| | | private BigDecimal total; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | //åå§å·¥æ¶ |
| | | public class AuxiliaryOriginalHoursDto { |
| | | |
| | | @ApiModelProperty("å§å") |
| | | @ExcelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | //ä¿®æ£å·¥æ¶ |
| | | private AuxiliaryCorrectionHours auxiliaryCorrectionHours; |
| | | |
| | | @ApiModelProperty("ç±»å") |
| | | @ExcelProperty(value = "ç±»å") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("1æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "1æ¥") |
| | | private BigDecimal oneHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer one; |
| | | |
| | | @ApiModelProperty("2æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "2æ¥") |
| | | private BigDecimal twoHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer two; |
| | | |
| | | @ApiModelProperty("3æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "3æ¥") |
| | | private BigDecimal threeHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer three; |
| | | |
| | | @ApiModelProperty("4æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "4æ¥") |
| | | private BigDecimal fourHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer four; |
| | | |
| | | @ApiModelProperty("5æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "5æ¥") |
| | | private BigDecimal fiveHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer five; |
| | | |
| | | @ApiModelProperty("6æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "6æ¥") |
| | | private BigDecimal sixHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer six; |
| | | |
| | | @ApiModelProperty("7æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "7æ¥") |
| | | private BigDecimal sevenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer seven; |
| | | |
| | | @ApiModelProperty("8æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "8æ¥") |
| | | private BigDecimal eightHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer eight; |
| | | |
| | | @ApiModelProperty("9æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "9æ¥") |
| | | private BigDecimal nineHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer nine; |
| | | |
| | | @ApiModelProperty("10æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "10æ¥") |
| | | private BigDecimal tenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer ten; |
| | | |
| | | @ApiModelProperty("11æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "11æ¥") |
| | | private BigDecimal elevenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer eleven; |
| | | |
| | | @ApiModelProperty("12æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "12æ¥") |
| | | private BigDecimal twelveHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twelve; |
| | | |
| | | @ApiModelProperty("13æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "13æ¥") |
| | | private BigDecimal thirteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer thirteen; |
| | | |
| | | @ApiModelProperty("14æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "14æ¥") |
| | | private BigDecimal fourteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer fourteen; |
| | | |
| | | @ApiModelProperty("15æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "15æ¥") |
| | | private BigDecimal fifteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer fifteen; |
| | | |
| | | @ApiModelProperty("16æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "16æ¥") |
| | | private BigDecimal sixteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer sixteen; |
| | | |
| | | @ApiModelProperty("17æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "17æ¥") |
| | | private BigDecimal seventeenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer seventeen; |
| | | |
| | | @ApiModelProperty("18æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "18æ¥") |
| | | private BigDecimal eighteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer eighteen; |
| | | |
| | | @ApiModelProperty("19æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "19æ¥") |
| | | private BigDecimal nineteenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer nineteen; |
| | | |
| | | @ApiModelProperty("20æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "20æ¥") |
| | | private BigDecimal twentyHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twenty; |
| | | |
| | | @ApiModelProperty("21æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "21æ¥") |
| | | private BigDecimal twentyOneHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyOne; |
| | | |
| | | @ApiModelProperty("22æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "22æ¥") |
| | | private BigDecimal twentyTwoHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyTwo; |
| | | |
| | | @ApiModelProperty("23æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "23æ¥") |
| | | private BigDecimal twentyThreeHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyThree; |
| | | |
| | | @ApiModelProperty("24æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "24æ¥") |
| | | private BigDecimal twentyFourHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyFour; |
| | | |
| | | @ApiModelProperty("25æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "25æ¥") |
| | | private BigDecimal twentyFiveHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyFive; |
| | | |
| | | @ApiModelProperty("26æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "26æ¥") |
| | | private BigDecimal twentySixHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentySix; |
| | | |
| | | @ApiModelProperty("27æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "27æ¥") |
| | | private BigDecimal twentySevenHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentySeven; |
| | | |
| | | @ApiModelProperty("28æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "28æ¥") |
| | | private BigDecimal twentyEightHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyEight; |
| | | |
| | | @ApiModelProperty("29æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "29æ¥") |
| | | private BigDecimal twentyNineHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer twentyNine; |
| | | |
| | | @ApiModelProperty("30æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "30æ¥") |
| | | private BigDecimal thirtyHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer thirty; |
| | | |
| | | @ApiModelProperty("31æ¥å·¥æ¶") |
| | | @ExcelProperty(value = "31æ¥") |
| | | private BigDecimal thirtyOneHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer thirtyOne; |
| | | |
| | | @ApiModelProperty("æ»å·¥æ¶") |
| | | @ExcelProperty(value = "æ»å·¥æ¶") |
| | | private BigDecimal total; |
| | | |
| | | @ApiModelProperty("æä»½") |
| | | @ExcelProperty(value = "æä»½") |
| | | private String month; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | //åå§å·¥æ¶ç»è®¡çæ¥è¯¢æ¡ä»¶ |
| | | public class AuxiliaryOriginalHoursLookDto { |
| | | |
| | | @NotNull |
| | | private String month;//æä»½ |
| | | |
| | | private String name; |
| | | |
| | | private String departLims; |
| | | |
| | | |
| | | @ApiModelProperty("å¼å§æ¶é´") |
| | | private String beginDate; |
| | | |
| | | @ApiModelProperty("ç»ææ¶é´") |
| | | private String endDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class AuxiliaryOutputWorkingHoursDto extends AuxiliaryOutputWorkingHours { |
| | | |
| | | @ApiModelProperty("æ£æµäºº") |
| | | @ExcelProperty(index = 1, value = "æ£æµäºº") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("çµç¼æ è¯") |
| | | private String cableTag; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class AuxiliaryWorkingHoursDayDto extends AuxiliaryWorkingHoursDay { |
| | | |
| | | @ApiModelProperty("å§å") |
| | | @ExcelProperty(index = 1, value = "å§å") |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class HoursDay { |
| | | |
| | | // æä½, 1éè¿, 2éå |
| | | private String operation; |
| | | |
| | | private List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class PerformanceShiftAddDto { |
| | | |
| | | @NotNull(message = "è¯·éæ©çæ¬¡") |
| | | @ApiModelProperty("çæ¬¡") |
| | | private String shift; |
| | | |
| | | @NotNull(message = "è¯·éæ©åå·¥") |
| | | @ApiModelProperty("åå·¥id") |
| | | private String userId; |
| | | |
| | | @NotNull(message = "è¯·éæ©å¨æ¬¡") |
| | | @ApiModelProperty("å¼å§å¨æ¬¡") |
| | | private LocalDateTime startWeek; |
| | | |
| | | @NotNull(message = "è¯·éæ©å¨æ¬¡") |
| | | @ApiModelProperty("ç»æå¨æ¬¡") |
| | | private LocalDateTime endWeek; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PerformanceShiftMapDto { |
| | | |
| | | private String name; |
| | | |
| | | private String shiftTime; |
| | | |
| | | private String userId; |
| | | |
| | | private String department; |
| | | |
| | | private Map<String, Object> monthlyAttendance = new HashMap<>(); |
| | | |
| | | private Map<String, Object> sidebarAnnualAttendance = new HashMap<>();; |
| | | private List<Map<String, Object>> list = new ArrayList<>(); |
| | | |
| | | private List<Map<Object, Object>> headerList = new ArrayList<>(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.ruoyi.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.service.AuxiliaryCorrectionHoursService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class AuxiliaryCorrectionHoursListener extends AnalysisEventListener<AuxiliaryCorrectionHoursDto> { |
| | | |
| | | private static final int BATCH_COUNT = 1000; |
| | | List<AuxiliaryCorrectionHoursDto> list = new ArrayList<>(); |
| | | |
| | | private AuxiliaryCorrectionHoursService auxiliaryCorrectionHoursService; |
| | | |
| | | public AuxiliaryCorrectionHoursListener(AuxiliaryCorrectionHoursService auxiliaryCorrectionHoursService) { |
| | | this.auxiliaryCorrectionHoursService = auxiliaryCorrectionHoursService; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(AuxiliaryCorrectionHoursDto data, AnalysisContext analysisContext) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | save(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | save(); |
| | | } |
| | | |
| | | |
| | | private void save() { |
| | | auxiliaryCorrectionHoursService.importExcel(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-29 02:38:19 |
| | | */ |
| | | public interface AuxiliaryCorrectionHoursMapper extends BaseMapper<AuxiliaryCorrectionHours> { |
| | | |
| | | IPage<AuxiliaryCorrectionHoursDto> selectAuxiliaryCorrectionHours(Page page, @Param("ew") QueryWrapper<AuxiliaryCorrectionHoursDto> ew, @Param("ids") List<Long> ids); |
| | | |
| | | List<Integer> selDepartLimsByName(String departLims); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface AuxiliaryOriginalHoursMapper { |
| | | |
| | | //æ¥è¯¢è¯¥æçæ»å·¥æ¶ |
| | | List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Integer> ids); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.performance.dto.AuxiliaryAllDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡çç产éå·¥æ¶ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 03:48:48 |
| | | */ |
| | | public interface AuxiliaryOutputWorkingHoursMapper extends BaseMapper<AuxiliaryOutputWorkingHours> { |
| | | |
| | | IPage<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHours(Page page, @Param("ew") QueryWrapper<AuxiliaryOutputWorkingHoursDto> ew, @Param("ids") List<Long> ids); |
| | | |
| | | //æ¥è¯¢ç»è®¡å·¥æ¶å¯¼åºæ°æ® |
| | | List<AuxiliaryOutputWorkingHoursDto> selectDataByUser(@Param("ids") List<Long> ids); |
| | | |
| | | //æ¥è¯¢è¯¥æç产éå·¥æ¶ |
| | | List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Long> ids, @Param("type") String type); |
| | | |
| | | |
| | | List<AuxiliaryOutputWorkingHours> selectListByIds(@Param("ids") List<Long> ids); |
| | | |
| | | List<AuxiliaryOutputWorkingHours> selectLists(@Param("ew") QueryWrapper<AuxiliaryOutputWorkingHours> ew, @Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * æ¥è¯¢ |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | List<AuxiliaryAllDto> selectAuxiliaryAllByMonth(@Param("dto") AuxiliaryOriginalHoursLookDto dto, @Param("userIds") List<Long> userIds); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¾
å©å·¥æ¶ |
| | | * @param dto |
| | | * @param userIds |
| | | * @return |
| | | */ |
| | | List<AuxiliaryAllDto> selectSubsidiaryAllByMonth(@Param("dto") AuxiliaryOriginalHoursLookDto dto, @Param("userIds") List<Long> userIds); |
| | | |
| | | List<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHoursList(@Param("ew") QueryWrapper<AuxiliaryOutputWorkingHoursDto> ew, @Param("ids") List<Long> ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.performance.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 02:22:19 |
| | | */ |
| | | public interface AuxiliaryWorkingHoursDayMapper extends BaseMapper<AuxiliaryWorkingHoursDay> { |
| | | |
| | | IPage<AuxiliaryWorkingHoursDayDto> selectAuxiliaryWorkingHoursDay(Page page, @Param("ew") QueryWrapper<AuxiliaryWorkingHoursDayDto> ew, @Param("ids") List<Long> ids); |
| | | |
| | | //æ¥è¯¢è¾
å©å·¥æ¶å¯¼åºä¿¡æ¯ |
| | | List<AuxiliaryWorkingHoursDayDto> selectDataByUser(@Param("ids") List<Long> ids); |
| | | |
| | | List<AuxiliaryWorkingHoursDay> selectListByIds(@Param("ids") List<Long> ids); |
| | | |
| | | //æ¥è¯¢è¯¥æçè¾
å©å·¥æ¶ |
| | | List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Long> ids); |
| | | |
| | | List<AuxiliaryWorkingHoursDay> selectLists(@Param("ew") QueryWrapper<AuxiliaryWorkingHoursDay> ew, @Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¾
å©å·¥æ¶éå |
| | | * @param ew |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<AuxiliaryWorkingHoursDayDto> selectAuxiliaryWorkingHoursDayList(@Param("ew") QueryWrapper<AuxiliaryWorkingHoursDayDto> ew, @Param("ids") List<Long> ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.performance.pojo.AuxiliaryWorkingHours; |
| | | |
| | | /** |
| | | * <p> |
| | | * è¾
å©å·¥æ¶ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-09 06:58:31 |
| | | */ |
| | | public interface AuxiliaryWorkingHoursMapper extends BaseMapper<AuxiliaryWorkingHours> { |
| | | IPage<AuxiliaryWorkingHours> selectAuxiliaryWorkingHours(Page page, QueryWrapper<AuxiliaryWorkingHours> ew); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.mybatis_config.MyBaseMapper; |
| | | import com.ruoyi.performance.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 绩æç®¡ç-çæ¬¡ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-08 09:12:04 |
| | | */ |
| | | public interface PerformanceShiftMapper extends MyBaseMapper<PerformanceShift> { |
| | | |
| | | IPage<PerformanceShiftMapDto> performanceShiftPage( |
| | | Page<Object> page, |
| | | @Param("time") String time, |
| | | @Param("userName") String userName, |
| | | @Param("laboratory") String laboratory |
| | | ); |
| | | |
| | | List<Map<String, Object>> performanceShiftYearPage(@Param("time") String time, |
| | | @Param("userName") String userName, |
| | | @Param("laboratory") String laboratory); |
| | | |
| | | IPage<Map<String, Object>> performanceShiftYear(Page<Object> page, String time, String userName, String laboratory); |
| | | |
| | | List<Map<String, Object>> performanceShiftYearList(String time, String userName, String laboratory); |
| | | |
| | | List<PerformanceShiftMapDto> performanceShiftList(String time, String userName, String laboratory); |
| | | |
| | | String seldepLimsId(int depLimsId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.performance.pojo.ShiftTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * çæ¬¡å¯¹åºçæ¶é´ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-07-24 11:22:17 |
| | | */ |
| | | public interface ShiftTimeMapper extends BaseMapper<ShiftTime> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-29 02:38:19 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("auxiliary_correction_hours") |
| | | @ApiModel(value = "AuxiliaryCorrectionHours对象", description = "å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶") |
| | | public class AuxiliaryCorrectionHours implements Serializable { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å§åid") |
| | | private Integer nameUser; |
| | | |
| | | @ApiModelProperty("ç±»å") |
| | | @ExcelProperty(value = "ç±»å") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("1") |
| | | @ExcelProperty(value = "1æ¥") |
| | | private BigDecimal oneHours; |
| | | |
| | | @ApiModelProperty("2") |
| | | @ExcelProperty(value = "2æ¥") |
| | | private BigDecimal twoHours; |
| | | |
| | | @ApiModelProperty("3") |
| | | @ExcelProperty(value = "3æ¥") |
| | | private BigDecimal threeHours; |
| | | |
| | | @ApiModelProperty("4") |
| | | @ExcelProperty(value = "4æ¥") |
| | | private BigDecimal fourHours; |
| | | |
| | | @ApiModelProperty("5") |
| | | @ExcelProperty(value = "5æ¥") |
| | | private BigDecimal fiveHours; |
| | | |
| | | @ApiModelProperty("6") |
| | | @ExcelProperty(value = "6æ¥") |
| | | private BigDecimal sixHours; |
| | | |
| | | @ApiModelProperty("7") |
| | | @ExcelProperty(value = "7æ¥") |
| | | private BigDecimal sevenHours; |
| | | |
| | | @ApiModelProperty("8") |
| | | @ExcelProperty(value = "8æ¥") |
| | | private BigDecimal eightHours; |
| | | |
| | | @ApiModelProperty("9") |
| | | @ExcelProperty(value = "9æ¥") |
| | | private BigDecimal nineHours; |
| | | |
| | | @ApiModelProperty("10") |
| | | @ExcelProperty(value = "10æ¥") |
| | | private BigDecimal tenHours; |
| | | |
| | | @ApiModelProperty("11") |
| | | @ExcelProperty(value = "11æ¥") |
| | | private BigDecimal elevenHours; |
| | | |
| | | @ApiModelProperty("12") |
| | | @ExcelProperty(value = "12æ¥") |
| | | private BigDecimal twelveHours; |
| | | |
| | | @ApiModelProperty("13") |
| | | @ExcelProperty(value = "13æ¥") |
| | | private BigDecimal thirteenHours; |
| | | |
| | | @ApiModelProperty("14") |
| | | @ExcelProperty(value = "14æ¥") |
| | | private BigDecimal fourteenHours; |
| | | |
| | | @ApiModelProperty("15") |
| | | @ExcelProperty(value = "15æ¥") |
| | | private BigDecimal fifteenHours; |
| | | |
| | | @ApiModelProperty("16") |
| | | @ExcelProperty(value = "16æ¥") |
| | | private BigDecimal sixteenHours; |
| | | |
| | | @ApiModelProperty("17") |
| | | @ExcelProperty(value = "17æ¥") |
| | | private BigDecimal seventeenHours; |
| | | |
| | | @ApiModelProperty("18") |
| | | @ExcelProperty(value = "18æ¥") |
| | | private BigDecimal eighteenHours; |
| | | |
| | | @ApiModelProperty("19") |
| | | @ExcelProperty(value = "19æ¥") |
| | | private BigDecimal nineteenHours; |
| | | |
| | | @ApiModelProperty("20") |
| | | @ExcelProperty(value = "20æ¥") |
| | | private BigDecimal twentyHours; |
| | | |
| | | @ApiModelProperty("21") |
| | | @ExcelProperty(value = "21æ¥") |
| | | private BigDecimal twentyOneHours; |
| | | |
| | | @ApiModelProperty("22") |
| | | @ExcelProperty(value = "22æ¥") |
| | | private BigDecimal twentyTwoHours; |
| | | |
| | | @ApiModelProperty("23") |
| | | @ExcelProperty(value = "23æ¥") |
| | | private BigDecimal twentyThreeHours; |
| | | |
| | | @ApiModelProperty("24") |
| | | @ExcelProperty(value = "24æ¥") |
| | | private BigDecimal twentyFourHours; |
| | | |
| | | @ApiModelProperty("25") |
| | | @ExcelProperty(value = "25æ¥") |
| | | private BigDecimal twentyFiveHours; |
| | | |
| | | @ApiModelProperty("26") |
| | | @ExcelProperty(value = "26æ¥") |
| | | private BigDecimal twentySixHours; |
| | | |
| | | @ApiModelProperty("27") |
| | | @ExcelProperty(value = "27æ¥") |
| | | private BigDecimal twentySevenHours; |
| | | |
| | | @ApiModelProperty("28") |
| | | @ExcelProperty(value = "28æ¥") |
| | | private BigDecimal twentyEightHours; |
| | | |
| | | @ApiModelProperty("29") |
| | | @ExcelProperty(value = "29æ¥") |
| | | private BigDecimal twentyNineHours; |
| | | |
| | | @ApiModelProperty("30") |
| | | @ExcelProperty(value = "30æ¥") |
| | | private BigDecimal thirtyHours; |
| | | |
| | | @ApiModelProperty("31") |
| | | @ExcelProperty(value = "31æ¥") |
| | | private BigDecimal thirtyOneHours; |
| | | |
| | | @ApiModelProperty("æä»½") |
| | | @ExcelProperty(value = "æä»½") |
| | | private String month; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡çç产éå·¥æ¶ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 03:48:48 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("auxiliary_output_working_hours") |
| | | @ApiModel(value = "AuxiliaryOutputWorkingHours对象", description = "æ¥å·¥æ¶ç®¡çç产éå·¥æ¶") |
| | | @ExcelIgnoreUnannotated |
| | | public class AuxiliaryOutputWorkingHours implements Serializable { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("æ£æµé¡¹åç±»") |
| | | @ExcelProperty(index = 2, value = "æ£æµé¡¹åç±»") |
| | | private String inspectionItemClass; |
| | | |
| | | @ApiModelProperty("æ£æµé¡¹") |
| | | @ExcelProperty(index = 3, value = "æ£æµé¡¹") |
| | | private String inspectionItem; |
| | | |
| | | @ApiModelProperty("æ£æµå项") |
| | | @ExcelProperty(index = 4, value = "æ£æµå项") |
| | | private String inspectionItemSubclass; |
| | | |
| | | @ApiModelProperty("æ ·åid") |
| | | private Integer sampleId; |
| | | |
| | | @ApiModelProperty("æ ·åç¼å·") |
| | | @ExcelProperty(index = 6, value = "æ ·åç¼å·") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty("å çå§æåå·") |
| | | private String overtimeOrderNo; |
| | | |
| | | @ApiModelProperty("å çå·¥æ¶") |
| | | private BigDecimal overtimeWorkTime; |
| | | |
| | | @ApiModelProperty("å çæ°é") |
| | | private Integer overtimeAmount; |
| | | |
| | | @ApiModelProperty("éå çå§æåå·") |
| | | private Integer orderId; |
| | | |
| | | @ApiModelProperty("å§æåå·") |
| | | @ExcelProperty(index = 5, value = "å§æåå·") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("å·¥æ¶") |
| | | private BigDecimal workTime; |
| | | |
| | | @ApiModelProperty("æ°é") |
| | | private Integer amount; |
| | | |
| | | @ApiModelProperty("产éå·¥æ¶") |
| | | @ExcelProperty(index = 7, value = "产éå·¥æ¶") |
| | | private BigDecimal outputWorkTime; |
| | | |
| | | @ApiModelProperty("æ¥æ") |
| | | @ExcelProperty(index = 10, value = "æ¥æ") |
| | | private String dateTime; |
| | | |
| | | @ApiModelProperty("卿¬¡") |
| | | @ExcelProperty(index = 11, value = "卿¬¡") |
| | | private String week; |
| | | |
| | | @ApiModelProperty("ææ") |
| | | @ExcelProperty(index = 12, value = "ææ") |
| | | private String weekDay; |
| | | |
| | | @ApiModelProperty("æ£æµäººid") |
| | | @TableField("`check`") |
| | | private Integer check; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("å·¥æ¶åç»") |
| | | @ExcelProperty(index = 8, value = "å·¥æ¶åç»") |
| | | private String manHourGroup; |
| | | |
| | | @ApiModelProperty("åä»·") |
| | | @ExcelProperty(index = 9, value = "åä»·") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty("æ£éªé¡¹id") |
| | | private Integer insProductId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * è¾
å©å·¥æ¶ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-09 06:58:31 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("auxiliary_working_hours") |
| | | @ApiModel(value = "AuxiliaryWorkingHours对象", description = "è¾
å©å·¥æ¶") |
| | | public class AuxiliaryWorkingHours implements Serializable { |
| | | @ApiModelProperty("主é®ID") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @ApiModelProperty("ç¼å·") |
| | | private String number; |
| | | @ApiModelProperty("è¾
å©é¡¹ç®åç§°") |
| | | private String auxiliaryProject; |
| | | @ApiModelProperty("æ ¸åå·¥æ¶") |
| | | private BigDecimal approvedWorkingHour; |
| | | @ApiModelProperty("夿³¨") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("é¨é¨") |
| | | private String department; |
| | | @ApiModelProperty("å®éªå®¤") |
| | | private String laboratory; |
| | | @ApiModelProperty("åä½") |
| | | private String unit; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 02:22:19 |
| | | */ |
| | | @Data |
| | | @TableName("auxiliary_working_hours_day") |
| | | @ApiModel(value = "AuxiliaryWorkingHoursDay对象", description = "æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶") |
| | | @ExcelIgnoreUnannotated |
| | | public class AuxiliaryWorkingHoursDay implements Serializable { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å§åid") |
| | | private Integer nameUser; |
| | | |
| | | @ApiModelProperty("ç¼å·") |
| | | @ExcelProperty(index = 2, value = "ç¼å·") |
| | | private String number; |
| | | |
| | | @ApiModelProperty("è¾
å©é¡¹ç®åç§°") |
| | | @ExcelProperty(index = 3, value = "è¾
å©é¡¹ç®åç§°") |
| | | private String auxiliaryProject; |
| | | |
| | | @ApiModelProperty("æ ¸åå·¥æ¶") |
| | | @ExcelProperty(index = 5, value = "æ ¸åå·¥æ¶") |
| | | private BigDecimal approvedWorkingHour; |
| | | |
| | | @ApiModelProperty("æ°é") |
| | | @ExcelProperty(index = 6, value = "æ°é") |
| | | private Integer amount; |
| | | |
| | | @ApiModelProperty("è¾
å©å·¥æ¶") |
| | | @ExcelProperty(index = 7, value = "è¾
å©å·¥æ¶") |
| | | private BigDecimal nonproductiveTime; |
| | | |
| | | @ApiModelProperty("è¾
å©è¯´æ") |
| | | @ExcelProperty(index = 8, value = "è¾
å©è¯´æ") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty("夿 ¸äºº") |
| | | @ExcelProperty(index = 9, value = "夿 ¸äºº") |
| | | private String reviewer; |
| | | |
| | | @ApiModelProperty("夿 ¸æ°é") |
| | | @ExcelProperty(index = 10, value = "夿 ¸æ°é") |
| | | private Integer reviewerNumber; |
| | | |
| | | @ApiModelProperty("夿 ¸å·¥æ¶") |
| | | @ExcelProperty(index = 11, value = "夿 ¸å·¥æ¶") |
| | | private BigDecimal reviewerNonproductiveTime; |
| | | |
| | | @ApiModelProperty("夿 ¸è¯´æ") |
| | | @ExcelProperty(index = 12, value = "夿 ¸è¯´æ") |
| | | private String reviewerRemark; |
| | | |
| | | @ApiModelProperty("å¹´") |
| | | @ExcelProperty(index = 13, value = "å¹´") |
| | | private String year; |
| | | |
| | | @ApiModelProperty("çæ¬¡") |
| | | @ExcelProperty(index = 14, value = "çæ¬¡") |
| | | private String shift; |
| | | |
| | | @ApiModelProperty("卿¬¡") |
| | | @ExcelProperty(index = 15, value = "卿¬¡") |
| | | private String week; |
| | | |
| | | @ApiModelProperty("ææ") |
| | | @ExcelProperty(index = 16, value = "ææ") |
| | | private String weekDay; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | @ExcelProperty(index = 4, value = "ç¶æ") |
| | | private String state; |
| | | |
| | | @ApiModelProperty("æ¥æ") |
| | | @ExcelProperty(index = 17, value = "æ¥æ") |
| | | private String dateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 绩æç®¡ç-çæ¬¡ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-08 09:12:04 |
| | | */ |
| | | @Data |
| | | @TableName("performance_shift") |
| | | @ApiModel(value = "PerformanceShift对象", description = "绩æç®¡ç-çæ¬¡") |
| | | public class PerformanceShift implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主é®ID") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("çæ¬¡") |
| | | private String shift; |
| | | |
| | | @ApiModelProperty("åå·¥id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("æçæ¥æ") |
| | | private LocalDateTime workTime; |
| | | |
| | | @ApiModelProperty("å建人Id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("åå»ºæ¥æ") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * çæ¬¡å¯¹åºçæ¶é´ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-07-24 11:22:17 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("shift_time") |
| | | @ApiModel(value = "ShiftTime对象", description = "çæ¬¡å¯¹åºçæ¶é´") |
| | | public class ShiftTime implements Serializable { |
| | | |
| | | @ApiModelProperty("主é®ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("çæ¬¡") |
| | | private String shift; |
| | | |
| | | @ApiModelProperty("å¼å§æ¶é´") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("ç»ææ¶é´") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty("å建人Id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("åå»ºæ¥æ") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°äººId") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | 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.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-29 02:38:19 |
| | | */ |
| | | public interface AuxiliaryCorrectionHoursService extends IService<AuxiliaryCorrectionHours> { |
| | | |
| | | IPage<AuxiliaryCorrectionHoursDto> selectAuxiliaryCorrectionHours(Page page, AuxiliaryCorrectionHoursDto auxiliaryCorrectionHoursDto); |
| | | |
| | | /** |
| | | * 导å
¥ä¸ä¼ |
| | | * @param list |
| | | */ |
| | | void importExcel(List<AuxiliaryCorrectionHoursDto> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.performance.dto.AuxiliaryAllDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface AuxiliaryOriginalHoursService { |
| | | |
| | | IPage<AuxiliaryOriginalHoursDto> selectAuxiliaryOriginalHours(Page page, AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto); |
| | | |
| | | /** |
| | | * 导åºåå§å·¥æ¶ |
| | | * |
| | | * @param response |
| | | */ |
| | | void exportWorkingHours(String month, String name, String departLims,HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»½å
¨é¨å·¥æ¶ |
| | | * @return |
| | | */ |
| | | List<AuxiliaryAllDto> selectAuxiliaryAllByMonth(AuxiliaryOriginalHoursLookDto dto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | 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.performance.dto.AuxiliaryOutputWorkingHoursDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡çç产éå·¥æ¶ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 03:48:48 |
| | | */ |
| | | public interface AuxiliaryOutputWorkingHoursService extends IService<AuxiliaryOutputWorkingHours> { |
| | | |
| | | IPage<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHours(Page page, AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto); |
| | | |
| | | /** |
| | | * ç»è®¡äº§éå·¥æ¶æ±æ»åè¾
å©å·¥æ¶æ±æ» |
| | | * @return |
| | | */ |
| | | Map<String,Object> collectWorkingHours(AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | * @throws IOException |
| | | */ |
| | | void exportWorkingHours(HttpServletResponse response)throws IOException; |
| | | |
| | | /** |
| | | * 导åºäº§éå·¥æ¶ |
| | | * @param entity |
| | | * @param response |
| | | */ |
| | | void exportOutputHours(AuxiliaryOutputWorkingHoursDto entity, HttpServletResponse response); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | 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.performance.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.ruoyi.performance.dto.HoursDay; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 02:22:19 |
| | | */ |
| | | public interface AuxiliaryWorkingHoursDayService extends IService<AuxiliaryWorkingHoursDay> { |
| | | |
| | | IPage<AuxiliaryWorkingHoursDayDto> selectAuxiliaryWorkingHoursDay(Page page, AuxiliaryWorkingHoursDayDto auxiliaryWorkingHoursDayDto); |
| | | |
| | | int insertAuxiliaryWorkingHoursDay(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay); |
| | | |
| | | AuxiliaryWorkingHoursDay selectAuxiliaryWorkingHoursByNumber(String number); |
| | | |
| | | boolean checkOrApprove(HoursDay hoursDay); |
| | | |
| | | int updateAuxiliaryWorkingHoursDay(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay); |
| | | |
| | | int deleteAuxiliaryWorkingHoursDay(Integer id); |
| | | |
| | | String selectshiftByUser(LocalDateTime dateTime); |
| | | |
| | | /** |
| | | * 导åºè¾
å©å·¥æ¶ |
| | | * @param entity |
| | | * @param response |
| | | */ |
| | | void exportWorkingHours(AuxiliaryWorkingHoursDayDto entity, HttpServletResponse response); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | 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.performance.pojo.AuxiliaryWorkingHours; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * è¾
å©å·¥æ¶ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-09 06:58:31 |
| | | */ |
| | | public interface AuxiliaryWorkingHoursService extends IService<AuxiliaryWorkingHours> { |
| | | IPage<AuxiliaryWorkingHours> selectAuxiliaryWorkingHours(Page page, AuxiliaryWorkingHours auxiliaryWorkingHours); |
| | | |
| | | int deleteAuxiliaryWorkingHours(Integer id); |
| | | |
| | | int upAuxiliaryWorkingHours(AuxiliaryWorkingHours auxiliaryWorkingHours); |
| | | |
| | | int insertAuxiliaryWorkingHours(AuxiliaryWorkingHours auxiliaryWorkingHours); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | 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.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 绩æç®¡ç-çæ¬¡ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-08 09:12:04 |
| | | */ |
| | | public interface PerformanceShiftService extends IService<PerformanceShift> { |
| | | |
| | | void performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto); |
| | | |
| | | Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory); |
| | | |
| | | void performanceShiftUpdate(PerformanceShift performanceShift); |
| | | |
| | | IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, String laboratory); |
| | | |
| | | Map<Object, Object> exportToYearExcel(String time, String userName, String laboratory) throws Exception; |
| | | |
| | | Map<Object, Object> exportToMonthExcel(String time, String userName, String laboratory); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.performance.pojo.ShiftTime; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * çæ¬¡å¯¹åºçæ¶é´ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-07-24 11:22:17 |
| | | */ |
| | | public interface ShiftTimeService extends IService<ShiftTime> { |
| | | |
| | | void shiftTimeAdd(ShiftTime shiftTime); |
| | | |
| | | List<ShiftTime> shiftTimeList(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.mapper.AuxiliaryCorrectionHoursMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | import com.ruoyi.performance.service.AuxiliaryCorrectionHoursService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.apache.commons.math3.analysis.function.Power; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥æ¶ç»è®¡çä¿®æ£å·¥æ¶ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-29 02:38:19 |
| | | */ |
| | | @Service |
| | | public class AuxiliaryCorrectionHoursServiceImpl extends ServiceImpl<AuxiliaryCorrectionHoursMapper, AuxiliaryCorrectionHours> implements AuxiliaryCorrectionHoursService { |
| | | |
| | | @Resource |
| | | AuxiliaryCorrectionHoursMapper auxiliaryCorrectionHoursMapper; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<AuxiliaryCorrectionHoursDto> selectAuxiliaryCorrectionHours(Page page, AuxiliaryCorrectionHoursDto auxiliaryCorrectionHoursDto) { |
| | | List<Long> ids = new ArrayList<>(); |
| | | String departLims = auxiliaryCorrectionHoursDto.getDepartLims(); |
| | | auxiliaryCorrectionHoursDto.setDepartLims(null); |
| | | if (ObjectUtils.isNotEmpty(departLims)) { |
| | | //å
æ¨¡ç³æ¥è¯¢åºæ¥id |
| | | List<Integer> ides = auxiliaryCorrectionHoursMapper.selDepartLimsByName(departLims); |
| | | for (Integer ide : ides) { |
| | | List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery() |
| | | .like(User::getDepartLimsId, ide)); |
| | | if (ObjectUtils.isNotEmpty(users)) { |
| | | ids.clear(); |
| | | ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |
| | | if (ids.size() == 0) { |
| | | ids = null; |
| | | } |
| | | return auxiliaryCorrectionHoursMapper.selectAuxiliaryCorrectionHours(page, QueryWrappers.queryWrappers(auxiliaryCorrectionHoursDto).eq("month", auxiliaryCorrectionHoursDto.getMonth()), ids); |
| | | } |
| | | |
| | | //导å
¥ä¸ä¼ |
| | | @Override |
| | | public void importExcel(List<AuxiliaryCorrectionHoursDto> list) { |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | return; |
| | | } |
| | | List<AuxiliaryCorrectionHours> auxiliaryCorrectionHoursList = new ArrayList<>(); |
| | | List<AuxiliaryCorrectionHours> auxiliaryCorrectionHoursList1 = new ArrayList<>(); |
| | | for (AuxiliaryCorrectionHoursDto auxiliaryCorrectionHoursDto : list) { |
| | | AuxiliaryCorrectionHours auxiliaryCorrectionHours = new AuxiliaryCorrectionHours(); |
| | | User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getName, auxiliaryCorrectionHoursDto.getName())); |
| | | if (ObjectUtils.isEmpty(user)) { |
| | | throw new RuntimeException("ç³»ç»æ²¡ææ¥å°" + auxiliaryCorrectionHoursDto.getName() + "è¿ä¸ªç¨æ·ä¿¡æ¯!"); |
| | | } |
| | | String regex = "\\d{4}-\\d{2}"; |
| | | if (!Pattern.matches(regex, auxiliaryCorrectionHoursDto.getMonth())) { |
| | | throw new RuntimeException(auxiliaryCorrectionHoursDto.getMonth() + "æ ¼å¼ä¸æ£ç¡®,æä»½æ ¼å¼åºä¸ºyyyy-MM"); |
| | | } |
| | | BeanUtils.copyProperties(auxiliaryCorrectionHoursDto, auxiliaryCorrectionHours); |
| | | auxiliaryCorrectionHours.setNameUser(user.getId().intValue()); |
| | | AuxiliaryCorrectionHours auxiliaryCorrectionHours1 = auxiliaryCorrectionHoursMapper.selectOne(Wrappers.<AuxiliaryCorrectionHours>lambdaQuery() |
| | | .eq(AuxiliaryCorrectionHours::getNameUser, user.getId()) |
| | | .eq(AuxiliaryCorrectionHours::getType, auxiliaryCorrectionHours.getType()) |
| | | .eq(AuxiliaryCorrectionHours::getMonth, auxiliaryCorrectionHours.getMonth())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours1)) { |
| | | auxiliaryCorrectionHoursList1.add(auxiliaryCorrectionHours); |
| | | } else { |
| | | auxiliaryCorrectionHoursList.add(auxiliaryCorrectionHours); |
| | | } |
| | | } |
| | | //æ¹éæ°å¢ |
| | | saveBatch(auxiliaryCorrectionHoursList); |
| | | //æ¹éä¿®æ¹ |
| | | updateBatchById(auxiliaryCorrectionHoursList1); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.performance.dto.AuxiliaryAllDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryCorrectionHoursDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryOriginalHoursLookDto; |
| | | import com.ruoyi.performance.mapper.AuxiliaryCorrectionHoursMapper; |
| | | import com.ruoyi.performance.mapper.AuxiliaryOriginalHoursMapper; |
| | | import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; |
| | | import com.ruoyi.performance.mapper.AuxiliaryWorkingHoursDayMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryCorrectionHours; |
| | | import com.ruoyi.performance.service.AuxiliaryOriginalHoursService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.apache.commons.math3.analysis.function.Power; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class AuxiliaryOriginalHoursServiceImpl implements AuxiliaryOriginalHoursService { |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryOriginalHoursMapper auxiliaryOriginalHoursMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryWorkingHoursDayMapper auxiliaryWorkingHoursDayMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryCorrectionHoursMapper auxiliaryCorrectionHoursMapper; |
| | | |
| | | @Override |
| | | public IPage<AuxiliaryOriginalHoursDto> selectAuxiliaryOriginalHours(Page page, AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto) { |
| | | List<Long> ids = new ArrayList<>(); |
| | | String departLims = auxiliaryOriginalHoursLookDto.getDepartLims(); |
| | | auxiliaryOriginalHoursLookDto.setDepartLims(null); |
| | | String name = auxiliaryOriginalHoursLookDto.getName(); |
| | | auxiliaryOriginalHoursLookDto.setName(null); |
| | | if (ObjectUtils.isNotEmpty(departLims)) { |
| | | //å
æ¨¡ç³æ¥è¯¢åºæ¥id |
| | | List<Integer> ides = auxiliaryCorrectionHoursMapper.selDepartLimsByName(departLims); |
| | | for (Integer ide : ides) { |
| | | List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery() |
| | | .like(User::getDepartLimsId, ide)); |
| | | if (ObjectUtils.isNotEmpty(users)) { |
| | | ides.clear(); |
| | | ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList())); |
| | | } |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | ids.clear(); |
| | | ids.add(userMapper.selectOne(Wrappers.<User>lambdaQuery().like(User::getName, name)).getId()); |
| | | } |
| | | if (ids.size() == 0) { |
| | | ids = null; |
| | | } |
| | | IPage<AuxiliaryOriginalHoursDto> originalHoursDtoIPage = new Page<>(); |
| | | originalHoursDtoIPage.setSize(page.getSize()); |
| | | originalHoursDtoIPage.setCurrent(page.getCurrent()); |
| | | List<AuxiliaryOriginalHoursDto> auxiliaryOriginalHoursDtos = new ArrayList<>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data1 = new HashMap<>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data2 = new HashMap<>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data3 = new HashMap<>(); |
| | | //产éå·¥æ¶ |
| | | List<Map<String, Object>> maps = auxiliaryOutputWorkingHoursMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids, "产éå·¥æ¶"); |
| | | if (ObjectUtils.isNotEmpty(maps)) { |
| | | data1 = getData(maps, "产éå·¥æ¶"); |
| | | auxiliaryOriginalHoursDtos.addAll(data1.values()); |
| | | } |
| | | //è¾
å©å·¥æ¶ |
| | | List<Map<String, Object>> maps1 = auxiliaryWorkingHoursDayMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids); |
| | | if (ObjectUtils.isNotEmpty(maps1)) { |
| | | data2 = getData(maps1, "è¾
å©å·¥æ¶"); |
| | | auxiliaryOriginalHoursDtos.addAll(data2.values()); |
| | | } |
| | | //å çå·¥æ¶ |
| | | List<Map<String, Object>> maps2 = auxiliaryOutputWorkingHoursMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids, "å çå·¥æ¶"); |
| | | if (ObjectUtils.isNotEmpty(maps2)) { |
| | | data3 = getData(maps2, "å çå·¥æ¶"); |
| | | auxiliaryOriginalHoursDtos.addAll(data3.values()); |
| | | } |
| | | //æ»å·¥æ¶=产éå·¥æ¶+è¾
å©å·¥æ¶+å çå·¥æ¶ |
| | | Map<String, AuxiliaryOriginalHoursDto> data4 = new HashMap<String, AuxiliaryOriginalHoursDto>(); |
| | | if (data1.size() > 0) { |
| | | Map<String, AuxiliaryOriginalHoursDto> data5 = data1; |
| | | if (data2.size() > 0) { |
| | | merge(data5, data4, data2); |
| | | } |
| | | if (data3.size() > 0) { |
| | | // merge(data5,data4,data3); |
| | | } |
| | | if (data2.size() == 0 && data3.size() == 0) { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> entry : data5.entrySet()) { |
| | | AuxiliaryOriginalHoursDto dto = entry.getValue(); |
| | | AuxiliaryOriginalHoursDto originalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | BeanUtils.copyProperties(dto, originalHoursDto); |
| | | originalHoursDto.setType("æ»å·¥æ¶"); |
| | | data4.put(entry.getKey(), originalHoursDto); |
| | | } |
| | | } |
| | | auxiliaryOriginalHoursDtos.addAll(data4.values()); |
| | | } |
| | | |
| | | auxiliaryOriginalHoursDtos = auxiliaryOriginalHoursDtos.stream().sorted(Comparator.comparing(AuxiliaryOriginalHoursDto::getName)).collect(Collectors.toList()); |
| | | // æ£æ¥æ¯ä¸ªäººçå·¥æ¶ç±»åï¼è¡¥å
¨ç¼ºå°çå·¥æ¶ |
| | | Map<String, Set<String>> workHoursMap = new HashMap<>(); |
| | | String[] requiredHours = {"产éå·¥æ¶", "è¾
å©å·¥æ¶", "å çå·¥æ¶", "æ»å·¥æ¶"}; |
| | | for (AuxiliaryOriginalHoursDto dto : auxiliaryOriginalHoursDtos) { |
| | | workHoursMap.computeIfAbsent(dto.getName(), k -> new HashSet<>()).add(dto.getType()); |
| | | } |
| | | List<AuxiliaryOriginalHoursDto> result = auxiliaryOriginalHoursDtos; |
| | | for (String name1 : workHoursMap.keySet()) { |
| | | Set<String> workTypes = workHoursMap.get(name1); |
| | | for (String requiredHour : requiredHours) { |
| | | if (!workTypes.contains(requiredHour)) { |
| | | AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | auxiliaryOriginalHoursDto.setName(name1); |
| | | auxiliaryOriginalHoursDto.setAuxiliaryCorrectionHours(null); |
| | | auxiliaryOriginalHoursDto.setType(requiredHour); |
| | | auxiliaryOriginalHoursDto.setMonth(auxiliaryOriginalHoursLookDto.getMonth()); |
| | | result.add(auxiliaryOriginalHoursDto); |
| | | } |
| | | } |
| | | } |
| | | List<String> order = Arrays.asList("产éå·¥æ¶", "è¾
å©å·¥æ¶", "å çå·¥æ¶", "æ»å·¥æ¶"); |
| | | Comparator<AuxiliaryOriginalHoursDto> comparator = Comparator.comparingInt(dto -> { |
| | | String type = dto.getType(); |
| | | return order.indexOf(type) == -1 ? order.size() : order.indexOf(type); |
| | | }); |
| | | result = result.stream().sorted(Comparator.comparing(AuxiliaryOriginalHoursDto::getName).thenComparing(comparator)).collect(Collectors.toList()); |
| | | originalHoursDtoIPage.setRecords(result); |
| | | originalHoursDtoIPage.setTotal(result.size()); |
| | | return originalHoursDtoIPage; |
| | | } |
| | | |
| | | |
| | | //导åºåå§å·¥æ¶ |
| | | @Override |
| | | public void exportWorkingHours(String month, String name, String departLims, HttpServletResponse response) throws IOException { |
| | | List<AuxiliaryOriginalHoursDto> auxiliaryOriginalHoursDtos = new ArrayList<AuxiliaryOriginalHoursDto>(); |
| | | //æ¥è¯¢åå§å·¥æ¶(使ç¨å页æ¥è¯¢) |
| | | AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto = new AuxiliaryOriginalHoursLookDto(); |
| | | if (ObjectUtils.isNotEmpty(month)) { |
| | | auxiliaryOriginalHoursLookDto.setMonth(month); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | auxiliaryOriginalHoursLookDto.setName(name); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(departLims)) { |
| | | auxiliaryOriginalHoursLookDto.setDepartLims(departLims); |
| | | } |
| | | IPage<AuxiliaryOriginalHoursDto> body = selectAuxiliaryOriginalHours(new Page(-1, -1), auxiliaryOriginalHoursLookDto); |
| | | auxiliaryOriginalHoursDtos = body.getRecords(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("å·¥æ¶ç»è®¡å¯¼åº", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | try { |
| | | // æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | WriteSheet mainSheet = EasyExcel.writerSheet(0, "åå§å·¥æ¶å¯¼åº").head(AuxiliaryOriginalHoursDto.class).build(); |
| | | excelWriter.write(auxiliaryOriginalHoursDtos, mainSheet); |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»½å
¨é¨å·¥æ¶ |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<AuxiliaryAllDto> selectAuxiliaryAllByMonth(AuxiliaryOriginalHoursLookDto dto) { |
| | | if (StringUtils.isBlank(dto.getMonth())) { |
| | | throw new BaseException("ç¼ºå°æä»½"); |
| | | } |
| | | List<Long> userIds = new ArrayList<>(); |
| | | |
| | | String name = dto.getName(); |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | userIds.addAll(userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getName, name)).stream().map(User::getId).collect(Collectors.toList())); |
| | | } |
| | | // è§£æè¾å
¥çæ¶é´å符串 |
| | | LocalDate date = LocalDate.parse(dto.getMonth() + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | |
| | | // è·ååä¸ä¸ªæç26å· |
| | | LocalDate previousMonth26th = date.minusMonths(1).withDayOfMonth(26); |
| | | |
| | | // è·åå½åæç25å· |
| | | LocalDate currentMonth25th = date.withDayOfMonth(25); |
| | | |
| | | // æ ¼å¼åæ¥æä¸º yyyy-MM-dd HH:mm:ss |
| | | DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String beginDate = previousMonth26th.atStartOfDay().format(outputFormatter); |
| | | String endDate = currentMonth25th.atStartOfDay().format(outputFormatter); |
| | | // dto.setBeginDate(beginDate + " 00:00:00"); |
| | | // dto.setEndDate(endDate + " 23:59:59"); |
| | | dto.setBeginDate(beginDate); |
| | | dto.setEndDate(endDate); |
| | | |
| | | |
| | | // æ¥è¯¢äº§éå·¥æ¶ |
| | | List<AuxiliaryAllDto> auxiliaryAllDtos = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryAllByMonth(dto, userIds); |
| | | |
| | | // æ¥è¯¢è¾
å©å·¥æ¶ |
| | | List<AuxiliaryAllDto> auxiliarySubsidiary = auxiliaryOutputWorkingHoursMapper.selectSubsidiaryAllByMonth(dto, userIds); |
| | | |
| | | //产éå·¥æ¶è¿è¡äººååç», æè¾
å©å·¥æ¶æ·»å |
| | | Map<Integer, List<AuxiliaryAllDto>> groupIds = auxiliaryAllDtos.stream().collect(Collectors.groupingBy(AuxiliaryAllDto::getUserId)); |
| | | |
| | | for (AuxiliaryAllDto auxiliaryAllDto : auxiliarySubsidiary) { |
| | | List<AuxiliaryAllDto> allDtos = groupIds.get(auxiliaryAllDto.getUserId()); |
| | | // 夿æ¯å¦ä¸ºç©º |
| | | if (CollectionUtils.isNotEmpty(allDtos)) { |
| | | // æ·»å è¾
å©å·¥æ¶ |
| | | allDtos.get(0).setSubsidiaryHour(auxiliaryAllDto.getSubsidiaryHour()); |
| | | |
| | | } else { |
| | | // æ²¡ææ¹äººåæ·»å ä¸è¡ |
| | | auxiliaryAllDtos.add(auxiliaryAllDto); |
| | | } |
| | | } |
| | | for (AuxiliaryAllDto auxiliaryAllDto : auxiliaryAllDtos) { |
| | | BigDecimal total = (auxiliaryAllDto.getYieldHour() != null ? auxiliaryAllDto.getYieldHour() : BigDecimal.ZERO) |
| | | .add(auxiliaryAllDto.getSubsidiaryHour() != null ? auxiliaryAllDto.getSubsidiaryHour() : BigDecimal.ZERO); |
| | | auxiliaryAllDto.setTotalHour(total); |
| | | } |
| | | |
| | | return auxiliaryAllDtos; |
| | | } |
| | | |
| | | private Map<String, AuxiliaryOriginalHoursDto> getData(List<Map<String, Object>> objectMaps, String type) { |
| | | Map<String, AuxiliaryOriginalHoursDto> dtoMap = new HashMap<>(); |
| | | for (Map<String, Object> objectMap : objectMaps) { |
| | | String name = objectMap.get("name").toString(); |
| | | String month = objectMap.get("month").toString().substring(0, 7); |
| | | AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = dtoMap.get(name); |
| | | if (auxiliaryOriginalHoursDto == null) { |
| | | auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | auxiliaryOriginalHoursDto.setName(name); |
| | | auxiliaryOriginalHoursDto.setType(type); |
| | | auxiliaryOriginalHoursDto.setMonth(month); |
| | | // æ¥è¯¢è¿ä¸ªäººè¿ä¸ªææ¯å¦æä¿®æ£ç产éå·¥æ¶ |
| | | AuxiliaryCorrectionHours auxiliaryCorrectionHours = auxiliaryCorrectionHoursMapper.selectOne(Wrappers.<AuxiliaryCorrectionHours>lambdaQuery() |
| | | .eq(AuxiliaryCorrectionHours::getNameUser, userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getName, auxiliaryOriginalHoursDto.getName())).getId()) |
| | | .eq(AuxiliaryCorrectionHours::getType, auxiliaryOriginalHoursDto.getType()) |
| | | .eq(AuxiliaryCorrectionHours::getMonth, auxiliaryOriginalHoursDto.getMonth())); |
| | | auxiliaryOriginalHoursDto.setAuxiliaryCorrectionHours(auxiliaryCorrectionHours); |
| | | } |
| | | AuxiliaryCorrectionHours auxiliaryCorrectionHours = auxiliaryOriginalHoursDto.getAuxiliaryCorrectionHours(); |
| | | switch (objectMap.get("month").toString().substring(8, 10)) { |
| | | case "01": |
| | | auxiliaryOriginalHoursDto.setOneHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getOneHours().compareTo(auxiliaryOriginalHoursDto.getOneHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setOne(1); |
| | | } |
| | | } |
| | | break; |
| | | case "02": |
| | | auxiliaryOriginalHoursDto.setTwoHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwoHours().compareTo(auxiliaryOriginalHoursDto.getTwoHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwo(1); |
| | | } |
| | | } |
| | | break; |
| | | case "03": |
| | | auxiliaryOriginalHoursDto.setThreeHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getThreeHours().compareTo(auxiliaryOriginalHoursDto.getThreeHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setThree(1); |
| | | } |
| | | } |
| | | break; |
| | | case "04": |
| | | auxiliaryOriginalHoursDto.setFourHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getFourHours().compareTo(auxiliaryOriginalHoursDto.getFourHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setFour(1); |
| | | } |
| | | } |
| | | break; |
| | | case "05": |
| | | auxiliaryOriginalHoursDto.setFiveHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getFiveHours().compareTo(auxiliaryOriginalHoursDto.getFiveHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setFive(1); |
| | | } |
| | | } |
| | | break; |
| | | case "06": |
| | | auxiliaryOriginalHoursDto.setSixHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getSixHours().compareTo(auxiliaryOriginalHoursDto.getSixHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setSix(1); |
| | | } |
| | | } |
| | | break; |
| | | case "07": |
| | | auxiliaryOriginalHoursDto.setSevenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getSevenHours().compareTo(auxiliaryOriginalHoursDto.getSevenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setSeven(1); |
| | | } |
| | | } |
| | | break; |
| | | case "08": |
| | | auxiliaryOriginalHoursDto.setEightHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getEightHours().compareTo(auxiliaryOriginalHoursDto.getEightHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setEight(1); |
| | | } |
| | | } |
| | | break; |
| | | case "09": |
| | | auxiliaryOriginalHoursDto.setNineHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getNineHours().compareTo(auxiliaryOriginalHoursDto.getNineHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setNine(1); |
| | | } |
| | | } |
| | | break; |
| | | case "10": |
| | | auxiliaryOriginalHoursDto.setTenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTenHours().compareTo(auxiliaryOriginalHoursDto.getTenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "11": |
| | | auxiliaryOriginalHoursDto.setElevenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getElevenHours().compareTo(auxiliaryOriginalHoursDto.getElevenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setEleven(1); |
| | | } |
| | | } |
| | | break; |
| | | case "12": |
| | | auxiliaryOriginalHoursDto.setTwelveHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwelveHours().compareTo(auxiliaryOriginalHoursDto.getTwelveHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwelve(1); |
| | | } |
| | | } |
| | | break; |
| | | case "13": |
| | | auxiliaryOriginalHoursDto.setThirteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getThirteenHours().compareTo(auxiliaryOriginalHoursDto.getThirteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setThirteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "14": |
| | | auxiliaryOriginalHoursDto.setFourteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getFourteenHours().compareTo(auxiliaryOriginalHoursDto.getFourteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setFourteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "15": |
| | | auxiliaryOriginalHoursDto.setFifteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getFifteenHours().compareTo(auxiliaryOriginalHoursDto.getFifteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setFifteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "16": |
| | | auxiliaryOriginalHoursDto.setSixteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getSixteenHours().compareTo(auxiliaryOriginalHoursDto.getSixteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setSixteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "17": |
| | | auxiliaryOriginalHoursDto.setSeventeenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getSeventeenHours().compareTo(auxiliaryOriginalHoursDto.getSeventeenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setSeventeen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "18": |
| | | auxiliaryOriginalHoursDto.setEighteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getEighteenHours().compareTo(auxiliaryOriginalHoursDto.getEighteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setEighteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "19": |
| | | auxiliaryOriginalHoursDto.setNineteenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getNineteenHours().compareTo(auxiliaryOriginalHoursDto.getNineteenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setNineteen(1); |
| | | } |
| | | } |
| | | break; |
| | | case "20": |
| | | auxiliaryOriginalHoursDto.setTwentyHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyHours().compareTo(auxiliaryOriginalHoursDto.getTwentyHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwenty(1); |
| | | } |
| | | } |
| | | break; |
| | | case "21": |
| | | auxiliaryOriginalHoursDto.setTwentyOneHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyOneHours().compareTo(auxiliaryOriginalHoursDto.getTwentyOneHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyOne(1); |
| | | } |
| | | } |
| | | break; |
| | | case "22": |
| | | auxiliaryOriginalHoursDto.setTwentyTwoHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyTwoHours().compareTo(auxiliaryOriginalHoursDto.getTwentyTwoHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyTwo(1); |
| | | } |
| | | } |
| | | break; |
| | | case "23": |
| | | auxiliaryOriginalHoursDto.setTwentyThreeHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyThreeHours().compareTo(auxiliaryOriginalHoursDto.getTwentyThreeHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyThree(1); |
| | | } |
| | | } |
| | | break; |
| | | case "24": |
| | | auxiliaryOriginalHoursDto.setTwentyFourHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyFourHours().compareTo(auxiliaryOriginalHoursDto.getTwentyFourHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyFour(1); |
| | | } |
| | | } |
| | | break; |
| | | case "25": |
| | | auxiliaryOriginalHoursDto.setTwentyFiveHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyFiveHours().compareTo(auxiliaryOriginalHoursDto.getTwentyFiveHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyFive(1); |
| | | } |
| | | } |
| | | break; |
| | | case "26": |
| | | auxiliaryOriginalHoursDto.setTwentySixHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentySixHours().compareTo(auxiliaryOriginalHoursDto.getTwentySixHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentySix(1); |
| | | } |
| | | } |
| | | break; |
| | | case "27": |
| | | auxiliaryOriginalHoursDto.setTwentySevenHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentySevenHours().compareTo(auxiliaryOriginalHoursDto.getTwentySevenHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentySeven(1); |
| | | } |
| | | } |
| | | break; |
| | | case "28": |
| | | auxiliaryOriginalHoursDto.setTwentyEightHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyEightHours().compareTo(auxiliaryOriginalHoursDto.getTwentyEightHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyEight(1); |
| | | } |
| | | } |
| | | break; |
| | | case "29": |
| | | auxiliaryOriginalHoursDto.setTwentyNineHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getTwentyNineHours().compareTo(auxiliaryOriginalHoursDto.getTwentyNineHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setTwentyNine(1); |
| | | } |
| | | } |
| | | break; |
| | | case "30": |
| | | auxiliaryOriginalHoursDto.setThirtyHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getThirtyHours().compareTo(auxiliaryOriginalHoursDto.getThirtyHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setThirty(1); |
| | | } |
| | | } |
| | | break; |
| | | case "31": |
| | | auxiliaryOriginalHoursDto.setThirtyOneHours(new BigDecimal(objectMap.get("manHours").toString())); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours)) { |
| | | if (auxiliaryCorrectionHours.getThirtyOneHours().compareTo(auxiliaryOriginalHoursDto.getThirtyOneHours()) != 0) { |
| | | auxiliaryOriginalHoursDto.setThirtyOne(1); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | auxiliaryOriginalHoursDto.setTotal((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getOneHours()) ? auxiliaryOriginalHoursDto.getOneHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThreeHours()) ? auxiliaryOriginalHoursDto.getThreeHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourHours()) ? auxiliaryOriginalHoursDto.getFourHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFiveHours()) ? auxiliaryOriginalHoursDto.getFiveHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixHours()) ? auxiliaryOriginalHoursDto.getSixHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSevenHours()) ? auxiliaryOriginalHoursDto.getSevenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEightHours()) ? auxiliaryOriginalHoursDto.getEightHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineHours()) ? auxiliaryOriginalHoursDto.getNineHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTenHours()) ? auxiliaryOriginalHoursDto.getTenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getElevenHours()) ? auxiliaryOriginalHoursDto.getElevenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwelveHours()) ? auxiliaryOriginalHoursDto.getTwelveHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirteenHours()) ? auxiliaryOriginalHoursDto.getThirteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourteenHours()) ? auxiliaryOriginalHoursDto.getFourteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFifteenHours()) ? auxiliaryOriginalHoursDto.getFifteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixteenHours()) ? auxiliaryOriginalHoursDto.getSixteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSeventeenHours()) ? auxiliaryOriginalHoursDto.getSeventeenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEighteenHours()) ? auxiliaryOriginalHoursDto.getEighteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineteenHours()) ? auxiliaryOriginalHoursDto.getNineteenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyHours()) ? auxiliaryOriginalHoursDto.getTwentyHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyOneHours()) ? auxiliaryOriginalHoursDto.getTwentyOneHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyTwoHours()) ? auxiliaryOriginalHoursDto.getTwentyTwoHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyThreeHours()) ? auxiliaryOriginalHoursDto.getTwentyThreeHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFourHours()) ? auxiliaryOriginalHoursDto.getTwentyFourHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFiveHours()) ? auxiliaryOriginalHoursDto.getTwentyFiveHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySixHours()) ? auxiliaryOriginalHoursDto.getTwentySixHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySevenHours()) ? auxiliaryOriginalHoursDto.getTwentySevenHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyEightHours()) ? auxiliaryOriginalHoursDto.getTwentyEightHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyNineHours()) ? auxiliaryOriginalHoursDto.getTwentyNineHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyHours()) ? auxiliaryOriginalHoursDto.getThirtyHours() : BigDecimal.ZERO) |
| | | .add(ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyOneHours()) ? auxiliaryOriginalHoursDto.getThirtyOneHours() : BigDecimal.ZERO) |
| | | ); |
| | | auxiliaryOriginalHoursDto.setTotal(auxiliaryOriginalHoursDto.getTotal().setScale(4, RoundingMode.HALF_UP)); |
| | | |
| | | dtoMap.put(name, auxiliaryOriginalHoursDto); |
| | | } |
| | | return dtoMap; |
| | | } |
| | | |
| | | //åå¹¶ |
| | | private void merge(Map<String, AuxiliaryOriginalHoursDto> data5, Map<String, AuxiliaryOriginalHoursDto> data4, Map<String, AuxiliaryOriginalHoursDto> data2) { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> entry : data2.entrySet()) { |
| | | String key = entry.getKey(); |
| | | AuxiliaryOriginalHoursDto value = entry.getValue(); |
| | | if (data5.containsKey(key)) { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> dtoEntry : data5.entrySet()) { |
| | | if (dtoEntry.getKey().equals(key)) { |
| | | AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | AuxiliaryOriginalHoursDto hoursDto = data5.get(key); |
| | | BeanUtils.copyProperties(hoursDto, auxiliaryOriginalHoursDto); |
| | | auxiliaryOriginalHoursDto.setType("æ»å·¥æ¶"); |
| | | auxiliaryOriginalHoursDto.setOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getOneHours()) ? auxiliaryOriginalHoursDto.getOneHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getOneHours()) ? value.getOneHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwoHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwoHours()) ? auxiliaryOriginalHoursDto.getTwoHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwoHours()) ? value.getTwoHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setThreeHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThreeHours()) ? auxiliaryOriginalHoursDto.getThreeHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getThreeHours()) ? value.getThreeHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setFourHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourHours()) ? auxiliaryOriginalHoursDto.getFourHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getFourHours()) ? value.getFourHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setFiveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFiveHours()) ? auxiliaryOriginalHoursDto.getFiveHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getFiveHours()) ? value.getFiveHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setSixHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixHours()) ? auxiliaryOriginalHoursDto.getSixHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getSixHours()) ? value.getSixHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setSevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSevenHours()) ? auxiliaryOriginalHoursDto.getSevenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getSevenHours()) ? value.getSevenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setEightHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEightHours()) ? auxiliaryOriginalHoursDto.getEightHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getEightHours()) ? value.getEightHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setNineHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineHours()) ? auxiliaryOriginalHoursDto.getNineHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getNineHours()) ? value.getNineHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTenHours()) ? auxiliaryOriginalHoursDto.getTenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTenHours()) ? value.getTenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setElevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getElevenHours()) ? auxiliaryOriginalHoursDto.getElevenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getElevenHours()) ? value.getElevenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwelveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwelveHours()) ? auxiliaryOriginalHoursDto.getTwelveHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwelveHours()) ? value.getTwelveHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setThirteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirteenHours()) ? auxiliaryOriginalHoursDto.getThirteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getThirteenHours()) ? value.getThirteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setFourteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourteenHours()) ? auxiliaryOriginalHoursDto.getFourteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getFourteenHours()) ? value.getFourteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setFifteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFifteenHours()) ? auxiliaryOriginalHoursDto.getFifteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getFifteenHours()) ? value.getFifteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setSixteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixteenHours()) ? auxiliaryOriginalHoursDto.getSixteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getSixteenHours()) ? value.getSixteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setSeventeenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSeventeenHours()) ? auxiliaryOriginalHoursDto.getSeventeenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getSeventeenHours()) ? value.getSeventeenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setEighteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEighteenHours()) ? auxiliaryOriginalHoursDto.getEighteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getEighteenHours()) ? value.getEighteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setNineteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineteenHours()) ? auxiliaryOriginalHoursDto.getNineteenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getNineteenHours()) ? value.getNineteenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwelveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwelveHours()) ? auxiliaryOriginalHoursDto.getTwelveHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwelveHours()) ? value.getTwelveHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyOneHours()) ? auxiliaryOriginalHoursDto.getTwentyOneHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyOneHours()) ? value.getTwentyOneHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyTwoHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyTwoHours()) ? auxiliaryOriginalHoursDto.getTwentyTwoHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyTwoHours()) ? value.getTwentyTwoHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyThreeHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyThreeHours()) ? auxiliaryOriginalHoursDto.getTwentyThreeHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyThreeHours()) ? value.getTwentyThreeHours() : BigDecimal.ZERO)); |
| | | BigDecimal v = ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFourHours()) ? auxiliaryOriginalHoursDto.getTwentyFourHours() : BigDecimal.ZERO; |
| | | BigDecimal v1 = ObjectUtils.isNotEmpty(value.getTwentyFourHours()) ? value.getTwentyFourHours() : BigDecimal.ZERO; |
| | | BigDecimal v2 = v.add(v1); |
| | | auxiliaryOriginalHoursDto.setTwentyFourHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFourHours()) ? auxiliaryOriginalHoursDto.getTwentyFourHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyFourHours()) ? value.getTwentyFourHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyFiveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFiveHours()) ? auxiliaryOriginalHoursDto.getTwentyFiveHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyFiveHours()) ? value.getTwentyFiveHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentySixHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySixHours()) ? auxiliaryOriginalHoursDto.getTwentySixHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentySixHours()) ? value.getTwentySixHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentySevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySevenHours()) ? auxiliaryOriginalHoursDto.getTwentySevenHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentySevenHours()) ? value.getTwentySevenHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyEightHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyEightHours()) ? auxiliaryOriginalHoursDto.getTwentyEightHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyEightHours()) ? value.getTwentyEightHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTwentyNineHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyNineHours()) ? auxiliaryOriginalHoursDto.getTwentyNineHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTwentyNineHours()) ? value.getTwentyNineHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setThirtyHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyHours()) ? auxiliaryOriginalHoursDto.getThirtyHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getThirtyHours()) ? value.getThirtyHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setThirtyOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyOneHours()) ? auxiliaryOriginalHoursDto.getThirtyOneHours() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getThirtyOneHours()) ? value.getThirtyOneHours() : BigDecimal.ZERO)); |
| | | auxiliaryOriginalHoursDto.setTotal((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTotal()) ? auxiliaryOriginalHoursDto.getTotal() : BigDecimal.ZERO).add(ObjectUtils.isNotEmpty(value.getTotal()) ? value.getTotal() : BigDecimal.ZERO)); |
| | | data4.put(key, auxiliaryOriginalHoursDto); |
| | | } /*else { |
| | | AuxiliaryOriginalHoursDto hoursDto = data5.get(dtoEntry.getKey()); |
| | | AuxiliaryOriginalHoursDto dto = new AuxiliaryOriginalHoursDto(); |
| | | BeanUtils.copyProperties(hoursDto, dto); |
| | | dto.setType("æ»å·¥æ¶"); |
| | | data4.put(dtoEntry.getKey(), dto); |
| | | }*/ |
| | | } |
| | | } else { |
| | | value.setType("æ»å·¥æ¶"); |
| | | data4.put(key, value); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto; |
| | | import com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; |
| | | import com.ruoyi.performance.mapper.AuxiliaryWorkingHoursDayMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.apache.commons.math3.analysis.function.Power; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡çç产éå·¥æ¶ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 03:48:48 |
| | | */ |
| | | @Service |
| | | public class AuxiliaryOutputWorkingHoursServiceImpl extends ServiceImpl<AuxiliaryOutputWorkingHoursMapper, AuxiliaryOutputWorkingHours> implements AuxiliaryOutputWorkingHoursService { |
| | | |
| | | @Resource |
| | | AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryWorkingHoursDayMapper auxiliaryWorkingHoursDayMapper; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Override |
| | | public IPage<AuxiliaryOutputWorkingHoursDto> selectAuxiliaryOutputWorkingHours(Page page, AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto) { |
| | | String dates = auxiliaryOutputWorkingHoursDto.getDateTime(); |
| | | String week = auxiliaryOutputWorkingHoursDto.getWeek(); |
| | | auxiliaryOutputWorkingHoursDto.setDateTime(null); |
| | | auxiliaryOutputWorkingHoursDto.setWeek(null); |
| | | List<Long> ids = new ArrayList<>(); |
| | | if (ids.size() == 0) { |
| | | ids = null; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | return auxiliaryOutputWorkingHoursDtoIPage ; |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | return auxiliaryOutputWorkingHoursDtoIPage ; |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | return auxiliaryOutputWorkingHoursDtoIPage ; |
| | | } else { |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | return auxiliaryOutputWorkingHoursDtoIPage ; |
| | | } |
| | | } |
| | | |
| | | //ç»è®¡äº§éå·¥æ¶æ±æ»åè¾
å©å·¥æ¶æ±æ» |
| | | @Override |
| | | public Map<String, Object> collectWorkingHours(AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto) { |
| | | AuxiliaryOutputWorkingHours outputWorkingHours = new AuxiliaryOutputWorkingHours(); |
| | | AuxiliaryWorkingHoursDay workingHoursDay = new AuxiliaryWorkingHoursDay(); |
| | | List<Long> ids = new ArrayList<>(); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getWeekDay())){ |
| | | outputWorkingHours.setWeekDay(auxiliaryOutputWorkingHoursDto.getWeekDay()); |
| | | workingHoursDay.setWeekDay(auxiliaryOutputWorkingHoursDto.getWeekDay()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getName())){ |
| | | List<User> user = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getName, auxiliaryOutputWorkingHoursDto.getName())); |
| | | ids.addAll(user.stream().map(User::getId).collect(Collectors.toList())); |
| | | } |
| | | String dates = auxiliaryOutputWorkingHoursDto.getDateTime(); |
| | | auxiliaryOutputWorkingHoursDto.setDateTime(null); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | BigDecimal sumOutputWorkTime = BigDecimal.ZERO; |
| | | BigDecimal sumApprovedWorkingHour = BigDecimal.ZERO; |
| | | |
| | | //夿æ¯ç»é¿è¿æ¯ç»åè¿æ¯ç®¡çå |
| | | List<AuxiliaryOutputWorkingHours> auxiliaryOutputWorkingHours = new ArrayList<>(); |
| | | List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays = new ArrayList<>(); |
| | | if (ids.size() == 0) { |
| | | ids=null; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(dates)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | //ç»è®¡å½åç¨æ·ç产åå·¥æ¶ |
| | | auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectLists(QueryWrappers.queryWrappers(outputWorkingHours) |
| | | .ge("date_time", split[0]) |
| | | .le("date_time", split[1] + " 23:59:59"),ids); |
| | | //ç»è®¡å½åç¨æ·çè¾
å©å·¥æ¶ |
| | | auxiliaryWorkingHoursDays = auxiliaryWorkingHoursDayMapper.selectLists(QueryWrappers.queryWrappers(workingHoursDay) |
| | | .eq("state","å·²æ¹å") |
| | | .ge("date_time", split[0]) |
| | | .le("date_time", split[1] + " 23:59:59"),ids); |
| | | }else if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getWeekDay())){ |
| | | //ç»è®¡å½åç¨æ·ç产åå·¥æ¶ |
| | | auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectLists(QueryWrappers.queryWrappers(outputWorkingHours),ids); |
| | | //ç»è®¡å½åç¨æ·çè¾
å©å·¥æ¶ |
| | | auxiliaryWorkingHoursDays = auxiliaryWorkingHoursDayMapper.selectLists(QueryWrappers.queryWrappers(workingHoursDay).eq("state","å·²æ¹å"),ids); |
| | | } |
| | | else { |
| | | auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectListByIds(ids); |
| | | auxiliaryWorkingHoursDays = auxiliaryWorkingHoursDayMapper.selectListByIds(ids); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours)) { |
| | | Map<String, BigDecimal> sumMap = new HashMap<>(); |
| | | for (AuxiliaryOutputWorkingHours auxiliaryOutputWorkingHour : auxiliaryOutputWorkingHours) { |
| | | if (!sumMap.containsKey(auxiliaryOutputWorkingHour.getManHourGroup()+auxiliaryOutputWorkingHour.getOrderNo()+auxiliaryOutputWorkingHour.getSample())) { |
| | | sumMap.put(auxiliaryOutputWorkingHour.getManHourGroup()+auxiliaryOutputWorkingHour.getOrderNo()+auxiliaryOutputWorkingHour.getSample(), auxiliaryOutputWorkingHour.getOutputWorkTime()); |
| | | } |
| | | } |
| | | sumOutputWorkTime = sumMap.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | map.put("产éå·¥æ¶æ±æ»", sumOutputWorkTime); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryWorkingHoursDays)) { |
| | | for (AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay : auxiliaryWorkingHoursDays) { |
| | | sumApprovedWorkingHour = sumApprovedWorkingHour.add(auxiliaryWorkingHoursDay.getReviewerNonproductiveTime());//夿 ¸å·¥æ¶ |
| | | } |
| | | } |
| | | map.put("è¾
å©å·¥æ¶æ±æ»", sumApprovedWorkingHour); |
| | | return map; |
| | | } |
| | | |
| | | //å¯¼åº |
| | | @Override |
| | | public void exportWorkingHours(HttpServletResponse response) throws IOException { |
| | | List<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtos = new ArrayList<>(); |
| | | List<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtos = new ArrayList<>(); |
| | | List<Long> ids = new ArrayList<>(); |
| | | //æ¥è¯¢è¾
å©å·¥æ¶ |
| | | auxiliaryWorkingHoursDayDtos = auxiliaryWorkingHoursDayMapper.selectDataByUser(ids); |
| | | //æ¥è¯¢ç»è®¡å·¥æ¶ |
| | | auxiliaryOutputWorkingHoursDtos = auxiliaryOutputWorkingHoursMapper.selectDataByUser(ids); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("æ¥å·¥æ¶ç®¡ç导åº", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | try { |
| | | // æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | |
| | | WriteSheet mainSheet = EasyExcel.writerSheet(0, "è¾
å©å·¥æ¶å¯¼åº").head(AuxiliaryWorkingHoursDayDto.class).build(); |
| | | excelWriter.write(auxiliaryWorkingHoursDayDtos, mainSheet); |
| | | |
| | | WriteSheet mainSheet1 = EasyExcel.writerSheet(1, "产éå·¥æ¶å¯¼åº").head(AuxiliaryOutputWorkingHoursDto.class).build(); |
| | | excelWriter.write(auxiliaryOutputWorkingHoursDtos, mainSheet1); |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导åºäº§éå·¥æ¶ |
| | | * @param response |
| | | */ |
| | | @Override |
| | | public void exportOutputHours(AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto, HttpServletResponse response) { |
| | | //æ¥è¯¢å¯¼åºçè´¹ç¨ç»è®¡æ°æ® |
| | | String dates = auxiliaryOutputWorkingHoursDto.getDateTime(); |
| | | String week = auxiliaryOutputWorkingHoursDto.getWeek(); |
| | | auxiliaryOutputWorkingHoursDto.setDateTime(null); |
| | | auxiliaryOutputWorkingHoursDto.setWeek(null); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | String name = auxiliaryOutputWorkingHoursDto.getName(); |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | ids.addAll(userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getName, name)).stream().map(User::getId).collect(Collectors.toList())); |
| | | } |
| | | |
| | | List<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = new ArrayList<>(); |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHoursList(QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHoursList(QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHoursList(QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | |
| | | } else { |
| | | auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHoursList(QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto), ids); |
| | | } |
| | | |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("产éå·¥æ¶ä¿¡æ¯å¯¼åº", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | //è·åsheet0对象 |
| | | WriteSheet mainSheet = EasyExcel.writerSheet(0, "产éå·¥æ¶ä¿¡æ¯å¯¼åº").head(AuxiliaryOutputWorkingHoursDto.class).build(); |
| | | |
| | | //åsheet0åå
¥æ°æ® ä¼ å
¥ç©ºlistè¿æ ·åªå¯¼åºè¡¨å¤´ |
| | | excelWriter.write(auxiliaryOutputWorkingHoursDtoIPage, mainSheet); |
| | | //å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.ruoyi.performance.dto.HoursDay; |
| | | import com.ruoyi.performance.mapper.AuxiliaryWorkingHoursDayMapper; |
| | | import com.ruoyi.performance.mapper.AuxiliaryWorkingHoursMapper; |
| | | import com.ruoyi.performance.mapper.PerformanceShiftMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHours; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | import com.ruoyi.performance.service.AuxiliaryWorkingHoursDayService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import org.apache.commons.math3.analysis.function.Power; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥å·¥æ¶ç®¡ççè¾
å©å·¥æ¶ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-28 02:22:19 |
| | | */ |
| | | @Service |
| | | public class AuxiliaryWorkingHoursDayServiceImpl extends ServiceImpl<AuxiliaryWorkingHoursDayMapper, AuxiliaryWorkingHoursDay> implements AuxiliaryWorkingHoursDayService { |
| | | |
| | | @Resource |
| | | AuxiliaryWorkingHoursDayMapper auxiliaryWorkingHoursDayMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryWorkingHoursMapper auxiliaryWorkingHoursMapper; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | PerformanceShiftMapper performanceShiftMapper; |
| | | |
| | | @Override |
| | | public IPage<AuxiliaryWorkingHoursDayDto> selectAuxiliaryWorkingHoursDay(Page page, AuxiliaryWorkingHoursDayDto auxiliaryWorkingHoursDayDto) { |
| | | String dates = auxiliaryWorkingHoursDayDto.getDateTime(); |
| | | String week = auxiliaryWorkingHoursDayDto.getWeek(); |
| | | auxiliaryWorkingHoursDayDto.setDateTime(null); |
| | | auxiliaryWorkingHoursDayDto.setWeek(null); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Long> ids = new ArrayList<>(); |
| | | if (ids.size() == 0) { |
| | | ids = null; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | return auxiliaryWorkingHoursDayDtoIPage; |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | return auxiliaryWorkingHoursDayDtoIPage; |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | return auxiliaryWorkingHoursDayDtoIPage; |
| | | } else { |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | return auxiliaryWorkingHoursDayDtoIPage; |
| | | } |
| | | |
| | | } |
| | | |
| | | //æ ¹æ®ç¼å·æ¥è¯¢è¾
å©å·¥æ¶é
ç½®ä¿¡æ¯ |
| | | @Override |
| | | public AuxiliaryWorkingHoursDay selectAuxiliaryWorkingHoursByNumber(String number) { |
| | | //æ ¹æ®å¡«åçç¼å·æ¥è¯¢è¾
å©å·¥æ¶é
ç½® |
| | | AuxiliaryWorkingHours auxiliaryWorkingHours = auxiliaryWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryWorkingHours>lambdaQuery().eq(AuxiliaryWorkingHours::getNumber, number)); |
| | | if (ObjectUtils.isEmpty(auxiliaryWorkingHours)) { |
| | | throw new BaseException("该ç¼å·æ²¡æå¯¹åºçè¾
å©å·¥æ¶é
ç½®"); |
| | | } |
| | | AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay = new AuxiliaryWorkingHoursDay(); |
| | | BeanUtils.copyProperties(auxiliaryWorkingHours, auxiliaryWorkingHoursDay); |
| | | return auxiliaryWorkingHoursDay; |
| | | } |
| | | |
| | | //å½å
¥æ°æ®(æ°å¢) |
| | | @Override |
| | | public int insertAuxiliaryWorkingHoursDay(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | auxiliaryWorkingHoursDay.setNameUser(userId);//å§åid |
| | | auxiliaryWorkingHoursDay.setState("å·²æäº¤"); |
| | | return auxiliaryWorkingHoursDayMapper.insert(auxiliaryWorkingHoursDay); |
| | | } |
| | | |
| | | //å®¡æ ¸/æ¹å |
| | | @Override |
| | | public boolean checkOrApprove(HoursDay hoursDay) { |
| | | List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays = hoursDay.getAuxiliaryWorkingHoursDays(); |
| | | for (AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay : auxiliaryWorkingHoursDays) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | auxiliaryWorkingHoursDay.setReviewer(userMapper.selectById(userId).getName()); |
| | | if (auxiliaryWorkingHoursDay.getReviewerNumber() == null) { |
| | | auxiliaryWorkingHoursDay.setReviewerNumber(auxiliaryWorkingHoursDay.getAmount());//夿 ¸æ°é |
| | | auxiliaryWorkingHoursDay.setReviewerNonproductiveTime(auxiliaryWorkingHoursDay.getNonproductiveTime());//夿 ¸å·¥æ¶ |
| | | } |
| | | } |
| | | return updateBatchById(auxiliaryWorkingHoursDays); |
| | | } |
| | | |
| | | //ç¼è¾ |
| | | @Override |
| | | public int updateAuxiliaryWorkingHoursDay(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | auxiliaryWorkingHoursDay.setNameUser(userId);//å§åid |
| | | return auxiliaryWorkingHoursDayMapper.updateById(auxiliaryWorkingHoursDay); |
| | | } |
| | | |
| | | //å é¤ |
| | | @Override |
| | | public int deleteAuxiliaryWorkingHoursDay(Integer id) { |
| | | return auxiliaryWorkingHoursDayMapper.deleteById(id); |
| | | } |
| | | |
| | | //æ ¹æ®ç¼å·å½åç¨æ·ä¿¡æ¯æ¥è¯¢æå¨ç次 |
| | | @Override |
| | | public String selectshiftByUser(LocalDateTime dateTime) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | PerformanceShift performanceShift = performanceShiftMapper.selectOne(Wrappers.<PerformanceShift>lambdaQuery().eq(PerformanceShift::getUserId, userId).eq(PerformanceShift::getWorkTime, dateTime)); |
| | | if (ObjectUtils.isEmpty(performanceShift)) { |
| | | return null; |
| | | } |
| | | return performanceShift.getShift(); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¾
å©å·¥æ¶ |
| | | * @param |
| | | * @param response |
| | | */ |
| | | @Override |
| | | public void exportWorkingHours(AuxiliaryWorkingHoursDayDto auxiliaryWorkingHoursDayDto, HttpServletResponse response) { |
| | | String dates = auxiliaryWorkingHoursDayDto.getDateTime(); |
| | | String week = auxiliaryWorkingHoursDayDto.getWeek(); |
| | | auxiliaryWorkingHoursDayDto.setDateTime(null); |
| | | auxiliaryWorkingHoursDayDto.setWeek(null); |
| | | List<Long> ids = new ArrayList<>(); |
| | | String name = auxiliaryWorkingHoursDayDto.getName(); |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | ids.addAll(userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getName, name)).stream().map(User::getId).collect(Collectors.toList())); |
| | | } |
| | | List<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = new ArrayList<>(); |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDayList(QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDayList(QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDayList(QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | } else { |
| | | auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDayList( QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto), ids); |
| | | } |
| | | |
| | | try { |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("è¾
å©å·¥æ¶ä¿¡æ¯å¯¼åº", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | //æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | //è·åsheet0对象 |
| | | WriteSheet mainSheet = EasyExcel.writerSheet(0, "è¾
å©å·¥æ¶ä¿¡æ¯å¯¼åº").head(AuxiliaryWorkingHoursDayDto.class).build(); |
| | | |
| | | //åsheet0åå
¥æ°æ® ä¼ å
¥ç©ºlistè¿æ ·åªå¯¼åºè¡¨å¤´ |
| | | excelWriter.write(auxiliaryWorkingHoursDayDtoIPage, mainSheet); |
| | | //å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | 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.common.utils.QueryWrappers; |
| | | import com.ruoyi.performance.mapper.AuxiliaryWorkingHoursMapper; |
| | | import com.ruoyi.performance.pojo.AuxiliaryWorkingHours; |
| | | import com.ruoyi.performance.service.AuxiliaryWorkingHoursService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * è¾
å©å·¥æ¶ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-09 06:58:31 |
| | | */ |
| | | @Service |
| | | public class AuxiliaryWorkingHoursServiceImpl extends ServiceImpl<AuxiliaryWorkingHoursMapper, AuxiliaryWorkingHours> implements AuxiliaryWorkingHoursService { |
| | | |
| | | @Resource |
| | | private AuxiliaryWorkingHoursMapper auxiliaryWorkingHoursMapper; |
| | | @Override |
| | | public IPage<AuxiliaryWorkingHours> selectAuxiliaryWorkingHours(Page page, AuxiliaryWorkingHours auxiliaryWorkingHours) { |
| | | return auxiliaryWorkingHoursMapper.selectAuxiliaryWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryWorkingHours)); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteAuxiliaryWorkingHours(Integer id) { |
| | | return auxiliaryWorkingHoursMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upAuxiliaryWorkingHours(AuxiliaryWorkingHours auxiliaryWorkingHours) { |
| | | return auxiliaryWorkingHoursMapper.updateById(auxiliaryWorkingHours); |
| | | } |
| | | |
| | | @Override |
| | | public int insertAuxiliaryWorkingHours(AuxiliaryWorkingHours auxiliaryWorkingHours) { |
| | | //ç¼å·ä¸è½éå¤ |
| | | List<String> strings = auxiliaryWorkingHoursMapper.selectList(null).stream().map(AuxiliaryWorkingHours::getNumber).distinct().collect(Collectors.toList()); |
| | | if (strings.contains(auxiliaryWorkingHours.getNumber())){ |
| | | throw new RuntimeException("ç¼å·ä¸è½éå¤!"); |
| | | } |
| | | return auxiliaryWorkingHoursMapper.insert(auxiliaryWorkingHours); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.performance.mapper.PerformanceShiftMapper; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | import com.ruoyi.performance.service.PerformanceShiftService; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 绩æç®¡ç-çæ¬¡ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-05-08 09:12:04 |
| | | */ |
| | | @Service |
| | | public class PerformanceShiftServiceImpl extends ServiceImpl<PerformanceShiftMapper, PerformanceShift> implements PerformanceShiftService { |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @Autowired |
| | | UserMapper userMapper; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto) { |
| | | List<PerformanceShift> list = new ArrayList<>(); |
| | | LocalDateTime startWeek = performanceShiftAddDto.getStartWeek(); |
| | | LocalDateTime endWeek = performanceShiftAddDto.getEndWeek(); |
| | | |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String formattedDateTime = performanceShiftAddDto.getStartWeek().format(formatter); |
| | | String[] splitUserId = performanceShiftAddDto.getUserId().split(","); |
| | | for (String userId : splitUserId) { |
| | | //夿æ¯å¦è·¨æ |
| | | boolean isMonth = startWeek.getMonthValue() != endWeek.getMonthValue(); |
| | | if (isMonth){ |
| | | //å¦æè·¨æ,å两个æé½å¤æä¸ä¸çæ°æ®åºæ¯åªä¸ªæä»½çæ°æ®æ²¡æ |
| | | boolean exists1 = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery() |
| | | .eq(PerformanceShift::getWorkTime, startWeek) |
| | | .eq(PerformanceShift::getUserId, userId)); |
| | | boolean exists2 = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery() |
| | | .eq(PerformanceShift::getWorkTime, endWeek) |
| | | .eq(PerformanceShift::getUserId, userId)); |
| | | if (!exists1 && !exists2){ |
| | | //两个æé½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list); |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | }else if (!exists1 && exists2){ |
| | | //å¼å§çæä»½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list); |
| | | }else if (exists1 && !exists2){ |
| | | //ç»æçæä»½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | } |
| | | }else { |
| | | //ä¸è·¨æ |
| | | boolean exists = baseMapper.exists(Wrappers.<PerformanceShift>lambdaQuery() |
| | | .in(PerformanceShift::getWorkTime, formattedDateTime) |
| | | .eq(PerformanceShift::getUserId, userId)); |
| | | // 妿ä¸å卿·»å æ°æ® |
| | | if (!exists) { |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | } |
| | | } |
| | | } |
| | | if (!list.isEmpty()) { |
| | | baseMapper.insertBatchSomeColumn(list); |
| | | list.clear(); |
| | | } |
| | | // 忬¡æ´æ° |
| | | List<LocalDateTime> datesBetween = getLocalDateTimesBetween(performanceShiftAddDto.getStartWeek(), performanceShiftAddDto.getEndWeek()); |
| | | for (LocalDateTime date : datesBetween) { |
| | | for (String s : splitUserId) { |
| | | PerformanceShift performanceShift = new PerformanceShift(); |
| | | performanceShift.setShift(performanceShiftAddDto.getShift()); |
| | | performanceShift.setUserId(Integer.valueOf(s)); |
| | | performanceShift.setWorkTime(date); |
| | | String formatterDateTime = date.format(formatter); |
| | | baseMapper.update(new PerformanceShift(), Wrappers.<PerformanceShift>lambdaUpdate() |
| | | .set(PerformanceShift::getShift, performanceShiftAddDto.getShift()) |
| | | .eq(PerformanceShift::getUserId, s) |
| | | .eq(PerformanceShift::getWorkTime, formatterDateTime)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private List<PerformanceShift> saveMonth (LocalDateTime week,String userId,List<PerformanceShift> list){ |
| | | LocalDate firstDayOfMonth = week.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = week.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | localDateTimesBetween.forEach(i -> { |
| | | PerformanceShift performanceShift = new PerformanceShift(); |
| | | performanceShift.setUserId(Integer.valueOf(userId)); |
| | | performanceShift.setWorkTime(i); |
| | | performanceShift.setShift(""); |
| | | list.add(performanceShift); |
| | | if (list.size() >= 1000) { |
| | | baseMapper.insertBatchSomeColumn(list); |
| | | list.clear(); |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) { |
| | | //æ¥è¯¢å½åç»å½äººåçæ¶æ |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | //夿å
¨é¨,个人,ç»ç»çæé |
| | | User user = userMapper.selectById(userId);//å½åç»å½ç人 |
| | | //è·åå½å人æå±å®éªå®¤id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //æ¥è¯¢å¯¹åºæ¶æåç§°(éä¿¡å®éªå®¤,çµåå®éªå®¤,æ£æµå) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("å®éªå®¤")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory); |
| | | |
| | | List<SysDictData> shiftType = dictTypeService.selectDictDataByName("çæ¬¡ç±»å"); |
| | | List<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYearPage(time, userName, laboratory); |
| | | mapIPage.getRecords().forEach(i -> { |
| | | String[] shiftTimes = i.getShiftTime().split(";"); |
| | | double totalAttendance = 0; |
| | | List<Map<String, Object>> map = new ArrayList<>(); |
| | | // å岿¥æ |
| | | for (String shiftTime : shiftTimes) { |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | String[] shiftTimeAndShift = shiftTime.split("ï¼"); |
| | | for (SysDictData enums : shiftType) { |
| | | if (!i.getMonthlyAttendance().containsKey(enums.getDictLabel())) { |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), 0); |
| | | } |
| | | if (enums.getDictValue().equals(shiftTimeAndShift[1])) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString()); |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("1"))); |
| | | } |
| | | // åï¼å¦å¤å天ç®ç»æ© |
| | | if (shiftTimeAndShift[1].equals("5") && enums.getDictValue().equals("0")) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString()); |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5"))); |
| | | } |
| | | } |
| | | // æ©ï¼ä¸ï¼å¤ï¼å·® |
| | | if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1); |
| | | } |
| | | // å |
| | | if (shiftTimeAndShift[1].equals("5")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5); |
| | | } |
| | | hashMap.put("id", shiftTimeAndShift[2]); |
| | | hashMap.put("shift", shiftTimeAndShift[1]); |
| | | hashMap.put("time", shiftTimeAndShift[0]); |
| | | map.add(hashMap); |
| | | } |
| | | double totalYearAttendance = 0; |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | for (Map<String, Object> record : mapYearIPage) { |
| | | if (record.get("user_id").toString().equals(i.getUserId())) { |
| | | for (SysDictData enums : shiftType) { |
| | | if (!hashMap.containsKey(enums.getDictLabel())) { |
| | | hashMap.put(enums.getDictLabel(), 0); |
| | | } |
| | | if (enums.getDictValue().equals(record.get("shift"))) { |
| | | BigDecimal num = new BigDecimal(hashMap.get(enums.getDictLabel()).toString()); |
| | | hashMap.put(enums.getDictLabel(), num.add(new BigDecimal("1"))); |
| | | } |
| | | // åï¼å¦å¤å天ç®ç»æ© |
| | | if (record.get("shift").equals("5") && enums.getDictValue().equals("0")) { |
| | | BigDecimal bigDecimal = new BigDecimal(hashMap.get(enums.getDictLabel()).toString()); |
| | | hashMap.put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5"))); |
| | | } |
| | | } |
| | | if (record.get("shift").equals("1") || record.get("shift").equals("2") || record.get("shift").equals("0") || record.get("shift").equals("6")) { |
| | | hashMap.put("totalAttendance", totalYearAttendance += 1); |
| | | } |
| | | // å |
| | | if (record.get("shift").equals("5")) { |
| | | hashMap.put("totalAttendance", totalYearAttendance += 0.5); |
| | | } |
| | | } |
| | | } |
| | | i.setSidebarAnnualAttendance(hashMap); |
| | | i.setList(map); |
| | | i.setShiftTime(null); |
| | | }); |
| | | // è·åheaderæ¶é´ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | LocalDate firstDayOfMonth = localDateTime.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = localDateTime.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | List<Object> list1 = new ArrayList<>(); |
| | | for (LocalDateTime dateTime : localDateTimesBetween) { |
| | | Map<Object, Object> hashMap = new HashMap<>(); |
| | | DateTime parse = DateUtil.parse(dateTime.format(formatter)); |
| | | hashMap.put("weekly", DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))); |
| | | hashMap.put("headerTime", getWeek(dateTime.format(formatters))); |
| | | list1.add(hashMap); |
| | | } |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | resultMap.put("page", mapIPage); |
| | | resultMap.put("headerList", list1); |
| | | return resultMap; |
| | | } |
| | | |
| | | @Override |
| | | public void performanceShiftUpdate(PerformanceShift performanceShift) { |
| | | baseMapper.update(new PerformanceShift(), Wrappers.<PerformanceShift>lambdaUpdate() |
| | | .eq(PerformanceShift::getId, performanceShift.getId()) |
| | | .set(PerformanceShift::getShift, performanceShift.getShift())); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, String laboratory) { |
| | | //æ¥è¯¢å½åç»å½äººåçæ¶æ |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | //夿å
¨é¨,个人,ç»ç»çæé |
| | | User user = userMapper.selectById(userId);//å½åç»å½ç人 |
| | | //è·åå½å人æå±å®éªå®¤id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | if (com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //æ¥è¯¢å¯¹åºæ¶æåç§°(éä¿¡å®éªå®¤,çµåå®éªå®¤,æ£æµå) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("å®éªå®¤")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | IPage<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYear(page, time, userName, laboratory); |
| | | List<SysDictData> shiftType = dictTypeService.selectDictDataByName("çæ¬¡ç±»å"); |
| | | mapYearIPage.setRecords(annualAttendanceProcessing(mapYearIPage.getRecords(), shiftType)); |
| | | return mapYearIPage; |
| | | } |
| | | |
| | | // å¹´å页ä¸å¯¼åºå
±åä½¿ç¨ |
| | | public List<Map<String, Object>> annualAttendanceProcessing(List<Map<String, Object>> mapYearList, List<SysDictData> shiftType) { |
| | | for (Map<String, Object> map : mapYearList) { |
| | | Map<String, Object> resultMap = new LinkedHashMap<>(); |
| | | Map<String, Object> hashMapYear = new LinkedHashMap<>(); |
| | | double totalYearAttendance = 0; |
| | | // ä¸å¹´12个æ |
| | | for (int i = 1; i < 13; i++) { |
| | | Map<String, Object> hashMapMonth = new LinkedHashMap<>(); |
| | | double totalMonthAttendance = 0; |
| | | for (SysDictData shift : shiftType) { |
| | | // åå§åèµå¼ |
| | | if (!hashMapYear.containsKey(shift.getDictLabel())) { |
| | | hashMapYear.put(shift.getDictLabel(), 0); |
| | | } |
| | | // æ |
| | | if (!ObjectUtils.isEmpty(map.get("month_str"))) { |
| | | String charArray = map.get("month_str").toString(); |
| | | int count = countOccurrences(charArray, i + "ï¼" + shift.getDictValue()); |
| | | hashMapMonth.put(shift.getDictLabel(), count); |
| | | hashMapYear.put(shift.getDictLabel(), new BigDecimal(hashMapYear.get(shift.getDictLabel()).toString()).add(new BigDecimal(count))); |
| | | // æ©ï¼ä¸ï¼å¤ï¼å·® |
| | | if (shift.getDictValue().equals("0") || shift.getDictValue().equals("1") || shift.getDictValue().equals("2") || shift.getDictValue().equals("6")) { |
| | | totalMonthAttendance += count; |
| | | totalYearAttendance += count; |
| | | } |
| | | // åï¼å¦å¤å天ç®ç»æ© |
| | | if (shift.getDictValue().equals("5")) { |
| | | BigDecimal multiply = new BigDecimal("0.5").multiply(new BigDecimal(count)).setScale(1, BigDecimal.ROUND_CEILING); |
| | | hashMapMonth.put(shiftType.get(0).getDictLabel(), new BigDecimal(hashMapMonth.get(shiftType.get(0).getDictLabel()).toString()).add(multiply)); |
| | | hashMapYear.put(shiftType.get(0).getDictLabel(), new BigDecimal(hashMapYear.get(shiftType.get(0).getDictLabel()).toString()).add(multiply)); |
| | | totalMonthAttendance += multiply.doubleValue(); |
| | | totalYearAttendance += multiply.doubleValue(); |
| | | } |
| | | } |
| | | // ç©ºæ°æ® |
| | | else { |
| | | map.put("work_time", i); |
| | | hashMapMonth.put(shift.getDictLabel(), 0); |
| | | } |
| | | } |
| | | hashMapMonth.put("totalMonthAttendance", totalMonthAttendance); |
| | | hashMapYear.put("totalYearAttendance", totalYearAttendance); |
| | | resultMap.put(i + "", hashMapMonth); |
| | | } |
| | | map.remove("month_str"); |
| | | map.remove("year_str"); |
| | | map.put("year", hashMapYear); |
| | | map.put("month", resultMap); |
| | | } |
| | | return mapYearList; |
| | | } |
| | | |
| | | public static int countOccurrences(String str, String target) { |
| | | int count = 0; |
| | | int index = 0; |
| | | while ((index = str.indexOf(target, index)) != -1) { |
| | | count++; |
| | | index += target.length(); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public List<List<Object>> dataRequiredForProcessingIntoExcel(List<Map<String, Object>> list, List<SysDictData> enums) throws Exception { |
| | | List<List<Object>> data = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | List<Object> excelRowList = new ArrayList<>(); |
| | | excelRowList.add(i + 1); |
| | | excelRowList.add(list.get(i).get("account")); |
| | | excelRowList.add(list.get(i).get("name")); |
| | | Map<String, Object> year = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("year")), Map.class); |
| | | excelRowList.add(year.get("totalYearAttendance")); |
| | | enums.forEach(j -> { |
| | | if (!j.getDictValue().equals("5")) { |
| | | excelRowList.add(year.get(j.getDictLabel())); |
| | | } |
| | | }); |
| | | Map<String, Map<String, Object>> month = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("month")), Map.class); |
| | | for (int j = 1; j < 13; j++) { |
| | | Object totalMonthAttendance = month.get(j + "").get("totalMonthAttendance"); |
| | | excelRowList.add(totalMonthAttendance); |
| | | for (SysDictData anEnum : enums) { |
| | | if (!anEnum.getDictValue().equals("5")) { |
| | | excelRowList.add(month.get(j + "").get(anEnum.getDictLabel())); |
| | | } |
| | | } |
| | | } |
| | | data.add(excelRowList); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Object, Object> exportToYearExcel(String time, String userName, String laboratory) throws Exception { |
| | | Map<Object, Object> map = new HashMap<>(); |
| | | List<SysDictData> shiftType = dictTypeService.selectDictDataByName("çæ¬¡ç±»å"); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | map.put("header", getYearHeader(localDateTime.getYear() + " å¹´", shiftType)); |
| | | List<Map<String, Object>> mapYearList = baseMapper.performanceShiftYearList(time, userName, laboratory); |
| | | annualAttendanceProcessing(mapYearList, shiftType); |
| | | List<List<Object>> lists = dataRequiredForProcessingIntoExcel(mapYearList, shiftType); |
| | | map.put("data", lists); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Object, Object> exportToMonthExcel(String time, String userName, String laboratory) { |
| | | List<SysDictData> shiftType = dictTypeService.selectDictDataByName("çæ¬¡ç±»å"); |
| | | List<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftList(time, userName, laboratory); |
| | | mapIPage.forEach(i -> { |
| | | String[] shiftTimes = i.getShiftTime().split(";"); |
| | | double totalAttendance = 0; |
| | | List<Map<String, Object>> map = new ArrayList<>(); |
| | | // å岿¥æ |
| | | for (String shiftTime : shiftTimes) { |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | String[] shiftTimeAndShift = shiftTime.split("ï¼"); |
| | | for (SysDictData enums : shiftType) { |
| | | if (!i.getMonthlyAttendance().containsKey(enums.getDictLabel())) { |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), 0); |
| | | } |
| | | if (enums.getDictValue().equals(shiftTimeAndShift[1])) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString()); |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("1"))); |
| | | } |
| | | // åï¼å¦å¤å天ç®ç»æ© |
| | | if (shiftTimeAndShift[1].equals("5") && enums.getDictValue().equals("0")) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getDictLabel()).toString()); |
| | | i.getMonthlyAttendance().put(enums.getDictLabel(), bigDecimal.add(new BigDecimal("0.5"))); |
| | | } |
| | | } |
| | | // æ©ï¼ä¸ï¼å¤ï¼å·® |
| | | if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1); |
| | | } |
| | | // å |
| | | if (shiftTimeAndShift[1].equals("5")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5); |
| | | } |
| | | hashMap.put("id", shiftTimeAndShift[2]); |
| | | hashMap.put("shift", shiftTimeAndShift[1]); |
| | | hashMap.put("time", shiftTimeAndShift[0]); |
| | | map.add(hashMap); |
| | | } |
| | | i.setList(map); |
| | | i.setShiftTime(null); |
| | | }); |
| | | Map<Object, Object> map = new HashMap<>(); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | map.put("header", getMonthHeader(localDateTime, shiftType)); |
| | | List<List<Object>> lists = dataRequiredForProcessingIntoExcelMonth(mapIPage, shiftType); |
| | | map.put("data", lists); |
| | | return map; |
| | | } |
| | | |
| | | // è·å两个localDateTimeçæ¯ä¸å¤© |
| | | public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) { |
| | | List<LocalDateTime> localDateTimes = new ArrayList<>(); |
| | | LocalDate currentDate = start.toLocalDate(); |
| | | LocalDateTime currentLocalDateTime = start; |
| | | while (!currentDate.isAfter(end.toLocalDate())) { |
| | | localDateTimes.add(currentLocalDateTime); |
| | | currentLocalDateTime = currentLocalDateTime.plusDays(1); |
| | | currentDate = currentDate.plusDays(1); |
| | | } |
| | | return localDateTimes; |
| | | } |
| | | |
| | | public static String getWeek(String dayStr) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | Date date = sdf.parse(dayStr); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | return day + " " + getWeekDay(dayOfWeek); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getWeekDay(int dayOfWeek) { |
| | | switch (dayOfWeek) { |
| | | case Calendar.MONDAY: |
| | | return "å¨ä¸"; |
| | | case Calendar.TUESDAY: |
| | | return "å¨äº"; |
| | | case Calendar.WEDNESDAY: |
| | | return "å¨ä¸"; |
| | | case Calendar.THURSDAY: |
| | | return "å¨å"; |
| | | case Calendar.FRIDAY: |
| | | return "å¨äº"; |
| | | case Calendar.SATURDAY: |
| | | return "å¨å
"; |
| | | case Calendar.SUNDAY: |
| | | return "卿¥"; |
| | | default: |
| | | return "æªç¥"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¿å表头 |
| | | * <p> |
| | | * å¤å±List代表è¡å
å± List代表å ç¸åçåæ°æ®ä¼è¢«ä¸»å¨åå¹¶ |
| | | * æé åå表头 |
| | | * |
| | | * @return List<List < String>> |
| | | */ |
| | | private static List<List<String>> getYearHeader(String year, List<SysDictData> enums) { |
| | | List<List<String>> line = new ArrayList<>(); |
| | | line.add(Arrays.asList("è夿±æ»", "åºå·", "åºå·")); |
| | | line.add(Arrays.asList("è夿±æ»", "å·¥å·", "å·¥å·")); |
| | | line.add(Arrays.asList("è夿±æ»", "å§å", "å§å")); |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", year, "åºå¤")); |
| | | // å¹´ header |
| | | for (SysDictData anEnum : enums) { |
| | | if (!anEnum.getDictValue().equals("5")) { |
| | | line.add(Arrays.asList("è夿±æ»", year, anEnum.getDictLabel())); |
| | | } |
| | | } |
| | | // æheader |
| | | for (int i = 1; i < 13; i++) { |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", i + " æ", "åºå¤")); |
| | | for (SysDictData anEnum : enums) { |
| | | if (!anEnum.getDictValue().equals("5")) { |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", i + " æ", anEnum.getDictLabel())); |
| | | } |
| | | } |
| | | } |
| | | return line; |
| | | } |
| | | |
| | | private static List<List<String>> getMonthHeader(LocalDateTime localDateTimeYear, List<SysDictData> enums) { |
| | | String year = localDateTimeYear.getYear() + " 年人åçæ¬¡"; |
| | | List<List<String>> line = new ArrayList<>(); |
| | | line.add(Arrays.asList(year, "åºå·", "åºå·", "åºå·")); |
| | | line.add(Arrays.asList(year, "å§å", "å§å", "å§å")); |
| | | line.add(Arrays.asList(year, "å®éªå®¤", "å®éªå®¤", "å®éªå®¤")); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getYear() + "", localDateTimeYear.getYear() + "", "åºå¤")); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getYear() + "", localDateTimeYear.getYear() + "", enums.get(3).getDictLabel())); |
| | | line.add(Arrays.asList(year, "å¹´", "å¹´", enums.get(4).getDictLabel())); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getMonthValue() + "", localDateTimeYear.getMonthValue() + "", enums.get(0).getDictLabel())); |
| | | line.add(Arrays.asList(year, "æ", "æ", enums.get(1).getDictLabel())); |
| | | line.add(Arrays.asList(year, "", "", enums.get(2).getDictLabel())); |
| | | line.add(Arrays.asList(year, "卿¬¡", "ææ", "åºå·®")); |
| | | LocalDate firstDayOfMonth = localDateTimeYear.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = localDateTimeYear.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> timeList = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | timeList.forEach(i -> { |
| | | int dayOfYear = i.getDayOfMonth(); |
| | | Date from = Date.from(i.atZone(ZoneId.systemDefault()).toInstant()); |
| | | String weekDay = getWeekDay(i.getDayOfWeek().getValue()); |
| | | line.add(Arrays.asList(year, DateUtil.weekOfYear(DateUtil.offsetDay(from, 1)) + "", weekDay, dayOfYear + "")); |
| | | }); |
| | | return line; |
| | | } |
| | | |
| | | public List<List<Object>> dataRequiredForProcessingIntoExcelMonth(List<PerformanceShiftMapDto> list, List<SysDictData> enums) { |
| | | List<List<Object>> data = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | List<Object> excelRowList = new ArrayList<>(); |
| | | excelRowList.add(i + 1); |
| | | excelRowList.add(list.get(i).getName()); |
| | | excelRowList.add(list.get(i).getDepartment()); |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("totalAttendance")); |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(3).getDictLabel())); // ä¼ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(4).getDictLabel())); // å |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(0).getDictLabel())); // æ© |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(1).getDictLabel())); // ä¸ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(2).getDictLabel())); // å¤ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(6).getDictLabel())); // å·® |
| | | for (Map<String, Object> o : list.get(i).getList()) { |
| | | String enumLabel = ""; |
| | | for (SysDictData anEnum : enums) { |
| | | if (anEnum.getDictValue().equals(o.get("shift"))) { |
| | | enumLabel = anEnum.getDictLabel(); |
| | | } |
| | | } |
| | | excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "-" : enumLabel); |
| | | } |
| | | data.add(excelRowList); |
| | | } |
| | | return data; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.performance.mapper.ShiftTimeMapper; |
| | | import com.ruoyi.performance.pojo.ShiftTime; |
| | | import com.ruoyi.performance.service.ShiftTimeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * çæ¬¡å¯¹åºçæ¶é´ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-07-24 11:22:17 |
| | | */ |
| | | @Service |
| | | public class ShiftTimeServiceImpl extends ServiceImpl<ShiftTimeMapper, ShiftTime> implements ShiftTimeService { |
| | | |
| | | @Resource |
| | | ShiftTimeMapper shiftTimeMapper; |
| | | |
| | | @Override |
| | | public void shiftTimeAdd(ShiftTime shiftTime) { |
| | | List<ShiftTime> shiftTimes = shiftTimeMapper.selectList(Wrappers.<ShiftTime>lambdaQuery().eq(ShiftTime::getShift, shiftTime.getShift())); |
| | | if (shiftTimes.size() > 0) { |
| | | throw new BaseException("å·²åå¨è¯¥çæ¬¡çæ¶é´é
ç½®,è¯·å æååæ°å¢!"); |
| | | } |
| | | shiftTimeMapper.insert(shiftTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<ShiftTime> shiftTimeList() { |
| | | return shiftTimeMapper.selectList(null); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.utils; |
| | | |
| | | import com.fasterxml.jackson.core.JsonGenerator; |
| | | import com.fasterxml.jackson.databind.JsonSerializer; |
| | | import com.fasterxml.jackson.databind.SerializerProvider; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.DecimalFormat; |
| | | |
| | | public class CustomerDoubleSerialize extends JsonSerializer { |
| | | private DecimalFormat df = new DecimalFormat("0.0000"); |
| | | |
| | | @Override |
| | | public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { |
| | | if(o.toString() != null && !o.toString().equals("0.0")) { |
| | | Double dd=Double.parseDouble(o.toString()); |
| | | jsonGenerator.writeString(df.format(dd)); |
| | | } else{ |
| | | if(o.toString().equals("0.0")) { |
| | | jsonGenerator.writeString("0"); |
| | | } else { |
| | | jsonGenerator.writeString(o.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.utils; |
| | | |
| | | import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
| | | import com.alibaba.excel.write.metadata.style.WriteFont; |
| | | import org.apache.poi.ss.usermodel.BorderStyle; |
| | | import org.apache.poi.ss.usermodel.FillPatternType; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | |
| | | public class StyleMonthUtils { |
| | | /** |
| | | * æ 颿 ·å¼ |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getHeadStyle(){ |
| | | // 头ççç¥ |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | // èæ¯é¢è² |
| | | // headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex()); |
| | | // headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // åä½ |
| | | WriteFont headWriteFont = new WriteFont(); |
| | | headWriteFont.setFontName("ç线");//设置åä½åå |
| | | headWriteFont.setFontHeightInPoints((short)9);//设置åä½å¤§å° |
| | | headWriteFont.setBold(true);//åä½å ç² |
| | | headWriteFont.setColor((short) 0); |
| | | headWriteCellStyle.setWriteFont(headWriteFont); //卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | // æ ·å¼ |
| | | headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | headWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | headWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | headWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | headWriteCellStyle.setTopBorderColor((short) 0); //设置顶边æ¡é¢è²; |
| | | |
| | | headWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置åç´å¯¹é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return headWriteCellStyle; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
å®¹æ ·å¼ |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getContentStyle(){ |
| | | // å
容ççç¥ |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | // è¿ééè¦æå® FillPatternType 为FillPatternType.SOLID_FOREGROUND ä¸ç¶æ æ³æ¾ç¤ºèæ¯é¢è².头é»è®¤äº FillPatternTypeæä»¥å¯ä»¥ä¸æå® |
| | | // contentWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex()); |
| | | contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // 设置åä½ |
| | | WriteFont contentWriteFont = new WriteFont(); |
| | | contentWriteFont.setFontHeightInPoints((short) 10);//设置åä½å¤§å° |
| | | contentWriteFont.setFontName("ç线"); //设置åä½åå |
| | | contentWriteCellStyle.setWriteFont(contentWriteFont);//卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | //è®¾ç½®æ ·å¼; |
| | | contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | contentWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | contentWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边æ¡é¢è²; |
| | | |
| | | contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// æ°´å¹³å±
ä¸ |
| | | contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// åç´å±
ä¸ |
| | | contentWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | // contentWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return contentWriteCellStyle; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.utils; |
| | | |
| | | import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
| | | import com.alibaba.excel.write.metadata.style.WriteFont; |
| | | import org.apache.poi.ss.usermodel.BorderStyle; |
| | | import org.apache.poi.ss.usermodel.FillPatternType; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | |
| | | public class StyleYearUtils { |
| | | /** |
| | | * æ 颿 ·å¼ |
| | | * |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getHeadStyle() { |
| | | // 头ççç¥ |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | // èæ¯é¢è² |
| | | // headWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex()); |
| | | headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // åä½ |
| | | WriteFont headWriteFont = new WriteFont(); |
| | | headWriteFont.setFontName("仿å®");//设置åä½åå |
| | | headWriteFont.setFontHeightInPoints((short) 9);//设置åä½å¤§å° |
| | | headWriteFont.setBold(true);//åä½å ç² |
| | | headWriteFont.setColor((short) 1); |
| | | headWriteCellStyle.setWriteFont(headWriteFont); //卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | // æ ·å¼ |
| | | headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | headWriteCellStyle.setBottomBorderColor((short) 1);//设置åºè¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | headWriteCellStyle.setLeftBorderColor((short) 1);//设置左边æ¡é¢è²; |
| | | headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | headWriteCellStyle.setRightBorderColor((short) 1);//设置å³è¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | headWriteCellStyle.setTopBorderColor((short) 1); //设置顶边æ¡é¢è²; |
| | | |
| | | headWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置åç´å¯¹é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return headWriteCellStyle; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
å®¹æ ·å¼ |
| | | * |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getContentStyle() { |
| | | // å
容ççç¥ |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | // è¿ééè¦æå® FillPatternType 为FillPatternType.SOLID_FOREGROUND ä¸ç¶æ æ³æ¾ç¤ºèæ¯é¢è².头é»è®¤äº FillPatternTypeæä»¥å¯ä»¥ä¸æå® |
| | | // contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); |
| | | contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // 设置åä½ |
| | | WriteFont contentWriteFont = new WriteFont(); |
| | | contentWriteFont.setFontHeightInPoints((short) 9);//设置åä½å¤§å° |
| | | contentWriteFont.setFontName("仿å®"); //设置åä½åå |
| | | contentWriteCellStyle.setWriteFont(contentWriteFont);//卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | //è®¾ç½®æ ·å¼; |
| | | contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | contentWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | contentWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边æ¡é¢è²; |
| | | |
| | | contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// æ°´å¹³å±
ä¸ |
| | | contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// åç´å±
ä¸ |
| | | contentWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | // contentWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return contentWriteCellStyle; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.AuxiliaryCorrectionHoursMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.AuxiliaryCorrectionHours"> |
| | | <id column="id" property="id"/> |
| | | <result column="name_user" property="nameUser"/> |
| | | <result column="type" property="type"/> |
| | | <result column="one_hours" property="oneHours"/> |
| | | <result column="two_hours" property="twoHours"/> |
| | | <result column="three_hours" property="threeHours"/> |
| | | <result column="four_hours" property="fourHours"/> |
| | | <result column="five_hours" property="fiveHours"/> |
| | | <result column="six_hours" property="sixHours"/> |
| | | <result column="seven_hours" property="sevenHours"/> |
| | | <result column="eight_hours" property="eightHours"/> |
| | | <result column="nine_hours" property="nineHours"/> |
| | | <result column="ten_hours" property="tenHours"/> |
| | | <result column="eleven_hours" property="elevenHours"/> |
| | | <result column="twelve_hours" property="twelveHours"/> |
| | | <result column="thirteen_hours" property="thirteenHours"/> |
| | | <result column="fourteen_hours" property="fourteenHours"/> |
| | | <result column="fifteen_hours" property="fifteenHours"/> |
| | | <result column="sixteen_hours" property="sixteenHours"/> |
| | | <result column="seventeen_hours" property="seventeenHours"/> |
| | | <result column="eighteen_hours" property="eighteenHours"/> |
| | | <result column="nineteen_hours" property="nineteenHours"/> |
| | | <result column="twenty_hours" property="twentyHours"/> |
| | | <result column="twenty_one_hours" property="twentyOneHours"/> |
| | | <result column="twenty_two_hours" property="twentyTwoHours"/> |
| | | <result column="twenty_three_hours" property="twentyThreeHours"/> |
| | | <result column="twenty_four_hours" property="twentyFourHours"/> |
| | | <result column="twenty_five_hours" property="twentyFiveHours"/> |
| | | <result column="twenty_six_hours" property="twentySixHours"/> |
| | | <result column="twenty_seven_hours" property="twentySevenHours"/> |
| | | <result column="twenty_eight_hours" property="twentyEightHours"/> |
| | | <result column="twenty_nine_hours" property="twentyNineHours"/> |
| | | <result column="thirty_hours" property="thirtyHours"/> |
| | | <result column="thirty_one_hours" property="thirtyOneHours"/> |
| | | <result column="month" property="month"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | </resultMap> |
| | | <select id="selectAuxiliaryCorrectionHours" resultType="com.ruoyi.performance.dto.AuxiliaryCorrectionHoursDto"> |
| | | select A.* |
| | | from ( |
| | | select ach.*, |
| | | name, |
| | | sum(one_hours+two_hours+ three_hours+ four_hours+ five_hours+ six_hours+ seven_hours+ eight_hours+ nine_hours+ |
| | | ten_hours+ eleven_hours+ twelve_hours+thirteen_hours+ fourteen_hours+ fifteen_hours+ sixteen_hours+ |
| | | seventeen_hours+ eighteen_hours+ nineteen_hours+ twenty_hours+ twenty_one_hours+ twenty_two_hours+ |
| | | twenty_three_hours+ twenty_four_hours+ twenty_five_hours+ twenty_six_hours+ twenty_seven_hours+ |
| | | twenty_eight_hours+ twenty_nine_hours+ thirty_hours+ thirty_one_hours) as total |
| | | FROM auxiliary_correction_hours ach |
| | | left join user on user.id=ach.name_user |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids != ''"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selDepartLimsByName" resultType="java.lang.Integer"> |
| | | select id |
| | | from department_lims |
| | | where name LIKE CONCAT('%', #{departLims}, '%'); |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.AuxiliaryOriginalHoursMapper"> |
| | | <select id="totalHours" resultType="java.util.Map"> |
| | | select E.name, E.month, E.total manHours |
| | | from (select C.name, C.month, C.manHours + D.manHours as total |
| | | from (select A.name, |
| | | A.month, |
| | | FORMAT(SUM(manHour), 4) as manHours |
| | | from ( |
| | | select user.name, |
| | | case |
| | | when reviewer_nonproductive_time is null then nonproductive_time |
| | | else reviewer_nonproductive_time end as manHour, |
| | | date_time as month |
| | | from auxiliary_working_hours_day awhd |
| | | left join user on user.id = awhd.name_user |
| | | left join department_lims dl on depart_lims_id = dl.id |
| | | where date_time LIKE CONCAT('%', #{month}, '%') |
| | | and awhd.state='å·²æ¹å' |
| | | <!--and name_user in(#{ids})--> |
| | | <if test="ids !=null and ids != ''"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | order by month |
| | | ) A |
| | | group by A.name, A.month) C |
| | | INNER JOIN |
| | | (select B.name, |
| | | B.month, |
| | | B.manHours |
| | | from ( |
| | | select user.name, |
| | | date_time as month, |
| | | FORMAT(SUM(output_work_time), 4) as manHours |
| | | from auxiliary_output_working_hours aowh |
| | | left join user on user.id = aowh.`check` |
| | | left join department_lims dl on depart_lims_id = dl.id |
| | | where date_time LIKE CONCAT('%', #{month}, '%') |
| | | <!--and `check` in(#{ids})--> |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | group by user.name, month |
| | | order by user.name, month |
| | | ) B |
| | | group by B.name, B.month) D |
| | | on C.month = D.month |
| | | where C.name = D.name |
| | | ) E |
| | | group by E.name, E.month |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.AuxiliaryOutputWorkingHoursMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours"> |
| | | <id column="id" property="id"/> |
| | | <result column="inspection_item" property="inspectionItem"/> |
| | | <result column="inspection_item_subclass" property="inspectionItemSubclass"/> |
| | | <result column="sample" property="sample"/> |
| | | <result column="overtime_order_no" property="overtimeOrderNo"/> |
| | | <result column="overtime_work_time" property="overtimeWorkTime"/> |
| | | <result column="overtime_amount" property="overtimeAmount"/> |
| | | <result column="order_no" property="orderNo"/> |
| | | <result column="work_time" property="workTime"/> |
| | | <result column="amount" property="amount"/> |
| | | <result column="output_work_time" property="outputWorkTime"/> |
| | | <result column="date_time" property="dateTime"/> |
| | | <result column="week" property="week"/> |
| | | <result column="week_day" property="weekDay"/> |
| | | <result column="check" property="check"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAuxiliaryOutputWorking"> |
| | | select * |
| | | from ( |
| | | select aowh.id, |
| | | aowh.inspection_item_class, |
| | | aowh.inspection_item, |
| | | aowh.inspection_item_subclass, |
| | | aowh.overtime_order_no, |
| | | aowh.overtime_work_time, |
| | | aowh.overtime_amount, |
| | | aowh.order_no, |
| | | aowh.work_time, |
| | | aowh.amount, |
| | | aowh.output_work_time, |
| | | aowh.date_time, |
| | | aowh.week, |
| | | aowh.week_day, |
| | | user.name, |
| | | aowh.sample, |
| | | aowh.price, |
| | | aowh.man_hour_group, |
| | | ip.cable_tag |
| | | FROM auxiliary_output_working_hours aowh |
| | | left join ins_product ip on ip.id = aowh.ins_product_id |
| | | left join user on user.id=aowh.`check` |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </sql> |
| | | <select id="selectAuxiliaryOutputWorkingHours" resultType="com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto"> |
| | | <include refid="selectAuxiliaryOutputWorking"/> |
| | | </select> |
| | | <select id="selectDataByUser" resultType="com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto"> |
| | | select aowh.*, name, ip.cable_tag cableTag |
| | | FROM auxiliary_output_working_hours aowh |
| | | left join ins_product ip on ip.id = aowh.ins_product_id |
| | | left join user on user.id = aowh.`check` |
| | | WHERE 1 = 1 |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="totalHours" resultType="java.util.Map"> |
| | | select A.name, |
| | | A.month, |
| | | FORMAT(SUM(A.manHours), 4) manHours |
| | | from( |
| | | select user.name, |
| | | date_time as month, |
| | | order_no, |
| | | sample, |
| | | man_hour_group, |
| | | case when #{type}='å çå·¥æ¶' then case when overtime_work_time is null then 0 else overtime_work_time end |
| | | else case when work_time is null then 0 else work_time end end as manHours |
| | | -- FORMAT(SUM(output_work_time), 4) as manHours |
| | | from auxiliary_output_working_hours aowh |
| | | left join user on user.id=aowh.`check` |
| | | left join department_lims dl on depart_lims_id=dl.id |
| | | where date_time LIKE CONCAT('%', #{month}, '%') |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | group by user.name,date_time,order_no, |
| | | sample, |
| | | man_hour_group |
| | | order by user.name,date_time,order_no, |
| | | sample, |
| | | man_hour_group |
| | | )A |
| | | group by A.name, |
| | | A.month |
| | | order by A.name, |
| | | A.month |
| | | </select> |
| | | <select id="selectListByIds" resultType="com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours"> |
| | | select * from auxiliary_output_working_hours |
| | | where 1=1 |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectLists" resultMap="BaseResultMap"> |
| | | select * from(select * from auxiliary_output_working_hours |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids != ''"> |
| | | and `check` in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectAuxiliaryAllByMonth" resultType="com.ruoyi.performance.dto.AuxiliaryAllDto"> |
| | | select sum(aowh.work_time) yieldHour, |
| | | u.name userName, |
| | | aowh.`check` userId, |
| | | #{dto.month} month |
| | | from (SELECT * |
| | | FROM auxiliary_output_working_hours |
| | | GROUP BY CASE |
| | | WHEN man_hour_group IS NOT NULL AND man_hour_group != '' THEN man_hour_group |
| | | ELSE id |
| | | END |
| | | , CASE |
| | | WHEN man_hour_group IS NOT NULL AND man_hour_group != '' THEN order_id |
| | | ELSE id |
| | | END) aowh |
| | | left join user u on u.id = aowh.`check` |
| | | where aowh.date_time between #{dto.beginDate} and #{dto.endDate} |
| | | <if test="userIds !=null and userIds.size() > 0"> |
| | | and aowh.`check` in |
| | | <foreach collection="userIds" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | group by aowh.`check` |
| | | </select> |
| | | <select id="selectSubsidiaryAllByMonth" resultType="com.ruoyi.performance.dto.AuxiliaryAllDto"> |
| | | select sum(awhd.reviewer_nonproductive_time) subsidiaryHour, |
| | | u.name userName, |
| | | awhd.name_user userId, |
| | | #{dto.month} month |
| | | from auxiliary_working_hours_day awhd |
| | | left join user u on u.id = awhd.name_user |
| | | where awhd.date_time between #{dto.beginDate} and #{dto.endDate} |
| | | and awhd.state = 'å·²æ¹å' |
| | | <if test="userIds !=null and userIds.size() > 0"> |
| | | and awhd.name_user in |
| | | <foreach collection="userIds" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | group by awhd.name_user |
| | | </select> |
| | | <!-- æ¥è¯¢äº§éå·¥æ¶éå --> |
| | | <select id="selectAuxiliaryOutputWorkingHoursList" resultType="com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursDto"> |
| | | <include refid="selectAuxiliaryOutputWorking"/> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.AuxiliaryWorkingHoursDayMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay"> |
| | | <id column="id" property="id"/> |
| | | <result column="nameUser" property="nameUser"/> |
| | | <result column="number" property="number"/> |
| | | <result column="auxiliary_project" property="auxiliaryProject"/> |
| | | <result column="approved_working_hour" property="approvedWorkingHour"/> |
| | | <result column="amount" property="amount"/> |
| | | <result column="nonproductive_time" property="nonproductiveTime"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="reviewer" property="reviewer"/> |
| | | <result column="reviewer_number" property="reviewerNumber"/> |
| | | <result column="reviewer_nonproductive_time" property="reviewerNonproductiveTime"/> |
| | | <result column="reviewer_remark" property="reviewerRemark"/> |
| | | <result column="year" property="year"/> |
| | | <result column="shift" property="shift"/> |
| | | <result column="week" property="week"/> |
| | | <result column="week_day" property="weekDay"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="state" property="state"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAuxiliaryWorkingHours"> |
| | | select A.* |
| | | from ( |
| | | select awhd.*,name |
| | | FROM auxiliary_working_hours_day awhd |
| | | left join user on name_user=user.id |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="selectAuxiliaryWorkingHoursDay" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto"> |
| | | <include refid="selectAuxiliaryWorkingHours"/> |
| | | </select> |
| | | <select id="selectDataByUser" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto"> |
| | | select awhd.*,name |
| | | FROM auxiliary_working_hours_day awhd |
| | | left join user on name_user=user.id |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="selectListByIds" resultType="com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay"> |
| | | select * from auxiliary_working_hours_day |
| | | where state='å·²å®¡æ ¸' |
| | | <if test="ids !=null and ids != ''"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="totalHours" resultType="java.util.Map"> |
| | | select A.name, |
| | | A.month, |
| | | FORMAT(SUM(manHour), 4)as manHours |
| | | from( |
| | | select user.name, |
| | | case when reviewer_nonproductive_time is null then nonproductive_time |
| | | else reviewer_nonproductive_time end as manHour, |
| | | date_time as month |
| | | from auxiliary_working_hours_day awhd |
| | | left join user on user.id=awhd.name_user |
| | | left join department_lims dl on depart_lims_id=dl.id |
| | | where date_time LIKE CONCAT('%', #{month}, '%') |
| | | and awhd.state='å·²æ¹å' |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | order by month,user.name |
| | | )A |
| | | group by A.name,A.month |
| | | order by A.name,A.month |
| | | </select> |
| | | |
| | | <select id="selectLists" resultMap="BaseResultMap"> |
| | | select * from(select * from auxiliary_working_hours_day |
| | | WHERE 1=1 |
| | | <if test="ids !=null and ids.size() > 0"> |
| | | and name_user in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </if> |
| | | ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectAuxiliaryWorkingHoursDayList" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto"> |
| | | <include refid="selectAuxiliaryWorkingHours"/> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.AuxiliaryWorkingHoursMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.AuxiliaryWorkingHours"> |
| | | <id column="id" property="id" /> |
| | | <result column="number" property="number"/> |
| | | <result column="AuxiliaryProject" property="auxiliaryProject" /> |
| | | <result column="approved_working_hour" property="approvedWorkingHour" /> |
| | | <result column="remarks" property="remarks" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="department" property="department" /> |
| | | <result column="laboratory" property="laboratory" /> |
| | | <result column="unit" property="unit"/> |
| | | </resultMap> |
| | | <select id="selectAuxiliaryWorkingHours" resultType="com.ruoyi.performance.pojo.AuxiliaryWorkingHours"> |
| | | select data.* |
| | | from ( |
| | | select |
| | | awh.id, |
| | | awh.number, |
| | | awh.auxiliary_project, |
| | | awh.laboratory, |
| | | awh.unit, |
| | | awh.approved_working_hour, |
| | | awh.department, |
| | | awh.remarks |
| | | FROM auxiliary_working_hours awh |
| | | ) data |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.PerformanceShiftMapper"> |
| | | |
| | | <resultMap id="performanceShiftPageMap" type="com.ruoyi.performance.dto.PerformanceShiftMapDto"> |
| | | <result column="name" property="name"/> |
| | | <result column="shift_time" property="shiftTime"/> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="department" property="department" /> |
| | | </resultMap> |
| | | |
| | | <select id="performanceShiftPage" resultMap="performanceShiftPageMap"> |
| | | SELECT |
| | | if(u2.department is not null and u2.department != '', CONCAT(u2.name, 'ï¼', u2.department, 'ï¼'), u2.name) name, |
| | | GROUP_CONCAT(s.work_time, 'ï¼', s.shift, 'ï¼', s.id order by s.work_time SEPARATOR ';') AS shift_time, u2.id user_id |
| | | FROM performance_shift s |
| | | LEFT JOIN (SELECT distinct u.* from |
| | | user u |
| | | left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where state=1 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | | ) u2 on u2.id = s.user_id |
| | | <where> |
| | | name is not null |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u2.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | </where> |
| | | order by s.create_time |
| | | GROUP BY u2.id |
| | | </select> |
| | | |
| | | <select id="performanceShiftYearPage" resultType="map"> |
| | | SELECT |
| | | s.user_id, s.shift |
| | | FROM performance_shift s |
| | | LEFT JOIN (SELECT u.* from |
| | | user u |
| | | left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where state=1 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | | ) u2 on u2.id = s.user_id |
| | | where s.shift is not NULL |
| | | and s.shift != '' |
| | | and name is not null |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u2.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftYear" resultType="java.util.Map"> |
| | | SELECT if(u2.department is not null and u2.department != '', CONCAT(u2.name, 'ï¼', u2.department, 'ï¼'), u2.name) name, |
| | | s.user_id, u2.account, |
| | | DATE_FORMAT(s.work_time, '%c') work_time, |
| | | GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), 'ï¼', s.shift order by s.work_time SEPARATOR ';') month_str |
| | | FROM performance_shift s |
| | | LEFT JOIN (SELECT u.* from |
| | | user u |
| | | left join department_lims dl on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where state=1 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | | ) u2 on u2.id = s.user_id |
| | | where s.shift is not NULL |
| | | and s.shift != '' |
| | | and name is not null |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | GROUP BY u2.id |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftYearList" resultType="map"> |
| | | SELECT if(u.department is not null and u.department != '', CONCAT(u.name, 'ï¼', u.department, 'ï¼'), u.name) name, |
| | | s.user_id, u.account, |
| | | DATE_FORMAT(s.work_time, '%c') work_time, |
| | | GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), 'ï¼', s.shift order by s.work_time SEPARATOR ';') month_str |
| | | FROM performance_shift s |
| | | LEFT JOIN user u on u.id = s.user_id |
| | | where s.shift is not NULL |
| | | and s.shift != '' |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | </if> |
| | | GROUP BY u.id |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftList" resultMap="performanceShiftPageMap"> |
| | | SELECT |
| | | if(u.department is not null and u.department != '', CONCAT(u.name, 'ï¼', u.department, 'ï¼'), u.name) name, |
| | | GROUP_CONCAT(s.work_time, 'ï¼', s.shift, 'ï¼', s.id order by s.work_time SEPARATOR ';') AS shift_time, u.id user_id, u.department |
| | | FROM performance_shift s |
| | | LEFT JOIN user u on u.id = s.user_id |
| | | <where> |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | </if> |
| | | </where> |
| | | order by s.create_time |
| | | GROUP BY u.id |
| | | </select> |
| | | |
| | | <select id="seldepLimsId" resultType="java.lang.String"> |
| | | select name |
| | | from department_lims |
| | | where id = #{depLimsId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.performance.mapper.ShiftTimeMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.ShiftTime"> |
| | | <id column="id" property="id" /> |
| | | <result column="shift" property="shift" /> |
| | | <result column="start_time" property="startTime" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <!--åç«¯æ³¨éæ£éªå·¥å
·--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | <version>${spring-boot.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è¦çlogbackçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>ch.qos.logback</groupId> |
| | |
| | | <module>ruoyi-common</module> |
| | | <module>basic-server</module> |
| | | <module>inspect-server</module> |
| | | <module>performance-server</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!--ç»©ææ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>performance-server</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | <artifactId>commons-text</artifactId> |
| | | <version>1.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.datatype</groupId> |
| | | <artifactId>jackson-datatype-jsr310</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import com.fasterxml.jackson.core.JsonGenerationException; |
| | | import com.fasterxml.jackson.core.JsonParseException; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.ObjectWriter; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | |
| | | /** |
| | | * JSONè§£æå¤ç |
| | | * |
| | | * @author å¼ å®¾ |
| | | */ |
| | | @Component |
| | | public class JackSonUtil { |
| | | private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); |
| | | private static final ObjectWriter OBJECT_WRITER = OBJECT_MAPPER.writerWithDefaultPrettyPrinter(); |
| | | |
| | | public static void marshal(File file, Object value) throws Exception { |
| | | try { |
| | | OBJECT_WRITER.writeValue(file, value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static void marshal(OutputStream os, Object value) throws Exception { |
| | | try { |
| | | OBJECT_WRITER.writeValue(os, value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static String marshal(Object value) throws Exception { |
| | | try { |
| | | return OBJECT_WRITER.writeValueAsString(value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static byte[] marshalBytes(Object value) throws Exception { |
| | | try { |
| | | return OBJECT_WRITER.writeValueAsBytes(value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(File file, Class<T> valueType) throws Exception { |
| | | try { |
| | | return OBJECT_MAPPER.readValue(file, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(InputStream is, Class<T> valueType) throws Exception { |
| | | try { |
| | | return OBJECT_MAPPER.readValue(is, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å符串转对象 |
| | | * @param str |
| | | * @param valueType |
| | | * @return |
| | | * @param <T> |
| | | * @throws Exception |
| | | */ |
| | | public static <T> T unmarshal(String str, Class<T> valueType) throws Exception { |
| | | try { |
| | | OBJECT_MAPPER.registerModule(new JavaTimeModule()); |
| | | return OBJECT_MAPPER.readValue(str, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(byte[] bytes, Class<T> valueType) throws Exception { |
| | | try { |
| | | if (bytes == null) { |
| | | bytes = new byte[0]; |
| | | } |
| | | return OBJECT_MAPPER.readValue(bytes, 0, bytes.length, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.entity.Custom; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | public interface CustomMapper extends BaseMapper<Custom> { |
| | | |
| | | IPage<Custom> selectCustomPageList(IPage<Custom> page, QueryWrapper<Custom> ew); |
| | | IPage<Custom> selectCustomPageList(IPage<Custom> page, @Param("ew") QueryWrapper<Custom> ew); |
| | | |
| | | int delCustomById(Integer id); |
| | | |