¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.pojo.EvaluateCompetent; |
| | | import com.ruoyi.process.service.EvaluateCompetentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | | * 主管æå å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:36 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-人åèè¯") |
| | | @RestController |
| | | @RequestMapping("/evaluateCompetent") |
| | | public class EvaluateCompetentController { |
| | | |
| | | @Resource |
| | | private EvaluateCompetentService evaluateCompetentService; |
| | | |
| | | @ApiOperation(value="æ¥è¯¢ä¸»ç®¡æå") |
| | | @GetMapping("/getEvaluateCompetent") |
| | | @PreAuthorize("@ss.hasPermi('staffEvaluate:supervisorRate:list')") |
| | | public Result getEvaluateCompetent(EvaluateGroupDto evaluateGroupDto) { |
| | | return Result.success(evaluateCompetentService.getEvaluateCompetent(evaluateGroupDto)); |
| | | } |
| | | |
| | | @ApiOperation(value="å¡«å主管æå") |
| | | @PostMapping("/writeEvaluateCompetent") |
| | | public Result writeEvaluateCompetent(@RequestBody EvaluateCompetent evaluateCompetent) { |
| | | return Result.success(evaluateCompetentService.writeEvaluateCompetent(evaluateCompetent)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºä¸»ç®¡æå") |
| | | @PostMapping("/exportEvaluateCompetent") |
| | | public void exportEvaluateCompetent(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateCompetentService.export(month, name, departLims, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.pojo.EvaluateLeader; |
| | | import com.ruoyi.process.service.EvaluateLeaderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç»é¿æå å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:56 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-人åèè¯") |
| | | @RestController |
| | | @RequestMapping("/evaluateLeader") |
| | | public class EvaluateLeaderController { |
| | | |
| | | @Resource |
| | | private EvaluateLeaderService evaluateLeaderService; |
| | | |
| | | @ApiOperation(value="æ¥è¯¢ç»é¿è¯å") |
| | | @GetMapping("/getEvaluateLeader") |
| | | @PreAuthorize("@ss.hasPermi('staffEvaluate:leaderRate:list')") |
| | | public Result getEvaluateLeader( EvaluateGroupDto evaluateGroupDto) { |
| | | return Result.success(evaluateLeaderService.getEvaluateLeader(evaluateGroupDto)); |
| | | } |
| | | |
| | | @ApiOperation(value="å¡«åç»é¿è¯å") |
| | | @PostMapping("/writeEvaluateLeader") |
| | | public Result writeEvaluateLeader(@RequestBody EvaluateLeader evaluateLeader) { |
| | | return Result.success(evaluateLeaderService.writeEvaluateLeader(evaluateLeader)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºç»é¿æå") |
| | | @PostMapping("/exportEvaluateLeader") |
| | | public void exportEvaluateLeader(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateLeaderService.export(month, name, departLims, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | //åå·¥äºè¯æ¥è¯¢æ¡ä»¶ |
| | | public class EvaluateGroupDto { |
| | | |
| | | //æä»½ |
| | | private String month; |
| | | |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | //人ååç§° |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.process.pojo.EvaluateCompetent; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 主管æå Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:36 |
| | | */ |
| | | public interface EvaluateCompetentMapper extends BaseMapper<EvaluateCompetent> { |
| | | |
| | | List<EvaluateCompetent> getEvaluateCompetent(@Param("month") String month, @Param("departLims") String departLims, @Param("name") String name); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.process.pojo.EvaluateLeader; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç»é¿æå Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:56 |
| | | */ |
| | | public interface EvaluateLeaderMapper extends BaseMapper<EvaluateLeader> { |
| | | |
| | | List<EvaluateLeader> getEvaluateLeader(@Param("month") String month, @Param("departLims") String departLims, @Param("name") String name); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | 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.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 主管æå |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:36 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("evaluate_competent") |
| | | @ApiModel(value = "EvaluateCompetent对象", description = "主管æå") |
| | | public class EvaluateCompetent { |
| | | |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ExcelIgnore |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å¤é® å
³è人åèè¯è¡¨id") |
| | | @ExcelIgnore |
| | | private Integer evaluateId; |
| | | |
| | | @TableField(exist = false, select = false) |
| | | @ExcelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("æè½æ°´å¹³") |
| | | @ExcelProperty(value = {"æè½æ°´å¹³", "20"}) |
| | | private Double skill; |
| | | |
| | | @ApiModelProperty("æä»åå·¥") |
| | | @ExcelProperty(value = {"æä»åå·¥", "20"}) |
| | | private Double compliance; |
| | | |
| | | @ApiModelProperty("ç§¯ææ§") |
| | | @ExcelProperty(value = {"ç§¯ææ§", "20"}) |
| | | private Double positive; |
| | | |
| | | @ApiModelProperty("5S-3å®") |
| | | @ExcelProperty(value = {"5S-3å®", "10"}) |
| | | private Double tidy; |
| | | |
| | | @ApiModelProperty("è§ç« å¶åº¦") |
| | | @ExcelProperty(value = {"è§ç« å¶åº¦", "10"}) |
| | | private Double discipline; |
| | | |
| | | @ApiModelProperty("å¢ç»åä½") |
| | | @ExcelProperty(value = {"å¢ç»åä½", "10"}) |
| | | private Double solidarity; |
| | | |
| | | @ApiModelProperty("ææ¡ç§¯å") |
| | | @ExcelProperty(value = {"ææ¡ç§¯å", "10"}) |
| | | private Double proposal; |
| | | |
| | | @ApiModelProperty("å¾å") |
| | | @ExcelProperty(value = {"å¾å", "100"}) |
| | | private Double total; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | 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.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç»é¿æå |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:56 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("evaluate_leader") |
| | | @ApiModel(value = "EvaluateLeader对象", description = "ç»é¿æå") |
| | | public class EvaluateLeader { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ExcelIgnore |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å¤é® å
³è人åèè¯è¡¨id") |
| | | @ExcelIgnore |
| | | private Integer evaluateId; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("å·¥ä½è´£ä»»å¿") |
| | | @ExcelProperty(value = {"å·¥ä½è´£ä»»å¿", "25"}) |
| | | private Double responsibility; |
| | | |
| | | @ApiModelProperty("æä»åå·¥") |
| | | @ExcelProperty(value = {"æä»åå·¥", "25"}) |
| | | private Double compliance; |
| | | |
| | | @ApiModelProperty("ç§¯ææ§") |
| | | @ExcelProperty(value = {"ç§¯ææ§", "20"}) |
| | | private Double positive; |
| | | |
| | | @ApiModelProperty("å¢ç»åäº") |
| | | @ExcelProperty(value = {"å¢ç»åäº", "10"}) |
| | | private Double solidarity; |
| | | |
| | | @ApiModelProperty("åæ¶æ§") |
| | | @ExcelProperty(value = {"è¯éªåæ¶æ§", "10"}) |
| | | private Double seasonable; |
| | | |
| | | @ApiModelProperty("åç¡®æ§") |
| | | @ExcelProperty(value = {"ç»æåç¡®æ§", "10"}) |
| | | private Double exact; |
| | | |
| | | @ApiModelProperty("å¾å") |
| | | @ExcelProperty(value = {"å¾å", "100"}) |
| | | private Double total; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.pojo.EvaluateCompetent; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | public interface EvaluateCompetentService extends IService<EvaluateCompetent> { |
| | | |
| | | List<EvaluateCompetent> getEvaluateCompetent(EvaluateGroupDto evaluateGroupDto); |
| | | |
| | | Double writeEvaluateCompetent(EvaluateCompetent evaluateCompetent); |
| | | |
| | | void export(String month, String name, String departLims, HttpServletResponse response)throws IOException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.pojo.EvaluateLeader; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | public interface EvaluateLeaderService extends IService<EvaluateLeader> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»é¿è¯å |
| | | * @param evaluateGroupDto |
| | | * @return |
| | | */ |
| | | List<EvaluateLeader> getEvaluateLeader(EvaluateGroupDto evaluateGroupDto); |
| | | |
| | | Double writeEvaluateLeader(EvaluateLeader evaluateLeader); |
| | | |
| | | void export(String month, String name, String departLims, HttpServletResponse response) throws IOException; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.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.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.performance.mapper.EvaluateMapper; |
| | | import com.ruoyi.performance.pojo.Evaluate; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.mapper.EvaluateCompetentMapper; |
| | | import com.ruoyi.process.pojo.EvaluateCompetent; |
| | | import com.ruoyi.process.service.EvaluateCompetentService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 主管æå æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:36 |
| | | */ |
| | | @Service |
| | | public class EvaluateCompetentServiceImpl extends ServiceImpl<EvaluateCompetentMapper, EvaluateCompetent> implements EvaluateCompetentService { |
| | | |
| | | @Resource |
| | | EvaluateCompetentMapper evaluateCompetentMapper; |
| | | |
| | | @Resource |
| | | EvaluateMapper evaluateMapper; |
| | | |
| | | @Override |
| | | public List<EvaluateCompetent> getEvaluateCompetent(EvaluateGroupDto evaluateGroupDto) { |
| | | return evaluateCompetentMapper.getEvaluateCompetent(evaluateGroupDto.getMonth(), evaluateGroupDto.getDepartLims(), evaluateGroupDto.getName()); |
| | | } |
| | | |
| | | @Override |
| | | public Double writeEvaluateCompetent(EvaluateCompetent evaluateCompetent) { |
| | | double newTotal = evaluateCompetent.getSkill() + evaluateCompetent.getCompliance() + evaluateCompetent.getPositive() + evaluateCompetent.getTidy() + evaluateCompetent.getDiscipline() + evaluateCompetent.getSolidarity() + evaluateCompetent.getProposal(); |
| | | EvaluateCompetent evaluateCompetent1 = evaluateCompetentMapper.selectById(evaluateCompetent.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateCompetent.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateCompetent1.getTotal() * 0.5 + newTotal * 0.5); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateCompetent.setTotal(newTotal); |
| | | evaluateCompetentMapper.updateById(evaluateCompetent); |
| | | return newTotal; |
| | | } |
| | | |
| | | //å¯¼åº |
| | | @Override |
| | | public void export(String month, String name, String departLims, HttpServletResponse response) throws IOException { |
| | | List<EvaluateCompetent> evaluateCompetents = new ArrayList<EvaluateCompetent>(); |
| | | evaluateCompetents = evaluateCompetentMapper.getEvaluateCompetent(month, departLims, name); |
| | | 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(EvaluateCompetent.class).build(); |
| | | excelWriter.write(evaluateCompetents, mainSheet); |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.process.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.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.performance.mapper.EvaluateMapper; |
| | | import com.ruoyi.performance.pojo.Evaluate; |
| | | import com.ruoyi.process.dto.EvaluateGroupDto; |
| | | import com.ruoyi.process.mapper.EvaluateLeaderMapper; |
| | | import com.ruoyi.process.pojo.EvaluateLeader; |
| | | import com.ruoyi.process.service.EvaluateLeaderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç»é¿æå æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:56 |
| | | */ |
| | | @Service |
| | | public class EvaluateLeaderServiceImpl extends ServiceImpl<EvaluateLeaderMapper, EvaluateLeader> implements EvaluateLeaderService { |
| | | |
| | | @Resource |
| | | EvaluateLeaderMapper evaluateLeaderMapper; |
| | | |
| | | @Resource |
| | | EvaluateMapper evaluateMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<EvaluateLeader> getEvaluateLeader(EvaluateGroupDto evaluateGroupDto) { |
| | | return evaluateLeaderMapper.getEvaluateLeader(evaluateGroupDto.getMonth(), evaluateGroupDto.getDepartLims(), evaluateGroupDto.getName()); |
| | | } |
| | | |
| | | @Override |
| | | public Double writeEvaluateLeader(EvaluateLeader evaluateLeader) { |
| | | double newTotal = evaluateLeader.getSeasonable() + evaluateLeader.getExact() + evaluateLeader.getResponsibility() + evaluateLeader.getCompliance() + evaluateLeader.getPositive() + evaluateLeader.getSolidarity(); |
| | | EvaluateLeader evaluateLeader1 = evaluateLeaderMapper.selectById(evaluateLeader.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateLeader.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateLeader1.getTotal() * 0.3 + newTotal * 0.3); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateLeader.setTotal(newTotal); |
| | | evaluateLeaderMapper.updateById(evaluateLeader); |
| | | return newTotal; |
| | | } |
| | | |
| | | @Override |
| | | public void export(String month, String name, String departLims, HttpServletResponse response) throws IOException { |
| | | List<EvaluateLeader> evaluateLeaders = new ArrayList<EvaluateLeader>(); |
| | | evaluateLeaders = evaluateLeaderMapper.getEvaluateLeader(month, departLims, name); |
| | | 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(EvaluateLeader.class).build(); |
| | | excelWriter.write(evaluateLeaders, mainSheet); |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.process.mapper.EvaluateCompetentMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.process.pojo.EvaluateCompetent"> |
| | | <id column="id" property="id" /> |
| | | <result column="evaluate_id" property="evaluateId" /> |
| | | <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="skill" property="skill" /> |
| | | <result column="compliance" property="compliance" /> |
| | | <result column="positive" property="positive" /> |
| | | <result column="tidy" property="tidy" /> |
| | | <result column="discipline" property="discipline" /> |
| | | <result column="solidarity" property="solidarity" /> |
| | | <result column="proposal" property="proposal" /> |
| | | <result column="total" property="total" /> |
| | | <result column="name" property="name" /> |
| | | <result column="depart_lims" property="departLims" /> |
| | | </resultMap> |
| | | <select id="getEvaluateCompetent" resultType="com.ruoyi.process.pojo.EvaluateCompetent"> |
| | | select ec.*,u.name, |
| | | dl.name depart_lims |
| | | from evaluate_competent ec |
| | | left join evaluate e on ec.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id) |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | | </if> |
| | | <if test="departLims!=null and departLims!=''"> |
| | | and dl.name like concat ('%',#{departLims},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and u.name like concat ('%',#{name},'%') |
| | | </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.process.mapper.EvaluateLeaderMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.process.pojo.EvaluateLeader"> |
| | | <id column="id" property="id" /> |
| | | <result column="evaluate_id" property="evaluateId" /> |
| | | <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="responsibility" property="responsibility" /> |
| | | <result column="compliance" property="compliance" /> |
| | | <result column="positive" property="positive" /> |
| | | <result column="solidarity" property="solidarity" /> |
| | | <result column="seasonable" property="seasonable" /> |
| | | <result column="exact" property="exact" /> |
| | | <result column="total" property="total" /> |
| | | <result column="name" property="name" /> |
| | | <result column="depart_lims" property="departLims"/> |
| | | </resultMap> |
| | | <select id="getEvaluateLeader" resultType="com.ruoyi.process.pojo.EvaluateLeader"> |
| | | select el.*,u.name,dl.name depart_lims |
| | | from evaluate_leader el |
| | | left join evaluate e on el.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id) |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | | </if> |
| | | <if test="departLims!=null and departLims!=''"> |
| | | and dl.name like concat ('%',#{departLims},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and u.name like concat ('%',#{name},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | |
| | | <groupId>com.ruoui</groupId> |
| | | <artifactId>cnas_server</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | </properties> |
| | | |
| | | </project> |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-system</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>basic-server</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <properties> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Evaluate; |
| | | import com.ruoyi.performance.service.EvaluateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | 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 = "绩æç®¡ç-人åèè¯") |
| | | @RestController |
| | | @RequestMapping("/evaluate") |
| | | public class EvaluateController { |
| | | |
| | | |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢èè¯") |
| | | @GetMapping("/page") |
| | | @PreAuthorize("@ss.hasPermi('staffEvaluate:evaluation:list')") |
| | | public Result page(Page page , Evaluate evaluate) throws Exception { |
| | | return Result.success(evaluateService.getPage(page, evaluate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºèè¯") |
| | | @PostMapping("/exportEvaluate") |
| | | public void exportEvaluate(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateService.export(month, name, departLims, response); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.performance.dto.EvaluateGroupDto; |
| | | import com.ruoyi.performance.pojo.EvaluateGroup; |
| | | import com.ruoyi.performance.service.EvaluateGroupService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥äºè¯è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:45 |
| | | */ |
| | | @Api(tags = "绩æç®¡ç-人åèè¯") |
| | | @RestController |
| | | @RequestMapping("/evaluateGroup") |
| | | public class EvaluateGroupController { |
| | | |
| | | |
| | | @Resource |
| | | private EvaluateGroupService evaluateGroupService; |
| | | |
| | | @ApiOperation(value="æ¥è¯¢åå·¥äºè¯") |
| | | @GetMapping("/getEvaluateGroup") |
| | | @PreAuthorize("@ss.hasPermi('staffEvaluate:employeeMutualEvaluation:list')") |
| | | public Result getEvaluateGroup(EvaluateGroupDto evaluateGroupDto) { |
| | | return Result.success(evaluateGroupService.getEvaluateGroup(evaluateGroupDto)); |
| | | } |
| | | |
| | | @ApiOperation(value="å¡«ååå·¥äºè¯") |
| | | @PostMapping("/writeEvaluateGroup") |
| | | public Result writeEvaluateGroup(@RequestBody EvaluateGroup evaluateGroup) { |
| | | return Result.success(evaluateGroupService.writeEvaluateGroup(evaluateGroup)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.service.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "æä»½å页æ¥è¯¢") |
| | | @PostMapping("page") |
| | | public Result<?> performanceShiftPage(Integer size, Integer current, String time, String userName, String laboratory) { |
| | | @GetMapping("page") |
| | | public Result<?> performanceShiftPage(@Param("size") Integer size,@Param("current") Integer current,@Param("time") String time,@Param("userName") String userName,@Param("laboratory") String laboratory) { |
| | | return Result.success(performanceShiftService.performanceShiftPage(new Page<>(current, size), time, userName, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "年份å页æ¥è¯¢") |
| | | @PostMapping("pageYear") |
| | | @GetMapping("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("çæ¬¡:æ¥è¯¢äººåå表") |
| | | @GetMapping("/getUserList") |
| | | public Result<?> getUserList(){ |
| | | return Result.success(performanceShiftService.getUserList()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "ä¸´æ¶æ¥å£-æ·»å 7æä»½8æä»½çæ°æ®") |
| | | @GetMapping("temporaryInterface") |
| | | public void temporaryInterface() { |
| | |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
ç½®æ¥è¯¢") |
| | | @PostMapping("list") |
| | | @GetMapping("list") |
| | | public Result<?> shiftTimeList() { |
| | | return Result.success(shiftTimeService.shiftTimeList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æçæ¶é´é
ç½®å é¤") |
| | | @PostMapping("remove") |
| | | @DeleteMapping("remove") |
| | | public Result<?> shiftTimeRemove(Long id) { |
| | | return Result.success(shiftTimeService.removeById(id)); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | //åå·¥äºè¯æ¥è¯¢æ¡ä»¶ |
| | | public class EvaluateGroupDto { |
| | | |
| | | //æä»½ |
| | | private String month; |
| | | |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | //人ååç§° |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.performance.pojo.EvaluateGroup; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥äºè¯è¡¨ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:45 |
| | | */ |
| | | public interface EvaluateGroupMapper extends BaseMapper<EvaluateGroup> { |
| | | |
| | | |
| | | List<EvaluateGroup> getEvaluateGroup(@Param("month") String month, @Param("departLims") String departLims, @Param("name") String name); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Evaluate; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface EvaluateMapper extends BaseMapper<Evaluate> { |
| | | |
| | | IPage<Evaluate> getPage(@Param("page") Page page, @Param("ew") QueryWrapper<Evaluate> ew); |
| | | } |
| | |
| | | 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 org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public interface PerformanceShiftMapper extends MyBaseMapper<PerformanceShift> { |
| | | |
| | | IPage<PerformanceShiftMapDto> performanceShiftPage( |
| | | Page<Object> page, |
| | | @Param("page") Page<Object> page, |
| | | @Param("time") String time, |
| | | @Param("userName") String userName, |
| | | @Param("laboratory") String laboratory |
| | |
| | | @Param("userName") String userName, |
| | | @Param("laboratory") String laboratory); |
| | | |
| | | IPage<Map<String, Object>> performanceShiftYear(Page<Object> page, String time, String userName, String laboratory); |
| | | IPage<Map<String, Object>> performanceShiftYear(Page<Object> page,@Param("time") String time,@Param("userName") String userName,@Param("laboratory") String laboratory); |
| | | |
| | | List<Map<String, Object>> performanceShiftYearList(String time, String userName, String laboratory); |
| | | List<Map<String, Object>> performanceShiftYearList(@Param("time") String time,@Param("userName") String userName,@Param("laboratory") String laboratory); |
| | | |
| | | List<PerformanceShiftMapDto> performanceShiftList(String time, String userName, String laboratory); |
| | | List<PerformanceShiftMapDto> performanceShiftList(@Param("time") String time, @Param("userName") String userName,@Param("laboratory") String laboratory); |
| | | |
| | | String seldepLimsId(int depLimsId); |
| | | |
| | | String selectLaboratory(Integer laboratoryId); |
| | | |
| | | List<Map<String,Object>> findUserList(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | 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.time.LocalDateTime; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @ApiModel(value = "Evaluate对象", description = "人åèè¯") |
| | | public class Evaluate { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ExcelIgnore |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å¤é® å
³èç¨æ·id") |
| | | @ExcelIgnore |
| | | private Integer userId; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "å·¥å·") |
| | | private String account; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "åå·¥äºè¯") |
| | | private Double groupTotal; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "åå·¥äºè¯") |
| | | private Double leaderTotal; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelProperty(value = "主管è¯å") |
| | | private Double competentTotal; |
| | | |
| | | @ApiModelProperty("èè¯å¾å") |
| | | @ExcelProperty(value = "èè¯å¾å") |
| | | private Double score; |
| | | |
| | | @ApiModelProperty("èè¯ç级") |
| | | @ExcelProperty(value = "èè¯ç级") |
| | | private String grade; |
| | | |
| | | @ApiModelProperty("æä»½") |
| | | @ExcelIgnore |
| | | private String month; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ExcelIgnore |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ExcelIgnore |
| | | private Integer updateUser; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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-06-17 01:39:45 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("evaluate_group") |
| | | @ApiModel(value = "EvaluateGroup对象", description = "åå·¥äºè¯è¡¨") |
| | | public class EvaluateGroup { |
| | | |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å¤é® å
³è人åèè¯è¡¨id") |
| | | private Integer evaluateId; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | private String name; |
| | | |
| | | @TableField(exist = false,select = false) |
| | | //å®éªå®¤ |
| | | private String departLims; |
| | | |
| | | @ApiModelProperty("åæ¶æ§") |
| | | private Double seasonable; |
| | | |
| | | @ApiModelProperty("åç¡®æ§") |
| | | private Double exact; |
| | | |
| | | @ApiModelProperty("æä½æè½") |
| | | private Double skill; |
| | | |
| | | @ApiModelProperty("设å¤ç»´æ¤") |
| | | private Double preserve; |
| | | |
| | | @ApiModelProperty("éµç« å®çºª") |
| | | private Double discipline; |
| | | |
| | | @ApiModelProperty("å¢ç»åä½") |
| | | private Double solidarity; |
| | | |
| | | @ApiModelProperty("5S-3å®") |
| | | private Double tidy; |
| | | |
| | | @ApiModelProperty("å¾å") |
| | | private Double total; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.performance.dto.EvaluateGroupDto; |
| | | import com.ruoyi.performance.pojo.EvaluateGroup; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface EvaluateGroupService extends IService<EvaluateGroup> { |
| | | |
| | | /** |
| | | * æ¥è¯¢åå·¥äºè¯ |
| | | * @param evaluateGroupDto |
| | | * @return |
| | | */ |
| | | List<EvaluateGroup> getEvaluateGroup(EvaluateGroupDto evaluateGroupDto); |
| | | |
| | | /** |
| | | * å¡«ååå·¥äºè¯ |
| | | * @param evaluateGroup |
| | | * @return |
| | | */ |
| | | Double writeEvaluateGroup(EvaluateGroup evaluateGroup); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Evaluate; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | public interface EvaluateService extends IService<Evaluate> { |
| | | |
| | | IPage<Evaluate> getPage(Page page, Evaluate entity); |
| | | |
| | | |
| | | void export(String month, String name, String departLims, HttpServletResponse response) throws IOException; |
| | | } |
| | |
| | | import com.ruoyi.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.pojo.PerformanceShift; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | Map<Object, Object> exportToYearExcel(String time, String userName, String laboratory) throws Exception; |
| | | |
| | | Map<Object, Object> exportToMonthExcel(String time, String userName, String laboratory); |
| | | |
| | | Map<String, List<Map<String,Object>>> getUserList(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.performance.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.performance.dto.EvaluateGroupDto; |
| | | import com.ruoyi.performance.mapper.EvaluateGroupMapper; |
| | | import com.ruoyi.performance.mapper.EvaluateMapper; |
| | | import com.ruoyi.performance.pojo.Evaluate; |
| | | import com.ruoyi.performance.pojo.EvaluateGroup; |
| | | import com.ruoyi.performance.service.EvaluateGroupService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥äºè¯è¡¨ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-06-17 01:39:45 |
| | | */ |
| | | @Service |
| | | public class EvaluateGroupServiceImpl extends ServiceImpl<EvaluateGroupMapper, EvaluateGroup> implements EvaluateGroupService { |
| | | |
| | | @Resource |
| | | EvaluateGroupMapper evaluateGroupMapper; |
| | | |
| | | @Resource |
| | | EvaluateMapper evaluateMapper; |
| | | |
| | | //æ¥è¯¢åå·¥äºè¯ |
| | | @Override |
| | | public List<EvaluateGroup> getEvaluateGroup(EvaluateGroupDto evaluateGroupDto) { |
| | | return evaluateGroupMapper.getEvaluateGroup(evaluateGroupDto.getMonth(), evaluateGroupDto.getDepartLims(), evaluateGroupDto.getName()); |
| | | } |
| | | |
| | | //å¡«ååå·¥äºè¯ |
| | | @Override |
| | | public Double writeEvaluateGroup(EvaluateGroup evaluateGroup) { |
| | | double newTotal = evaluateGroup.getSeasonable() + evaluateGroup.getExact() + evaluateGroup.getSkill() + evaluateGroup.getPreserve() + evaluateGroup.getDiscipline() + evaluateGroup.getSolidarity() + evaluateGroup.getTidy(); |
| | | EvaluateGroup evaluateGroup1 = evaluateGroupMapper.selectById(evaluateGroup.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateGroup.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateGroup1.getTotal()*0.2 + newTotal*0.2); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateGroup.setTotal(newTotal); |
| | | evaluateGroupMapper.updateById(evaluateGroup); |
| | | return newTotal; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.performance.mapper.EvaluateMapper; |
| | | import com.ruoyi.performance.pojo.Evaluate; |
| | | import com.ruoyi.performance.service.EvaluateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService { |
| | | |
| | | @Resource |
| | | EvaluateMapper evaluateMapper; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public IPage<Evaluate> getPage(Page page, Evaluate evaluate) { |
| | | return evaluateMapper.getPage(page, QueryWrappers.queryWrappers(evaluate)); |
| | | } |
| | | |
| | | //导åºèè¯ |
| | | @Override |
| | | public void export(String month, String name, String departLims, HttpServletResponse response) throws IOException { |
| | | List<Evaluate> evaluates = new ArrayList<Evaluate>(); |
| | | //æ¥è¯¢åå§å·¥æ¶(使ç¨å页æ¥è¯¢) |
| | | Evaluate evaluate = new Evaluate(); |
| | | if (ObjectUtils.isNotEmpty(month)) { |
| | | evaluate.setMonth(month); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(name)) { |
| | | evaluate.setName(name); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(departLims)) { |
| | | evaluate.setDepartLims(departLims); |
| | | } |
| | | IPage<Evaluate> body = (IPage<Evaluate>) getPage(new Page(-1, -1), evaluate); |
| | | evaluates = 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(Evaluate.class).build(); |
| | | excelWriter.write(evaluates, mainSheet); |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.performance.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.performance.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.performance.mapper.PerformanceShiftMapper; |
| | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | UserMapper userMapper; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, String laboratory) { |
| | | String laboratoryName = ""; |
| | | if(StringUtils.isNotEmpty(laboratory)) { |
| | | laboratoryName = baseMapper.selectLaboratory(Integer.parseInt(laboratory)); |
| | | } |
| | | //æ¥è¯¢å½åç»å½äººåçæ¶æ |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | //夿å
¨é¨,个人,ç»ç»çæé |
| | |
| | | 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; |
| | | if(departLims.contains("æ£æµå") || departLims.equals(laboratoryName)) { |
| | | laboratory = laboratoryName; |
| | | } |
| | | } |
| | | IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, laboratory); |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<Map<String, Object>>> getUserList() { |
| | | return baseMapper.findUserList().stream().collect(Collectors.groupingBy(m->m.get("depName").toString())); |
| | | } |
| | | |
| | | // è·å两个localDateTimeçæ¯ä¸å¤© |
| | | public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) { |
| | | List<LocalDateTime> localDateTimes = new ArrayList<>(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.EvaluateGroupMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.EvaluateGroup"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="depart_lims" property="departLims"/> |
| | | <result column="evaluate_id" property="evaluateId"/> |
| | | <result column="seasonable" property="seasonable"/> |
| | | <result column="exact" property="exact"/> |
| | | <result column="skill" property="skill"/> |
| | | <result column="preserve" property="preserve"/> |
| | | <result column="discipline" property="discipline"/> |
| | | <result column="solidarity" property="solidarity"/> |
| | | <result column="tidy" property="tidy"/> |
| | | <result column="total" property="total"/> |
| | | <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="getEvaluateGroup" resultType="com.ruoyi.performance.pojo.EvaluateGroup"> |
| | | select eg.*,u.name,dl.name depart_lims |
| | | from evaluate_group eg |
| | | left join evaluate e on eg.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id) |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | | </if> |
| | | <if test="departLims!=null and departLims!=''"> |
| | | and dl.name like concat ('%',#{departLims},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and u.name like concat ('%',#{name},'%') |
| | | </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.EvaluateMapper"> |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.performance.pojo.Evaluate"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="account" property="account"/> |
| | | <result column="name" property="name"/> |
| | | <result column="depart_lims" property="departLims"/> |
| | | <result column="score" property="score"/> |
| | | <result column="grade" property="grade"/> |
| | | <result column="month" property="month"/> |
| | | <result column="competentTotal" property="competentTotal"/> |
| | | <result column="groupTotal" property="groupTotal"/> |
| | | <result column="leaderTotal" property="leaderTotal"/> |
| | | </resultMap> |
| | | <select id="getPage" resultType="com.ruoyi.performance.pojo.Evaluate"> |
| | | select * from(select e.*, |
| | | account, |
| | | u.name name, |
| | | dl.name depart_lims, |
| | | ec.total*0.5 competentTotal, |
| | | eg.total*0.2 groupTotal, |
| | | el.total*0.3 leaderTotal |
| | | from evaluate e |
| | | left join evaluate_competent ec on e.id = ec.evaluate_id |
| | | left join evaluate_group eg on e.id = eg.evaluate_id |
| | | left join evaluate_leader el on e.id = el.evaluate_id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on FIND_IN_SET(dl.id, depart_lims_id) ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="name" property="name"/> |
| | | <result column="shift_time" property="shiftTime"/> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="department" property="department" /> |
| | | <result column="dept_id" 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, |
| | | <!--if(u2.dept_id is not null and u2.dept_id != '', CONCAT(u2.name, 'ï¼', u2.dept_id, 'ï¼'), u2.name) name,--> |
| | | 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 |
| | | where status=0 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | |
| | | and u2.name like concat('%', #{userName}, '%') |
| | | </if> |
| | | </where> |
| | | order by s.create_time |
| | | GROUP BY u2.id |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftYearPage" resultType="map"> |
| | |
| | | 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 |
| | | where status=0 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | |
| | | </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, |
| | | SELECT if(u2.dept_id is not null and u2.dept_id != '', CONCAT(u2.name, 'ï¼', u2.dept_id, 'ï¼'), 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 |
| | |
| | | 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 |
| | | where status=0 |
| | | <if test="laboratory != null and laboratory != ''"> |
| | | and dl.name=#{laboratory} |
| | | </if> |
| | |
| | | from department_lims |
| | | where id = #{depLimsId} |
| | | </select> |
| | | |
| | | <select id="selectLaboratory" resultType="java.lang.String"> |
| | | select laboratory_name |
| | | from laboratory |
| | | where id = #{laboratoryId} |
| | | </select> |
| | | |
| | | <select id="findUserList" resultType="map"> |
| | | select |
| | | u.id, |
| | | u.name, |
| | | dl.name as depName |
| | | from user u |
| | | left join department_lims dl |
| | | on FIND_IN_SET(dl.id,u.depart_lims_id) |
| | | where dl.name in('é信产åå®éªå®¤','çµå产åå®éªå®¤') |
| | | and u.status = 0 |
| | | and u.is_custom = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | <module>cnas-manage</module> |
| | | <module>cnas-process</module> |
| | | <module>cnas-require</module> |
| | | <module>cnas_server</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |