¶Ô±ÈÐÂÎļþ |
| | |
| | | ###################################################################### |
| | | # Build Tools |
| | | |
| | | .gradle |
| | | /build/ |
| | | !gradle/wrapper/gradle-wrapper.jar |
| | | |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | |
| | | ###################################################################### |
| | | # IDE |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### JRebel ### |
| | | rebel.xml |
| | | |
| | | ### NetBeans ### |
| | | nbproject/private/ |
| | | build/* |
| | | nbbuild/ |
| | | dist/ |
| | | nbdist/ |
| | | .nb-gradle/ |
| | | |
| | | ###################################################################### |
| | | # Others |
| | | *.log |
| | | *.xml.versionsBackup |
| | | *.swp |
| | | |
| | | !*/build/*.java |
| | | !*/build/*.html |
| | | !*/build/*.xml |
| | | #/ruoyi-admin/src/main/resources/application.yml |
| | | #/ruoyi-admin/src/main/resources/application-druid.yml |
| | | #/ruoyi-admin/src/main/resources/logback.xml |
| | | #/ruoyi-generator/src/main/resources/generator.yml |
¶Ô±ÈÐÂÎļþ |
| | |
| | | The MIT License (MIT) |
| | | |
| | | Copyright (c) 2018 RuoYi |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy of |
| | | this software and associated documentation files (the "Software"), to deal in |
| | | the Software without restriction, including without limitation the rights to |
| | | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| | | the Software, and to permit persons to whom the Software is furnished to do so, |
| | | subject to the following conditions: |
| | | |
| | | The above copyright notice and this permission notice shall be included in all |
| | | copies or substantial portions of the Software. |
| | | |
| | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| | | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| | | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| | | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| | | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| | |
| | | ## center-lims-after-ruoyi |
| | | <p align="center"> |
| | | <img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png"> |
| | | </p> |
| | | <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.8.9</h1> |
| | | <h4 align="center">åºäºSpringBoot+Vueåå端å离çJavaå¿«éå¼åæ¡æ¶</h4> |
| | | <p align="center"> |
| | | <a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a> |
| | | <a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.8.9-brightgreen.svg"></a> |
| | | <a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a> |
| | | </p> |
| | | |
| | | æ£æµä¸å¿LIMSæ°å端 |
| | | ## å¹³å°ç®ä» |
| | | |
| | | è¥ä¾æ¯ä¸å¥å
¨é¨å¼æºçå¿«éå¼åå¹³å°ï¼æ¯«æ ä¿çç»ä¸ªäººåä¼ä¸å
费使ç¨ã |
| | | |
| | | * å端éç¨VueãElement UIã |
| | | * å端éç¨Spring BootãSpring SecurityãRedis & Jwtã |
| | | * æé认è¯ä½¿ç¨Jwtï¼æ¯æå¤ç»ç«¯è®¤è¯ç³»ç»ã |
| | | * æ¯æå è½½å¨ææéèåï¼å¤æ¹å¼è½»æ¾æéæ§å¶ã |
| | | * 髿çå¼åï¼ä½¿ç¨ä»£ç çæå¨å¯ä»¥ä¸é®çæåå端代ç ã |
| | | * æä¾äºææ¯æ ï¼[Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev)ï¼çæ¬[RuoYi-Vue3](https://gitcode.com/yangzongzhuan/RuoYi-Vue3)ï¼ä¿æåæ¥æ´æ°ã |
| | | * æä¾äºååºç¨çæ¬[RuoYi-Vue-fast](https://gitcode.com/yangzongzhuan/RuoYi-Vue-fast)ï¼Oracleçæ¬[RuoYi-Vue-Oracle](https://gitcode.com/yangzongzhuan/RuoYi-Vue-Oracle)ï¼ä¿æåæ¥æ´æ°ã |
| | | * ä¸åç¦»çæ¬ï¼è¯·ç§»æ¥[RuoYi](https://gitee.com/y_project/RuoYi)ï¼å¾®æå¡çæ¬ï¼è¯·ç§»æ¥[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud) |
| | | * é¿éäºææ£åºï¼[ç¹æè¿å
¥](http://aly.ruoyi.vip)ï¼è
¾è®¯äºç§æåºï¼[ç¹æè¿å
¥](http://txy.ruoyi.vip) |
| | | |
| | | ## å
ç½®åè½ |
| | | |
| | | 1. ç¨æ·ç®¡çï¼ç¨æ·æ¯ç³»ç»æä½è
ï¼è¯¥åè½ä¸»è¦å®æç³»ç»ç¨æ·é
ç½®ã |
| | | 2. é¨é¨ç®¡çï¼é
置系ç»ç»ç»æºæï¼å
¬å¸ãé¨é¨ãå°ç»ï¼ï¼æ ç»æå±ç°æ¯ææ°æ®æéã |
| | | 3. å²ä½ç®¡çï¼é
置系ç»ç¨æ·æå±æ
ä»»èå¡ã |
| | | 4. èå管çï¼é
置系ç»èåï¼æä½æéï¼æé®æéæ è¯çã |
| | | 5. è§è²ç®¡çï¼è§è²èåæéåé
ã设置è§è²ææºæè¿è¡æ°æ®èå´æéååã |
| | | 6. åå
¸ç®¡çï¼å¯¹ç³»ç»ä¸ç»å¸¸ä½¿ç¨çä¸äºè¾ä¸ºåºå®çæ°æ®è¿è¡ç»´æ¤ã |
| | | 7. åæ°ç®¡çï¼å¯¹ç³»ç»å¨æé
置常ç¨åæ°ã |
| | | 8. éç¥å
¬åï¼ç³»ç»éç¥å
¬åä¿¡æ¯åå¸ç»´æ¤ã |
| | | 9. æä½æ¥å¿ï¼ç³»ç»æ£å¸¸æä½æ¥å¿è®°å½åæ¥è¯¢ï¼ç³»ç»å¼å¸¸ä¿¡æ¯æ¥å¿è®°å½åæ¥è¯¢ã |
| | | 10. ç»å½æ¥å¿ï¼ç³»ç»ç»å½æ¥å¿è®°å½æ¥è¯¢å
å«ç»å½å¼å¸¸ã |
| | | 11. å¨çº¿ç¨æ·ï¼å½åç³»ç»ä¸æ´»è·ç¨æ·ç¶æçæ§ã |
| | | 12. 宿¶ä»»å¡ï¼å¨çº¿ï¼æ·»å ãä¿®æ¹ãå é¤)ä»»å¡è°åº¦å
嫿§è¡ç»ææ¥å¿ã |
| | | 13. 代ç çæï¼åå端代ç ççæï¼javaãhtmlãxmlãsqlï¼æ¯æCRUDä¸è½½ ã |
| | | 14. ç³»ç»æ¥å£ï¼æ ¹æ®ä¸å¡ä»£ç èªå¨çæç¸å
³çapiæ¥å£ææ¡£ã |
| | | 15. æå¡çæ§ï¼çè§å½åç³»ç»CPUãå
åãç£çãå æ çç¸å
³ä¿¡æ¯ã |
| | | 16. ç¼åçæ§ï¼å¯¹ç³»ç»çç¼åä¿¡æ¯æ¥è¯¢ï¼å½ä»¤ç»è®¡çã |
| | | 17. å¨çº¿æå»ºå¨ï¼æå¨è¡¨åå
ç´ çæç¸åºçHTML代ç ã |
| | | 18. è¿æ¥æ± çè§ï¼çè§å½åç³»ç»æ°æ®åºè¿æ¥æ± ç¶æï¼å¯è¿è¡åæSQLæ¾åºç³»ç»æ§è½ç¶é¢ã |
| | | |
| | | ## å¨çº¿ä½éª |
| | | |
| | | - admin/admin123 |
| | | - ééç»ç»æ¶å°ä¸äºæèµï¼ä¸ºäºæ´å¥½çä½éªå·²ç¨äºæ¼ç¤ºæå¡å¨å级ã谢谢åä½å°ä¼ä¼´ã |
| | | |
| | | æ¼ç¤ºå°åï¼http://vue.ruoyi.vip |
| | | ææ¡£å°åï¼http://doc.ruoyi.vip |
| | | |
| | | ## æ¼ç¤ºå¾ |
| | | |
| | | <table> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td> |
| | | </tr> |
| | | <tr> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td> |
| | | <td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td> |
| | | </tr> |
| | | </table> |
| | | |
| | | |
| | | ## è¥ä¾åå端å离交æµç¾¤ |
| | | |
| | | QQç¾¤ï¼ [](https://jq.qq.com/?_wv=1027&k=5bVB1og) [](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [](https://jq.qq.com/?_wv=1027&k=51G72yr) [](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [](https://jq.qq.com/?_wv=1027&k=SpyH2875) [](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Fn2aF5IHpwsy8j6VlalNJK6qbwFLFHat&authKey=uyIT%2B97x2AXj3odyXpsSpVaPMC%2Bidw0LxG5MAtEqlrcBcWJUA%2FeS43rsF1Tg7IRJ&noverify=0&group_code=161281055) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=XIzkm_mV2xTsUtFxo63bmicYoDBA6Ifm&authKey=dDW%2F4qsmw3x9govoZY9w%2FoWAoC4wbHqGal%2BbqLzoS6VBarU8EBptIgPKN%2FviyC8j&noverify=0&group_code=138988063) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=DkugnCg68PevlycJSKSwjhFqfIgrWWwR&authKey=pR1Pa5lPIeGF%2FFtIk6d%2FGB5qFi0EdvyErtpQXULzo03zbhopBHLWcuqdpwY241R%2F&noverify=0&group_code=151450850) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=F58bgRa-Dp-rsQJThiJqIYv8t4-lWfXh&authKey=UmUs4CVG5OPA1whvsa4uSespOvyd8%2FAr9olEGaWAfdLmfKQk%2FVBp2YU3u2xXXt76&noverify=0&group_code=224622315) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Nxb2EQ5qozWa218Wbs7zgBnjLSNk_tVT&authKey=obBKXj6SBKgrFTJZx0AqQnIYbNOvBB2kmgwWvGhzxR67RoRr84%2Bus5OadzMcdJl5&noverify=0&group_code=287842588) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=numtK1M_I4eVd2Gvg8qtbuL8JgX42qNh&authKey=giV9XWMaFZTY%2FqPlmWbkB9g3fi0Ev5CwEtT9Tgei0oUlFFCQLDp4ozWRiVIzubIm&noverify=0&group_code=187944233) ç¹å»æé®å
¥ç¾¤ã |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>basic-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.basic.controller; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | 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.system.service.ISysDictTypeService; |
| | | import com.ruoyi.basic.dto.PageTestObjectDto; |
| | | import com.ruoyi.basic.dto.ProductDTO1; |
| | | import com.ruoyi.basic.excel.StructureTestObjectData; |
| | | import com.ruoyi.basic.excel.StructureTestObjectListener; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.StandardTemplate; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import com.ruoyi.basic.service.CapacityScopeService; |
| | | import com.ruoyi.basic.service.ProductService; |
| | | import com.ruoyi.basic.service.StandardTemplateService; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åæ°(StructureItemParameter)表æ§å¶å± |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 16:21:17 |
| | | */ |
| | | @Api(tags = "è½åèå´") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/capacityScope") |
| | | public class CapacityScopeController { |
| | | |
| | | private CapacityScopeService capacityScopeService; |
| | | |
| | | private ProductService productService; |
| | | |
| | | private StructureItemParameterService structureItemParameterService; |
| | | |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | |
| | | @ApiOperation(value = "è·åé¡¹ç®æ£éªåæ°å表") |
| | | @PostMapping("/selectItemParameterList") |
| | | public Result selectItemParameterList(Page page,StructureItemParameter itemParameter) throws Exception { |
| | | return Result.success(capacityScopeService.selectItemParameterList(page, itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å é¡¹ç®æ£éªåæ°") |
| | | @PostMapping("/addItemParameter") |
| | | public Result addItemParameter(@RequestBody StructureItemParameter itemParameter) { |
| | | return Result.success(capacityScopeService.addItemParameter(itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤é¡¹ç®æ£éªåæ°") |
| | | @PostMapping("/delItemParameter") |
| | | public Result<?> delItemParameter(Integer id) { |
| | | return Result.success(capacityScopeService.delItemParameter(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹é¡¹ç®æ£éªåæ°") |
| | | @PostMapping("/upItemParameter") |
| | | public Result<?> upItemParameter(@RequestBody StructureItemParameter itemParameter) { |
| | | return Result.success(capacityScopeService.upItemParameter(itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ£éªå¯¹è±¡") |
| | | @PostMapping("/selectTestObjectList") |
| | | public Result selectTestObjectList(Page page,PageTestObjectDto pageTestObjectDto) throws Exception { |
| | | return Result.success(capacityScopeService.selectTestObjectList(page, pageTestObjectDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ£éªå¯¹è±¡") |
| | | @PostMapping("/addTestObject") |
| | | public Result addTestObject(@RequestBody StructureTestObject testObject) { |
| | | return Result.success(capacityScopeService.addTestObject(testObject)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿£éªå¯¹è±¡") |
| | | @PostMapping("/delTestObject") |
| | | public Result<?> delTestObject(Integer id) { |
| | | return Result.success(capacityScopeService.delTestObject(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ£éªå¯¹è±¡") |
| | | @PostMapping("/upTestObject") |
| | | public Result upTestObject(@RequestBody StructureTestObject testObject) { |
| | | return Result.success(capacityScopeService.upTestObject(testObject)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ£éªå¯¹è±¡æä¸¾") |
| | | @GetMapping("/selectTestObjectByName") |
| | | public Result selectTestObjectByName() { |
| | | return Result.success(capacityScopeService.selectTestObjectByName()); |
| | | } |
| | | |
| | | @ApiOperation(value = "设å¤éé¢éæ©æ£éªé¡¹ç®(æ å½¢ç»æ)") |
| | | @PostMapping("/getInsProduction") |
| | | public Result getInsProduction() { |
| | | return Result.success(capacityScopeService.getInsProduction()); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç»´æ¤æ£éªå¯¹è±¡ç产å") |
| | | @PostMapping("/selectProductListByObjectId") |
| | | public Result selectProductListByObjectId(Page page,ProductDTO1 productDTO) throws Exception { |
| | | return Result.success(productService.selectProductListByObjectId(page, productDTO)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å 产å") |
| | | @PostMapping("/addProduct") |
| | | public Result addProduct(@RequestBody Product product) { |
| | | return Result.success(productService.addProduct(product)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹äº§å") |
| | | @PostMapping("/upProduct") |
| | | public Result upProduct(@RequestBody Product product) { |
| | | return Result.success(productService.upProduct(product)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤äº§å") |
| | | @PostMapping("/delProduct") |
| | | public Result delProduct(Integer id) { |
| | | return Result.success(productService.delProduct(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ£éªå¯¹è±¡æ ") |
| | | @GetMapping("/getItemTree") |
| | | public Result getItemTree() { |
| | | return Result.success(capacityScopeService.getItemTree()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "è£
å¤å¯¼å
¥æ£éªé¡¹ç®") |
| | | @PostMapping("/importEquipData") |
| | | @Transactional |
| | | public Result importEquipData(@RequestParam("file") MultipartFile file) throws Exception { |
| | | InputStream inputStream = file.getInputStream(); |
| | | List<StructureItemParameter> lists = new ArrayList<>(); |
| | | AtomicReference<String> sample = new AtomicReference<>(); |
| | | ExcelUtil.readBySax(inputStream, -1, (i, l, list1) -> { |
| | | if (l == 1) { |
| | | sample.set(list1.get(1) + ""); |
| | | } |
| | | if (l >= 1) { |
| | | StructureItemParameter str = new StructureItemParameter(); |
| | | // æµè¯å¯¹è±¡ |
| | | if (list1.get(1) == null) { |
| | | str.setSample(null); |
| | | } else { |
| | | String brand = (String) list1.get(1); |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append("["); |
| | | // 产å |
| | | if (ObjectUtil.isNotEmpty(list1.get(2))) { |
| | | String production = (String) list1.get(2); |
| | | if (!production.contains("ï¼")) { |
| | | builder.append(String.format("[\"%s\",\"%s\"]", brand, production)); |
| | | } else { |
| | | Arrays.stream(production.split("ï¼")).forEach(item -> { |
| | | builder.append(String.format("[\"%s\",\"%s\"],", brand, item)); |
| | | }); |
| | | builder.deleteCharAt(builder.length() - 1); |
| | | } |
| | | } else { |
| | | builder.append("["); |
| | | builder.append(String.format("\"%s\"", brand)); |
| | | builder.append("]"); |
| | | } |
| | | builder.append("]"); |
| | | str.setSample(builder.toString()); |
| | | } |
| | | // æ£éªé¡¹ |
| | | str.setInspectionItem(list1.get(4).toString().trim()); |
| | | // æ£éªé¡¹è±æ |
| | | if (list1.get(5) != null) { |
| | | str.setInspectionItemEn(list1.get(5).toString()); |
| | | } |
| | | // æ£éªå项 |
| | | if (list1.get(6) == null) { |
| | | str.setInspectionItemSubclass(null); |
| | | } else { |
| | | str.setInspectionItemSubclass(list1.get(6).toString().trim()); |
| | | } |
| | | // æ£éªåé¡¹è±æ |
| | | if (list1.get(7) == null) { |
| | | str.setInspectionItemSubclassEn(null); |
| | | } else { |
| | | str.setInspectionItemSubclassEn(String.valueOf(list1.get(7).toString())); |
| | | } |
| | | // æ£éªé¡¹åç±» |
| | | if (list1.get(22) != null && list1.get(22) != "") { |
| | | str.setInspectionItemClass(list1.get(22).toString().trim()); |
| | | } else { |
| | | str.setInspectionItemClass(null); |
| | | } |
| | | // æ£éªé¡¹åç±»è±æ |
| | | if (list1.get(23) != null && list1.get(23) != "") { |
| | | str.setInspectionItemClassEn(list1.get(23) + ""); |
| | | } else { |
| | | str.setInspectionItemClassEn(null); |
| | | } |
| | | |
| | | LambdaQueryWrapper<StructureItemParameter> wrapper = Wrappers.lambdaQuery(StructureItemParameter.class) |
| | | .eq(StructureItemParameter::getInspectionItem, str.getInspectionItem()) |
| | | .eq(StructureItemParameter::getSample, str.getSample()) |
| | | |
| | | .last("limit 1"); |
| | | // 夿æ¯å¦ææ£éªé¡¹ç±»å |
| | | if (ObjectUtils.isNotEmpty(str.getInspectionItemClass())) { |
| | | wrapper.eq(StructureItemParameter::getInspectionItemClass, str.getInspectionItemClass()); |
| | | } |
| | | |
| | | // 夿æ¯å¦ææ£éªå项 |
| | | if (ObjectUtils.isNotEmpty(str.getInspectionItemSubclass())) { |
| | | wrapper.eq(StructureItemParameter::getInspectionItemSubclass, str.getInspectionItemSubclass()); |
| | | } |
| | | StructureItemParameter db_str = structureItemParameterService.getOne(wrapper); |
| | | if (ObjectUtils.isNotEmpty(db_str)) { |
| | | str.setId(db_str.getId()); |
| | | } |
| | | // æ¹æ³åç§° |
| | | if (list1.get(8) == null) { |
| | | str.setMethod(null); |
| | | } else { |
| | | StringBuffer buffer = new StringBuffer(); |
| | | String input = list1.get(8).toString(); |
| | | buffer.append("["); |
| | | String[] values = input.split("ï¼"); |
| | | for (String value : values) { |
| | | buffer.append("\"").append(value.trim()).append("\","); |
| | | } |
| | | buffer.deleteCharAt(buffer.length() - 1); |
| | | buffer.append("]"); |
| | | str.setMethod(buffer.toString()); |
| | | } |
| | | // è¯éªå®¤ |
| | | if (list1.get(9) == null) { |
| | | str.setSonLaboratory(null); |
| | | } else { |
| | | str.setSonLaboratory(list1.get(9).toString()); |
| | | } |
| | | // 计éåä½ |
| | | if (list1.get(10) == null) { |
| | | str.setUnit(null); |
| | | } else { |
| | | str.setUnit(list1.get(10).toString()); |
| | | } |
| | | // è¦æ±å¼ |
| | | if (list1.get(11) == null) { |
| | | str.setAskTell(null); |
| | | } else { |
| | | str.setAskTell(list1.get(11).toString()); |
| | | } |
| | | // è¦æ±æè¿° |
| | | if (list1.get(12) == null) { |
| | | str.setAsk(null); |
| | | } else { |
| | | str.setAsk(list1.get(12).toString()); |
| | | } |
| | | // åä»· |
| | | if (list1.get(13) == null) { |
| | | str.setPrice(null); |
| | | } else { |
| | | str.setPrice(list1.get(13) + ""); |
| | | } |
| | | // å·¥æ¶ç³»æ° |
| | | if (list1.get(14) == null) { |
| | | str.setManHour(null); |
| | | } else { |
| | | str.setManHour(Double.valueOf(list1.get(14).toString())); |
| | | } |
| | | // å·¥æ¶åç» |
| | | if (list1.get(15) == null) { |
| | | str.setManHourGroup(null); |
| | | } else { |
| | | str.setManHourGroup(list1.get(15).toString()); |
| | | } |
| | | // é¢è®¡å®ææ¶é´ |
| | | if (list1.get(16) == null) { |
| | | str.setManDay(null); |
| | | } else { |
| | | str.setManDay(Integer.valueOf(list1.get(16).toString())); |
| | | } |
| | | // æ°æ®ç±»å |
| | | String jy; |
| | | if (list1.get(17).toString().equals("éééç±»å")) { |
| | | jy = "0"; |
| | | } else { |
| | | jy = "1"; |
| | | } |
| | | str.setInspectionItemType(jy); |
| | | // æ£éªé¡¹ç±»å |
| | | String validateValueType = list1.get(18).toString(); |
| | | if (ObjectUtils.isNotEmpty(validateValueType)) { |
| | | List<SysDictData> enums = dictTypeService.selectDictDataByName("æ£éªå¼ç±»å") |
| | | .stream().filter(sysDictData -> sysDictData.getDictLabel().equals(validateValueType)).collect(Collectors.toList()); |
| | | str.setInspectionValueType(enums.get(0).getDictValue()); |
| | | } |
| | | int bsm; |
| | | //ç¹æ®æ è¯ |
| | | if (list1.get(19).toString().equals("å¦")) { |
| | | bsm = 0; |
| | | } else { |
| | | bsm = 1; |
| | | } |
| | | str.setBsm(bsm + ""); |
| | | // æ°ååå
¸ |
| | | if (list1.get(20) != null) { |
| | | str.setDic(list1.get(20) + ""); |
| | | } else { |
| | | str.setDic(null); |
| | | } |
| | | // åå§è®°å½æ¨¡æ¿ |
| | | StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list1.get(21))); |
| | | if (standTempIdByName != null) { |
| | | str.setTemplateId(standTempIdByName.getId()); |
| | | } else { |
| | | str.setTemplateId(null); |
| | | } |
| | | try { |
| | | if (list1.get(24) != null) { |
| | | str.setLaboratory(list1.get(24) + ""); |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | | // æ¡ä»¶ |
| | | if (list1.get(25) == null) { |
| | | str.setRadiusList(null); |
| | | } else { |
| | | StringBuffer buffer = new StringBuffer(); |
| | | String input = list1.get(25).toString(); |
| | | buffer.append("["); |
| | | String[] values = input.split("ï¼"); |
| | | for (String value : values) { |
| | | buffer.append("\"").append(value.trim()).append("\","); |
| | | } |
| | | buffer.deleteCharAt(buffer.length() - 1); |
| | | buffer.append("]"); |
| | | str.setRadiusList(buffer.toString()); |
| | | } |
| | | // æ¶è´¹æ å |
| | | if (list1.get(26) == null) { |
| | | str.setRates(null); |
| | | } else { |
| | | str.setRates(list1.get(26) + ""); |
| | | } |
| | | |
| | | lists.add(str); |
| | | } |
| | | }); |
| | | // structureItemParameterService.removeNoSample(sample.get()); |
| | | // å¦ææ°æ®åºéé¢çæ°æ®åå¨é£ä¹å°±æ§è¡æ´æ°æ·è´æä½ |
| | | try { |
| | | structureItemParameterService.saveOrUpdateBatch(lists); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("æå¡ç«¯æ¥é"); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "导å
¥æ£éªå¯¹è±¡") |
| | | @PostMapping("/importExcel") |
| | | public Result importExcel(@RequestParam("file") MultipartFile file) { |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), StructureTestObjectData.class, new StructureTestObjectListener(productService)).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.Certification; |
| | | import com.ruoyi.basic.service.CertificationService; |
| | | 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; |
| | | |
| | | @Api(tags = "èµè´¨è¯´æ") |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/certification") |
| | | |
| | | public class CertificationController { |
| | | |
| | | private CertificationService certificationService; |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢èµè´¨æç»å表") |
| | | @PostMapping("/getCertificationDetail") |
| | | public Result getCertificationDetail(Page page,Certification certification) { |
| | | return Result.success(certificationService.getCertificationDetail(page, certification)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å èµè´¨æç»å表") |
| | | @PostMapping("/addCertificationDetail") |
| | | public Result addCertificationDetail(@RequestBody Certification certification) { |
| | | return Result.success(certificationService.addCertificationDetail(certification)); |
| | | } |
| | | @ApiOperation(value = "å é¤èµè´¨æç»å表") |
| | | @PostMapping("/delCertificationDetail") |
| | | public Result<?> delCertificationDetail( String ids) { |
| | | return Result.success(certificationService.delCertificationDetail(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.service.LaboratoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * å®éªå®¤ç®¡ç(LaboratoryController)表æ§å¶å± |
| | | */ |
| | | @Api(tags = "åºææè®¾æ½") |
| | | |
| | | @RestController |
| | | @RequestMapping("/laboratoryScope") |
| | | public class LaboratoryController { |
| | | |
| | | @Resource |
| | | private LaboratoryService laboratoryService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å®éªå®¤ç®¡çå表") |
| | | @PostMapping("/selectItemParameter") |
| | | public Result selectItemParameter(Page page ,Laboratory itemParameter) { |
| | | return Result.success(laboratoryService.selectItemParameter(page, itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å å®éªå®¤åæ°") |
| | | @PostMapping("/addParameter") |
| | | public Result addParameter(@RequestBody Laboratory itemParameter) { |
| | | return Result.success(laboratoryService.addParameter(itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤å®éªå®¤åæ°") |
| | | @PostMapping("/delParameter") |
| | | public Result<?> delParameter(Integer id) { |
| | | return Result.success(laboratoryService.delParameter(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹å®éªå®¤åæ°") |
| | | @PostMapping("/upParameter") |
| | | public Result<?> upParameter(@RequestBody Laboratory itemParameter) { |
| | | return Result.success(laboratoryService.upParameter(itemParameter)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åå®éªå®¤åç§°") |
| | | @GetMapping("/obtainItemParameterList") |
| | | public Result obtainItemParameterList() { |
| | | return Result.success(laboratoryService.obtainItemParameterList()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.ProductPart; |
| | | import com.ruoyi.basic.service.ProductPartService; |
| | | 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; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/productPart") |
| | | @Api(tags = "产åé¶ä»¶ç»å®") |
| | | public class ProductPartController { |
| | | |
| | | private ProductPartService productPartService; |
| | | |
| | | @ApiOperation(value = "æ ¹æ®äº§åidæ¥è¯¢é¶ä»¶") |
| | | @PostMapping("/selectByProductId") |
| | | public Result selectByProductId(Page page,ProductPart productPart){ |
| | | return Result.success(productPartService.selectByProductId(page,productPart)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢äº§åé¶ä»¶") |
| | | @PostMapping("/addProductPart") |
| | | public Result addProductPart(@RequestBody ProductPart productPart) { |
| | | productPartService.addProductPart(productPart); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°äº§åé¶ä»¶") |
| | | @PostMapping("/updateProductPart") |
| | | public Result updateProductPart(@RequestBody ProductPart productPart) { |
| | | productPartService.updateProductPartById(productPart); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤äº§åé¶ä»¶") |
| | | @PostMapping("/deleteProductPart") |
| | | public Result deleteProductPart(Integer id) { |
| | | productPartService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.ProductSupplierDensity; |
| | | import com.ruoyi.basic.service.ProductSupplierDensityService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * 产ååå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-19 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/productSupplierDensity") |
| | | @AllArgsConstructor |
| | | @Api(tags = "产ååå®¶å¯åº¦ç»å®") |
| | | public class ProductSupplierDensityController { |
| | | |
| | | private ProductSupplierDensityService productSupplierDensityService; |
| | | |
| | | @ApiOperation(value = "æ ¹æ®äº§åidæ¥è¯¢åå®¶å¯åº¦ç»å®") |
| | | @PostMapping("/selectSupplierDensityByProductId") |
| | | public Result selectSupplierDensityByProductId(Page page,ProductSupplierDensity supplierDensity) { |
| | | return Result.success(productSupplierDensityService.selectByProductId(page, supplierDensity)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢åå®¶å¯åº¦ç»å®") |
| | | @PostMapping("/addProductSupplierDensity") |
| | | public Result addProductSupplierDensity(@RequestBody ProductSupplierDensity supplierDensity) { |
| | | productSupplierDensityService.addProductSupplierDensity(supplierDensity); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°åå®¶å¯åº¦ç»å®") |
| | | @PostMapping("/updateProductSupplierDensity") |
| | | public Result updateProductSupplierDensity(@RequestBody ProductSupplierDensity supplierDensity) { |
| | | productSupplierDensityService.updateProductSupplierDensity(supplierDensity); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤åå®¶å¯åº¦ç»å®") |
| | | @PostMapping("/deleteProductSupplierDensity") |
| | | public Result deleteProductSupplierDensity(Integer id) { |
| | | productSupplierDensityService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.StandardMethod; |
| | | import com.ruoyi.basic.service.StandardMethodService; |
| | | 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 java.io.IOException; |
| | | |
| | | @Api(tags = "æ åæ¹æ³") |
| | | @RestController |
| | | @RequestMapping("/standardMethod") |
| | | @AllArgsConstructor |
| | | public class StandardMethodController { |
| | | |
| | | private StandardMethodService standardMethodService; |
| | | |
| | | @ApiOperation(value = "è·åæ åæ¹æ³å表") |
| | | @PostMapping("/selectStandardMethodList") |
| | | public Result selectStandardMethodList(Page page,StandardMethod standardMethod) throws Exception { |
| | | return Result.success(standardMethodService.selectStandardMethodList(page, standardMethod)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ åæ¹æ³æä¸¾") |
| | | @GetMapping("/selectStandardMethods") |
| | | public Result selectStandardMethods(){ |
| | | return Result.success(standardMethodService.selectStandardMethods()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ åæ¹æ³") |
| | | @PostMapping("/addStandardMethod") |
| | | public Result addStandardMethod(@RequestBody StandardMethod standardMethod) { |
| | | return Result.success(standardMethodService.addStandardMethod(standardMethod)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿 åæ¹æ³") |
| | | @PostMapping("/delStandardMethod") |
| | | public Result<?> delStandardMethod(Integer id) { |
| | | return Result.success(standardMethodService.delStandardMethod(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ åæ¹æ³") |
| | | @PostMapping("/upStandardMethod") |
| | | public Result<?> upStandardMethod(@RequestBody StandardMethod standardMethod) { |
| | | return Result.success(standardMethodService.upStandardMethod(standardMethod)); |
| | | } |
| | | |
| | | @ApiOperation(value = "导å
¥æ åæç»") |
| | | @PostMapping("/importStandardDetails") |
| | | public Result<?> importStandardDetails(@RequestPart("file") MultipartFile file) throws IOException { |
| | | standardMethodService.inputExcel(file); |
| | | return Result.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.StandardTemplate; |
| | | import com.ruoyi.basic.service.StandardTemplateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RequestMapping("/StandardTemplate") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Api(tags = "åå§è®°å½æ¨¡æ¿") |
| | | public class StandardTemplateController { |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | |
| | | @ApiOperation(value = "è·ååå§è®°å½æ¨¡æ¿å表") |
| | | @PostMapping("/selectStandardTemplatePageList") |
| | | public Result selectStandardTemplatePageList(Page page,StandardTemplate standardTemplate) throws Exception { |
| | | return Result.success(standardTemplateService.selectStandardTemplatePageList(page, standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/addStandardTemplate") |
| | | public Result addStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.addStandardTemplate(standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/upStandardTemplate") |
| | | public Result<?> upStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.upStandardTemplate(standardTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/delStandardTemplate") |
| | | public Result<?> delStandardTemplate(Integer id) { |
| | | return Result.success(standardTemplateService.delStandardTemplate(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢åå§è®°å½æ¨¡æ¿æä¸¾") |
| | | @GetMapping("/getStandardTemplate") |
| | | public Result<?> getStandardTemplate() { |
| | | return Result.success(standardTemplateService.getStandardTemplate()); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè¿æ¨¡æ¿idè·åæ£éªé¡¹æ¨¡æ¿å
容") |
| | | @PostMapping("/getStandTempThingById") |
| | | public Result<?> getStandTempThingById(Integer id) { |
| | | return Result.success(standardTemplateService.getStandTempThingById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¼è¾æ¨¡æ¿ç¼å¶") |
| | | @GetMapping("/getEditTemplatePreparation") |
| | | public Result<?> getEditTemplatePreparation(@RequestParam("id") Integer id) { |
| | | StandardTemplate byId = standardTemplateService.getById(id); |
| | | return Result.success("OK", byId.getThing()); |
| | | } |
| | | |
| | | @ApiOperation(value = "å¤å¶åå§è®°å½æ¨¡æ¿") |
| | | @PostMapping("/copyStandardTemplate") |
| | | public Result copyStandardTemplate(@RequestBody StandardTemplate newTemplate) { |
| | | return Result.success(standardTemplateService.copyStandardTemplate(newTemplate)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.dto.CopyStandardProductListDto; |
| | | import com.ruoyi.basic.dto.FactoryDto; |
| | | import com.ruoyi.basic.dto.InsSampleReceiveDto; |
| | | import com.ruoyi.basic.dto.ResetTreeDragDTO; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import com.ruoyi.basic.service.StandardMethodListService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StandardProductListSupplierAskService; |
| | | import com.ruoyi.basic.service.StandardTreeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/standardTree") |
| | | @Api(tags = "æ ååº") |
| | | public class StandardTreeController { |
| | | |
| | | private StandardTreeService standardTreeService; |
| | | |
| | | private StandardMethodListService standardMethodListService; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | private StandardProductListSupplierAskService standardProductListSupplierAskService; |
| | | |
| | | @ApiOperation(value = "è·åæ åæ ") |
| | | @GetMapping("/selectStandardTreeList") |
| | | public Result selectStandardTreeList() { |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ åæ (æ£éªä¸å)") |
| | | @GetMapping("/selectStandardTreeList2") |
| | | public Result selectStandardTreeList2() { |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ åæ ") |
| | | @PostMapping("/addStandardTree") |
| | | public Result addStandardTree(@RequestBody StandardTree standardTree) { |
| | | return Result.success(standardTreeService.addStandardTree(standardTree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç»æ åæ æ·»å æ£éªæ å") |
| | | @PostMapping("/addStandardMethodList") |
| | | public Result addStandardMethodList(String tree, Integer standardId) { |
| | | return Result.success(standardMethodListService.addStandardMethodList(standardId, tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®æ åæ è¿è¡æ åæ¥è¯¢") |
| | | @PostMapping("/selectsStandardMethodByFLSSM") |
| | | public Result selectsStandardMethodByFLSSM(String tree) { |
| | | return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ ååºä¸çå
容") |
| | | @PostMapping("/upStandardProductList") |
| | | public Result upStandardProductList(String str) { |
| | | StandardProductList list = JSON.parseObject(str, StandardProductList.class); |
| | | return Result.success(standardProductListService.upStandardProductList(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ ååºåºé´") |
| | | @PostMapping("/updateSection") |
| | | public Result updateSection(String str) { |
| | | StandardProductList list = JSON.parseObject(str, StandardProductList.class); |
| | | return Result.success(standardProductListService.updateSection(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªæ å") |
| | | @PostMapping("/delStandardMethodByFLSSM") |
| | | public Result delStandardMethodByFLSSM(Integer id) { |
| | | return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªé¡¹ç®") |
| | | @PostMapping("/delStandardProductByIds") |
| | | public Result delStandardProductByIds(String ids) { |
| | | JSONArray lists = JSON.parseArray(ids); |
| | | return Result.success(standardProductListService.delStandardProduct(lists)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æ åæ ä¸çæ£éªé¡¹ç®") |
| | | @PostMapping("/addStandardProduct") |
| | | public Result addStandardProduct(String ids, String tree) { |
| | | return Result.success(standardTreeService.addStandardProduct(ids, tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿 åæ çå±çº§") |
| | | @PostMapping("/delStandardTree") |
| | | public Result delStandardTree(String tree) { |
| | | return Result.success(standardTreeService.delStandardTree(tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè¿æ åæ æ¥è¯¢å¯¹åºçæ£éªé¡¹ç®") |
| | | @PostMapping("/selectStandardProductList") |
| | | public Result selectStandardProductList(@RequestBody InsSampleReceiveDto insSample) { |
| | | return Result.success(standardProductListService.selectStandardProductList(insSample)); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè¿æ£éªæ åæ¥è¯¢æ£éªé¡¹ç®") |
| | | @PostMapping("/selectStandardProductListByMethodId") |
| | | public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page) { |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éç¼è¾æ¥è¯¢æ£éªé¡¹ç®") |
| | | @PostMapping("/selectStandardProductByMethodId") |
| | | public Result selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { |
| | | return Result.success(standardProductListService.selectStandardProductByMethodId(id, tree, page, laboratory, item, items)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éç¼è¾æ¥è¯¢æææ£éªé¡¹ç®åæ£éªå项æä¸¾") |
| | | @PostMapping("/selectStandardProductEnumByMethodId") |
| | | public Result selectStandardProductEnumByMethodId(Integer id, String tree, String item) { |
| | | return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree, item)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ åæ ä¸æ åæ¹æ³æä¸¾") |
| | | @GetMapping("/selectStandardMethodEnum") |
| | | public Result selectStandardMethodEnum() { |
| | | return Result.success(standardMethodListService.selectStandardMethodEnum()); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åäº§åæ¶æ") |
| | | @GetMapping("/getStandardTree2") |
| | | public Result getStandardTree2() { |
| | | return Result.success(standardTreeService.getStandardTree2()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éä¿®æ¹é¡¹ç®å
容") |
| | | @PostMapping("/upStandardProducts") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "standardProductList", dataTypeClass = StandardProductList.class), |
| | | @ApiImplicitParam(name = "ids", dataTypeClass = Integer.class) |
| | | }) |
| | | public Result upStandardProducts(@RequestBody Map<String, Object> product) { |
| | | return Result.success(standardTreeService.upStandardProducts(product)); |
| | | } |
| | | |
| | | @PostMapping("/getStandTreeBySampleType") |
| | | @ApiOperation("ä»
è·åå
纤çåå·") |
| | | public Result<?> getStandTreeBySampleType(String laboratory, String sampleType) { |
| | | return Result.success(standardTreeService.getStandTreeBySampleType(laboratory, sampleType)); |
| | | } |
| | | |
| | | @ApiOperation("导å
¥æ ååº") |
| | | @PostMapping("/inExcelOfTree/{isEquipment}") |
| | | public Result inExcelOfTree(@RequestParam("file") MultipartFile file, @PathVariable("isEquipment") Boolean isEquipment) { |
| | | if (!isEquipment) { |
| | | standardTreeService.inExcelOfTree(file); |
| | | } else { |
| | | standardTreeService.importWorkstationExcel(file); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("éç½®æ ååºåä»·") |
| | | @PostMapping("/resetTreeOfPrice") |
| | | public Result resetTreeOfPrice(String tree, Integer standardId) { |
| | | standardTreeService.resetTreeOfPrice(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("éç½®æ ååºå·¥æ¶ç³»æ°") |
| | | @PostMapping("/resetTreeOfHour") |
| | | public Result resetTreeOfHour(String tree, Integer standardId) { |
| | | standardTreeService.resetTreeOfHour(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("éç½®æ ååºè¦æ±æè¿°åè¦æ±å¼") |
| | | @PostMapping("/resetTreeOfAsk") |
| | | public Result resetTreeOfAsk(String tree, Integer standardId) { |
| | | standardTreeService.resetTreeOfAsk(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ ååºææ½") |
| | | @PostMapping("/resetTreeDrag") |
| | | public Result resetTreeDrag(@RequestBody ResetTreeDragDTO resetTreeDragDTO) { |
| | | standardProductListService.resetTreeDrag(resetTreeDragDTO); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ ååºææ½å
¨é¨") |
| | | @PostMapping("/resetTreeDragBatch") |
| | | public Result resetTreeDragBatch(@RequestBody Map<String, Object> params) { |
| | | List<StandardProductList> standardProductLists = (List<StandardProductList>) params.get("params"); |
| | | standardProductListService.resetTreeDragBatch(standardProductLists); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ åæ æåº") |
| | | @PostMapping("/updateTreeSort") |
| | | public Result updateTreeSort(@RequestBody List<FactoryDto> list) { |
| | | return Result.success(standardTreeService.updateTreeSort(list)); |
| | | } |
| | | |
| | | /*************************************************** åå®¶ç¹æ®è¦æ±å¼å¤ç ************************************************************/ |
| | | |
| | | @ApiOperation(value = "æ ¹æ®äº§åidæ¥è¯¢åå®¶è¦æ±å¼ç»å®") |
| | | @PostMapping("/selectSupplierAsk") |
| | | public Result selectSupplierAsk(StandardProductListSupplierAsk supplierAsk) throws Exception { |
| | | return Result.success(standardProductListSupplierAskService.selectByProductId(supplierAsk)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢åå®¶è¦æ±å¼ç»å®") |
| | | @PostMapping("/addProductSupplierAsk") |
| | | public Result addProductSupplierAsk(String str) { |
| | | StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); |
| | | return Result.success(standardProductListSupplierAskService.addProductSupplierAsk(supplierAsk)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°åå®¶è¦æ±å¼ç»å®") |
| | | @PostMapping("/updateProductSupplierAsk") |
| | | public Result updateProductSupplierAsk(String str) { |
| | | StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); |
| | | standardProductListSupplierAskService.updateProductSupplierAsk(supplierAsk); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤åå®¶è¦æ±å¼ç»å®") |
| | | @PostMapping("/deleteProductSupplierAsk") |
| | | public Result deleteProductSupplierAsk(Integer supplierAskId) { |
| | | standardProductListSupplierAskService.removeById(supplierAskId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ åæ ") |
| | | @PostMapping("/updateStandardTree") |
| | | public Result updateStandardTree(@RequestBody StandardTree standardTree) { |
| | | return Result.success(standardTreeService.updateStandardTree(standardTree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ£éªé¡¹è¦æ±å¼å¤å¶å¯¹æ¯") |
| | | @PostMapping("/copyStandardProductList") |
| | | public Result copyStandardProductList(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductList(copyStandardProductListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ£éªé¡¹è¦æ±å¼åç¬å¯¹æ¯") |
| | | @PostMapping("/copyStandardProductOne") |
| | | public Result copyStandardProductOne(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductOne(copyStandardProductListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ£éªé¡¹æ¹éä¿®æ¹è¦æ±å¼è¦æ±æè¿°") |
| | | @PostMapping("/updateStandardProductListBatch") |
| | | public Result updateStandardProductListBatch(@RequestBody Map<String, Object> param) { |
| | | List<StandardProductList> standardProductList = (List<StandardProductList>) param.get("standardProductList"); |
| | | return Result.success(standardProductListService.updateBatchById(standardProductList)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ£éªé¡¹å¤å¶æåº") |
| | | @PostMapping("/copyStandardProductSort") |
| | | public Result copyStandardProductSort(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductSort(copyStandardProductListDto)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.pojo.StructureTestObjectPart; |
| | | import com.ruoyi.basic.service.StructureTestObjectPartService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * æ£éªå¯¹è±¡é¶ä»¶è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-08-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/structureTestObjectPart") |
| | | @AllArgsConstructor |
| | | @Api(tags = "æ£éªå¯¹è±¡é¶ä»¶è¡¨") |
| | | public class StructureTestObjectPartController { |
| | | |
| | | private StructureTestObjectPartService structureTestObjectPartService; |
| | | |
| | | @ApiOperation(value = "æ ¹æ®æ£éªå¯¹è±¡idæ¥è¯¢é¶ä»¶") |
| | | @PostMapping("/selectByTestObjectId") |
| | | public Result selectByTestObjectId(Page page,StructureTestObjectPart structureTestObjectPart){ |
| | | return Result.success(structureTestObjectPartService.selectByTestObjectId(page,structureTestObjectPart)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æ£éªå¯¹è±¡é¶ä»¶") |
| | | @PostMapping("/addTestObjectPart") |
| | | public Result addTestObjectPart(@RequestBody StructureTestObjectPart structureTestObjectPart) { |
| | | structureTestObjectPartService.addTestObjectPart(structureTestObjectPart); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ´æ°æ£éªå¯¹è±¡é¶ä»¶") |
| | | @PostMapping("/updateTestObjectPart") |
| | | public Result updateTestObjectPart(@RequestBody StructureTestObjectPart structureTestObjectPart) { |
| | | structureTestObjectPartService.updateTestObjectPart(structureTestObjectPart); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿£éªå¯¹è±¡é¶ä»¶") |
| | | @PostMapping("/deleteTestObjectPart") |
| | | public Result deleteTestObjectPart(Integer id) { |
| | | structureTestObjectPartService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ 忣éªé¡¹å¤å¶ |
| | | * |
| | | * @Author zhuo |
| | | * @Date 2024/10/31 |
| | | */ |
| | | @Data |
| | | public class CopyStandardProductListDto { |
| | | |
| | | @ApiModelProperty("忬æ£éªé¡¹ä¿¡æ¯") |
| | | private List<StandardProductList> oldStandardProductList; |
| | | |
| | | @ApiModelProperty("éè¦å¯¹æ¯çæ£éªé¡¹ä¿¡æ¯") |
| | | private List<StandardProductList> newStandardProductList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class FactoryDto { |
| | | |
| | | private String code = "[1]"; |
| | | |
| | | private String label; |
| | | |
| | | private String value; |
| | | |
| | | private List<LaboratoryDto> children; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * åæææ¥è¯¢, æé¤äºä¾åºå |
| | | * @Author zhuo |
| | | * @Date 2024/8/28 |
| | | */ |
| | | @Data |
| | | public class IfsInventoryQuantityCheckDto implements Serializable { |
| | | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("å") |
| | | private String contract; |
| | | |
| | | @ApiModelProperty("订åå·") |
| | | private String orderNo; |
| | | |
| | | |
| | | @ApiModelProperty("è¡å·") |
| | | private String lineNo; |
| | | |
| | | @ApiModelProperty("ä¸è¾¾å·") |
| | | private String releaseNo; |
| | | |
| | | @ApiModelProperty("æ¥æ¶å·") |
| | | private Integer receiptNo; |
| | | |
| | | @ApiModelProperty("é¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ApiModelProperty("é¶ä»¶æè¿°") |
| | | private String partDesc; |
| | | |
| | | @ApiModelProperty("ç¶ææè¿°") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | private String statusDb; |
| | | |
| | | @ApiModelProperty("æµè¾¾çéè´æ°é") |
| | | private BigDecimal qtyArrived; |
| | | |
| | | @ApiModelProperty("å·²æ£éªçè´ä¹°æ°é") |
| | | private BigDecimal qtyInspected; |
| | | |
| | | @ApiModelProperty("è¦æ£éªçéè´æ°é") |
| | | private BigDecimal qtyToInspect; |
| | | |
| | | @ApiModelProperty("æµè¾¾çåºåæ°é") |
| | | private BigDecimal invQtyInStore; |
| | | |
| | | @ApiModelProperty("æµè¾¾çéè´æ°é") |
| | | private BigDecimal purQtyInStore; |
| | | |
| | | @ApiModelProperty("é
ç½®æ è¯") |
| | | private String configurationId; |
| | | |
| | | @ApiModelProperty("æ¹å·") |
| | | private String lotBatchNo; |
| | | |
| | | @ApiModelProperty("wdrå·") |
| | | private String waivDevRejNo; |
| | | |
| | | @ApiModelProperty("æ´»å¨åºå") |
| | | private Integer activitySeq; |
| | | |
| | | |
| | | @ApiModelProperty("åºåå·") |
| | | private String serialNo; |
| | | |
| | | @ApiModelProperty("åºä½å·") |
| | | private String locationNo; |
| | | |
| | | @ApiModelProperty("çæ¬å·") |
| | | private String engChgLevel; |
| | | |
| | | @ApiModelProperty("æ¥æ¶äºº") |
| | | private String receiver; |
| | | |
| | | @ApiModelProperty("æ¥æ¶äººå§å") |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty("éè´å") |
| | | private String buyerCode; |
| | | |
| | | @ApiModelProperty("éè´åå§å") |
| | | private String buyerName; |
| | | |
| | | @ApiModelProperty("å®é
å°è´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime arriveDate; |
| | | |
| | | @ApiModelProperty("å®é
äº¤è´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime deliveryDate; |
| | | |
| | | @ApiModelProperty("çäº§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime productDate; |
| | | |
| | | @ApiModelProperty("å¤±ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime invalidDate; |
| | | |
| | | |
| | | @ApiModelProperty("å®¡æ¹æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime approvedDate; |
| | | |
| | | @ApiModelProperty("éè´ç³è¯·å建人") |
| | | private String reqCeater; |
| | | |
| | | @ApiModelProperty("éè´ç³è¯·å建人å§å") |
| | | private String reqCeaterName; |
| | | |
| | | @ApiModelProperty("éè´è®¢åè¡å¤æ³¨") |
| | | private String lineRemarks; |
| | | |
| | | @ApiModelProperty("åä½") |
| | | private String buyUnitMeas; |
| | | |
| | | |
| | | private Integer isSource; |
| | | |
| | | private Integer number; |
| | | |
| | | |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("æ¥æ¶æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime receiverDate; |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¸ºé¦æ¬¡åºç° 0 å¦ 1 æ¯") |
| | | private Integer isFirst; |
| | | |
| | | @ApiModelProperty("ç®æ åºä½å·") |
| | | private String toLocation; |
| | | |
| | | @ApiModelProperty("æ¯å¦æ¯æ¥æ£ 0 å¦ 1 æ¯") |
| | | private Integer isInspect; |
| | | |
| | | @ApiModelProperty("æ¥æ£äºº") |
| | | private String declareUser; |
| | | |
| | | |
| | | @ApiModelProperty("æ¥æ£äººid") |
| | | private Integer declareUserId; |
| | | |
| | | @ApiModelProperty("åä½") |
| | | private String partUnit; |
| | | |
| | | @ApiModelProperty("产ä¸é¾æ£æµæ°æ®") |
| | | private String industryChain; |
| | | |
| | | @ApiModelProperty("æ¥æ£æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime declareDate; |
| | | |
| | | @ApiModelProperty("æ¯å¦å¡å¯ä»¥å£åº¦æ£éª 0 å¦ 1 æ¯") |
| | | private Integer isQuarter; |
| | | |
| | | // ä¿®æ¹åç |
| | | @ApiModelProperty("æ¹å·") |
| | | private String updateBatchNo; |
| | | |
| | | @ApiModelProperty("æ¯å¦æ¯éåä¸, 0å¦, 1æ¯") |
| | | private Integer isCopper; |
| | | |
| | | @ApiModelProperty("ç©æç±»å") |
| | | private Integer isExpire; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class IfsInventoryQuantityDto extends IfsInventoryQuantityCheckDto { |
| | | |
| | | /** |
| | | * å§æç¼å· |
| | | */ |
| | | @ApiModelProperty("å§æç¼å·") |
| | | private String entrustCode; |
| | | |
| | | @ApiModelProperty("æ£éªå¯¹è±¡") |
| | | private String sampleType; |
| | | |
| | | @ApiModelProperty("æ ·ååç§°") |
| | | private String sampleName; |
| | | |
| | | @ApiModelProperty("æ ·ååå·") |
| | | private String sampleModel; |
| | | |
| | | @ApiModelProperty("æ ·åç¼å·") |
| | | private String sampleCode; |
| | | |
| | | // è¿å |
| | | @ApiModelProperty("订åid") |
| | | private Integer enterOrderId; |
| | | |
| | | @ApiModelProperty("æ¥åid") |
| | | private String enterReportId; |
| | | |
| | | @ApiModelProperty("ç³»ç»çææ¥åå°å") |
| | | private String enterUrl; |
| | | |
| | | @ApiModelProperty("æå¨ä¸ä¼ æ¥åå°å") |
| | | private String enterUrlS; |
| | | |
| | | // å£åº¦ |
| | | @ApiModelProperty("订åid") |
| | | private Integer quarterOrderId; |
| | | |
| | | @ApiModelProperty("æ¥åid") |
| | | private String quarterReportId; |
| | | |
| | | @ApiModelProperty("ç³»ç»çææ¥åå°å") |
| | | private String quarterUrl; |
| | | |
| | | @ApiModelProperty("æå¨ä¸ä¼ æ¥åå°å") |
| | | private String quarterUrlS; |
| | | |
| | | private Integer orderState; |
| | | |
| | | @ApiModelProperty("ä¸åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendTime; |
| | | |
| | | @ApiModelProperty("ææåå®¶") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty("å§æäºº") |
| | | private String prepareUser; |
| | | |
| | | @ApiModelProperty("é¢è²") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("æ ç¾ç¶æ") |
| | | private String labelStatus; |
| | | |
| | | @ApiModelProperty("æ ç¾æ¡å½¢ç ") |
| | | private String labelBarCode; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("æ£éªäºº") |
| | | private String userName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * è½æ¥è¯¢å°ä¾åºå |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class IfsInventoryQuantitySupplierDto extends IfsInventoryQuantity { |
| | | |
| | | /** |
| | | * å§æç¼å· |
| | | */ |
| | | @ExcelProperty(index = 2, value = "å§æç¼å·") |
| | | @ApiModelProperty("å§æç¼å·") |
| | | private String entrustCode; |
| | | |
| | | @ApiModelProperty("æ ·åid") |
| | | private Integer sampleId; |
| | | |
| | | @ApiModelProperty("æ£éªå¯¹è±¡") |
| | | private String sampleType; |
| | | |
| | | @ExcelProperty(index = 7, value = "æ ·ååç§°") |
| | | @ApiModelProperty("æ ·ååç§°") |
| | | private String sampleName; |
| | | |
| | | @ExcelProperty(index = 8, value = "æ ·ååå·") |
| | | @ApiModelProperty("æ ·ååå·") |
| | | private String sampleModel; |
| | | |
| | | @ApiModelProperty("æ ·åç¼å·") |
| | | private String sampleCode; |
| | | |
| | | // è¿å |
| | | @ApiModelProperty("è¿å订åid") |
| | | private Integer enterOrderId; |
| | | |
| | | @ApiModelProperty("æ¥åid") |
| | | private String enterReportId; |
| | | |
| | | @ApiModelProperty("ç³»ç»çææ¥åå°å") |
| | | private String enterUrl; |
| | | |
| | | @ApiModelProperty("æå¨ä¸ä¼ æ¥åå°å") |
| | | private String enterUrlS; |
| | | |
| | | // å£åº¦ |
| | | @ApiModelProperty("å£åº¦è®¢åid") |
| | | private Integer quarterOrderId; |
| | | |
| | | @ApiModelProperty("æ¥åid") |
| | | private String quarterReportId; |
| | | |
| | | @ApiModelProperty("ç³»ç»çææ¥åå°å") |
| | | private String quarterUrl; |
| | | |
| | | @ApiModelProperty("æå¨ä¸ä¼ æ¥åå°å") |
| | | private String quarterUrlS; |
| | | |
| | | private Integer orderState; |
| | | |
| | | @ApiModelProperty("ä¸åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendTime; |
| | | |
| | | @ApiModelProperty("å§æäºº") |
| | | private String prepareUser; |
| | | |
| | | @ApiModelProperty("é¢è²") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("æ ç¾ç¶æ") |
| | | private String labelStatus; |
| | | |
| | | @ApiModelProperty("æ ç¾æ¡å½¢ç ") |
| | | private String labelBarCode; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | private Integer createUser; |
| | | |
| | | @ExcelProperty(index = 9, value = "æ£éªäºº") |
| | | @ApiModelProperty("æ£éªäºº") |
| | | private String userName; |
| | | |
| | | @ExcelProperty(index = 10, value = "ä¸åæ¶é´") |
| | | private String sendTimeString; |
| | | |
| | | @ExcelProperty(index = 14, value = "æ¥æ¶æ¶é´") |
| | | private String receiverDateString; |
| | | |
| | | @ExcelProperty(index = 15, value = "æ¥æ£æ¶é´") |
| | | private String declareDateString; |
| | | |
| | | // åæ ¼ç¶æ,: 0 æ£éªä¸, 1åæ ¼, 2ä¸åæ ¼, 3æªä¸å,4è®©æ¥æ¾è¡ |
| | | @ExcelProperty(index = 6, value = "æ£éªç¶æ") |
| | | private String inspectStatusString; |
| | | |
| | | @ApiModelProperty("æ¥æ£å¼å§æ¶é´") |
| | | private String beginDeclareDate; |
| | | |
| | | @ApiModelProperty("æ¥æ£ç»ææ¶é´") |
| | | private String endDeclareDate; |
| | | |
| | | @ApiModelProperty("ä¸åæ ¼æè¿°") |
| | | @ExcelProperty(index = 16, value = "ä¸åæ ¼æè¿°") |
| | | private String unqualifiedDesc; |
| | | |
| | | |
| | | @ApiModelProperty("ä¸åæ ¼é¡¹") |
| | | @ExcelProperty(index = 17, value = "ä¸åæ ¼é¡¹") |
| | | private String unqualifiedItem; |
| | | |
| | | @ApiModelProperty("å
æ£") |
| | | private Integer isExemption; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.InsSample1; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author zhuo |
| | | * @Date 2024/10/29 |
| | | */ |
| | | @Data |
| | | public class InsSampleReceiveDto extends InsSample1 { |
| | | |
| | | @ApiModelProperty("é¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ApiModelProperty("åææid") |
| | | private Integer ifsInventoryId; |
| | | |
| | | @ApiModelProperty("è¯æ°") |
| | | private String cores; |
| | | |
| | | @ApiModelProperty("åå·åæ°") |
| | | private String modelNum; |
| | | |
| | | @ApiModelProperty("å¯¼ä½æè´¨") |
| | | private String conductorMaterial; |
| | | |
| | | @ApiModelProperty("导ä½ç±»å") |
| | | private String conductorType; |
| | | |
| | | @ApiModelProperty("æ¯å¦æ¯çµç¼é
ç½®") |
| | | private String isCableTag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class LaboratoryDto { |
| | | |
| | | private String code = "[2]"; |
| | | |
| | | private String label; |
| | | |
| | | private String value; |
| | | |
| | | private List<SampleTypeDto> children; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ModelDto { |
| | | |
| | | private String code = "[5]"; |
| | | |
| | | private String label; |
| | | |
| | | private String value; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author æ´å |
| | | * @Date 2024/2/26 |
| | | */ |
| | | @Data |
| | | public class PageTestObjectDto extends StructureTestObject { |
| | | |
| | | @ApiModelProperty(value = "产å") |
| | | private String product; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateUserName; |
| | | |
| | | @ApiModelProperty(value = "é¶ä»¶å·") |
| | | private String partNo; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author zhuo |
| | | * @Date 2024/8/5 |
| | | */ |
| | | @Data |
| | | public class ProductDTO1 extends Product { |
| | | |
| | | @ApiModelProperty(value = "é¶ä»¶å·") |
| | | private String partNo; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductDto { |
| | | |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author zhuo |
| | | * @Date 2024/8/22 |
| | | */ |
| | | @Data |
| | | public class ResetTreeDragDTO { |
| | | @ApiModelProperty(value = "å¼å§ç´¢å¼") |
| | | private String beginIndex; |
| | | |
| | | @ApiModelProperty(value = "ç»æç´¢å¼") |
| | | private String endIndex; |
| | | |
| | | @ApiModelProperty(value = "æ åç¼å·id") |
| | | private String methodId; |
| | | |
| | | @ApiModelProperty(value = "æ°") |
| | | private String tree; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹è¡id") |
| | | private String productionId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SampleDto { |
| | | |
| | | private String code = "[4]"; |
| | | |
| | | private String label; |
| | | |
| | | private String value; |
| | | |
| | | private String partNo; |
| | | |
| | | // æ ·åè±æ |
| | | private String sampleEn; |
| | | |
| | | private List<ModelDto> children; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SampleTypeDto { |
| | | |
| | | private String code = "[3]"; |
| | | |
| | | // æ£æµå¯¹è±¡id |
| | | private Integer sampleTypeId; |
| | | |
| | | // æ£æµå¯¹è±¡æåº |
| | | private Integer sort; |
| | | |
| | | private String label; |
| | | |
| | | private String value; |
| | | |
| | | private String partNo; |
| | | |
| | | // å¯¹è±¡è±æ |
| | | private String sampleTypeEn; |
| | | |
| | | private List<SampleDto> children; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TestItemDto { |
| | | |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | private List<ProductDto> children; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StructureTestObjectData { |
| | | @ExcelProperty(value = "åºæ") |
| | | private String laboratory; |
| | | |
| | | @ExcelProperty(value = "æ£æµå¯¹è±¡") |
| | | private String specimenName; |
| | | |
| | | @ExcelProperty(value = "æ£æµå¯¹è±¡(EN)") |
| | | private String specimenNameEn; |
| | | |
| | | @ExcelProperty(value = "对象代å·") |
| | | private String code; |
| | | |
| | | @ExcelProperty(value = "产ååç§°") |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "产ååç§°(EN)") |
| | | private String nameEn; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.excel; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.ruoyi.basic.service.ProductService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class StructureTestObjectListener extends AnalysisEventListener<StructureTestObjectData> { |
| | | private static final int BATCH_COUNT = 1000; |
| | | List<StructureTestObjectData> list = new ArrayList<>(); |
| | | |
| | | private ProductService productService; |
| | | |
| | | public StructureTestObjectListener(ProductService productService) { |
| | | this.productService = productService; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(StructureTestObjectData data, AnalysisContext analysisContext) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | save(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | save(); |
| | | } |
| | | |
| | | |
| | | private void save() { |
| | | productService.importPartExcel(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Certification; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CertificationMapper extends BaseMapper<Certification> { |
| | | |
| | | //æ¥è¯¢èµè´¨æç»å表 |
| | | IPage<Certification> getCertificationDetail(Page page, @Param("ew") QueryWrapper<Certification> ew); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.basic.dto.IfsInventoryQuantityDto; |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface IfsInventoryQuantityMapper extends BaseMapper<IfsInventoryQuantity> { |
| | | |
| | | /** |
| | | * æå°æ ç¾æ¥è¯¢ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<IfsInventoryQuantityDto> printLabel(@Param("ids") List<Integer> ids); |
| | | |
| | | /** |
| | | * |
| | | * @param ifsInventoryId |
| | | * @return |
| | | */ |
| | | int selectReportCountById(@Param("ifsInventoryId") Integer ifsInventoryId); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å½åå£åº¦æ¯å¦åºç°è¿è¯¥ææ |
| | | * @param partDetail åå· |
| | | * @param supplierName ä¾åºååç§° |
| | | * @param startOfNextQuarter å£åº¦å¼å§æ¶é´ |
| | | * @param endOfQuarter å£åº¦ç»ææ¶é´ |
| | | * @return |
| | | */ |
| | | Integer selectIsFirst(@Param("partDetail") String partDetail, |
| | | @Param("supplierName") String supplierName, |
| | | @Param("startOfNextQuarter") LocalDateTime startOfNextQuarter, |
| | | @Param("endOfQuarter") LocalDateTime endOfQuarter); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * å®éªå®¤ç®¡ç(Laboratory)è¡¨æ°æ®åºè®¿é®å± |
| | | */ |
| | | public interface LaboratoryMapper extends BaseMapper<Laboratory> { |
| | | |
| | | IPage<Laboratory> selectItemParameter(Page page, @Param("ew") QueryWrapper<Laboratory> ew); |
| | | |
| | | Object obtainItemParameterList(@Param("page") Page page, @Param("ew") QueryWrapper<Laboratory> ew); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.ProductDTO1; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author z1292 |
| | | * @description é对表ãproduct(产å表)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-04-26 01:11:02 |
| | | * @Entity com.ruoyi.basic.pojo.Product |
| | | */ |
| | | public interface ProductMapper extends BaseMapper<Product> { |
| | | |
| | | IPage<Product> selectProductListByObjectId(Page page, @Param("ew") QueryWrapper<ProductDTO1> ew, @Param("partNo") String partNo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.ruoyi.basic.pojo.ProductPart; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface ProductPartMapper extends BaseMapper<ProductPart> { |
| | | IPage<ProductPart> selectListByProductId(IPage<ProductPart> page, |
| | | @Param("ew") QueryWrapper<ProductPart> ew, |
| | | @Param("productId") Integer productId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.ProductSupplierDensity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 产ååå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-19 |
| | | */ |
| | | @Mapper |
| | | public interface ProductSupplierDensityMapper extends BaseMapper<ProductSupplierDensity> { |
| | | |
| | | IPage<ProductSupplierDensity> selectListByProductId(@Param("page") Page page, @Param("ew") QueryWrapper<ProductSupplierDensity> ew, @Param("productId") Integer productId); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.basic.pojo.StandardMethodList; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method_list(æ åæ ä¸çæ åå表)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-04 13:44:04 |
| | | * @Entity com.ruoyi.basic.pojo.StandardMethodList |
| | | */ |
| | | public interface StandardMethodListMapper extends BaseMapper<StandardMethodList> { |
| | | |
| | | Map<String, String> selectStandardMethodById(Integer id); |
| | | |
| | | String selectUserById(Integer id); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists(String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodListsByNull(String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists3(String tree); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists2(@Param("data1") String data1, @Param("data2") String data2, @Param("data3") String data3, @Param("data4") String data4, @Param("data5") String data5); |
| | | |
| | | List<StandardProductList> selectParameterList(String code); |
| | | |
| | | List<StandardMethodList> selectListEnum(); |
| | | |
| | | Integer getStandardMethodId(String code); |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.mybatis_config.MyBaseMapper; |
| | | import com.ruoyi.basic.pojo.StandardMethod; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method(æ åæ¹æ³)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-03 19:21:41 |
| | | * @Entity com.ruoyi.basic.pojo.StandardMethod |
| | | */ |
| | | public interface StandardMethodMapper extends MyBaseMapper<StandardMethod> { |
| | | |
| | | IPage<StandardMethod> selectStandardMethodList(Page page, @Param("ew") QueryWrapper<StandardMethod> ew); |
| | | |
| | | StandardMethod selectStandMethodById(Integer id); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_product_list(æ åæ ä¸çæ£éªé¡¹ç®)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-05 10:33:29 |
| | | * @Entity com.ruoyi.basic.pojo.StandardProductList |
| | | */ |
| | | public interface StandardProductListMapper extends BaseMapper<StandardProductList> { |
| | | |
| | | IPage<StandardProductList> standardProductListIPage(@Param("id") Integer id, @Param("tree") String tree, IPage<StandardProductList> page, @Param("laboratory") String laboratory, @Param("insItem") String insItem, @Param("insItems") String insItems); |
| | | |
| | | StandardProductList getOne(@Param("standardMethodListId") Integer standardMethodListId, @Param("inspectionItem") String inspectionItem, @Param("sample") String sample, @Param("inspectionItemSubclass") String inspectionItemSubclass, @Param("model") String model, @Param("inspectionItemClass") String inspectionItemClass); |
| | | |
| | | List<StandardProductList> selectDetail(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("model") String model, @Param("isCableTag") String isCableTag); |
| | | |
| | | List<StandardProductList> selectDetail2(@Param("standardMethodListId") Integer standardMethodListId, @Param("state") int state, @Param("tree") String tree, @Param("isCableTag") String isCableTag); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¶ä»¶é¢è² |
| | | * @param partNo |
| | | * @return |
| | | */ |
| | | Map<String, String> selectPartColor(@Param("partNo") String partNo); |
| | | |
| | | /** |
| | | * åºé´ä¿®æ¹ |
| | | * @param productList |
| | | * @return |
| | | */ |
| | | void updateSection(@Param("productList") StandardProductList productList); |
| | | |
| | | |
| | | /** |
| | | * ä»ä¸å¾ä¸ä¿®æ¹é¡ºåº |
| | | * @param beginIndex å¼å§ä½ç½® |
| | | * @param endIndex ç»æä½ç½® |
| | | * @param methodId æ åid |
| | | * @param tree æ |
| | | */ |
| | | void updateSortUp(@Param("beginIndex") Integer beginIndex, |
| | | @Param("endIndex") Integer endIndex, |
| | | @Param("methodId") Integer methodId, |
| | | @Param("tree") String tree); |
| | | |
| | | /** |
| | | * ä»ä¸ç½ä¸ä¿®æ¹é¡ºåº |
| | | * @param beginIndex |
| | | * @param endIndex |
| | | * @param methodId |
| | | * @param tree |
| | | */ |
| | | void updateSortDown(@Param("beginIndex") Integer beginIndex, |
| | | @Param("endIndex") Integer endIndex, |
| | | @Param("methodId") Integer methodId, |
| | | @Param("tree") String tree); |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-23 |
| | | */ |
| | | @Mapper |
| | | public interface StandardProductListSupplierAskMapper extends BaseMapper<StandardProductListSupplierAsk> { |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.StandardTemplate; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-11 13:47:52 |
| | | * @Entity com.ruoyi.basic.pojo.StandardTemplate |
| | | */ |
| | | public interface StandardTemplateMapper extends BaseMapper<StandardTemplate> { |
| | | |
| | | IPage<StandardTemplate> selectStandardTemplatePageList(Page page, @Param("ew") QueryWrapper<StandardTemplate> ew); |
| | | |
| | | StandardTemplate getStandTempIdByName(String name); |
| | | |
| | | /** |
| | | * æ¥è¯¢å缩åçæ°æ® |
| | | * @param templateId |
| | | * @return |
| | | */ |
| | | String selectCompressThing(Integer templateId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.*; |
| | | import com.ruoyi.basic.pojo.IfsInventoryQuantity; |
| | | import com.ruoyi.basic.pojo.StandardMethodList; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_tree(æ åæ )ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-01 15:06:44 |
| | | * @Entity com.ruoyi.basic.pojo.StandardTree |
| | | */ |
| | | public interface StandardTreeMapper extends BaseMapper<StandardTree> { |
| | | |
| | | List<FactoryDto> selectStandardTreeList(); |
| | | |
| | | List<StandardTree> selectStandardTreeList2(String sampleType); |
| | | |
| | | StandardProductList selectStandardProductById(Integer id); |
| | | |
| | | List<StandardProductList> getStandardProductListBySample(String sampleType); |
| | | |
| | | List<StandardMethodList> getStandardMethodListBySample(String sampleType); |
| | | |
| | | List<StandardProductList> selectStandardProductListByTree(String tree, String sample, String model, String trees, String laboratory); |
| | | |
| | | List<StandardProductList> selectStandardProductListByTree2(String tree, String sample, String model, String trees, String laboratory); |
| | | |
| | | |
| | | List<SampleTypeDto> getStandardTree2(); |
| | | |
| | | List<SampleDto> getStandardTree3(String sampleType); |
| | | |
| | | |
| | | String getLaboratory(String str); |
| | | |
| | | Integer getStructureItemParameterId(String sampleType, String item, String itemChild, String inspectionItemClass); |
| | | |
| | | List<ProductDto> selectPList(String name); |
| | | |
| | | String selSample(String sample); |
| | | |
| | | List<FactoryDto> selectStandardTreeListByPartNo(@Param("partNo") String partNo); |
| | | |
| | | IPage<IfsInventoryQuantity> selectIfsPage(IPage<IfsInventoryQuantity> page, |
| | | @Param("ew") QueryWrapper<IfsInventoryQuantity> ew); |
| | | |
| | | IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, |
| | | @Param("ew") QueryWrapper<IfsInventoryQuantityDto> ew); |
| | | |
| | | |
| | | IPage<IfsInventoryQuantityCheckDto> selectIfsInventoryQuantity(Page<IfsInventoryQuantityCheckDto> page, @Param("ew")QueryWrapper<IfsInventoryQuantityCheckDto> ew); |
| | | |
| | | /** |
| | | * åææ¥æ£æ¥è¯¢å
¨é¨(å页) |
| | | * @param page |
| | | * @param ew |
| | | * @return |
| | | */ |
| | | IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, @Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); |
| | | |
| | | /** |
| | | * åææ¥æ£æ¥è¯¢å
¨é¨(æ å页) |
| | | * @param ew |
| | | * @return |
| | | */ |
| | | List<IfsInventoryQuantitySupplierDto> getIfsByOverList(@Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); |
| | | |
| | | /** |
| | | * åæææ¥è¯¢å£åº¦æ£éª |
| | | * @param page |
| | | * @param |
| | | * @param beginDeclareDate |
| | | * @param endDeclareDate |
| | | * @return |
| | | */ |
| | | IPage<IfsInventoryQuantitySupplierDto> getIfsByQuarter(Page<IfsInventoryQuantitySupplierDto> page, @Param("ew") QueryWrapper<IfsInventoryQuantitySupplierDto> ew, @Param("beginDeclareDate") String beginDeclareDate, @Param("endDeclareDate")String endDeclareDate); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.TestItemDto; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åæ°(StructureItemParameter)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 16:21:17 |
| | | */ |
| | | public interface StructureItemParameterMapper extends BaseMapper<StructureItemParameter> { |
| | | |
| | | IPage<StructureItemParameter> selectItemParameterList(Page page, @Param("ew") QueryWrapper<StructureItemParameter> ew); |
| | | |
| | | List<Map<String, Object>> getInsProduction(); |
| | | |
| | | List<TestItemDto> getItemTree(); |
| | | |
| | | int removeNoSample(@Param("sample") String sample); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.PageTestObjectDto; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * æ£æµå¯¹è±¡(StructureTestObject)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 17:36:41 |
| | | */ |
| | | public interface StructureTestObjectMapper extends BaseMapper<StructureTestObject> { |
| | | |
| | | IPage<PageTestObjectDto> selectTestObjectList(Page page, @Param("ew") QueryWrapper<PageTestObjectDto> ew, @Param("partNo") String partNo); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.StructureTestObjectPart; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * æ£éªå¯¹è±¡é¶ä»¶è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface StructureTestObjectPartMapper extends BaseMapper<StructureTestObjectPart> { |
| | | IPage<StructureTestObjectPart> selectListByTestObjectId(Page page, @Param("ew") QueryWrapper<StructureTestObjectPart> structureTestObjectPartQueryWrapper, @Param("testObjectId") Integer testObjectId); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | @TableName(value = "certification") |
| | | @Data |
| | | public class Certification implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨ç¼ç ") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "é¢åæºæ") |
| | | private String organization; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨è¯´æ") |
| | | private String explanation; |
| | | |
| | | @ApiModelProperty(value = "馿¬¡é¢åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime firstIssuanceDate; |
| | | |
| | | @ApiModelProperty(value = "æè¿é¢åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime latestIssuanceDate; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "å°æé¢åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime expireTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é¢å¸æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime dateOfIssuance; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨å¾çå°å") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨éä»¶å°å") |
| | | private String fileUrl; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("ifs_inventory_quantity") |
| | | @ExcelIgnoreUnannotated |
| | | public class IfsInventoryQuantity implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | |
| | | @ApiModelProperty("å") |
| | | private String contract; |
| | | |
| | | @ExcelProperty(index = 13, value = "订åå·") |
| | | @ApiModelProperty("订åå·") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("è¡å·") |
| | | private String lineNo; |
| | | |
| | | @ApiModelProperty("ä¸è¾¾å·") |
| | | private String releaseNo; |
| | | |
| | | @ApiModelProperty("æ¥æ¶å·") |
| | | private Integer receiptNo; |
| | | |
| | | @ExcelProperty(index = 3, value = "é¶ä»¶å·") |
| | | @ApiModelProperty("é¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ExcelProperty(index = 4, value = "é¶ä»¶æè¿°") |
| | | @ApiModelProperty("é¶ä»¶æè¿°") |
| | | private String partDesc; |
| | | |
| | | @ApiModelProperty("ç¶ææè¿°(IFS忬æåçç¶æ)") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("ç¶æ(IFS忬æåçç¶æ)") |
| | | private String statusDb; |
| | | |
| | | @ExcelProperty(index = 11, value = "æµè¾¾çéè´æ°é") |
| | | @ApiModelProperty("æµè¾¾çéè´æ°é") |
| | | private BigDecimal qtyArrived; |
| | | |
| | | @ApiModelProperty("å·²æ£éªçè´ä¹°æ°é") |
| | | private BigDecimal qtyInspected; |
| | | |
| | | @ApiModelProperty("è¦æ£éªçéè´æ°é") |
| | | private BigDecimal qtyToInspect; |
| | | |
| | | @ApiModelProperty("ä¾åºåç¼å·") |
| | | private String supplierId; |
| | | |
| | | @ExcelProperty(index = 5, value = "ä¾åºååç§°") |
| | | @ApiModelProperty("ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty("æµè¾¾çåºåæ°é") |
| | | private BigDecimal invQtyInStore; |
| | | |
| | | @ApiModelProperty("æµè¾¾çéè´æ°é") |
| | | private BigDecimal purQtyInStore; |
| | | |
| | | @ApiModelProperty("é
ç½®æ è¯") |
| | | private String configurationId; |
| | | |
| | | @ApiModelProperty("æ¹å·") |
| | | private String lotBatchNo; |
| | | |
| | | @ApiModelProperty("wdrå·") |
| | | private String waivDevRejNo; |
| | | |
| | | @ApiModelProperty("æ´»å¨åºå") |
| | | private Integer activitySeq; |
| | | |
| | | @ApiModelProperty("åºåå·") |
| | | private String serialNo; |
| | | |
| | | @ApiModelProperty("åºä½å·") |
| | | private String locationNo; |
| | | |
| | | @ApiModelProperty("çæ¬å·") |
| | | private String engChgLevel; |
| | | |
| | | @ApiModelProperty("æ¥æ¶äºº") |
| | | private String receiver; |
| | | |
| | | @ApiModelProperty("æ¥æ¶äººå§å") |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty("éè´å") |
| | | private String buyerCode; |
| | | |
| | | @ApiModelProperty("éè´åå§å") |
| | | private String buyerName; |
| | | |
| | | @ApiModelProperty("å®é
å°è´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime arriveDate; |
| | | |
| | | @ApiModelProperty("å®é
äº¤è´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime deliveryDate; |
| | | |
| | | @ApiModelProperty("çäº§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime productDate; |
| | | |
| | | @ApiModelProperty("å¤±ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime invalidDate; |
| | | |
| | | |
| | | @ApiModelProperty("å®¡æ¹æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime approvedDate; |
| | | |
| | | @ApiModelProperty("éè´ç³è¯·å建人") |
| | | private String reqCeater; |
| | | |
| | | @ApiModelProperty("éè´ç³è¯·å建人å§å") |
| | | private String reqCeaterName; |
| | | |
| | | @ApiModelProperty("éè´è®¢åè¡å¤æ³¨") |
| | | private String lineRemarks; |
| | | |
| | | @ExcelProperty(index = 12, value = "åä½") |
| | | @ApiModelProperty("åä½") |
| | | private String buyUnitMeas; |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¸ºifsæå,0 å¦, 1æ¯") |
| | | private Integer isSource; |
| | | |
| | | private Integer number; |
| | | |
| | | |
| | | @ApiModelProperty("ç¶æ: 0:å¾
æ¥æ£, 1:å¾
æ£éª, :å·²å®¡æ ¸") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("æ¥æ¶æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime receiverDate; |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¸ºé¦æ¬¡åºç° 0 å¦ 1 æ¯") |
| | | private Integer isFirst; |
| | | |
| | | @ApiModelProperty("ç®æ åºä½å·") |
| | | private String toLocation; |
| | | |
| | | @ApiModelProperty("æ¯å¦æ¯æ¥æ£ 0 å¦ 1 æ¯") |
| | | private Integer isInspect; |
| | | |
| | | @ApiModelProperty("æ¥æ£äºº") |
| | | private String declareUser; |
| | | |
| | | |
| | | @ApiModelProperty("æ¥æ£äººid") |
| | | private Integer declareUserId; |
| | | |
| | | @ApiModelProperty("åä½") |
| | | private String partUnit; |
| | | |
| | | @ApiModelProperty("产ä¸é¾æ£æµæ°æ®") |
| | | private String industryChain; |
| | | |
| | | @ApiModelProperty("æ¥æ£æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime declareDate; |
| | | |
| | | @ApiModelProperty("æ¯å¦å¡å¯ä»¥å£åº¦æ£éª 0 å¦ 1 æ¯") |
| | | private Integer isQuarter; |
| | | |
| | | // ä¿®æ¹åç |
| | | @ExcelProperty(index = 1, value = "æ¹å·") |
| | | @ApiModelProperty("æ¹å·") |
| | | private String updateBatchNo; |
| | | |
| | | @ApiModelProperty("æ¯å¦ç»æ, 0å¦, 1æ¯") |
| | | private Integer isFinish; |
| | | |
| | | @ApiModelProperty("æ¯å¦æ¯éåä¸, 0å¦, 1æ¯") |
| | | private Integer isCopper; |
| | | |
| | | // åæ ¼ç¶æ,: 0 æ£éªä¸, 1åæ ¼, 2ä¸åæ ¼, 3æªä¸å,4è®©æ¥æ¾è¡ |
| | | @ApiModelProperty("æ£éªç¶æ") |
| | | private Integer inspectStatus; |
| | | |
| | | @ApiModelProperty("æ¯å¦éè´è®¢åç»è®°: 0å¦, 1:æ¯") |
| | | private Integer isRegister; |
| | | |
| | | @ApiModelProperty("æ¯å¦ä¿®æ¹è¿æ¹å·: 0å¦, 1:æ¯") |
| | | private Integer isUpdateBatch; |
| | | |
| | | // æ¯å¦æ¯è¿æææ: 0å¦, 1:æ¯" |
| | | @ApiModelProperty("ç©æç±»å") |
| | | private Integer isExpire; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£éªæ ·å |
| | | * @TableName ins_sample |
| | | */ |
| | | @TableName(value ="ins_sample") |
| | | @Data |
| | | public class InsSample1 implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 1ï¼åæ ¼ 0ï¼ä¸åæ ¼ |
| | | */ |
| | | private Integer insResult; |
| | | |
| | | /** |
| | | * å¤é®ï¼ins_order表id |
| | | */ |
| | | private Integer insOrderId; |
| | | |
| | | /** |
| | | * é
奿 ·ååå· |
| | | */ |
| | | private String joinModel; |
| | | |
| | | /** |
| | | * é
奿 ·ååç§° |
| | | */ |
| | | private String joinName; |
| | | |
| | | /** |
| | | * é
奿 ·åæ°é |
| | | */ |
| | | private Integer joinNum; |
| | | |
| | | /** |
| | | * æ ·åç¼ç |
| | | */ |
| | | private String sampleCode; |
| | | |
| | | /** |
| | | * æ£éªå·¥å |
| | | */ |
| | | private String factory; |
| | | |
| | | /** |
| | | * å®éªå®¤åç§° |
| | | */ |
| | | private String laboratory; |
| | | |
| | | /** |
| | | * æ ·åç±»å |
| | | */ |
| | | private String sampleType; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | */ |
| | | private String sample; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String model; |
| | | |
| | | /** |
| | | * æ£éªç¶æ(0ï¼å¾
æ£éª1:æ£éªä¸ 2:å·²æ£éª3ï¼å¾
夿 ¸4ï¼å¤æ ¸æªéè¿5ï¼å¤æ ¸éè¿) |
| | | */ |
| | | private Integer insState; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | private Integer standardMethodListId; |
| | | |
| | | @ApiModelProperty("æ ·ååä½") |
| | | private String unit; |
| | | |
| | | private Integer cellId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | private Integer parentId; |
| | | |
| | | @ApiModelProperty("æ°é") |
| | | private Integer quantity; |
| | | |
| | | @ApiModelProperty("ç¹æ®æ åæ¹æ³") |
| | | private String specialStandardMethod; |
| | | |
| | | @TableField(select = false,exist = false) |
| | | private Integer num=1; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * å®éªå®¤ç®¡ç(Laboratory)表对象 |
| | | */ |
| | | @TableName(value = "laboratory") |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class Laboratory implements Serializable { |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å®éªå®¤åç§°") |
| | | private String laboratoryName; |
| | | |
| | | @ApiModelProperty(value = "åºæç¼ç ") |
| | | private String laboratoryNumber; |
| | | |
| | | @ApiModelProperty(value = "å®éªå®¤ä»£å·") |
| | | private String laboratoryCode; |
| | | |
| | | @ApiModelProperty(value = "è´è´£äººçµè¯") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "è´è´£äºº") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String head; |
| | | |
| | | @ApiModelProperty(value = "å°å") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 产å表 |
| | | * @TableName product |
| | | */ |
| | | @TableName(value ="product") |
| | | @Data |
| | | public class Product implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 产ååç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 产ååç§°EN |
| | | */ |
| | | private String nameEn; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å¤é®ï¼structure_test_object表id |
| | | */ |
| | | private Integer objectId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | @Data |
| | | @TableName("product_part") |
| | | public class ProductPart implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("产åid") |
| | | private Integer productId; |
| | | |
| | | @ApiModelProperty("é¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ApiModelProperty("é¢è²") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("è²æ ") |
| | | private String colorCode; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 产ååå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-19 |
| | | */ |
| | | @Data |
| | | @TableName("product_supplier_density") |
| | | public class ProductSupplierDensity implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("产åid") |
| | | private Integer productId; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("åå®¶åç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty("å¯åº¦å¼") |
| | | private String densityValue; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.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; |
| | | |
| | | /** |
| | | * æ åæ¹æ³ |
| | | * @TableName standard_method |
| | | */ |
| | | @TableName(value ="standard_method") |
| | | @Data |
| | | public class StandardMethod implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | private String field; |
| | | |
| | | @ApiModelProperty("æ£éªå¯¹è±¡") |
| | | private String structureTestObjectId; |
| | | |
| | | /** |
| | | * æ åç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "æ åç¼å·") |
| | | private String code; |
| | | |
| | | /** |
| | | * æ åæ¹æ³ |
| | | */ |
| | | @ApiModelProperty(value = "æ åæè¿°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æ åæè¿°EN") |
| | | private String nameEn; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "èµè´¨") |
| | | private String qualificationId; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦äº§åæ å") |
| | | private Integer isProduct; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å¯ç¨") |
| | | private Integer isUse; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @TableField(exist = false,select = false) |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | @TableField(exist = false,select = false) |
| | | private String updateUserName; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ åæ ä¸çæ åå表 |
| | | * @TableName standard_method_list |
| | | */ |
| | | @TableName(value ="standard_method_list") |
| | | @Data |
| | | public class StandardMethodList implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * æ åç¼å· |
| | | */ |
| | | @ApiModelProperty("æ åç¼å·") |
| | | private String code; |
| | | |
| | | /** |
| | | * æ ååç§° |
| | | */ |
| | | @ApiModelProperty("æ åç§°å·") |
| | | private String name; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("å·¥å") |
| | | private String factory; |
| | | |
| | | @ApiModelProperty("å®éªå®¤") |
| | | private String laboratory; |
| | | |
| | | @ApiModelProperty("æ ·ååç±»") |
| | | private String sampleType; |
| | | |
| | | @ApiModelProperty("æ ·å") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * æ åæ ä¸çæ£éªé¡¹ç® |
| | | * @TableName standard_product_list |
| | | */ |
| | | @TableName(value ="standard_product_list") |
| | | @Data |
| | | public class StandardProductList implements Serializable { |
| | | /** |
| | | * 主é®id |
| | | */ |
| | | @TableId(value = "id",type = IdType.ASSIGN_ID) |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ |
| | | */ |
| | | @ApiModelProperty("æ£éªé¡¹") |
| | | private String inspectionItem; |
| | | |
| | | @ApiModelProperty("æ£éªé¡¹EN") |
| | | private String inspectionItemEn; |
| | | |
| | | /** |
| | | * æ£éªé¡¹å°ç±» |
| | | */ |
| | | @ApiModelProperty("æ£éªé¡¹å°ç±»") |
| | | private String inspectionItemSubclass; |
| | | |
| | | @ApiModelProperty("æ£éªé¡¹å°ç±»EN") |
| | | private String inspectionItemSubclassEn; |
| | | |
| | | /** |
| | | * å®éªå®¤ |
| | | */ |
| | | @ApiModelProperty("å®éªå®¤") |
| | | private String laboratory; |
| | | |
| | | @ApiModelProperty("åå®éªå®¤") |
| | | private String sonLaboratory; |
| | | |
| | | /** |
| | | * 计éåä½ |
| | | */ |
| | | @ApiModelProperty("计éåä½") |
| | | private String unit; |
| | | |
| | | /** |
| | | * åä»·(å
) |
| | | */ |
| | | @ApiModelProperty("åä»·") |
| | | private String price; |
| | | |
| | | /** |
| | | * å·¥æ¶(H) |
| | | */ |
| | | @ApiModelProperty("å·¥æ¶") |
| | | private String manHour; |
| | | |
| | | /** |
| | | * å·¥æ¶åç» |
| | | */ |
| | | @ApiModelProperty("å·¥æ¶åç»") |
| | | private String manHourGroup; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç±»å |
| | | */ |
| | | @ApiModelProperty("æ£éªé¡¹ç±»å") |
| | | private String inspectionItemType; |
| | | |
| | | /** |
| | | * æ£éªå¼ç±»å |
| | | */ |
| | | @ApiModelProperty("æ£éªå¼ç±»å") |
| | | private String inspectionValueType; |
| | | |
| | | /** |
| | | * æ£éªæ¬¡æ° |
| | | */ |
| | | @ApiModelProperty("æ£éªæ¬¡æ°") |
| | | private Integer checkoutNumber; |
| | | |
| | | /** |
| | | * åºé´ |
| | | */ |
| | | @ApiModelProperty("åºé´") |
| | | private String section; |
| | | |
| | | /** |
| | | * åºé´ |
| | | */ |
| | | @ApiModelProperty("è¯æ°åºé´") |
| | | private String cores; |
| | | |
| | | /** |
| | | * æ¹æ³ |
| | | */ |
| | | @ApiModelProperty("æ¹æ³å表") |
| | | private String method; |
| | | |
| | | @ApiModelProperty("æ¹æ³") |
| | | private String methodS; |
| | | |
| | | /** |
| | | * é¢è®¡æ¶é´(天) |
| | | */ |
| | | @ApiModelProperty("é¢è®¡æ¶é´") |
| | | private Integer manDay; |
| | | |
| | | /** |
| | | * ç¹æ®æ è¯ |
| | | */ |
| | | @ApiModelProperty("ç¹æ®æ è¯") |
| | | private String bsm; |
| | | |
| | | /** |
| | | * è¦æ±å¼ |
| | | */ |
| | | @ApiModelProperty("è¦æ±å¼") |
| | | private String ask; |
| | | |
| | | @ApiModelProperty("è¦æ±æè¿°") |
| | | private String tell; |
| | | |
| | | /** |
| | | * å¤é®ï¼æ åæ¹æ³id |
| | | */ |
| | | @ApiModelProperty("æ åæ¹æ³id") |
| | | private Integer standardMethodListId; |
| | | |
| | | @ApiModelProperty("å·¥å") |
| | | private String factory; |
| | | |
| | | @ApiModelProperty("æ ·ååç±»") |
| | | private String sampleType; |
| | | |
| | | @ApiModelProperty("æ ·å") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private Integer templateId; |
| | | |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("1ï¼ææ 0ï¼æ æ") |
| | | private Integer state; |
| | | |
| | | private String dic; |
| | | |
| | | private String tree; |
| | | |
| | | private Integer structureItemParameterId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»") |
| | | private String inspectionItemClass; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»EN") |
| | | private String inspectionItemClassEn; |
| | | |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String radius; |
| | | |
| | | @ApiModelProperty(value = "æ¡ä»¶å表") |
| | | private String radiusList; |
| | | |
| | | @ApiModelProperty(value = "æ¶è´¹æ å(å
/次)") |
| | | private String rates; |
| | | |
| | | @ApiModelProperty(value = "ç´¢å¼é¡ºåº") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * å¯¼ä½æè´¨ |
| | | */ |
| | | @ApiModelProperty("å¯¼ä½æè´¨") |
| | | private String conductorMaterial; |
| | | |
| | | /** |
| | | * 导ä½ç±»å |
| | | */ |
| | | @ApiModelProperty("导ä½ç±»å") |
| | | private String conductorType; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-23 |
| | | */ |
| | | @TableName(value ="standard_product_list_supplier_ask") |
| | | @Data |
| | | public class StandardProductListSupplierAsk { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer supplierAskId; |
| | | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty("æ£éªé¡¹ç®id") |
| | | private Long productListId; |
| | | |
| | | @ApiModelProperty("åå®¶åç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty("è¦æ±å¼") |
| | | private String ask; |
| | | |
| | | @ApiModelProperty("è¦æ±æè¿°") |
| | | private String tell; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ 忍¡æ¿ |
| | | * @TableName standard_template |
| | | */ |
| | | @TableName(value ="standard_template") |
| | | @Data |
| | | public class StandardTemplate implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 模æ¿åç§° |
| | | */ |
| | | @ApiModelProperty("模æ¿åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 模æ¿ç»æ |
| | | */ |
| | | private String thing; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("åå»ºç¨æ·") |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty("æ´æ°ç¨æ·") |
| | | @TableField(exist = false) |
| | | private String updateUserName; |
| | | |
| | | /** |
| | | * 模æ¿ç¼å· |
| | | */ |
| | | @ApiModelProperty("模æ¿ç¼å·") |
| | | private String number; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * æ åæ |
| | | * @TableName standard_tree |
| | | */ |
| | | @TableName(value ="standard_tree") |
| | | @Data |
| | | public class StandardTree implements Serializable { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message="[]ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty("") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * å·¥å |
| | | */ |
| | | @Size(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | @ApiModelProperty("å·¥å") |
| | | @Length(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | private String factory; |
| | | /** |
| | | * å®éªå®¤ |
| | | */ |
| | | @Size(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | @ApiModelProperty("å®éªå®¤") |
| | | @Length(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | private String laboratory; |
| | | /** |
| | | * æ ·å大类 |
| | | */ |
| | | @Size(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | @ApiModelProperty("æ ·å大类") |
| | | @Length(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | private String sampleType; |
| | | /** |
| | | * æ ·å |
| | | */ |
| | | @Size(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | @ApiModelProperty("æ ·å") |
| | | @Length(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | private String sample; |
| | | /** |
| | | * åå· |
| | | */ |
| | | @Size(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | @ApiModelProperty("åå·") |
| | | @Length(max= 255,message="ç¼ç é¿åº¦ä¸è½è¶
è¿255") |
| | | private String model; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ååç§° |
| | | */ |
| | | @TableField(exist = false,select = false) |
| | | private String oldModel; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åæ°(StructureItemParameter)表对象 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 16:21:17 |
| | | */ |
| | | @TableName(value ="structure_item_parameter") |
| | | @Data |
| | | public class StructureItemParameter implements Serializable { |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹") |
| | | private String inspectionItem; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹EN") |
| | | private String inspectionItemEn; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå项") |
| | | private String inspectionItemSubclass; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå项EN") |
| | | private String inspectionItemSubclassEn; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¯¹è±¡") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty(value = "åä»·(å
)") |
| | | private String price; |
| | | |
| | | @ApiModelProperty(value = "åºæ") |
| | | private String laboratory; |
| | | |
| | | @ApiModelProperty(value = "è¯éªå®¤") |
| | | private String sonLaboratory; |
| | | |
| | | @ApiModelProperty(value = "è¦æ±æè¿°") |
| | | private String askTell; |
| | | |
| | | @ApiModelProperty(value = "è¦æ±å¼") |
| | | private String ask; |
| | | |
| | | @ApiModelProperty(value = "计éåä½") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³") |
| | | private String method; |
| | | |
| | | @ApiModelProperty(value = "å·¥æ¶(H)") |
| | | private Double manHour; |
| | | |
| | | @ApiModelProperty(value = "é¢è®¡æ¶é´(H)") |
| | | private Integer manDay; |
| | | |
| | | @ApiModelProperty(value = "å·¥æ¶åç»") |
| | | private String manHourGroup; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹ç±»å") |
| | | private String inspectionItemType; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¼ç±»å") |
| | | private String inspectionValueType; |
| | | |
| | | @ApiModelProperty(value = "æ£éªæ¬¡æ°") |
| | | private Integer checkoutNumber; |
| | | |
| | | @ApiModelProperty(value = "åºé´") |
| | | private String section; |
| | | |
| | | @ApiModelProperty(value = "ç¹æ®æ è¯") |
| | | private String bsm; |
| | | |
| | | @ApiModelProperty(value = "åå§è®°å½æ¨¡æ¿") |
| | | private Integer templateId; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå
¸ç±»å") |
| | | private String dic; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»") |
| | | private String inspectionItemClass; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹åç±»EN") |
| | | private String inspectionItemClassEn; |
| | | |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String radiusList; |
| | | |
| | | @ApiModelProperty(value = "æ¶è´¹æ å(å
/次)") |
| | | private String rates; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£æµå¯¹è±¡(StructureTestObject)表对象 |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 17:36:41 |
| | | */ |
| | | @TableName(value ="structure_test_object") |
| | | @Data |
| | | public class StructureTestObject implements Serializable { |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "åºæ") |
| | | private Integer laboratoryId; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¯¹è±¡") |
| | | private String specimenName; |
| | | |
| | | @ApiModelProperty(value = "æ£éªå¯¹è±¡EN") |
| | | private String specimenNameEn; |
| | | |
| | | @ApiModelProperty(value = "对象代å·") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "æåº") |
| | | private Integer sort; |
| | | |
| | | //"对象类å, 1:åææ, 2:æå, 3:è¾
æ" |
| | | @ApiModelProperty(value = "对象类å") |
| | | private String objectType; |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£éªå¯¹è±¡é¶ä»¶è¡¨(StructureTestObjectPart)$desc |
| | | * |
| | | * @author makejava |
| | | * @since 2024-08-07 10:10:30 |
| | | */ |
| | | @TableName(value ="structure_test_object_part") |
| | | @Data |
| | | public class StructureTestObjectPart implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("æ£éªå¯¹è±¡id") |
| | | private Integer testObjectId; |
| | | |
| | | @ApiModelProperty("é¶ä»¶å·") |
| | | private String partNo; |
| | | |
| | | @ApiModelProperty("é¢è²") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("è²æ ") |
| | | private String colorCode; |
| | | |
| | | @ApiModelProperty(value = "å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.PageTestObjectDto; |
| | | import com.ruoyi.basic.dto.TestItemDto; |
| | | |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åæ°(StructureItemParameter)表æå¡æ¥å£ |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 16:21:17 |
| | | */ |
| | | public interface CapacityScopeService extends IService<StructureItemParameter> { |
| | | |
| | | IPage<StructureItemParameter> selectItemParameterList(Page page, StructureItemParameter itemParameter); |
| | | |
| | | int addItemParameter(StructureItemParameter itemParameter); |
| | | |
| | | int delItemParameter(Integer id); |
| | | |
| | | int upItemParameter(StructureItemParameter itemParameter); |
| | | |
| | | IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto); |
| | | |
| | | int addTestObject(StructureTestObject testObject); |
| | | |
| | | int delTestObject(Integer id); |
| | | |
| | | int upTestObject(StructureTestObject testObject); |
| | | |
| | | List<StructureTestObject> selectTestObjectByName(); |
| | | |
| | | //设å¤éé¢éæ©æ£éªé¡¹ç®(æ å½¢ç»æ) |
| | | List<Map<String, Object>> getInsProduction(); |
| | | |
| | | List<TestItemDto> getItemTree(); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.Certification; |
| | | |
| | | public interface CertificationService extends IService<Certification> { |
| | | //æ¥è¯¢èµè´¨æç»å表 |
| | | IPage<Certification> getCertificationDetail(Page page, Certification certification); |
| | | |
| | | //æ·»å èµè´¨æç»å表 |
| | | int addCertificationDetail(Certification certification); |
| | | |
| | | //å é¤èµè´¨æç»å表 |
| | | int delCertificationDetail(String ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * å®éªå®¤ç®¡ç(Laboratory)表æå¡æ¥å£ |
| | | */ |
| | | public interface LaboratoryService extends IService<Laboratory> { |
| | | |
| | | IPage<Laboratory> selectItemParameter(Page page, Laboratory itemParameter); |
| | | |
| | | int addParameter(Laboratory itemParameter); |
| | | |
| | | int delParameter(Integer id); |
| | | |
| | | int upParameter(Laboratory itemParameter); |
| | | |
| | | List<Laboratory> obtainItemParameterList(); |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.ProductPart; |
| | | |
| | | public interface ProductPartService extends IService<ProductPart> { |
| | | |
| | | IPage<ProductPart> selectByProductId(IPage<ProductPart> page,ProductPart productPart); |
| | | |
| | | void addProductPart(ProductPart productPart); |
| | | |
| | | void updateProductPartById(ProductPart productPart); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dto.ProductDTO1; |
| | | import com.ruoyi.basic.excel.StructureTestObjectData; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author z1292 |
| | | * @description é对表ãproduct(产å表)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-04-26 01:11:02 |
| | | */ |
| | | public interface ProductService extends IService<Product> { |
| | | |
| | | IPage<Product> selectProductListByObjectId(Page page, ProductDTO1 productDto); |
| | | |
| | | int addProduct(Product product); |
| | | |
| | | int upProduct(Product product); |
| | | |
| | | int delProduct(Integer id); |
| | | |
| | | void importPartExcel(List<StructureTestObjectData> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.ProductSupplierDensity; |
| | | |
| | | /** |
| | | * 产ååå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-19 |
| | | */ |
| | | public interface ProductSupplierDensityService extends IService<ProductSupplierDensity> { |
| | | |
| | | IPage<ProductSupplierDensity> selectByProductId(Page page, ProductSupplierDensity supplierDensity); |
| | | |
| | | void addProductSupplierDensity(ProductSupplierDensity supplierDensity); |
| | | |
| | | void updateProductSupplierDensity(ProductSupplierDensity supplierDensity); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StandardMethodList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method_list(æ åæ ä¸çæ åå表)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-04 13:44:04 |
| | | */ |
| | | public interface StandardMethodListService extends IService<StandardMethodList> { |
| | | |
| | | int addStandardMethodList(Integer standardId, String tree); |
| | | |
| | | Map<String, List<?>> selectsStandardMethodByFLSSM(String tree); |
| | | |
| | | Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree); |
| | | |
| | | int delStandardMethodByFLSSM(Integer id); |
| | | |
| | | List<StandardMethodList> selectStandardMethodEnum(); |
| | | |
| | | Integer getStandardMethodId(String code); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.StandardMethod; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method(æ åæ¹æ³)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-03 19:21:41 |
| | | */ |
| | | public interface StandardMethodService extends IService<StandardMethod> { |
| | | |
| | | IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod); |
| | | |
| | | List<StandardMethod> selectStandardMethods(); |
| | | |
| | | int addStandardMethod(StandardMethod standardMethod); |
| | | |
| | | int delStandardMethod(Integer id); |
| | | |
| | | int upStandardMethod(StandardMethod standardMethod); |
| | | |
| | | void inputExcel(MultipartFile file) throws IOException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.CopyStandardProductListDto; |
| | | import com.ruoyi.basic.dto.InsSampleReceiveDto; |
| | | import com.ruoyi.basic.dto.ResetTreeDragDTO; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_product_list(æ åæ ä¸çæ£éªé¡¹ç®)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-05 10:33:29 |
| | | */ |
| | | public interface StandardProductListService extends IService<StandardProductList> { |
| | | |
| | | int upStandardProductList(StandardProductList list); |
| | | |
| | | int delStandardProduct(JSONArray list); |
| | | |
| | | List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample); |
| | | |
| | | Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page); |
| | | |
| | | IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items); |
| | | |
| | | Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item); |
| | | |
| | | boolean updateSection(StandardProductList list); |
| | | |
| | | /** |
| | | * æ ååºææ½ |
| | | * @param resetTreeDragDTO |
| | | */ |
| | | void resetTreeDrag(ResetTreeDragDTO resetTreeDragDTO); |
| | | |
| | | /** |
| | | * æ ååºææ½ |
| | | * @param standardProductLists |
| | | */ |
| | | void resetTreeDragBatch(List<StandardProductList> standardProductLists); |
| | | |
| | | /** |
| | | * æ£éªé¡¹è¦æ±å¼å¯¹æ¯ |
| | | * @param copyStandardProductListDto |
| | | * @return |
| | | */ |
| | | List<StandardProductList> copyStandardProductList(CopyStandardProductListDto copyStandardProductListDto); |
| | | |
| | | /** |
| | | * æ£éªé¡¹è¦æ±å¼å¯¹æ¯ä¸ä¸ª |
| | | * @param copyStandardProductListDto |
| | | * @return |
| | | */ |
| | | List<StandardProductList> copyStandardProductOne(CopyStandardProductListDto copyStandardProductListDto); |
| | | |
| | | /** |
| | | * æ£éªé¡¹å¤å¶æåº |
| | | * @param copyStandardProductListDto |
| | | * @return |
| | | */ |
| | | boolean copyStandardProductSort(CopyStandardProductListDto copyStandardProductListDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_product_list(æ åæ ä¸çæ£éªé¡¹ç®)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-05 10:33:29 |
| | | */ |
| | | public interface StandardProductListService2 extends IService<StandardProductList> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author makejava |
| | | * @since 2024-09-23 |
| | | */ |
| | | public interface StandardProductListSupplierAskService extends IService<StandardProductListSupplierAsk> { |
| | | |
| | | List<StandardProductListSupplierAsk> selectByProductId(StandardProductListSupplierAsk supplierAsk); |
| | | |
| | | Integer addProductSupplierAsk(StandardProductListSupplierAsk supplierAsk); |
| | | |
| | | Integer updateProductSupplierAsk(StandardProductListSupplierAsk supplierAsk); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.StandardTemplate; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-11 13:47:52 |
| | | */ |
| | | public interface StandardTemplateService extends IService<StandardTemplate> { |
| | | |
| | | IPage<StandardTemplate> selectStandardTemplatePageList(Page page, StandardTemplate standardTemplate); |
| | | |
| | | int addStandardTemplate(StandardTemplate standardTemplate); |
| | | |
| | | int upStandardTemplate(StandardTemplate standardTemplate); |
| | | |
| | | int delStandardTemplate(Integer id); |
| | | |
| | | List<StandardTemplate> getStandardTemplate(); |
| | | |
| | | String getStandTempThingById(Integer templateId); |
| | | |
| | | String getStandTempNameById(Integer templateId); |
| | | |
| | | StandardTemplate getStandTempIdByName(String name); |
| | | |
| | | int copyStandardTemplate(StandardTemplate newTemplate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.FactoryDto; |
| | | import com.ruoyi.basic.dto.SampleTypeDto; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_tree(æ åæ )ãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-01 15:06:44 |
| | | */ |
| | | public interface StandardTreeService extends IService<StandardTree> { |
| | | |
| | | List<FactoryDto> selectStandardTreeList(); |
| | | |
| | | |
| | | int addStandardTree(StandardTree standardTree); |
| | | |
| | | int delStandardTree(String tree); |
| | | |
| | | int addStandardProduct(String ids, String tree); |
| | | |
| | | List<SampleTypeDto> getStandardTree2(); |
| | | |
| | | int upStandardProducts(Map<String, Object> product); |
| | | |
| | | List<StandardTree> getStandTreeBySampleType(String laboratory, String sampleType); |
| | | |
| | | void inExcelOfTree(MultipartFile file); |
| | | |
| | | void resetTreeOfPrice(String tree, Integer standardId); |
| | | |
| | | void resetTreeOfHour(String tree, Integer standardId); |
| | | |
| | | void resetTreeOfAsk(String tree, Integer standardId); |
| | | |
| | | void importWorkstationExcel(MultipartFile file); |
| | | |
| | | /** |
| | | * æ åæ°æåº |
| | | * @param list |
| | | * @return |
| | | */ |
| | | boolean updateTreeSort(List<FactoryDto> list); |
| | | |
| | | int updateStandardTree(StandardTree standardTree); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | |
| | | public interface StructureItemParameterService extends IService<StructureItemParameter> { |
| | | void removeNoSample(String sample); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.StructureTestObjectPart; |
| | | |
| | | /** |
| | | * æ£éªå¯¹è±¡é¶ä»¶è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-08-07 |
| | | */ |
| | | public interface StructureTestObjectPartService extends IService<StructureTestObjectPart> { |
| | | |
| | | IPage<StructureTestObjectPart> selectByTestObjectId(Page page, StructureTestObjectPart structureTestObjectPart); |
| | | |
| | | void addTestObjectPart(StructureTestObjectPart structureTestObjectPart); |
| | | |
| | | void updateTestObjectPart(StructureTestObjectPart structureTestObjectPart); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | |
| | | /** |
| | | * æ£æµå¯¹è±¡(StructureTestObject)$desc |
| | | * |
| | | * @author makejava |
| | | * @since 2024-09-13 09:45:55 |
| | | */ |
| | | public interface StructureTestObjectService extends IService<StructureTestObject> { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | 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.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.dto.PageTestObjectDto; |
| | | import com.ruoyi.basic.dto.TestItemDto; |
| | | import com.ruoyi.basic.mapper.*; |
| | | import com.ruoyi.basic.pojo.*; |
| | | import com.ruoyi.basic.service.CapacityScopeService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åæ°(StructureItemParameter)表æå¡å®ç°ç±» |
| | | * |
| | | * @author makejava |
| | | * @since 2024-02-26 16:21:17 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class CapacityScopeServiceImpl extends ServiceImpl<StructureItemParameterMapper, StructureItemParameter> implements CapacityScopeService { |
| | | |
| | | private LaboratoryMapper laboratoryMapper; |
| | | |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | | private StructureTestObjectMapper structureTestObjectMapper; |
| | | |
| | | private ProductMapper productMapper; |
| | | |
| | | private StructureTestObjectPartMapper structureTestObjectPartMapper; |
| | | |
| | | private ProductPartMapper productPartMapper; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | private StandardTreeMapper standardTreeMapper; |
| | | |
| | | private StructureItemParameterService structureItemParameterService; |
| | | |
| | | @Override |
| | | public IPage<StructureItemParameter> selectItemParameterList(Page page, StructureItemParameter itemParameter) { |
| | | return structureItemParameterMapper.selectItemParameterList(page, QueryWrappers.queryWrappers(itemParameter)); |
| | | } |
| | | |
| | | @Override |
| | | public int addItemParameter(StructureItemParameter itemParameter) { |
| | | if (itemParameter.getBsm().equals("")||itemParameter.getBsm()==null){ |
| | | itemParameter.setBsm("0"); |
| | | } |
| | | int insert = structureItemParameterMapper.insert(itemParameter); |
| | | return insert; |
| | | } |
| | | |
| | | @Override |
| | | public int delItemParameter(Integer id) { |
| | | return structureItemParameterMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upItemParameter(StructureItemParameter itemParameter) { |
| | | return structureItemParameterMapper.updateById(itemParameter); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PageTestObjectDto> selectTestObjectList(Page page, PageTestObjectDto pageTestObjectDto) { |
| | | String partNo = pageTestObjectDto.getPartNo(); |
| | | pageTestObjectDto.setPartNo(null); |
| | | return structureTestObjectMapper.selectTestObjectList(page, QueryWrappers.queryWrappers(pageTestObjectDto),partNo); |
| | | } |
| | | |
| | | @Override |
| | | public int addTestObject(StructureTestObject testObject) { |
| | | Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery().eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName())); |
| | | if(count.compareTo(0L) > 0){ |
| | | throw new BaseException("æ£éªå¯¹è±¡ä¸è½éå¤"); |
| | | } |
| | | |
| | | return structureTestObjectMapper.insert(testObject); |
| | | } |
| | | |
| | | @Override |
| | | public int delTestObject(Integer id) { |
| | | // äº§åºæ£éªå¯¹è±¡äº§åç»´æ¤ |
| | | structureTestObjectPartMapper.delete(Wrappers.<StructureTestObjectPart>lambdaQuery() |
| | | .eq(StructureTestObjectPart::getTestObjectId, id)); |
| | | |
| | | // å é¤äº§åç»´æ¤çé¶ä»¶ç»å® |
| | | List<Product> products = productMapper.selectList(Wrappers.<Product>lambdaQuery() |
| | | .eq(Product::getObjectId, id)); |
| | | List<Integer> productIds = products.stream().map(Product::getId).collect(Collectors.toList()); |
| | | productPartMapper.delete(Wrappers.<ProductPart>lambdaQuery() |
| | | .in(ProductPart::getProductId, productIds)); |
| | | |
| | | // å é¤äº§åç»´æ¤ |
| | | productMapper.delete(Wrappers.<Product>lambdaQuery() |
| | | .in(Product::getId, productIds)); |
| | | |
| | | return structureTestObjectMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upTestObject(StructureTestObject testObject) { |
| | | // æ¥è¯¢æ§çæ£éªå¯¹è±¡ |
| | | StructureTestObject oldTestObject = structureTestObjectMapper.selectById(testObject.getId()); |
| | | |
| | | if (!oldTestObject.getSpecimenName().equals(testObject.getSpecimenName())) { |
| | | // æ¥è¯¢ææå¯¹è±¡ä¸æ ·çæ£éªé¡¹ç® |
| | | List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getSampleType, oldTestObject.getSpecimenName())); |
| | | if (CollectionUtils.isNotEmpty(standardProductLists)){ |
| | | for (StandardProductList standardProductList : standardProductLists) { |
| | | // ä¿®æ¹ææç对象åç§°åæ°åç»æ |
| | | standardProductList.setSampleType(testObject.getSpecimenName()); |
| | | // éè¦æªå第ä¸çº§, é¿å
ä¸å级åç§°ä¸æ ·ä¿®æ¹é误 |
| | | String[] trees = standardProductList.getTree().split(" - "); |
| | | trees[2] = testObject.getSpecimenName(); |
| | | List<String> list = CollUtil.newArrayList(trees); |
| | | String newName = CollUtil.join(list, " - "); |
| | | standardProductList.setTree(newName); |
| | | } |
| | | standardProductListService.updateBatchById(standardProductLists); |
| | | } |
| | | // ä¿®æ¹æ£éªé¡¹ç®åæ°çæ£éªå¯¹è±¡ |
| | | // æ¼æ¥ ["object", æ¥è¯¢æ£éªé¡¹ç®åæ°ä¿®æ¹ç»å®çæ£éªå¯¹è±¡ |
| | | String format = "[\"{}\","; |
| | | String sampleOld = StrUtil.format(format, oldTestObject.getSpecimenName()); |
| | | List<StructureItemParameter> itemParameterList = structureItemParameterService.list(Wrappers.<StructureItemParameter>lambdaQuery() |
| | | .like(StructureItemParameter::getSample, sampleOld)); |
| | | if (CollectionUtils.isNotEmpty(itemParameterList)) { |
| | | for (StructureItemParameter structureItemParameter : itemParameterList) { |
| | | // ä¿®æ¹ç»å®çæ ·ååç§° |
| | | String sampleNew = StrUtil.format(format, testObject.getSpecimenName()); |
| | | String sampleUp = structureItemParameter.getSample().replace(sampleOld, sampleNew); |
| | | structureItemParameter.setSample(sampleUp); |
| | | } |
| | | structureItemParameterService.updateBatchById(itemParameterList); |
| | | } |
| | | |
| | | // ä¿®æ¹æ çåå· |
| | | standardTreeMapper.update(null, Wrappers.<StandardTree>lambdaUpdate() |
| | | .eq(StandardTree::getSampleType, oldTestObject.getSpecimenName()) |
| | | .set(StandardTree::getSampleType, testObject.getSpecimenName())); |
| | | } |
| | | |
| | | Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery() |
| | | .eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName()) |
| | | .ne(StructureTestObject::getId, testObject.getId())); |
| | | if(count.compareTo(0L) > 0){ |
| | | throw new BaseException("æ£éªå¯¹è±¡ä¸è½éå¤"); |
| | | } |
| | | |
| | | return structureTestObjectMapper.updateById(testObject); |
| | | } |
| | | |
| | | @Override |
| | | public List<StructureTestObject> selectTestObjectByName() { |
| | | return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName,StructureTestObject::getId)); |
| | | } |
| | | |
| | | //设å¤éé¢éæ©æ£éªé¡¹ç®(æ å½¢ç»æ) |
| | | @Override |
| | | public List<Map<String, Object>> getInsProduction() { |
| | | return structureItemParameterMapper.getInsProduction(); |
| | | } |
| | | |
| | | @Override |
| | | public List<TestItemDto> getItemTree() { |
| | | return structureItemParameterMapper.getItemTree(); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | 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.basic.mapper.CertificationMapper; |
| | | import com.ruoyi.basic.pojo.Certification; |
| | | import com.ruoyi.basic.service.CertificationService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class CertificationServiceImpl extends ServiceImpl<CertificationMapper, Certification> implements CertificationService { |
| | | |
| | | |
| | | private CertificationMapper certificationMapper; |
| | | |
| | | |
| | | //æ¥è¯¢èµè´¨æç»å表 |
| | | @Override |
| | | public IPage<Certification> getCertificationDetail(Page page, Certification certification) { |
| | | return certificationMapper.getCertificationDetail(page, QueryWrappers.queryWrappers(certification)); |
| | | } |
| | | |
| | | //æ·»å èµè´¨æç»å表 |
| | | @Override |
| | | public int addCertificationDetail(Certification certification) { |
| | | return certificationMapper.insert(certification); |
| | | } |
| | | |
| | | //å é¤èµè´¨æç»å表 |
| | | @Override |
| | | public int delCertificationDetail(String ids) { |
| | | List<Integer> list = JSON.parseArray(ids,Integer.class); |
| | | return certificationMapper.deleteBatchIds(list); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | 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.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.LaboratoryMapper; |
| | | import com.ruoyi.basic.pojo.Laboratory; |
| | | import com.ruoyi.basic.service.LaboratoryService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å®éªå®¤ç®¡ç(Laboratory)表æå¡å®ç°ç±» |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LaboratoryServiceImpl extends ServiceImpl<LaboratoryMapper, Laboratory> implements LaboratoryService { |
| | | |
| | | |
| | | private LaboratoryMapper laboratoryMapper; |
| | | |
| | | @Override |
| | | public IPage<Laboratory> selectItemParameter(Page page, Laboratory itemParameter) { |
| | | return laboratoryMapper.selectItemParameter(page, QueryWrappers.queryWrappers(itemParameter)); |
| | | } |
| | | |
| | | @Override |
| | | public int addParameter(Laboratory itemParameter) { |
| | | return laboratoryMapper.insert(itemParameter); |
| | | } |
| | | |
| | | @Override |
| | | public int delParameter(Integer id) { |
| | | return laboratoryMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upParameter(Laboratory itemParameter) { |
| | | return laboratoryMapper.updateById(itemParameter); |
| | | } |
| | | |
| | | @Override |
| | | public List<Laboratory> obtainItemParameterList() { |
| | | return laboratoryMapper.selectList(Wrappers.<Laboratory>lambdaQuery().select(Laboratory::getLaboratoryName, Laboratory::getId)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | 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.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.ProductPartMapper; |
| | | import com.ruoyi.basic.mapper.StructureTestObjectPartMapper; |
| | | import com.ruoyi.basic.pojo.ProductPart; |
| | | import com.ruoyi.basic.pojo.StructureTestObjectPart; |
| | | import com.ruoyi.basic.service.ProductPartService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Transactional |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProductPartServiceImpl extends ServiceImpl<ProductPartMapper, ProductPart> implements ProductPartService { |
| | | |
| | | private ProductPartMapper productPartMapper; |
| | | private StructureTestObjectPartMapper structureTestObjectPartMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<ProductPart> selectByProductId(IPage<ProductPart> page,ProductPart productPart) { |
| | | return productPartMapper.selectListByProductId(page, QueryWrappers.queryWrappers(productPart),productPart.getProductId()); |
| | | } |
| | | |
| | | @Override |
| | | public void addProductPart(ProductPart productPart) { |
| | | if (productPart.getProductId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), null); |
| | | productPartMapper.insert(productPart); |
| | | } |
| | | |
| | | @Override |
| | | public void updateProductPartById(ProductPart productPart) { |
| | | this.isPartNoExist(productPart.getPartNo(), productPart.getProductId(), productPart.getId()); |
| | | if (productPart.getProductId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | productPartMapper.updateById(productPart); |
| | | } |
| | | |
| | | // 夿é¶ä»¶å·æ¯å¦åå¨ |
| | | public void isPartNoExist(String partNo,Integer productId, Integer id) { |
| | | // é¶ä»¶å·å¯ä¸ ä½ä¸å¿
å¡« |
| | | if (StringUtils.isNotBlank(partNo)) { |
| | | Long count = productPartMapper.selectCount(new LambdaQueryWrapper<ProductPart>() |
| | | // .eq(ProductPart::getProductId, productId) |
| | | .eq(ProductPart::getPartNo, partNo) |
| | | .ne(id != null, ProductPart::getId, id)); |
| | | Long selectCount = structureTestObjectPartMapper.selectCount(Wrappers.<StructureTestObjectPart>lambdaQuery() |
| | | .eq(StructureTestObjectPart::getPartNo, partNo)); |
| | | if (count > 0 || selectCount > 0) { |
| | | throw new BaseException("该é¶ä»¶å·å·²ç»å®è¿æ£éªå¯¹è±¡"); |
| | | } |
| | | } else { |
| | | throw new BaseException("请è¾å
¥é¶ä»¶å·"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | 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.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.dto.ProductDTO1; |
| | | import com.ruoyi.basic.excel.StructureTestObjectData; |
| | | import com.ruoyi.basic.mapper.ProductMapper; |
| | | import com.ruoyi.basic.mapper.ProductPartMapper; |
| | | import com.ruoyi.basic.mapper.StandardTreeMapper; |
| | | import com.ruoyi.basic.mapper.StructureTestObjectMapper; |
| | | import com.ruoyi.basic.pojo.*; |
| | | import com.ruoyi.basic.service.LaboratoryService; |
| | | import com.ruoyi.basic.service.ProductService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author z1292 |
| | | * @description é对表ãproduct(产å表)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-04-26 01:11:02 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> |
| | | implements ProductService{ |
| | | |
| | | private ProductMapper productMapper; |
| | | |
| | | private LaboratoryService laboratoryService; |
| | | |
| | | private StructureTestObjectMapper structureTestObjectMapper; |
| | | |
| | | private ProductPartMapper productPartMapper; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | private StandardTreeMapper standardTreeMapper; |
| | | |
| | | private StructureItemParameterService structureItemParameterService; |
| | | |
| | | @Override |
| | | public IPage<Product> selectProductListByObjectId(Page page, ProductDTO1 product) { |
| | | String partNo = product.getPartNo(); |
| | | product.setPartNo(null); |
| | | return productMapper.selectProductListByObjectId(page, QueryWrappers.queryWrappers(product), partNo); |
| | | } |
| | | |
| | | @Override |
| | | public int addProduct(Product product) { |
| | | |
| | | return productMapper.insert(product); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int upProduct(Product product) { |
| | | // æ¥è¯¢åæ¬çåç§° |
| | | Product oldProduct = productMapper.selectById(product.getId()); |
| | | |
| | | if (!oldProduct.getName().equals(product.getName())) { |
| | | // ä¿®æ¹åç§°å¹é
çæ åæ ä¸çæ£éªé¡¹ç® |
| | | // æ¥è¯¢ææå¯¹è±¡+åç§°çæ |
| | | StructureTestObject testObject = structureTestObjectMapper.selectById(oldProduct.getObjectId()); |
| | | |
| | | List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getSample, oldProduct.getName()) |
| | | .eq(StandardProductList::getSampleType, testObject.getSpecimenName())); |
| | | if (CollectionUtils.isNotEmpty(standardProductLists)) { |
| | | for (StandardProductList standardProductList : standardProductLists) { |
| | | // ä¿®æ¹æ ·ååç§° |
| | | standardProductList.setSample(product.getName()); |
| | | // ä¿®æ¹æ åç§° |
| | | // éè¦æªå第å级, é¿å
ä¸å级åç§°ä¸æ ·ä¿®æ¹é误 |
| | | String[] trees = standardProductList.getTree().split(" - "); |
| | | trees[3] = product.getName(); |
| | | List<String> list = CollUtil.newArrayList(trees); |
| | | String newName = CollUtil.join(list, " - "); |
| | | standardProductList.setTree(newName); |
| | | } |
| | | standardProductListService.updateBatchById(standardProductLists); |
| | | } |
| | | |
| | | // ä¿®æ¹æ£éªé¡¹ç®åæ°çæ£éªå¯¹è±¡ |
| | | // æ¼æ¥["object","product"]æ¥è¯¢æ£éªé¡¹ç®åæ°ä¿®æ¹ç»å®çæ£éªå¯¹è±¡ |
| | | String format = "[\"{}\",\"{}\"]"; |
| | | String sampleOld = StrUtil.format(format, testObject.getSpecimenName(), oldProduct.getName()); |
| | | List<StructureItemParameter> itemParameterList = structureItemParameterService.list(Wrappers.<StructureItemParameter>lambdaQuery() |
| | | .like(StructureItemParameter::getSample, sampleOld)); |
| | | if (CollectionUtils.isNotEmpty(itemParameterList)) { |
| | | for (StructureItemParameter structureItemParameter : itemParameterList) { |
| | | // ä¿®æ¹ç»å®çæ ·ååç§° |
| | | String sampleNew = StrUtil.format(format, testObject.getSpecimenName(), product.getName()); |
| | | String sampleUp = structureItemParameter.getSample().replace(sampleOld, sampleNew); |
| | | structureItemParameter.setSample(sampleUp); |
| | | } |
| | | structureItemParameterService.updateBatchById(itemParameterList); |
| | | } |
| | | |
| | | // ä¿®æ¹æ çåå· |
| | | standardTreeMapper.update(null, Wrappers.<StandardTree>lambdaUpdate() |
| | | .eq(StandardTree::getSampleType, testObject.getSpecimenName()) |
| | | .eq(StandardTree::getSample, oldProduct.getName()) |
| | | .set(StandardTree::getSample, product.getName())); |
| | | } |
| | | |
| | | return productMapper.updateById(product); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int delProduct(Integer id) { |
| | | // å é¤é¶ä»¶ç»å® |
| | | productPartMapper.delete(Wrappers.<ProductPart>lambdaQuery() |
| | | .eq(ProductPart::getProductId, id)); |
| | | |
| | | return productMapper.deleteById(id); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void importPartExcel(List<StructureTestObjectData> list) { |
| | | list.forEach(i -> { |
| | | // æ£éªå¯¹è±¡ |
| | | StructureTestObject structureTestObject1 = structureTestObjectMapper.selectOne(Wrappers.<StructureTestObject>lambdaQuery() |
| | | .eq(StructureTestObject::getSpecimenName, i.getSpecimenName()) |
| | | .eq(StructureTestObject::getSpecimenNameEn, i.getSpecimenNameEn())); |
| | | Laboratory laboratory = laboratoryService.getOne(Wrappers.<Laboratory>lambdaQuery() |
| | | .eq(Laboratory::getLaboratoryName, i.getLaboratory())); |
| | | if (ObjectUtils.isEmpty(laboratory)) { |
| | | throw new BaseException("æªæ¾å°è¯¥åºæï¼" + i.getLaboratory() + "ï¼è¯·æ£æ¥æ¯å¦åå¨è¯¥åºæï¼"); |
| | | } |
| | | // å¦æä¸ºç©ºè¿è¡æ°å¢ |
| | | if(ObjectUtils.isEmpty(structureTestObject1)) { |
| | | StructureTestObject structureTestObject = new StructureTestObject(); |
| | | structureTestObject.setLaboratoryId(laboratory.getId()); |
| | | structureTestObject.setSpecimenName(i.getSpecimenName()); |
| | | structureTestObject.setSpecimenNameEn(i.getSpecimenNameEn()); |
| | | structureTestObject.setCode(i.getCode()); |
| | | structureTestObjectMapper.insert(structureTestObject); |
| | | |
| | | // 产å |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery() |
| | | .eq(Product::getName, i.getName()) |
| | | .eq(Product::getNameEn, i.getNameEn())); |
| | | if (ObjectUtils.isEmpty(product)){ |
| | | Product product1 = new Product(); |
| | | product1.setName(i.getName()); |
| | | product1.setNameEn(i.getNameEn()); |
| | | product1.setObjectId(structureTestObject.getId()); |
| | | baseMapper.insert(product1); |
| | | } |
| | | } else { |
| | | structureTestObject1.setCode(i.getCode()); |
| | | structureTestObject1.setLaboratoryId(laboratory.getId()); |
| | | structureTestObjectMapper.updateById(structureTestObject1); |
| | | // 产å |
| | | Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery() |
| | | .eq(Product::getName, i.getName()) |
| | | .eq(Product::getNameEn, i.getNameEn())); |
| | | if (ObjectUtils.isEmpty(product)){ |
| | | Product product1 = new Product(); |
| | | product1.setName(i.getName()); |
| | | product1.setNameEn(i.getNameEn()); |
| | | product1.setObjectId(structureTestObject1.getId()); |
| | | baseMapper.insert(product1); |
| | | } else { |
| | | product.setName(i.getName()); |
| | | product.setNameEn(i.getNameEn()); |
| | | product.setObjectId(structureTestObject1.getId()); |
| | | baseMapper.updateById(product); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.ProductSupplierDensityMapper; |
| | | import com.ruoyi.basic.pojo.ProductSupplierDensity; |
| | | import com.ruoyi.basic.service.ProductSupplierDensityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 产ååå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-19 |
| | | */ |
| | | @Service |
| | | public class ProductSupplierDensityServiceImpl extends ServiceImpl<ProductSupplierDensityMapper, ProductSupplierDensity> implements ProductSupplierDensityService { |
| | | |
| | | @Override |
| | | public IPage<ProductSupplierDensity> selectByProductId(Page page, ProductSupplierDensity supplierDensity) { |
| | | if (supplierDensity.getProductId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | return baseMapper.selectListByProductId(page, QueryWrappers.queryWrappers(supplierDensity), supplierDensity.getProductId()); |
| | | } |
| | | |
| | | @Override |
| | | public void addProductSupplierDensity(ProductSupplierDensity supplierDensity) { |
| | | if (supplierDensity.getProductId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | // æ¥è¯¢æ¹åå®¶æ¯å¦ç»å®è¿ |
| | | // Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery() |
| | | // .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId()) |
| | | // .eq(ProductSupplierDensity::getModel, supplierDensity) |
| | | // .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName())); |
| | | // if (count > 0){ |
| | | // throw new BaseException("该产åå·²ç»å®è¿è¯¥åå®¶"); |
| | | // } |
| | | |
| | | baseMapper.insert(supplierDensity); |
| | | } |
| | | |
| | | @Override |
| | | public void updateProductSupplierDensity(ProductSupplierDensity supplierDensity) { |
| | | if (supplierDensity.getProductId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | // æ¥è¯¢æ¹åå®¶æ¯å¦ç»å®è¿ |
| | | // Long count = baseMapper.selectCount(Wrappers.<ProductSupplierDensity>lambdaQuery() |
| | | // .ne(ProductSupplierDensity::getId, supplierDensity.getId()) |
| | | // .eq(ProductSupplierDensity::getProductId, supplierDensity.getProductId()) |
| | | // .eq(ProductSupplierDensity::getModel, supplierDensity) |
| | | // .eq(ProductSupplierDensity::getSupplierName, supplierDensity.getSupplierName())); |
| | | // if (count > 0){ |
| | | // throw new BaseException("该产åå·²ç»å®è¿è¯¥åå®¶"); |
| | | // } |
| | | baseMapper.updateById(supplierDensity); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StandardMethodListMapper; |
| | | import com.ruoyi.basic.mapper.StandardProductListMapper; |
| | | import com.ruoyi.basic.pojo.StandardMethodList; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.service.StandardMethodListService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method_list(æ åæ ä¸çæ åå表)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-04 13:44:04 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardMethodListServiceImpl extends ServiceImpl<StandardMethodListMapper, StandardMethodList> |
| | | implements StandardMethodListService{ |
| | | |
| | | private StandardMethodListMapper standardMethodListMapper; |
| | | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | @Override |
| | | public int addStandardMethodList(Integer standardId, String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId); |
| | | StandardMethodList list = new StandardMethodList(); |
| | | list.setCode(map.get("code")); |
| | | list.setName(map.get("name")); |
| | | list.setRemark(map.get("remark")); |
| | | list.setFactory(trees[0]); |
| | | try { |
| | | list.setLaboratory(trees[1]); |
| | | }catch (Exception e){} |
| | | try { |
| | | list.setSampleType(trees[2]); |
| | | }catch (Exception e){} |
| | | try { |
| | | list.setSample(trees[3]); |
| | | }catch (Exception e){} |
| | | try { |
| | | list.setModel(trees[4]); |
| | | }catch (Exception e){} |
| | | standardMethodListMapper.insert(list); |
| | | List<StandardProductList> standardProductLists = standardMethodListMapper.selectParameterList(list.getCode()); |
| | | for (StandardProductList standardProductList : standardProductLists) { |
| | | standardProductList.setStandardMethodListId(list.getId()); |
| | | standardProductList.setFactory(trees[0]); |
| | | try { |
| | | standardProductList.setLaboratory(trees[1]); |
| | | }catch (Exception e){} |
| | | try { |
| | | standardProductList.setSampleType(trees[2]); |
| | | }catch (Exception e){} |
| | | try { |
| | | standardProductList.setSample(trees[3]); |
| | | }catch (Exception e){} |
| | | try { |
| | | standardProductList.setModel(trees[4]); |
| | | }catch (Exception e){} |
| | | standardProductListMapper.insert(standardProductList); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | Map<String, List<?>> map = new HashMap<>(); |
| | | String str = ""; |
| | | List<StandardMethodList> standardMethodLists = new ArrayList<>(); |
| | | switch (trees.length){ |
| | | case 5: |
| | | str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str)); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\"")); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); |
| | | break; |
| | | case 4: |
| | | str += "\"" + trees[2] + "\",\"" + trees[3] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str)); |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\"")); |
| | | break; |
| | | case 3: |
| | | str += "\"" + trees[2] + "\""; |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str)); |
| | | break; |
| | | default: |
| | | map.put("standardMethodList", null); |
| | | return map; |
| | | } |
| | | standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodListsByNull(str)); |
| | | map.put("standardMethodList", standardMethodLists); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM2(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | List<StandardMethodList> standardMethodLists = null; |
| | | switch (trees.length){ |
| | | case 5: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],trees[4]); |
| | | break; |
| | | case 4: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],trees[3],null); |
| | | break; |
| | | case 3: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],trees[2],null,null); |
| | | break; |
| | | case 2: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],trees[1],null,null,null); |
| | | break; |
| | | case 1: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists2(trees[0],null,null,null,null); |
| | | break; |
| | | } |
| | | Map<String, List<?>> map = new HashMap<>(); |
| | | map.put("standardMethodList", standardMethodLists); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardMethodByFLSSM(Integer id) { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id)); |
| | | return standardMethodListMapper.deleteById(id); |
| | | } |
| | | @Override |
| | | public List<StandardMethodList> selectStandardMethodEnum() { |
| | | return standardMethodListMapper.selectListEnum(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getStandardMethodId(String code) { |
| | | return baseMapper.getStandardMethodId(code); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | 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.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.StandardMethodMapper; |
| | | import com.ruoyi.basic.mapper.StandardProductListMapper; |
| | | import com.ruoyi.basic.mapper.StructureItemParameterMapper; |
| | | import com.ruoyi.basic.pojo.StandardMethod; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.basic.service.StandardMethodService; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_method(æ åæ¹æ³)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-03 19:21:41 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardMethodServiceImpl extends ServiceImpl<StandardMethodMapper, StandardMethod> |
| | | implements StandardMethodService { |
| | | |
| | | |
| | | private StandardMethodMapper standardMethodMapper; |
| | | |
| | | StandardProductListMapper standardProductListMapper; |
| | | StandardProductListService standardProductListService; |
| | | |
| | | StructureItemParameterMapper structureItemParameterMapper; |
| | | StructureItemParameterService structureItemParameterService; |
| | | |
| | | @Override |
| | | public IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod) { |
| | | return standardMethodMapper.selectStandardMethodList(page, QueryWrappers.queryWrappers(standardMethod)); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardMethod> selectStandardMethods() { |
| | | return standardMethodMapper.selectList(Wrappers.<StandardMethod>lambdaQuery().select(StandardMethod::getId, StandardMethod::getCode, StandardMethod::getName).ne(StandardMethod::getId, 0)); |
| | | } |
| | | |
| | | @Override |
| | | public int addStandardMethod(StandardMethod standardMethod) { |
| | | int insert = standardMethodMapper.insert(standardMethod); |
| | | return insert; |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardMethod(Integer id) { |
| | | int i = standardMethodMapper.deleteById(id); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int upStandardMethod(StandardMethod standardMethod) { |
| | | StandardMethod oldStandardMethod = standardMethodMapper.selectById(standardMethod.getId()); |
| | | if (!oldStandardMethod.getCode().equals(standardMethod.getCode())) { |
| | | CompletableFuture.supplyAsync(() -> replaceMethod(oldStandardMethod.getCode(), standardMethod.getCode())); |
| | | } |
| | | int i = standardMethodMapper.updateById(standardMethod); |
| | | return i; |
| | | } |
| | | |
| | | //ç¼è¾methodåå
¨é¨æ¿æ¢ |
| | | public String replaceMethod(String oldCode, String code) { |
| | | //æ¥è¯¢StandardProductList䏿æMethod妿å
å«ä¹åçåæ¿æ¢ |
| | | List<StandardProductList> standardProductLists = standardProductListMapper.selectList(null); |
| | | for (StandardProductList standardProductList : standardProductLists) { |
| | | if (standardProductList.getMethod().contains(oldCode)) { |
| | | String[] split = standardProductList.getMethod().split(","); |
| | | String a = null; |
| | | for (int i = 0; i < split.length; i++) { |
| | | String methodName = split[i].substring(1, split[i].length() - 1); |
| | | if (i == 0) { |
| | | methodName = split[i].substring(2, split[i].length() - 1); |
| | | } else if (i == split.length - 1) { |
| | | methodName = split[i].substring(1, split[i].length() - 2); |
| | | } |
| | | if (methodName.equals(oldCode)) { |
| | | methodName = code; |
| | | } |
| | | a += "\"" + methodName + "\","; |
| | | } |
| | | String method = "[\"" + a.substring(0, a.length() - 1) + "\"]"; |
| | | standardProductList.setMethod(method); |
| | | } |
| | | } |
| | | standardProductListService.updateBatchById(standardProductLists); |
| | | //æ¥è¯¢StructureItemParameter䏿æMethod妿å
å«ä¹åçåæ¿æ¢ |
| | | List<StructureItemParameter> structureItemParameters = structureItemParameterMapper.selectList(null); |
| | | for (StructureItemParameter structureItemParameter : structureItemParameters) { |
| | | if (structureItemParameter.getMethod().contains(oldCode)) { |
| | | String[] split = structureItemParameter.getMethod().split(","); |
| | | String a = null; |
| | | for (int i = 0; i < split.length; i++) { |
| | | String methodName = split[i].substring(1, split[i].length() - 1); |
| | | if (i == 0) { |
| | | methodName = split[i].substring(2, split[i].length() - 1); |
| | | } else if (i == split.length - 1) { |
| | | methodName = split[i].substring(1, split[i].length() - 2); |
| | | } |
| | | if (methodName.equals(oldCode)) { |
| | | methodName = code; |
| | | } |
| | | a += "\"" + methodName + "\","; |
| | | } |
| | | String method = "[\"" + a.substring(0, a.length() - 1) + "\"]"; |
| | | structureItemParameter.setMethod(method); |
| | | } |
| | | } |
| | | structureItemParameterService.updateBatchById(structureItemParameters); |
| | | return "æ¿æ¢å®æ¯!"; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void inputExcel(MultipartFile file) throws IOException { |
| | | // å卿£æµå¯¹è±¡List |
| | | List<Object> structureTestObjectIdList = new ArrayList<>(); |
| | | List<StandardMethod> result = new ArrayList<>(); |
| | | ExcelUtil.readBySax(file.getInputStream(), 0, (i, l, list) -> { |
| | | // å»é¤ç¬¬ä¸è¡è¡¨å¤´ |
| | | if (l == 0) { |
| | | return; |
| | | } |
| | | // åå¨å¯ä¸æ£æµå¯¹è±¡ |
| | | if (!structureTestObjectIdList.contains(list.get(2))) { |
| | | structureTestObjectIdList.add(list.get(2)); |
| | | } |
| | | StandardMethod standardMethod = formatData(list); |
| | | result.add(standardMethod); |
| | | }); |
| | | addStructureTest(structureTestObjectIdList, result); |
| | | } |
| | | |
| | | // æ ¼å¼åæ°æ® |
| | | public StandardMethod formatData(List<Object> list) { |
| | | StandardMethod standardMethod = new StandardMethod(); |
| | | standardMethod.setField(list.get(1).toString()); |
| | | // é æ ¼å¼ |
| | | List<List<Object>> structureTestObjectId = new ArrayList<>(); |
| | | if (ObjectUtils.isEmpty(list.get(3))) { |
| | | structureTestObjectId.add(Arrays.asList(list.get(2))); |
| | | } else { |
| | | structureTestObjectId.add(Arrays.asList(list.get(2), list.get(3))); |
| | | } |
| | | standardMethod.setStructureTestObjectId(JSONUtil.toJsonStr(structureTestObjectId)); |
| | | standardMethod.setCode(list.get(4).toString()); |
| | | standardMethod.setName(list.get(5).toString()); |
| | | standardMethod.setNameEn(list.get(6).toString()); |
| | | if (!Objects.equals(list.get(7), null)) { |
| | | standardMethod.setRemark(list.get(7).toString()); |
| | | } |
| | | standardMethod.setQualificationId(list.get(8).toString()); |
| | | if (ObjectUtils.isNotEmpty(list.get(9))) { |
| | | if (list.get(9).equals("æ¯")) { |
| | | standardMethod.setIsProduct(1); |
| | | } else if (list.get(9).equals("å¦")) { |
| | | standardMethod.setIsProduct(0); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(list.get(10))) { |
| | | if (list.get(10).equals("æ¯")) { |
| | | standardMethod.setIsUse(1); |
| | | } else if (list.get(9).equals("å¦")) { |
| | | standardMethod.setIsUse(0); |
| | | } |
| | | } |
| | | return standardMethod; |
| | | } |
| | | |
| | | // æ°å¢æ°æ® |
| | | public void addStructureTest(List<Object> structureTestObjectIdList, List<StandardMethod> standardMethodList) { |
| | | List<StandardMethod> updateList = new ArrayList<>(); |
| | | List<Integer> deleteListId = new ArrayList<>(); |
| | | List<StandardMethod> addList = new ArrayList<>(); |
| | | if (!structureTestObjectIdList.isEmpty()) { |
| | | // 循ç¯exceléé¢çåç» |
| | | structureTestObjectIdList.forEach(j -> { |
| | | // 以excelä¸çç»åæ¥è¯¢æ°æ®åºä¸çåç» |
| | | List<StandardMethod> standardMethods = baseMapper.selectList(Wrappers.<StandardMethod>lambdaQuery() |
| | | .like(StandardMethod::getStructureTestObjectId, "\"" + j + "\"")); |
| | | // å°ç»æå¾ªç¯å¹é
|
| | | for (int i = 0; i < standardMethods.size(); i++) { |
| | | boolean isExistence = false; |
| | | for (int i1 = 0; i1 < standardMethodList.size(); i1++) { |
| | | // æ´æ° |
| | | if (standardMethods.get(i).getStructureTestObjectId().equals(standardMethodList.get(i1).getStructureTestObjectId()) |
| | | && standardMethods.get(i).getCode().equals(standardMethodList.get(i1).getCode()) |
| | | && standardMethods.get(i).getField().equals(standardMethodList.get(i1).getField())) { |
| | | // ç»excelæ°æ®èµå¼idåæ´æ° |
| | | standardMethodList.get(i1).setId(standardMethods.get(i).getId()); |
| | | // æ´æ° |
| | | updateList.add(standardMethodList.get(i1)); |
| | | isExistence = true; |
| | | break; |
| | | } |
| | | } |
| | | // å é¤ |
| | | if (!isExistence) { |
| | | deleteListId.add(standardMethods.get(i).getId()); |
| | | } |
| | | } |
| | | for (int i = 0; i < standardMethodList.size(); i++) { |
| | | if (standardMethodList.get(i).getStructureTestObjectId().contains("\"" + j + "\"")) { |
| | | boolean isExistence = false; |
| | | for (int i1 = 0; i1 < standardMethods.size(); i1++) { |
| | | if (standardMethods.get(i1).getStructureTestObjectId().equals(standardMethodList.get(i).getStructureTestObjectId()) |
| | | && standardMethods.get(i1).getCode().equals(standardMethodList.get(i).getCode()) |
| | | && standardMethods.get(i1).getField().equals(standardMethodList.get(i).getField())) { |
| | | isExistence = true; |
| | | break; |
| | | } |
| | | } |
| | | // æ°å¢ |
| | | if (!isExistence) { |
| | | addList.add(standardMethodList.get(i)); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | if (!addList.isEmpty()) { |
| | | // æ°å¢ |
| | | baseMapper.insertBatchSomeColumn(addList); |
| | | } |
| | | |
| | | if (!deleteListId.isEmpty()) { |
| | | // å é¤ |
| | | baseMapper.deleteBatchIds(deleteListId); |
| | | } |
| | | |
| | | if (!updateList.isEmpty()) { |
| | | // æ´æ° |
| | | updateList.forEach(i -> { |
| | | baseMapper.updateById(i); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StandardProductListMapper; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.service.StandardProductListService2; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class StandardProductListService2Impl extends ServiceImpl<StandardProductListMapper, StandardProductList> |
| | | implements StandardProductListService2 { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.*; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.basic.dto.CopyStandardProductListDto; |
| | | import com.ruoyi.basic.dto.InsSampleReceiveDto; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ResetTreeDragDTO; |
| | | import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; |
| | | import com.ruoyi.basic.mapper.StandardProductListMapper; |
| | | import com.ruoyi.basic.mapper.StandardProductListSupplierAskMapper; |
| | | import com.ruoyi.basic.mapper.StandardTreeMapper; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StandardProductListService2; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_product_list(æ åæ ä¸çæ£éªé¡¹ç®)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-05 10:33:29 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardProductListServiceImpl extends ServiceImpl<StandardProductListMapper, StandardProductList> |
| | | implements StandardProductListService { |
| | | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | private StandardTreeMapper standardTreeMapper; |
| | | |
| | | private StandardProductListService2 standardProductListService2; |
| | | |
| | | private IfsInventoryQuantityMapper ifsInventoryQuantityMapper; |
| | | |
| | | private StandardProductListSupplierAskMapper standardProductListSupplierAskMapper; |
| | | |
| | | |
| | | @Override |
| | | public int upStandardProductList(StandardProductList list) { |
| | | return standardProductListMapper.updateById(list); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardProduct(JSONArray list) { |
| | | return standardProductListMapper.deleteBatchIds(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSampleReceiveDto insSample) { |
| | | // æ¯å¦æ²¡æäº§å |
| | | boolean isNoSample = false; |
| | | // String[] models = insSample.getModel().split("-(?=[^-]*$)");//æåæåä¸ä¸ªã-ã |
| | | String model = insSample.getModel(); |
| | | String modelNum = insSample.getModelNum(); |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, model, insSample.getIsCableTag()); |
| | | if (list.size() == 0) { |
| | | if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { |
| | | return null; |
| | | } |
| | | String[] split = insSample.getFactory().split(" - "); |
| | | split[3] = split[3].replace("- ", ""); |
| | | String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree, insSample.getIsCableTag()); |
| | | if (list.size() == 0) { |
| | | String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3]; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1, insSample.getIsCableTag()); |
| | | |
| | | // åªæå¯¹è±¡çä¸å± |
| | | if (list.size() == 0) { |
| | | String tree2 = split[0] + " - " + split[1] + " - " + split[2] + " - null - null"; |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree2, insSample.getIsCableTag()); |
| | | // æ ·åç´æ¥èµå¼æ ·ååç±» |
| | | list.forEach(standardProductList -> standardProductList.setSample(standardProductList.getSampleType())); |
| | | isNoSample = true; |
| | | } |
| | | } |
| | | } |
| | | String[] split1 = insSample.getFactory().split(" - "); |
| | | if (!isNoSample) { |
| | | //夿é¿åº¦ |
| | | if (split1.length > 4) { |
| | | if (ObjectUtils.isNotEmpty(split1[3])) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSample()) && Objects.equals(list1.getSample(), split1[3])).collect(Collectors.toList()); |
| | | } else if (split1[3].equals("")) { |
| | | list = list.stream().filter(list1 -> Objects.nonNull(list1.getSampleType()) && Objects.equals(list1.getSampleType(), split1[2])).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | } |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | | if (a.getSection() != null && !Objects.equals(a.getSection(), "")) { |
| | | List<String> sections = JSON.parseArray(a.getSection(), String.class);// åºé´ |
| | | List<String> cores = JSON.parseArray(a.getCores(), String.class); // è¯æ° |
| | | List<String> conductorMaterials = JSON.parseArray(a.getConductorMaterial(), String.class); // å¯¼ä½æè´¨ |
| | | List<String> conductorTypes = JSON.parseArray(a.getConductorType(), String.class); // 导ä½ç±»å |
| | | List<String> asks = JSON.parseArray(a.getAsk(), String.class); |
| | | List<String> tells = JSON.parseArray(a.getTell(), String.class); |
| | | boolean isIf; |
| | | for (int i = 0; i < sections.size(); i++) { |
| | | if (Objects.equals(a.getBsm(), "1")) { |
| | | return true; |
| | | } else { |
| | | if (sections.get(i).contains("&")) { |
| | | String[] split = sections.get(i).split("&"); |
| | | isIf = getIsIf(split[0], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample) |
| | | && getIsIf(split[1], modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample); |
| | | } else { |
| | | isIf = getIsIf(sections.get(i), modelNum, cores.get(i), conductorMaterials.get(i), conductorTypes.get(i), insSample); |
| | | } |
| | | if (isIf) { |
| | | a.setSection(sections.get(i)); |
| | | a.setAsk(asks.get(i)); |
| | | a.setTell(tells.get(i)); |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } catch (Exception ignored) { |
| | | return false; |
| | | } |
| | | return true; |
| | | }).peek(standardProductList -> { |
| | | // todo: 夿æ¯å¦æ¯åæä¸å, éè¦åæé¢è²ç»å®å°è¯æ ·é¢è²çè¦æ±å¼ä¸ |
| | | if (StringUtils.isNotBlank(insSample.getPartNo())) { |
| | | // 夿æ¯å¦æè¿ä¸ªåæ®µä¸æ¯ææ¬ç±»å |
| | | if (StringUtils.isNotBlank(standardProductList.getInspectionItem()) |
| | | && standardProductList.getInspectionItem().contains("è¯æ ·é¢è²")) { |
| | | Map<String, String> partColor = baseMapper.selectPartColor(insSample.getPartNo()); |
| | | if (CollectionUtils.isNotEmpty(partColor)) { |
| | | if (StringUtils.isNotBlank(partColor.get("color"))) { |
| | | // 夿æ£éªå¼æ¯å¦ä¸ºç©ºåä¸çäº - å / |
| | | if (StringUtils.isBlank(standardProductList.getAsk()) || partColor.get("color").contains("æ¬")) { // 没æaskç´æ¥å¤å¶ |
| | | // æ¥è¯¢å¯¹è±¡ç»å®è¡¨å产åç»å®è¡¨ |
| | | standardProductList.setAsk("=" + partColor.get("color") |
| | | + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")")); |
| | | standardProductList.setTell(partColor.get("color") |
| | | + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")")); |
| | | standardProductList.setInspectionValueType("2"); |
| | | } else { // æ¼æ¥å°è¦æ±æè¿°åé¢ |
| | | standardProductList.setTell(partColor.get("color") |
| | | + (StringUtils.isBlank(partColor.get("color_code")) ? "" : "(" + partColor.get("color_code") + ")") + "@" + standardProductList.getTell()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // æ¥è¯¢åå®¶æ¯å¦æç¹æ®è¦æ±å¼ |
| | | if (insSample.getIfsInventoryId() != null) { |
| | | // æ¥è¯¢åææåå®¶åç§° |
| | | String supplierName = ifsInventoryQuantityMapper.selectById(insSample.getIfsInventoryId()) |
| | | .getSupplierName(); |
| | | List<Long> collect = list.stream().map(StandardProductList::getId).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(collect)) { |
| | | List<StandardProductListSupplierAsk> supplierAsks = standardProductListSupplierAskMapper.selectList(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() |
| | | .in(StandardProductListSupplierAsk::getProductListId, collect) |
| | | .eq(StandardProductListSupplierAsk::getSupplierName, supplierName)); |
| | | |
| | | // å¤æææ²¡æç¹æ®å¼ç»å® |
| | | if (CollectionUtils.isNotEmpty(supplierAsks)) { |
| | | for (StandardProductList standardProductList : list) { |
| | | for (StandardProductListSupplierAsk supplierAsk : supplierAsks) { |
| | | if (standardProductList.getId().equals(supplierAsk.getProductListId())) { |
| | | // éæ°èµå¼è¦æ±å¼åè¦æ±æè¿° |
| | | standardProductList.setAsk(supplierAsk.getAsk()); |
| | | standardProductList.setTell(supplierAsk.getTell()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param str å¤å®å
¬å¼ |
| | | * @param model åå· |
| | | * @param standardCores è¯æ° |
| | | * @param conductorMaterial å¯¼ä½æè´¨ |
| | | * @param conductorType 导ä½ç±»å |
| | | * @param insSample |
| | | * @return |
| | | */ |
| | | private boolean getIsIf(String str, String model, String standardCores, String conductorMaterial, String conductorType,InsSampleReceiveDto insSample) { |
| | | Matcher matcher = Pattern.compile("\\d+(\\.\\d+)?").matcher(model); |
| | | String model2 = ""; |
| | | while (matcher.find()) { |
| | | model2 += matcher.group(); |
| | | break; |
| | | } |
| | | boolean flag = false; |
| | | if (str.contains("â¥") || str.contains(">=")) { |
| | | String param = str.replace("â¥", "").replace(">=", ""); |
| | | flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) > -1; |
| | | } else if (str.contains("â¤") || str.contains("<=")) { |
| | | String param = str.replace("â¤", "").replace("<=", ""); |
| | | flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) < 1; |
| | | } else if (str.contains(">") || str.contains("ï¼")) { |
| | | String param = str.replace(">", "").replace("ï¼", ""); |
| | | flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) > 0; |
| | | } else if (str.contains("<") || str.contains("ï¼")) { |
| | | String param = str.replace("<", "").replace("ï¼", ""); |
| | | flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) < 0; |
| | | } else if (str.contains("=")) { |
| | | String param = str.replace("=", ""); |
| | | flag = new BigDecimal(model2).compareTo(new BigDecimal(param)) == 0; |
| | | } |
| | | if (flag) { |
| | | boolean coresMatch = true; |
| | | boolean conductorMaterialMatch = true; |
| | | boolean conductorTypeMatch = true; |
| | | |
| | | // 夿æ¯å¦æçº¿è¯æ°é |
| | | if (StringUtils.isNotBlank(standardCores)) { |
| | | if (StringUtils.isBlank(insSample.getCores()) || !standardCores.equals(insSample.getCores())) { |
| | | coresMatch = false; |
| | | } |
| | | } |
| | | |
| | | // 夿æ¯å¦æå¯¼ä½æè´¨ |
| | | if (StringUtils.isNotBlank(conductorMaterial)) { |
| | | if (StringUtils.isBlank(insSample.getConductorMaterial()) || !conductorMaterial.equals(insSample.getConductorMaterial())) { |
| | | conductorMaterialMatch = false; |
| | | } |
| | | } |
| | | |
| | | // 夿æ¯å¦æå¯¼ä½ç±»å |
| | | if (StringUtils.isNotBlank(conductorType)) { |
| | | if (StringUtils.isBlank(insSample.getConductorType()) || !conductorType.equals(insSample.getConductorType())) { |
| | | conductorTypeMatch = false; |
| | | } |
| | | } |
| | | // æç»å¤æ |
| | | flag = coresMatch && conductorMaterialMatch && conductorTypeMatch; |
| | | } |
| | | |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page) { |
| | | String[] trees = tree.split(" - "); |
| | | try { |
| | | String tree1 = trees[2]; |
| | | } catch (Exception e) { |
| | | throw new BaseException("æä½å¤ªå¿«,ç³»ç»ä¼ åé误!!!!"); |
| | | } |
| | | boolean isDrag = false; |
| | | List<StandardProductList> list = new ArrayList<>(); |
| | | if (trees.length == 3) { |
| | | List<StandardTree> treeList = new ArrayList<>(); |
| | | StandardTree standardTree = new StandardTree(); |
| | | standardTree.setFactory(trees[0]); |
| | | standardTree.setLaboratory(trees[1]); |
| | | standardTree.setSampleType(trees[2]); |
| | | List<ProductDto> pList = standardTreeMapper.selectPList(trees[2]); |
| | | if (pList.size() == 0 || pList.get(0) == null) { |
| | | List<StandardTree> treeList1 = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2])); |
| | | if (treeList1.size() == 0) { |
| | | treeList.add(standardTree); |
| | | } else { |
| | | treeList.addAll(treeList1); |
| | | } |
| | | } else { |
| | | for (ProductDto p : pList) { |
| | | standardTree.setSample(p.getName()); |
| | | List<StandardTree> treeList1 = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, p.getName())); |
| | | if (treeList1.size() == 0) { |
| | | treeList.add(JSON.parseObject(JSON.toJSONString(standardTree), StandardTree.class)); |
| | | } else { |
| | | treeList.addAll(treeList1); |
| | | } |
| | | } |
| | | } |
| | | for (StandardTree standardTree2 : treeList) { |
| | | String tree2 = trees[0] + " - " + trees[1] + " - " + trees[2] + " - " + standardTree2.getSample() + " - " + standardTree2.getModel(); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1])); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + standardTree2.getSample() + "\"", standardTree2.getSample(), standardTree2.getModel(), tree2, trees[1])); |
| | | } |
| | | } else if (trees.length == 4) { |
| | | // å¤æç¬¬å屿¯å¦æåå· |
| | | Long count = standardProductListMapper.selectCount(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .isNull(StandardProductList::getModel) |
| | | .like(StandardProductList::getTree, tree)); |
| | | if (count == 0) { |
| | | isDrag = true; |
| | | } |
| | | |
| | | isDrag = true; |
| | | List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); |
| | | if (treeList.size() == 0) { |
| | | StandardTree standardTree = new StandardTree(); |
| | | standardTree.setFactory(trees[0]); |
| | | standardTree.setLaboratory(trees[1]); |
| | | standardTree.setSampleType(trees[2]); |
| | | standardTree.setSample(trees[3]); |
| | | treeList.add(standardTree); |
| | | } |
| | | for (StandardTree standardTree : treeList) { |
| | | String str = tree + " - " + standardTree.getModel(); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1])); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", standardTree.getSample(), standardTree.getModel(), str, trees[1])); |
| | | } |
| | | } else { |
| | | isDrag = true; |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1])); |
| | | list.addAll(standardTreeMapper.selectStandardProductListByTree2("\"" + trees[2] + "\",\"" + trees[3] + "\"", trees[3].equals("null") ? null : trees[3], trees[4], tree, trees[1])); |
| | | } |
| | | for (StandardProductList productList : list) { |
| | | productList.setId(IdWorker.getId()); |
| | | } |
| | | List<StandardProductList> standardProductLists; |
| | | |
| | | if (isDrag) { |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree) |
| | | .orderByAsc(StandardProductList::getSort)); |
| | | // 夿æ¯å¦ææ²¡æåºå·ç, 没æåºå·éç½® |
| | | boolean b = standardProductLists.stream().anyMatch(standardProductList -> standardProductList.getSort() == null); |
| | | } else { |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree)); |
| | | } |
| | | |
| | | for (StandardProductList sp : standardProductLists) { |
| | | for (StandardProductList pl : list) { |
| | | // 夿æ¡ä»¶æ¯å¦åªæä¸ä¸ª, æä¸ä¸ªçè¯é»è®¤ç¬¬ä¸ä¸ª |
| | | String radiusList = pl.getRadiusList(); |
| | | if (StringUtils.isNotBlank(radiusList) && !radiusList.equals("null") && !radiusList.equals("\"\"")) { |
| | | JSONArray jsonArray = JSON.parseArray(radiusList); |
| | | List<String> radius = jsonArray.toJavaList(String.class); |
| | | if (CollectionUtils.isNotEmpty(radius) && radius.size() == 1) { |
| | | pl.setRadius(radius.get(0)); |
| | | } |
| | | } |
| | | if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem()) |
| | | && Objects.equals((sp.getInspectionItemSubclass() == null) ? "" : sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass() == null ? "" : pl.getInspectionItemSubclass()) |
| | | // && Objects.equals(sp.getSample(), pl.getSample()) |
| | | && Objects.equals(sp.getModel(), pl.getModel()) |
| | | && sp.getTree().indexOf(pl.getSample() == null ? "null" : pl.getSample()) > -1 |
| | | && Objects.equals(sp.getStructureItemParameterId(), pl.getStructureItemParameterId())) { |
| | | pl.setId(sp.getId()); |
| | | // æ·»å æåºå段 |
| | | pl.setSort(sp.getSort()); |
| | | if (sp.getState() != null && !sp.getState().equals("")) { |
| | | pl.setState(sp.getState()); |
| | | } else { |
| | | pl.setState(id == 0 ? 1 : 0); |
| | | } |
| | | if (sp.getMethodS() != null && !sp.getMethodS().equals("")) { |
| | | pl.setMethod(sp.getMethodS()); |
| | | } |
| | | if (sp.getRadius() != null && !sp.getRadius().equals("")) { |
| | | pl.setRadius(sp.getRadius()); |
| | | } |
| | | if (sp.getRates() != null && !sp.getRates().equals("")) { |
| | | pl.setRates(sp.getRates()); |
| | | } |
| | | if (sp.getAsk() != null && !sp.getAsk().equals("")) { |
| | | pl.setAsk(sp.getAsk()); |
| | | } |
| | | if (sp.getTell() != null && !sp.getTell().equals("")) { |
| | | pl.setTell(sp.getTell()); |
| | | } |
| | | if (sp.getPrice() != null && !sp.getPrice().equals("")) { |
| | | pl.setPrice(sp.getPrice()); |
| | | } |
| | | if (sp.getManHour() != null && !sp.getManHour().equals("")) { |
| | | pl.setManHour(sp.getManHour()); |
| | | } |
| | | if (sp.getSection() != null && !sp.getSection().equals("")) { |
| | | pl.setSection(sp.getSection()); |
| | | } |
| | | if (sp.getCores() != null && !sp.getCores().equals("")) { |
| | | pl.setCores(sp.getCores()); |
| | | } |
| | | if (sp.getConductorMaterial() != null && !sp.getConductorMaterial().equals("")) { |
| | | pl.setConductorMaterial(sp.getConductorMaterial()); |
| | | } |
| | | if (sp.getConductorType() != null && !sp.getConductorType().equals("")) { |
| | | pl.setConductorType(sp.getConductorType()); |
| | | } |
| | | if (sp.getTemplateId() != null && !sp.getTemplateId().equals("")) { |
| | | pl.setTemplateId(sp.getTemplateId()); |
| | | } |
| | | //å ä¸ºè¿æä¸ªäº§åå«èå¼ çº¿å¤¹ æ¥ç»éå
· ,è¿ä¸¤ä¸ªé¡¹ç®çæ°æ®å®å
¨ä¸æ ·,ç¹æ®å¤ç |
| | | if (sp.getTree() != null && !sp.getTree().equals("") && !pl.getTree().equals("ä¸å¤©ç§ææ£æµä¸å¿ - çµå产åå®éªå®¤ - éå
· - èå¼ çº¿å¤¹ - null")) { |
| | | pl.setTree(sp.getTree()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (page == 1) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | // CompletableFuture.supplyAsync(() -> { |
| | | if (trees.length == 5) { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .eq(StandardProductList::getTree, tree)); |
| | | } else { |
| | | standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree)); |
| | | } |
| | | |
| | | boolean success = false; |
| | | int retryCount = 0; |
| | | while (!success && retryCount < 100) { |
| | | try { |
| | | standardProductListService2.saveBatch(list.stream().map(a -> { |
| | | a.setFactory(trees[0]); |
| | | a.setLaboratory(trees[1]); |
| | | a.setSampleType(trees[2]); |
| | | a.setCreateUser(userId); |
| | | a.setUpdateUser(userId); |
| | | a.setStandardMethodListId(id); |
| | | return a; |
| | | }).collect(Collectors.toList())); |
| | | ; |
| | | success = true; |
| | | } catch (Exception e) { |
| | | // å¤çéå¤ ID çè®°å½ï¼éæ°çæ ID å¹¶ç»§ç»å°è¯æå
¥ |
| | | for (StandardProductList productList : list) { |
| | | productList.setId(IdWorker.getId()); |
| | | } |
| | | } |
| | | } |
| | | if (!success) { |
| | | throw new RuntimeException("æå
¥å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Collections.sort(list, (o1, o2) -> { |
| | | String field1 = o1.getManHourGroup(); |
| | | String field2 = o2.getManHourGroup(); |
| | | |
| | | boolean isEmpty1 = field1 == null || field1.isEmpty(); |
| | | boolean isEmpty2 = field2 == null || field2.isEmpty(); |
| | | |
| | | if (isEmpty1 && isEmpty2) { |
| | | return 0; |
| | | } else if (isEmpty1) { |
| | | return 1; |
| | | } else if (isEmpty2) { |
| | | return -1; |
| | | } else { |
| | | int num1 = extractNumber(field1); |
| | | int num2 = extractNumber(field2); |
| | | return Integer.compare(num1, num2); |
| | | } |
| | | }); |
| | | // æç
§ç´¢å¼æåº |
| | | if (isDrag) { |
| | | list.sort((o1, o2) -> (o1.getSort() == null ? 0 : o1.getSort()) |
| | | - (o2.getSort() == null ? 0 : o2.getSort())); |
| | | } |
| | | try { |
| | | map.put("productList", list.subList((page - 1) * 300, page * 300)); |
| | | } catch (IndexOutOfBoundsException e) { |
| | | map.put("productList", list.subList((page - 1) * 300, list.size())); |
| | | } |
| | | map.put("total", list.size()); |
| | | return map; |
| | | } |
| | | |
| | | private int extractNumber(String s) { |
| | | // ä»åç¬¦ä¸²ä¸æåæ°åçé»è¾ï¼è¿éåè®¾åæ®µçæ ¼å¼æ¯ "text<number>" |
| | | String number = s; |
| | | if (!s.matches("\\d+")) { |
| | | number = s.replaceAll("\\D", ""); |
| | | } |
| | | return Integer.parseInt(number); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { |
| | | IPage<StandardProductList> iPage = new Page<>(); |
| | | iPage.setSize(100); |
| | | iPage.setCurrent(page); |
| | | return standardProductListMapper.standardProductListIPage(id, tree, iPage, laboratory, item, items); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item) { |
| | | HashMap<String, List<?>> map = new HashMap<>(); |
| | | map.put("item", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItem) |
| | | .groupBy(StandardProductList::getInspectionItem))); |
| | | if (ObjectUtils.isNotEmpty(item)) { |
| | | map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .eq(StandardProductList::getInspectionItem, item) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItemSubclass) |
| | | .groupBy(StandardProductList::getInspectionItemSubclass))); |
| | | } else { |
| | | map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItemSubclass) |
| | | .groupBy(StandardProductList::getInspectionItemSubclass))); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ ååºåºé´ |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateSection(StandardProductList list) { |
| | | standardProductListMapper.updateSection(list); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ååºææ½ |
| | | * @param resetTreeDragDTO |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void resetTreeDrag(ResetTreeDragDTO resetTreeDragDTO) { |
| | | Integer beginIndex = Integer.parseInt(resetTreeDragDTO.getBeginIndex()); |
| | | Integer endIndex = Integer.parseInt(resetTreeDragDTO.getEndIndex()); |
| | | Integer methodId = Integer.parseInt(resetTreeDragDTO.getMethodId()); |
| | | Long productionId = Long.parseLong(resetTreeDragDTO.getProductionId()); |
| | | // 夿æ¯ä»ä¸å¾ä¸ææ½è¿æ¯ä»ä¸å¾ä¸æ¾ææ½ |
| | | // ä»ä¸å¾ä¸ |
| | | if (beginIndex < endIndex) { |
| | | standardProductListMapper.updateSortUp(beginIndex, |
| | | endIndex, |
| | | methodId, |
| | | resetTreeDragDTO.getTree()); |
| | | |
| | | // ä»ä¸å¾ä¸ |
| | | } else if (beginIndex > endIndex){ |
| | | standardProductListMapper.updateSortDown(beginIndex, |
| | | endIndex, |
| | | methodId, |
| | | resetTreeDragDTO.getTree()); |
| | | } else { |
| | | return; |
| | | } |
| | | // ä¿®æ¹æ ååºé¡¹é¡ºåº |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getId, productionId) |
| | | .set(StandardProductList::getSort, endIndex)); |
| | | } |
| | | |
| | | @Override |
| | | public void resetTreeDragBatch(List<StandardProductList> standardProductLists) { |
| | | standardProductListService2.updateBatchById(standardProductLists); |
| | | } |
| | | |
| | | /** |
| | | * æ£éªé¡¹è¦æ±å¼å¯¹æ¯ |
| | | * @param copyDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<StandardProductList> copyStandardProductList(CopyStandardProductListDto copyDto) { |
| | | List<StandardProductList> productLists = new ArrayList<>(); |
| | | |
| | | // å¯¹æ¯æ£éªé¡¹ä¸æ ·çå¡«å
è¦æ±å¼è¦æ±æè¿° |
| | | for (StandardProductList oldProductList : copyDto.getOldStandardProductList()) { |
| | | String oldItemName = oldProductList.getInspectionItemClassEn() |
| | | + oldProductList.getInspectionItem() |
| | | + oldProductList.getInspectionItemSubclass(); |
| | | for (StandardProductList newProductList : copyDto.getNewStandardProductList()) { |
| | | String newItemName = newProductList.getInspectionItemClassEn() |
| | | + newProductList.getInspectionItem() |
| | | + newProductList.getInspectionItemSubclass(); |
| | | // 夿åç§°æ¯å¦ä¸æ · |
| | | if (oldItemName.equals(newItemName)) { |
| | | // åºé´ |
| | | oldProductList.setSection(newProductList.getSection()); |
| | | // è¯æ° |
| | | oldProductList.setCores(newProductList.getCores()); |
| | | // è¦æ±å¼ |
| | | oldProductList.setAsk(newProductList.getAsk()); |
| | | // è¦æ±æè¿° |
| | | oldProductList.setTell(newProductList.getTell()); |
| | | // åä»· |
| | | oldProductList.setPrice(newProductList.getPrice()); |
| | | // å·¥æ¶åç» |
| | | oldProductList.setManHour(newProductList.getManHour()); |
| | | // å¯¼ä½æè´¨ |
| | | oldProductList.setConductorMaterial(newProductList.getConductorMaterial()); |
| | | // 导ä½ç±»å |
| | | oldProductList.setConductorType(newProductList.getConductorType()); |
| | | productLists.add(oldProductList); |
| | | } |
| | | } |
| | | } |
| | | return productLists; |
| | | } |
| | | |
| | | /** |
| | | * æ£éªé¡¹å¤å¶å¯¹æ¯ä¸ä¸ª |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<StandardProductList> copyStandardProductOne(CopyStandardProductListDto dto) { |
| | | if (CollectionUtils.isEmpty(dto.getNewStandardProductList()) && dto.getNewStandardProductList().size() == 1 && |
| | | CollectionUtils.isEmpty(dto.getOldStandardProductList()) && dto.getOldStandardProductList().size() == 1) { |
| | | throw new BaseException("éè¦å¯¹æ¯çæ£éªé¡¹è¯·éæ©ä¸ä¸ª"); |
| | | } |
| | | StandardProductList newProductList = dto.getNewStandardProductList().get(0); |
| | | StandardProductList oldProductList = dto.getOldStandardProductList().get(0); |
| | | // åºé´ |
| | | oldProductList.setSection(newProductList.getSection()); |
| | | // è¯æ° |
| | | oldProductList.setCores(newProductList.getCores()); |
| | | // è¦æ±å¼ |
| | | oldProductList.setAsk(newProductList.getAsk()); |
| | | // è¦æ±æè¿° |
| | | oldProductList.setTell(newProductList.getTell()); |
| | | // åä»· |
| | | oldProductList.setPrice(newProductList.getPrice()); |
| | | // å·¥æ¶åç» |
| | | oldProductList.setManHour(newProductList.getManHour()); |
| | | // å¯¼ä½æè´¨ |
| | | oldProductList.setConductorMaterial(newProductList.getConductorMaterial()); |
| | | // 导ä½ç±»å |
| | | oldProductList.setConductorType(newProductList.getConductorType()); |
| | | List<StandardProductList> productLists = new ArrayList<>(); |
| | | productLists.add(oldProductList); |
| | | return productLists; |
| | | } |
| | | |
| | | /** |
| | | * æ£éªé¡¹å¤å¶æåº |
| | | * @param copyDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean copyStandardProductSort(CopyStandardProductListDto copyDto) { |
| | | List<StandardProductList> productLists = new ArrayList<>(); |
| | | |
| | | // å¯¹æ¯æ£éªé¡¹ä¸æ ·çå¡«å
è¦æ±å¼è¦æ±æè¿° |
| | | for (StandardProductList oldProductList : copyDto.getOldStandardProductList()) { |
| | | String oldItemName = oldProductList.getInspectionItemClassEn() |
| | | + oldProductList.getInspectionItem() |
| | | + oldProductList.getInspectionItemSubclass(); |
| | | for (StandardProductList newProductList : copyDto.getNewStandardProductList()) { |
| | | String newItemName = newProductList.getInspectionItemClassEn() |
| | | + newProductList.getInspectionItem() |
| | | + newProductList.getInspectionItemSubclass(); |
| | | // 夿åç§°æ¯å¦ä¸æ · |
| | | if (oldItemName.equals(newItemName)) { |
| | | StandardProductList standardProductList = new StandardProductList(); |
| | | standardProductList.setId(oldProductList.getId()); |
| | | // å¤å¶æåº |
| | | standardProductList.setSort(newProductList.getSort()); |
| | | productLists.add(standardProductList); |
| | | } |
| | | } |
| | | } |
| | | this.updateBatchById(productLists); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.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.basic.mapper.StandardProductListSupplierAskMapper; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | import com.ruoyi.basic.service.StandardProductListSupplierAskService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ£éªé¡¹ç®åå®¶å¯åº¦ç»å®è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-23 |
| | | */ |
| | | @Service |
| | | public class StandardProductListSupplierAskServiceImpl extends ServiceImpl<StandardProductListSupplierAskMapper, StandardProductListSupplierAsk> implements StandardProductListSupplierAskService { |
| | | |
| | | /** |
| | | * æ¥è¯¢åå®¶è¦æ±å¼ç»å® |
| | | * @param supplierAsk |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<StandardProductListSupplierAsk> selectByProductId(StandardProductListSupplierAsk supplierAsk) { |
| | | if (supplierAsk.getProductListId() == null) { |
| | | throw new BaseException("ç¼ºå°æ£éªé¡¹id"); |
| | | } |
| | | return baseMapper.selectList(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() |
| | | .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId())); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå®¶è¦æ±å¼ç»å® |
| | | * @param supplierAsk |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer addProductSupplierAsk(StandardProductListSupplierAsk supplierAsk) { |
| | | if (supplierAsk.getProductListId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | // æ¥è¯¢æ¹åå®¶æ¯å¦ç»å®è¿ |
| | | Long count = baseMapper.selectCount(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() |
| | | .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId()) |
| | | .eq(StandardProductListSupplierAsk::getSupplierName, supplierAsk.getSupplierName())); |
| | | if (count > 0){ |
| | | throw new BaseException("该产åå·²ç»å®è¿è¯¥åå®¶"); |
| | | } |
| | | baseMapper.insert(supplierAsk); |
| | | return supplierAsk.getSupplierAskId(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åå®¶è¦æ±å¼ç»å® |
| | | * @param supplierAsk |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer updateProductSupplierAsk(StandardProductListSupplierAsk supplierAsk) { |
| | | if (supplierAsk.getProductListId() == null) { |
| | | throw new BaseException("ç¼ºå°æ£éªé¡¹id"); |
| | | } |
| | | // æ¥è¯¢æ¹åå®¶æ¯å¦ç»å®è¿ |
| | | Long count = baseMapper.selectCount(Wrappers.<StandardProductListSupplierAsk>lambdaQuery() |
| | | .ne(StandardProductListSupplierAsk::getSupplierAskId, supplierAsk.getSupplierAskId()) |
| | | .eq(StandardProductListSupplierAsk::getProductListId, supplierAsk.getProductListId()) |
| | | .eq(StandardProductListSupplierAsk::getSupplierName, supplierAsk.getSupplierName())); |
| | | if (count > 0){ |
| | | throw new BaseException("该æ£éªé¡¹å·²ç»å®è¿è¯¥åå®¶"); |
| | | } |
| | | baseMapper.updateById(supplierAsk); |
| | | return supplierAsk.getSupplierAskId(); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | 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.numgen.NumberGenerator; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.StandardTemplateMapper; |
| | | import com.ruoyi.basic.pojo.StandardTemplate; |
| | | import com.ruoyi.basic.service.StandardTemplateService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_template(æ 忍¡æ¿)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-11 13:47:52 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardTemplateServiceImpl extends ServiceImpl<StandardTemplateMapper, StandardTemplate> |
| | | implements StandardTemplateService{ |
| | | |
| | | private StandardTemplateMapper standardTemplateMapper; |
| | | |
| | | |
| | | private final NumberGenerator<StandardTemplate> numberGenerator; |
| | | |
| | | @Override |
| | | public IPage<StandardTemplate> selectStandardTemplatePageList(Page page, StandardTemplate standardTemplate) { |
| | | return standardTemplateMapper.selectStandardTemplatePageList(page, QueryWrappers.queryWrappers(standardTemplate)); |
| | | } |
| | | |
| | | @Override |
| | | public int addStandardTemplate(StandardTemplate standardTemplate) { |
| | | if (StringUtils.isBlank(standardTemplate.getNumber())) { |
| | | String giveCode = numberGenerator.generateNumberWithPrefix(5, |
| | | "MB" + DateUtil.format(new Date(), "yyMM"), |
| | | StandardTemplate::getNumber); |
| | | standardTemplate.setNumber(giveCode); |
| | | } |
| | | return standardTemplateMapper.insert(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int upStandardTemplate(StandardTemplate standardTemplate) { |
| | | if(standardTemplate.getThing().equals("")){ |
| | | standardTemplate.setThing(null); |
| | | } |
| | | return standardTemplateMapper.updateById(standardTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardTemplate(Integer id) { |
| | | return standardTemplateMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardTemplate> getStandardTemplate() { |
| | | return standardTemplateMapper.selectList(Wrappers.<StandardTemplate>lambdaQuery().select(StandardTemplate::getId,StandardTemplate::getName)); |
| | | } |
| | | |
| | | @Override |
| | | public String getStandTempThingById(Integer templateId) { |
| | | StandardTemplate standardTemplate = standardTemplateMapper.selectOne(Wrappers.<StandardTemplate>lambdaQuery() |
| | | .eq(StandardTemplate::getId, templateId) |
| | | .select(StandardTemplate::getThing)); |
| | | if(standardTemplate==null){ |
| | | return null; |
| | | }else{ |
| | | return standardTemplate.getThing(); |
| | | } |
| | | // æ¥è¯¢å缩åçæ°æ® |
| | | // String thing = standardTemplateMapper.selectCompressThing(templateId); |
| | | // if (StringUtils.isNotBlank(thing)) { |
| | | // try { |
| | | // return DecompressMySQLData.decompress(java.util.Base64.getDecoder().decode(thing)); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } else { |
| | | // return null; |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | | public String getStandTempNameById(Integer templateId) { |
| | | StandardTemplate standardTemplate = standardTemplateMapper.selectOne(Wrappers.<StandardTemplate>lambdaQuery() |
| | | .eq(StandardTemplate::getId, templateId) |
| | | .select(StandardTemplate::getName)); |
| | | if(standardTemplate==null){ |
| | | return null; |
| | | }else{ |
| | | return standardTemplate.getName(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public StandardTemplate getStandTempIdByName(String name) { |
| | | return standardTemplateMapper.getStandTempIdByName(name); |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶åå§è®°å½æ¨¡æ¿ |
| | | * @param newTemplate |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int copyStandardTemplate(StandardTemplate newTemplate) { |
| | | // æ¥è¯¢æ§æ¨¡æ¿ |
| | | StandardTemplate standardTemplate = baseMapper.selectById(newTemplate.getId()); |
| | | newTemplate.setThing(standardTemplate.getThing()); |
| | | |
| | | if (StringUtils.isBlank(newTemplate.getNumber())) { |
| | | String giveCode = numberGenerator.generateNumberWithPrefix(5, |
| | | "MB" + DateUtil.format(new Date(), "yyMM"), |
| | | StandardTemplate::getNumber); |
| | | newTemplate.setNumber(giveCode); |
| | | } |
| | | newTemplate.setId(null); |
| | | |
| | | return standardTemplateMapper.insert(newTemplate); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | 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.basic.dto.FactoryDto; |
| | | import com.ruoyi.basic.dto.LaboratoryDto; |
| | | import com.ruoyi.basic.dto.SampleTypeDto; |
| | | import com.ruoyi.basic.mapper.StandardProductListMapper; |
| | | import com.ruoyi.basic.mapper.StandardTreeMapper; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StandardTemplate; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import com.ruoyi.basic.service.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãstandard_tree(æ åæ )ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-01 15:06:44 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StandardTreeServiceImpl extends ServiceImpl<StandardTreeMapper, StandardTree> |
| | | implements StandardTreeService { |
| | | |
| | | |
| | | private StandardTreeMapper standardTreeMapper; |
| | | |
| | | private StandardMethodListService standardMethodListService; |
| | | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | |
| | | private StructureTestObjectService structureTestObjectService; |
| | | |
| | | |
| | | @Override |
| | | public List<FactoryDto> selectStandardTreeList() { |
| | | List<FactoryDto> factoryDtos = standardTreeMapper.selectStandardTreeList(); |
| | | for (FactoryDto factoryDto : factoryDtos) { |
| | | for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { |
| | | laboratoryDto.getChildren().sort((o1, o2) -> (o1.getSort() == null ? 0 : o1.getSort()) |
| | | - (o2.getSort() == null ? 0 : o2.getSort())); |
| | | for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) { |
| | | // if (sampleTypeDto.getChildren().size() == 0) { |
| | | sampleTypeDto.getChildren().addAll(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue())); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | return factoryDtos; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardTree(StandardTree standardTree) { |
| | | LambdaQueryWrapper<StandardTree> wrapper = Wrappers.<StandardTree>lambdaQuery() |
| | | .eq(StandardTree::getFactory, standardTree.getFactory()) |
| | | .eq(StandardTree::getLaboratory, standardTree.getLaboratory()) |
| | | .eq(StandardTree::getSampleType, standardTree.getSampleType()) |
| | | .eq(StandardTree::getSample, standardTree.getSample()) |
| | | .eq(StandardTree::getModel, standardTree.getModel()); |
| | | if (StringUtils.isNotBlank(standardTree.getSample())) { |
| | | wrapper.eq(StandardTree::getSample, standardTree.getSample()); |
| | | } |
| | | |
| | | StandardTree tree = standardTreeMapper.selectOne(wrapper); |
| | | if (tree != null) { |
| | | throw new BaseException("该åå·å·²åå¨"); |
| | | } |
| | | return standardTreeMapper.insert(standardTree); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int delStandardTree(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | switch (trees.length) { |
| | | case 5: |
| | | if (trees[3].equals("null")) { |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).isNull(StandardTree::getSample).eq(StandardTree::getModel, trees[4])); |
| | | } else { |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]).eq(StandardTree::getModel, trees[4])); |
| | | } |
| | | break; |
| | | /*case 4: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3])); |
| | | break; |
| | | case 3: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2])); |
| | | break; |
| | | case 2: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1])); |
| | | break; |
| | | case 1: |
| | | standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0])); |
| | | break;*/ |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardProduct(String ids, String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | JSONArray jsonArray = JSON.parseArray(ids); |
| | | for (Object o : jsonArray) { |
| | | StandardProductList standardProductList = standardTreeMapper.selectStandardProductById(Integer.parseInt("" + o)); |
| | | standardProductList.setFactory(trees[0]); |
| | | try { |
| | | standardProductList.setLaboratory(trees[1]); |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setSampleType(trees[2]); |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setSample(trees[3]); |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setModel(trees[4]); |
| | | } catch (Exception e) { |
| | | } |
| | | standardProductListMapper.insert(standardProductList); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public List<SampleTypeDto> getStandardTree2() { |
| | | return standardTreeMapper.getStandardTree2(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int upStandardProducts(Map<String, Object> product) { |
| | | List<Integer> ids = JSON.parseArray(product.get("ids") + ""); |
| | | StandardProductList productList = JSON.parseObject(JSON.toJSONString(product.get("standardProductList")), StandardProductList.class); |
| | | if (productList.getMethodS() != null) { |
| | | standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids).like(StandardProductList::getMethod, productList.getMethodS())); |
| | | return 1; |
| | | } |
| | | if (productList.getRadiusList() != null) { |
| | | standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids).like(StandardProductList::getRadiusList, productList.getRadius())); |
| | | return 1; |
| | | } |
| | | standardProductListMapper.update(productList, Wrappers.<StandardProductList>lambdaUpdate().in(StandardProductList::getId, ids)); |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardTree> getStandTreeBySampleType(String laboratory, String sampleType) { |
| | | return standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery() |
| | | .eq(StandardTree::getLaboratory, laboratory) |
| | | .eq(StandardTree::getSampleType, sampleType) |
| | | .select(StandardTree::getModel, StandardTree::getSample)); |
| | | } |
| | | |
| | | /** |
| | | * æ²³å£æ£æµä¸å¿å¯¼å
¥ |
| | | * @param file |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void inExcelOfTree(MultipartFile file) { |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | List<StandardProductList> lists = new ArrayList<>(); |
| | | AtomicReference<String> laboratory = new AtomicReference<>(); |
| | | ExcelUtil.readBySax(inputStream, 0, (i, l, list) -> { |
| | | StandardProductList str = new StandardProductList(); |
| | | if (i == 0 && l == 1) { |
| | | laboratory.set(standardTreeMapper.getLaboratory(list.get(1) + "")); |
| | | if (laboratory.get() == null) { |
| | | throw new BaseException("æ£éªå¯¹è±¡ä¸åå¨ï¼" + list.get(1)); |
| | | } |
| | | } |
| | | if (i == 0 && l >= 1) { |
| | | Integer standardMethodId = standardMethodListService.getStandardMethodId(list.get(0) + ""); |
| | | if (standardMethodId == null) { |
| | | throw new BaseException("æ åç¼å·ä¸åå¨ï¼" + list.get(0)); |
| | | } |
| | | str.setStandardMethodListId(standardMethodId); |
| | | str.setSampleType(list.get(1) + ""); |
| | | if (list.get(2) != null) { |
| | | String sample = baseMapper.selSample(list.get(2) + ""); |
| | | if (sample == null) { |
| | | throw new BaseException("æ ·åä¸åå¨ï¼" + list.get(2)); |
| | | } |
| | | str.setSample(list.get(2) + ""); |
| | | } else { |
| | | str.setSample(null); |
| | | } |
| | | if (list.get(3) != null) { |
| | | str.setModel(list.get(3) + ""); |
| | | Long aLong = standardTreeMapper.selectCount(Wrappers.<StandardTree>lambdaQuery() |
| | | .eq(StandardTree::getModel, str.getModel()) |
| | | .eq(StandardTree::getSampleType, list.get(1) + "")); |
| | | if (aLong == 0) { |
| | | StandardTree standardTree = new StandardTree(); |
| | | standardTree.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); |
| | | standardTree.setLaboratory(laboratory.get()); |
| | | standardTree.setSampleType(str.getSampleType()); |
| | | standardTree.setSample(str.getSample()); |
| | | standardTree.setModel(str.getModel()); |
| | | standardTreeMapper.insert(standardTree); |
| | | } |
| | | } else { |
| | | str.setModel(null); |
| | | } |
| | | str.setInspectionItem(list.get(4) + ""); |
| | | if (list.get(6) == null) { |
| | | str.setInspectionItemSubclass(""); |
| | | } else { |
| | | str.setInspectionItemSubclass(list.get(6).toString()); |
| | | } |
| | | StandardProductList db_str; |
| | | try { |
| | | db_str = standardProductListMapper.getOne(str.getStandardMethodListId(), str.getInspectionItem(), str.getSample(), str.getInspectionItemSubclass(), str.getModel(), str.getInspectionItemClass()); |
| | | } catch (Exception e) { |
| | | throw new BaseException("é夿¥è¯¢ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(db_str)) { |
| | | str.setId(db_str.getId()); |
| | | str.setStructureItemParameterId(db_str.getStructureItemParameterId()); |
| | | } |
| | | if (list.get(8) != null) { |
| | | str.setMethodS(list.get(8) + ""); |
| | | } |
| | | |
| | | if (list.get(11) == null) { |
| | | str.setTell(null); |
| | | } else { |
| | | str.setTell(list.get(11).toString()); |
| | | } |
| | | |
| | | if (list.get(12) == null) { |
| | | str.setAsk(null); |
| | | } else { |
| | | str.setAsk(list.get(12).toString()); |
| | | } |
| | | |
| | | if (list.get(13) == null) { |
| | | str.setPrice(null); |
| | | } else { |
| | | str.setPrice((list.get(13).toString())); |
| | | } |
| | | |
| | | if (list.get(14) == null) { |
| | | str.setManHour(null); |
| | | } else { |
| | | str.setManHour(list.get(14).toString()); |
| | | } |
| | | |
| | | StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list.get(21))); |
| | | if (standTempIdByName != null) { |
| | | str.setTemplateId(standTempIdByName.getId()); |
| | | } else { |
| | | throw new BaseException("模æ¿ä¸åå¨ï¼" + list.get(21)); |
| | | } |
| | | str.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); |
| | | str.setLaboratory(laboratory.get()); |
| | | str.setState(1); |
| | | str.setTree(str.getFactory() + " - " + str.getLaboratory() + " - " + str.getSampleType() + " - " + str.getSample() + " - " + (str.getModel() == null ? "" : str.getModel())); |
| | | try { |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); |
| | | } catch (Exception e) { |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); |
| | | } |
| | | if (str.getStructureItemParameterId() == null) { |
| | | throw new BaseException("æ£éªé¡¹ç®ä¸åå¨ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); |
| | | } |
| | | lists.add(str); |
| | | } |
| | | }); |
| | | lists.forEach(a -> { |
| | | if (a.getId() != null) { |
| | | standardProductListMapper.updateById(a); |
| | | } else { |
| | | standardProductListMapper.insert(a); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void importWorkstationExcel(MultipartFile file) { |
| | | InputStream inputStream; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | List<StandardProductList> lists = new ArrayList<>(); |
| | | AtomicReference<String> laboratory = new AtomicReference<>(); |
| | | ExcelUtil.readBySax(inputStream, 0, (i, l, list) -> { |
| | | StandardProductList str = new StandardProductList(); |
| | | if (i == 0 && l == 1) { |
| | | laboratory.set(standardTreeMapper.getLaboratory(list.get(1) + "")); |
| | | if (laboratory.get() == null) { |
| | | throw new BaseException("æ£éªå¯¹è±¡ä¸åå¨ï¼" + list.get(1)); |
| | | } |
| | | } |
| | | if (i == 0 && l >= 1) { |
| | | Integer standardMethodId = standardMethodListService.getStandardMethodId(list.get(0) + ""); |
| | | if (standardMethodId == null) { |
| | | throw new BaseException("æ åç¼å·ä¸åå¨ï¼" + list.get(0)); |
| | | } |
| | | str.setStandardMethodListId(standardMethodId); |
| | | str.setSampleType(list.get(1) + ""); |
| | | if (list.get(2) != null) { |
| | | String sample = baseMapper.selSample(list.get(2) + ""); |
| | | if (sample == null) { |
| | | throw new BaseException("æ ·åä¸åå¨ï¼" + list.get(2)); |
| | | } |
| | | str.setSample(list.get(2) + ""); |
| | | } else { |
| | | str.setSample(null); |
| | | } |
| | | if (list.get(3) != null) { |
| | | str.setModel(list.get(3) + ""); |
| | | Long aLong = standardTreeMapper.selectCount(Wrappers.<StandardTree>lambdaQuery() |
| | | .eq(StandardTree::getModel, str.getModel()) |
| | | .eq(StandardTree::getSampleType, list.get(1) + "")); |
| | | if (aLong == 0) { |
| | | StandardTree standardTree = new StandardTree(); |
| | | standardTree.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); |
| | | standardTree.setLaboratory(laboratory.get()); |
| | | standardTree.setSampleType(str.getSampleType()); |
| | | standardTree.setSample(str.getSample()); |
| | | standardTree.setModel(str.getModel()); |
| | | standardTreeMapper.insert(standardTree); |
| | | } |
| | | } else { |
| | | str.setModel(null); |
| | | } |
| | | str.setInspectionItemClass(list.get(4).toString()); |
| | | str.setInspectionItemClassEn(list.get(5).toString()); |
| | | // å¼å§å 2 |
| | | str.setInspectionItem(list.get(6) + ""); |
| | | if (list.get(8) == null) { |
| | | str.setInspectionItemSubclass(""); |
| | | } else { |
| | | str.setInspectionItemSubclass(list.get(8).toString()); |
| | | } |
| | | StandardProductList db_str; |
| | | try { |
| | | db_str = standardProductListMapper.getOne(str.getStandardMethodListId(), str.getInspectionItem(), str.getSample(), str.getInspectionItemSubclass(), str.getModel(), str.getInspectionItemClass()); |
| | | } catch (Exception e) { |
| | | throw new BaseException("é夿¥è¯¢ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(db_str)) { |
| | | str.setId(db_str.getId()); |
| | | str.setStructureItemParameterId(db_str.getStructureItemParameterId()); |
| | | } |
| | | if (list.get(10) != null) { |
| | | str.setMethodS(list.get(10) + ""); |
| | | } |
| | | if (list.get(13) == null) { |
| | | str.setTell(null); |
| | | } else { |
| | | str.setTell(list.get(13).toString()); |
| | | } |
| | | |
| | | if (list.get(14) == null) { |
| | | str.setAsk(null); |
| | | } else { |
| | | str.setAsk(list.get(14).toString()); |
| | | } |
| | | |
| | | if (list.get(15) == null) { |
| | | str.setPrice(null); |
| | | } else { |
| | | str.setPrice((list.get(15).toString())); |
| | | } |
| | | |
| | | if (list.get(16) == null) { |
| | | str.setManHour(null); |
| | | } else { |
| | | str.setManHour(list.get(16).toString()); |
| | | } |
| | | |
| | | StandardTemplate standTempIdByName = standardTemplateService.getStandTempIdByName(String.valueOf(list.get(23))); |
| | | if (standTempIdByName != null) { |
| | | str.setTemplateId(standTempIdByName.getId()); |
| | | } else { |
| | | throw new BaseException("模æ¿ä¸åå¨ï¼" + list.get(23)); |
| | | } |
| | | str.setFactory("ä¸å¤©ç§ææ£æµä¸å¿"); |
| | | str.setLaboratory(laboratory.get()); |
| | | str.setState(1); |
| | | str.setTree(str.getFactory() + " - " + str.getLaboratory() + " - " + str.getSampleType() + " - " + str.getSample() + " - " + (str.getModel() == null ? "" : str.getModel())); |
| | | try { |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); |
| | | } catch (Exception e) { |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass(), str.getInspectionItemClass())); |
| | | } |
| | | if (str.getStructureItemParameterId() == null) { |
| | | throw new BaseException("æ£éªé¡¹ç®ä¸åå¨ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); |
| | | } |
| | | lists.add(str); |
| | | } |
| | | }); |
| | | lists.forEach(a -> { |
| | | if (a.getId() != null) { |
| | | standardProductListMapper.updateById(a); |
| | | } else { |
| | | standardProductListMapper.insert(a); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateTreeSort(List<FactoryDto> list) { |
| | | List<StructureTestObject> testObjects = new ArrayList<>(); |
| | | for (FactoryDto factoryDto : list) { |
| | | for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) { |
| | | List<SampleTypeDto> children = laboratoryDto.getChildren(); |
| | | int sort = 0; |
| | | // 循ç¯ç¬¬ä¸å± |
| | | for (SampleTypeDto child : children) { |
| | | StructureTestObject structureTestObject = new StructureTestObject(); |
| | | structureTestObject.setSort(sort); |
| | | structureTestObject.setId(child.getSampleTypeId()); |
| | | testObjects.add(structureTestObject); |
| | | sort++; |
| | | } |
| | | } |
| | | } |
| | | structureTestObjectService.updateBatchById(testObjects); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ åæ° |
| | | * @param standardTree |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int updateStandardTree(StandardTree standardTree) { |
| | | // ä¿®æ¹åç§°å¹é
çæ åæ ä¸çæ£éªé¡¹ç® |
| | | // æ¥è¯¢ææå¯¹è±¡+åç§°çæ |
| | | |
| | | List<StandardProductList> standardProductLists = standardProductListService.list(Wrappers.<StandardProductList>lambdaUpdate() |
| | | .eq(StandardProductList::getSample, standardTree.getSample()) |
| | | .eq(StandardProductList::getSampleType, standardTree.getSampleType()) |
| | | .eq(StandardProductList::getModel, standardTree.getOldModel())); |
| | | if (CollectionUtils.isNotEmpty(standardProductLists)) { |
| | | for (StandardProductList standardProductList : standardProductLists) { |
| | | // ä¿®æ¹æ ·ååç§° |
| | | standardProductList.setModel(standardTree.getModel()); |
| | | // ä¿®æ¹æ åç§° |
| | | // éè¦æªå第å级, é¿å
ä¸å级åç§°ä¸æ ·ä¿®æ¹é误 |
| | | String[] trees = standardProductList.getTree().split(" - "); |
| | | trees[4] = standardTree.getModel(); |
| | | List<String> list = CollUtil.newArrayList(trees); |
| | | String newName = CollUtil.join(list, " - "); |
| | | standardProductList.setTree(newName); |
| | | } |
| | | standardProductListService.updateBatchById(standardProductLists); |
| | | } |
| | | |
| | | // ä¿®æ¹æ åæ°æ£éªé¡¹ç® |
| | | LambdaUpdateWrapper<StandardTree> wrapper = Wrappers.<StandardTree>lambdaUpdate() |
| | | .eq(StandardTree::getFactory, standardTree.getFactory()) |
| | | .eq(StandardTree::getLaboratory, standardTree.getLaboratory()) |
| | | .eq(StandardTree::getSampleType, standardTree.getSampleType()) |
| | | .eq(StandardTree::getModel, standardTree.getOldModel()) |
| | | .set(StandardTree::getModel, standardTree.getModel()); |
| | | if (StringUtils.isNotBlank(standardTree.getSample())) { |
| | | wrapper.eq(StandardTree::getSample, standardTree.getSample()); |
| | | } |
| | | return standardTreeMapper.update(null, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void resetTreeOfPrice(String tree, Integer standardId) { |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId).set(StandardProductList::getPrice, null)); |
| | | } |
| | | |
| | | @Override |
| | | public void resetTreeOfHour(String tree, Integer standardId) { |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId).set(StandardProductList::getManHour, null)); |
| | | } |
| | | |
| | | @Override |
| | | public void resetTreeOfAsk(String tree, Integer standardId) { |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId) |
| | | .set(StandardProductList::getAsk, null) |
| | | .set(StandardProductList::getTell, null) |
| | | .set(StandardProductList::getSection, null) |
| | | .set(StandardProductList::getCores, null) |
| | | .set(StandardProductList::getConductorMaterial, null) |
| | | .set(StandardProductList::getConductorType, null) |
| | | .set(StandardProductList::getPrice, null) |
| | | .set(StandardProductList::getManHour, null)); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StructureItemParameterMapper; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.basic.service.StructureItemParameterService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StructureItemParameterServiceImpl extends ServiceImpl<StructureItemParameterMapper, StructureItemParameter> implements StructureItemParameterService { |
| | | |
| | | @Resource |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | | @Override |
| | | public void removeNoSample(String sample) { |
| | | structureItemParameterMapper.removeNoSample("\""+sample+"\""); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | 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.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.basic.mapper.ProductPartMapper; |
| | | import com.ruoyi.basic.mapper.StructureTestObjectPartMapper; |
| | | import com.ruoyi.basic.pojo.ProductPart; |
| | | import com.ruoyi.basic.pojo.StructureTestObjectPart; |
| | | import com.ruoyi.basic.service.StructureTestObjectPartService; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * æ£éªå¯¹è±¡é¶ä»¶è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-08-07 |
| | | */ |
| | | @Transactional |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class StructureTestObjectPartServiceImpl extends ServiceImpl<StructureTestObjectPartMapper, StructureTestObjectPart> implements StructureTestObjectPartService { |
| | | |
| | | private ProductPartMapper productPartMapper; |
| | | |
| | | @Override |
| | | public IPage<StructureTestObjectPart> selectByTestObjectId(Page page, StructureTestObjectPart structureTestObjectPart) { |
| | | return baseMapper.selectListByTestObjectId(page, QueryWrappers.queryWrappers(structureTestObjectPart),structureTestObjectPart.getTestObjectId()); |
| | | } |
| | | |
| | | @Override |
| | | public void addTestObjectPart(StructureTestObjectPart structureTestObjectPart) { |
| | | this.isPartNoExist(structureTestObjectPart.getPartNo(), null); |
| | | if (structureTestObjectPart.getTestObjectId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | baseMapper.insert(structureTestObjectPart); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTestObjectPart(StructureTestObjectPart structureTestObjectPart) { |
| | | this.isPartNoExist(structureTestObjectPart.getPartNo(), structureTestObjectPart.getId()); |
| | | if (structureTestObjectPart.getTestObjectId() == null) { |
| | | throw new BaseException("缺å°äº§å对象id"); |
| | | } |
| | | baseMapper.updateById(structureTestObjectPart); |
| | | } |
| | | |
| | | // 夿é¶ä»¶å·æ¯å¦åå¨ |
| | | public void isPartNoExist(String partNo, Integer id) { |
| | | // é¶ä»¶å·å¯ä¸ ä½ä¸å¿
å¡« |
| | | if (StringUtils.isNotBlank(partNo)) { |
| | | Long count = productPartMapper.selectCount(new LambdaQueryWrapper<ProductPart>() |
| | | .eq(ProductPart::getPartNo, partNo)); |
| | | Long selectCount = baseMapper.selectCount(Wrappers.<StructureTestObjectPart>lambdaQuery() |
| | | .eq(StructureTestObjectPart::getPartNo, partNo) |
| | | .ne(id != null, StructureTestObjectPart::getId, id)); |
| | | if (count > 0 || selectCount > 0) { |
| | | throw new BaseException("该é¶ä»¶å·å·²ç»å®è¿æ£éªå¯¹è±¡"); |
| | | } |
| | | } else { |
| | | throw new BaseException("请è¾å
¥é¶ä»¶å·"); |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StructureTestObjectMapper; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import com.ruoyi.basic.service.StructureTestObjectService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æ£æµå¯¹è±¡ |
| | | * |
| | | * @author zhuo |
| | | * @since 2024-09-13 |
| | | */ |
| | | @Service |
| | | public class StructureTestObjectServiceImpl extends ServiceImpl<StructureTestObjectMapper, StructureTestObject> implements StructureTestObjectService { |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.CertificationMapper"> |
| | | <select id="getCertificationDetail" resultType="com.ruoyi.basic.pojo.Certification"> |
| | | select b.* |
| | | from ( select a.`name`, a.`code`,a.organization,a.explanation,a.first_issuance_date,a.latest_issuance_date,c.expire_time FROM |
| | | (SELECT id,name,MIN(date_of_issuance) AS first_issuance_date, |
| | | MAX(date_of_issuance) AS latest_issuance_date, |
| | | c.`code`,c.organization,c.explanation |
| | | FROM |
| | | certification c |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | GROUP BY |
| | | name) a left join certification c on a.id=c.id |
| | | ) b |
| | | </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.basic.mapper.IfsInventoryQuantityMapper"> |
| | | |
| | | <select id="printLabel" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityDto"> |
| | | SELECT io.sample sample_name, |
| | | iiq.supplier_name, |
| | | io.part_detail part_desc, |
| | | io.send_time, |
| | | io.prepare_user, |
| | | io.entrust_code, |
| | | iiq.qty_arrived, |
| | | iiq.buy_unit_meas, |
| | | CASE |
| | | WHEN pp.color IS NOT NULL |
| | | THEN pp.color |
| | | ELSE sto.color |
| | | END color, |
| | | case |
| | | when iiq.state = 2 then '2' |
| | | when iiq.state = 1 then case |
| | | when ROUND((select count(*) |
| | | from ins_product ip |
| | | where state = 1 |
| | | and ins_result is not null |
| | | and ip.ins_sample_id in (select id |
| | | from ins_sample |
| | | where ins_sample.ins_order_id = io.id)) / |
| | | (select count(*) |
| | | from ins_product ip2 |
| | | where state = 1 |
| | | and ip2.ins_sample_id in |
| | | (select id from ins_sample where ins_sample.ins_order_id = io.id)) * |
| | | 100, 2) != 100 then '0' |
| | | else '1' end |
| | | end labelStatus, |
| | | JSON_OBJECT( |
| | | 'sample_ame', io.sample, |
| | | 'supplier_name', iiq.supplier_name, |
| | | 'part_desc', iiq.part_desc, |
| | | 'entrust_code', io.entrust_code |
| | | ) labelBarCode |
| | | FROM ifs_inventory_quantity iiq |
| | | LEFT JOIN ins_order io on io.id = (SELECT io2.id |
| | | FROM ins_order io2 |
| | | WHERE io2.ifs_inventory_id = iiq.id |
| | | and io2.state != -1 |
| | | order by io2.send_time desc |
| | | limit 1) COLLATE utf8mb4_general_ci |
| | | LEFT JOIN product_part pp ON pp.part_no = iiq.part_no COLLATE utf8mb4_general_ci |
| | | LEFT JOIN structure_test_object_part sto ON sto.part_no = iiq.part_no COLLATE utf8mb4_general_ci |
| | | WHERE iiq.id in |
| | | <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> |
| | | #{val} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectReportCountById" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from ifs_inventory_quantity iiq |
| | | left join ins_order io on io.ifs_inventory_id = iiq.id and io.state |
| | | left join ins_report ir on ir.ins_order_id = io.id |
| | | where iiq.id = #{ifsInventoryId} |
| | | and ir.id is not null |
| | | </select> |
| | | <select id="selectIsFirst" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from ifs_inventory_quantity iiq |
| | | LEFT JOIN ins_order io1 on io1.ifs_inventory_id = iiq.id |
| | | and io1.state != -1 |
| | | where io1.part_detail = #{partDetail} |
| | | and iiq.supplier_name = #{supplierName} |
| | | and iiq.receiver_date between #{startOfNextQuarter} and #{endOfQuarter} |
| | | </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.basic.mapper.LaboratoryMapper"> |
| | | |
| | | <select id="selectItemParameter" resultType="com.ruoyi.basic.pojo.Laboratory"> |
| | | select * from |
| | | ( |
| | | select l.id, |
| | | laboratory_name, |
| | | laboratory_number, |
| | | laboratory_code, |
| | | phone_number, |
| | | head, |
| | | l.address, |
| | | u1.name create_user_name, |
| | | l.create_time |
| | | from laboratory l |
| | | left join user u1 on l.create_user = u1.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="obtainItemParameterList" resultType="java.lang.Object"> |
| | | select * from |
| | | ( |
| | | select l.id, |
| | | laboratory_name, |
| | | laboratory_number, |
| | | phone_number, |
| | | head, |
| | | l.address, |
| | | u1.name create_user_name, |
| | | l.create_time |
| | | from laboratory l |
| | | left join user u1 on l.create_user = u1.id |
| | | ) a |
| | | </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.basic.mapper.ProductMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.Product"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="nameEn" column="name_en" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="objectId" column="object_id" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,name_en, |
| | | create_user,update_user,create_time, |
| | | update_time,object_id |
| | | </sql> |
| | | <select id="selectProductListByObjectId" resultType="com.ruoyi.basic.pojo.Product"> |
| | | select * from ( |
| | | select p.id, |
| | | p.name, |
| | | p.name_en, |
| | | p.create_user, |
| | | p.update_user, |
| | | p.create_time, |
| | | p.update_time, |
| | | p.object_id |
| | | from product p |
| | | WHERE 1=1 |
| | | <if test="partNo != null and partNo != ''"> |
| | | and p.id = (select pp.product_id |
| | | from product_part pp |
| | | where pp.part_no = #{partNo}) |
| | | </if>) a |
| | | <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.basic.mapper.ProductPartMapper"> |
| | | <select id="selectListByProductId" resultType="com.ruoyi.basic.pojo.ProductPart"> |
| | | SELECT * from product_part pp |
| | | where pp.product_id=#{productId} |
| | | </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.basic.mapper.ProductSupplierDensityMapper"> |
| | | <select id="selectListByProductId" resultType="com.ruoyi.basic.pojo.ProductSupplierDensity"> |
| | | SELECT * from product_supplier_density pp |
| | | where pp.product_id=#{productId} |
| | | </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.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.StandardMethodListMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="code" column="code" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectStandardMethodById" resultType="java.util.Map"> |
| | | select code, name, remark |
| | | from standard_method |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectUserById" resultType="java.lang.String"> |
| | | select name |
| | | from user |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectStandardMethodLists" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select id, code, name, remark |
| | | from standard_method |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | and structure_test_object_id LIKE CONCAT('%[', #{tree}, ']%') |
| | | </select> |
| | | <select id="selectParameterList" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select inspection_item, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | checkout_number, |
| | | section, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | template_id, |
| | | son_laboratory |
| | | from structure_item_parameter |
| | | where method = #{code} |
| | | </select> |
| | | <select id="selectStandardMethodLists2" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select sml.id, sml.code, sml.name,sml.remark, sml.create_time, u.name create_user_name |
| | | from standard_method_list sml |
| | | left join user u on u.id = sml.create_user |
| | | where factory = #{data1} |
| | | <if test="data2 != null"> |
| | | and laboratory = #{data2} |
| | | </if> |
| | | <if test="data3 != null"> |
| | | and sample_type = #{data3} |
| | | </if> |
| | | <if test="data4 != null"> |
| | | and sample = #{data4} |
| | | </if> |
| | | <if test="data5 != null"> |
| | | and model = #{data5} |
| | | </if> |
| | | </select> |
| | | <select id="selectStandardMethodLists3" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select id, code, name, remark |
| | | from standard_method |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | and structure_test_object_id LIKE CONCAT('%', #{tree}, '%') |
| | | </select> |
| | | <select id="selectListEnum" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select id,code,name from standard_method |
| | | where is_product = 1 |
| | | and is_use = 1 |
| | | </select> |
| | | <select id="selectStandardMethodListsByNull" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select id, code, name, remark |
| | | from standard_method |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | and ( |
| | | structure_test_object_id is null |
| | | OR structure_test_object_id = '' |
| | | OR structure_test_object_id = '[]' |
| | | ) |
| | | </select> |
| | | <select id="getStandardMethodId" resultType="java.lang.Integer"> |
| | | select id from standard_method where code = #{code} |
| | | </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.basic.mapper.StandardMethodMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardMethod"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="code" column="code" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectStandardMethodList" resultType="com.ruoyi.basic.pojo.StandardMethod"> |
| | | select * from ( |
| | | select sm.id, |
| | | sm.code, |
| | | sm.name, |
| | | sm.structure_test_object_id, |
| | | sto.specimen_name sample_type, |
| | | sm.remark, |
| | | u1.name create_user_name, |
| | | sm.create_time, |
| | | u2.name update_user_name, |
| | | sm.update_time, |
| | | sm.is_product, |
| | | sm.field, |
| | | sm.name_en, |
| | | sm.is_use, |
| | | sm.qualification_id |
| | | from standard_method sm |
| | | left join user u1 on sm.create_user = u1.id |
| | | left join user u2 on sm.update_user = u2.id |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | where sm.code != 'ææ¯è¦æ±' |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectStandMethodById" resultType="com.ruoyi.basic.pojo.StandardMethod"> |
| | | select sm.id, |
| | | sm.code, |
| | | sm.name, |
| | | sm.structure_test_object_id, |
| | | sto.specimen_name sample_type, |
| | | sm.remark, |
| | | u1.name create_user_name, |
| | | sm.create_time, |
| | | u2.name update_user_name, |
| | | sm.update_time, |
| | | sm.is_product, |
| | | sm.field, |
| | | sm.name_en, |
| | | sm.is_use, |
| | | sm.qualification_id |
| | | from standard_method sm |
| | | left join user u1 on sm.create_user = u1.id |
| | | left join user u2 on sm.update_user = u2.id |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | where sm.id = #{id} |
| | | </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.basic.mapper.StandardProductListMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardProductList"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="price" column="price" jdbcType="DECIMAL"/> |
| | | <result property="manHour" column="man_hour" jdbcType="INTEGER"/> |
| | | <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/> |
| | | <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/> |
| | | <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/> |
| | | <result property="section" column="section" jdbcType="VARCHAR"/> |
| | | <result property="method" column="method" jdbcType="VARCHAR"/> |
| | | <result property="manDay" column="man_day" jdbcType="INTEGER"/> |
| | | <result property="bsm" column="bsm" jdbcType="VARCHAR"/> |
| | | <result property="ask" column="ask" jdbcType="VARCHAR"/> |
| | | <result property="standardMethodListId" column="standard_method_list_id" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <update id="updateSection"> |
| | | UPDATE standard_product_list |
| | | SET price=#{productList.price}, |
| | | man_hour=#{productList.manHour}, |
| | | section=#{productList.section}, |
| | | cores=#{productList.cores}, |
| | | conductor_material=#{productList.conductorMaterial}, |
| | | conductor_type=#{productList.conductorType}, |
| | | ask=#{productList.ask}, |
| | | tell=#{productList.tell}, |
| | | update_user=#{productList.updateUser}, |
| | | update_time=#{productList.updateTime} |
| | | WHERE id = #{productList.id} |
| | | </update> |
| | | <update id="updateSortUp"> |
| | | update standard_product_list |
| | | set sort = sort - 1 |
| | | where tree = #{tree} |
| | | and standard_method_list_id = #{methodId} |
| | | and sort between #{beginIndex} + 1 and #{endIndex} |
| | | </update> |
| | | <update id="updateSortDown"> |
| | | update standard_product_list |
| | | set sort = sort + 1 |
| | | where tree = #{tree} |
| | | and standard_method_list_id = #{methodId} |
| | | and sort between #{endIndex} and #{beginIndex} - 1 |
| | | </update> |
| | | <select id="standardProductListIPage" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select spl.* from standard_product_list spl |
| | | left join product p on spl.sample = p.name |
| | | where standard_method_list_id = #{id} |
| | | and tree like concat('%',#{tree},'%') |
| | | <if test="laboratory != ''"> |
| | | and son_laboratory = #{laboratory} |
| | | </if> |
| | | <if test="insItem != ''"> |
| | | and inspection_item = #{insItem} |
| | | </if> |
| | | <if test="insItems != ''"> |
| | | and inspection_item_subclass = #{insItems} |
| | | </if> |
| | | order by p.id |
| | | group by spl.id |
| | | </select> |
| | | <select id="getOne" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and inspection_item = #{inspectionItem} |
| | | <if test="sample!=null"> |
| | | and sample = #{sample} |
| | | </if> |
| | | <if test="inspectionItemSubclass!=null"> |
| | | and inspection_item_subclass = #{inspectionItemSubclass} |
| | | </if> |
| | | <if test="inspectionItemSubclass == null"> |
| | | and (inspection_item_subclass is null or inspection_item_subclass = '') |
| | | </if> |
| | | <if test="model!=null"> |
| | | and model = #{model} |
| | | </if> |
| | | <if test="inspectionItemClass != null and inspectionItemClass != ''"> |
| | | and inspection_item_class = #{inspectionItemClass} |
| | | </if> |
| | | </select> |
| | | <select id="selectDetail" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and state =#{state} |
| | | and model=#{model} |
| | | <if test="isCableTag != null and isCableTag != ''"> |
| | | and (inspection_item_class like concat('%ç»æå°ºå¯¸%') or |
| | | inspection_item_class like concat('%çµç¼çµæ§è½%')or |
| | | inspection_item_class like concat('%ç»ç¼%')or |
| | | inspection_item_class like concat('%çµç¼çç§æ§è½%')) |
| | | </if> |
| | | order by sort asc, |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 妿以æ°åå¼å¤´ï¼åæç
§æ°åå¤§å°æåº |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- æå忝åé¢çæ°åé¨å |
| | | ,id asc |
| | | </select> |
| | | <select id="selectDetail2" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and state =#{state} |
| | | and tree =#{tree} |
| | | <if test="isCableTag != null and isCableTag != ''"> |
| | | and (inspection_item_class like concat('%ç»æå°ºå¯¸%') or |
| | | inspection_item_class like concat('%çµç¼çµæ§è½%')or |
| | | inspection_item_class like concat('%ç»ç¼%')or |
| | | inspection_item_class like concat('%çµç¼çç§æ§è½%')) |
| | | </if> |
| | | order by sort asc, |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 妿以æ°åå¼å¤´ï¼åæç
§æ°åå¤§å°æåº |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- æå忝åé¢çæ°åé¨å |
| | | ,id asc |
| | | </select> |
| | | <select id="selectPartColor" resultType="java.util.Map"> |
| | | select color, |
| | | color_code |
| | | from product_part |
| | | where part_no = #{partNo} |
| | | union all |
| | | select color, |
| | | color_code |
| | | from structure_test_object_part |
| | | where part_no = #{partNo} |
| | | </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.basic.mapper.StandardProductListSupplierAskMapper"> |
| | | |
| | | </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.basic.mapper.StandardTemplateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardTemplate"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="thing" column="thing" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectStandardTemplatePageList" resultType="com.ruoyi.basic.pojo.StandardTemplate"> |
| | | select * from ( |
| | | select st.id, st.name,st.number, st.remark, u2.name create_user_name, u3.name update_user_name, st.create_time, st.update_time |
| | | from standard_template st |
| | | left join user u2 on u2.id = st.create_user |
| | | left join user u3 on u3.id = st.update_user |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getStandTempIdByName" resultType="com.ruoyi.basic.pojo.StandardTemplate"> |
| | | select id from standard_template where name=#{name} |
| | | </select> |
| | | <!-- æ¥è¯¢å缩åçæ°æ® --> |
| | | <select id="selectCompressThing" resultType="java.lang.String"> |
| | | SELECT COMPRESS(thing) |
| | | from standard_template b |
| | | WHERE id = #{templateId} |
| | | </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.basic.mapper.StandardTreeMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.StandardTree"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="FactoryDto" type="com.ruoyi.basic.dto.FactoryDto"> |
| | | <result property="label" column="factory"/> |
| | | <result property="value" column="factory"/> |
| | | <collection property="children" resultMap="LaboratoryDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="LaboratoryDto" type="com.ruoyi.basic.dto.LaboratoryDto"> |
| | | <result property="label" column="laboratory"/> |
| | | <result property="value" column="laboratory"/> |
| | | <collection property="children" resultMap="SampleTypeDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="SampleTypeDto" type="com.ruoyi.basic.dto.SampleTypeDto"> |
| | | <result property="label" column="sample_type"/> |
| | | <result property="value" column="sample_type"/> |
| | | <result property="sampleTypeId" column="sample_type_id"/> |
| | | <result property="sort" column="sort"/> |
| | | <result property="partNo" column="part_no"/> |
| | | <result property="sampleTypeEn" column="sample_type_en"/> |
| | | <collection property="children" resultMap="SampleDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="SampleDto" type="com.ruoyi.basic.dto.SampleDto"> |
| | | <result property="label" column="sample"/> |
| | | <result property="value" column="sample"/> |
| | | <result property="partNo" column="sample_part_no"/> |
| | | <result property="sampleEn" column="sample_en"/> |
| | | <collection property="children" resultMap="ModelDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ModelDto" type="com.ruoyi.basic.dto.ModelDto"> |
| | | <result property="label" column="model"/> |
| | | <result property="value" column="model"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectStandardTree"> |
| | | sample sample2, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | method, |
| | | son_laboratory, |
| | | unit, |
| | | ask_tell tell, |
| | | ask, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | man_day, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | bsm, |
| | | template_id, |
| | | laboratory, |
| | | checkout_number, |
| | | section, |
| | | dic, |
| | | 0 state, |
| | | #{model} |
| | | model, |
| | | #{sample} |
| | | sample, |
| | | #{trees} |
| | | tree, |
| | | id |
| | | structure_item_parameter_id, |
| | | radius_list, |
| | | rates |
| | | </sql> |
| | | |
| | | <select id="selectStandardTreeList" resultMap="FactoryDto"> |
| | | select 'ä¸å¤©ç§ææ£æµä¸å¿' factory, |
| | | l.laboratory_name laboratory, |
| | | sto.specimen_name sample_type, |
| | | p.name sample, |
| | | st.model, |
| | | sto.code, |
| | | sto.id sample_type_id, |
| | | sto.sort, |
| | | sto.specimen_name_en sample_type_en, |
| | | p.name_en sample_en |
| | | from laboratory l |
| | | left join structure_test_object sto on sto.laboratory_id = l.id |
| | | left join product p on p.object_id = sto.id |
| | | left join standard_tree st on st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id |
| | | </select> |
| | | |
| | | <select id="selectStandardProductById" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select inspection_item, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | son_laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | checkout_number, |
| | | section, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | template_id |
| | | from structure_item_parameter |
| | | where id = #{id} |
| | | </select> |
| | | <select id="getStandardProductListBySample" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select inspection_item, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | son_laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | inspection_value_type, |
| | | checkout_number, |
| | | section, |
| | | method, |
| | | man_day, |
| | | sample, |
| | | bsm, |
| | | template_id, |
| | | dic, |
| | | ask, |
| | | ask_tell as tell |
| | | from structure_item_parameter sp |
| | | where sp.sample = #{sampleType} |
| | | or sp.sample = '' |
| | | or sp.sample = '[]' |
| | | </select> |
| | | <select id="getStandardMethodListBySample" resultType="com.ruoyi.basic.pojo.StandardMethodList"> |
| | | select sm.code,sm.name,sm.remark from standard_method sm |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | where is_use = 1 |
| | | and is_product = 1 |
| | | <if test="sampleType != null"> |
| | | and sto.specimen_name = #{sampleType} |
| | | </if> |
| | | </select> |
| | | <select id="selectStandardTreeList2" resultType="com.ruoyi.basic.pojo.StandardTree"> |
| | | select 'ä¸å¤©ç§ææ£æµä¸å¿' factory, |
| | | l.laboratory_name laboratory, |
| | | sto.specimen_name sample_type, |
| | | p.name sample |
| | | from laboratory l |
| | | left join structure_test_object sto on sto.laboratory_id = l.id |
| | | left join product p on p.object_id = sto.id |
| | | left join standard_tree st on st.laboratory = l.laboratory_name |
| | | and st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | where sto.specimen_name = #{sampleType} |
| | | group by sto.specimen_name |
| | | </select> |
| | | <select id="selectStandardProductListByTree" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select <include refid="selectStandardTree"/> |
| | | from structure_item_parameter |
| | | where ( |
| | | sample is NULL |
| | | OR sample = '' |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | ) |
| | | and (laboratory is null |
| | | or laboratory = '' |
| | | or laboratory = #{laboratory}) |
| | | order by inspection_item_class, inspection_item, id asc |
| | | </select> |
| | | |
| | | <select id="selectStandardProductListByTree2" resultType="com.ruoyi.basic.pojo.StandardProductList"> |
| | | select <include refid="selectStandardTree"/> |
| | | from structure_item_parameter |
| | | where sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | and (laboratory is null |
| | | or laboratory = '' |
| | | or laboratory = #{laboratory}) |
| | | order by inspection_item_class, inspection_item, id asc |
| | | </select> |
| | | |
| | | <select id="getStandardTree2" resultMap="SampleTypeDto"> |
| | | select sto.specimen_name sample_type, |
| | | p.name sample, |
| | | st.model |
| | | from structure_test_object sto |
| | | left join product p on p.object_id = sto.id |
| | | left join standard_tree st on st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | </select> |
| | | |
| | | <select id="getStandardTree3" resultType="com.ruoyi.basic.dto.SampleDto"> |
| | | select model label, |
| | | model value |
| | | from standard_tree |
| | | where sample_type = #{sampleType} |
| | | and sample is null |
| | | </select> |
| | | |
| | | <select id="getLaboratory" resultType="java.lang.String"> |
| | | select l.laboratory_name |
| | | from structure_test_object sto |
| | | left join laboratory l on sto.laboratory_id = l.id |
| | | where sto.specimen_name = #{str} |
| | | </select> |
| | | <select id="getStructureItemParameterId" resultType="java.lang.Integer"> |
| | | select id from structure_item_parameter |
| | | where sample like concat('%', #{sampleType}, '%') |
| | | and inspection_item = #{item} |
| | | <if test="itemChild != null and itemChild != ''"> |
| | | and inspection_item_subclass = #{itemChild} |
| | | </if> |
| | | <if test="inspectionItemClass != null and inspectionItemClass != ''"> |
| | | and inspection_item_class = #{inspectionItemClass} |
| | | </if> |
| | | <if test="itemChild == null or itemChild == ''"> |
| | | and (inspection_item_subclass is null or inspection_item_subclass = '') |
| | | </if> |
| | | </select> |
| | | <select id="selectPList" resultType="com.ruoyi.basic.dto.ProductDto"> |
| | | select p.name |
| | | from structure_test_object sto |
| | | left join product p on p.object_id = sto.id |
| | | where sto.specimen_name = #{name} |
| | | order by p.id |
| | | </select> |
| | | <select id="selSample" resultType="java.lang.String"> |
| | | select name |
| | | from product |
| | | where name = #{name} |
| | | </select> |
| | | <select id="selectStandardTreeListByPartNo" resultMap="FactoryDto"> |
| | | select 'ä¸å¤©ç§ææ£æµä¸å¿' factory, |
| | | l.laboratory_name laboratory, |
| | | sto.specimen_name sample_type, |
| | | p.name sample, |
| | | st.model, |
| | | CASE |
| | | WHEN p.id = (SELECT pp.product_id |
| | | FROM product_part pp |
| | | WHERE pp.part_no = #{partNo}) |
| | | THEN #{partNo} |
| | | ELSE NULL |
| | | END AS sample_part_no, |
| | | CASE |
| | | WHEN sto.id = (SELECT sto.test_object_id |
| | | FROM structure_test_object_part sto |
| | | WHERE sto.part_no = #{partNo}) |
| | | THEN #{partNo} |
| | | ELSE NULL |
| | | END AS part_no |
| | | from laboratory l |
| | | left join structure_test_object sto on sto.laboratory_id = l.id |
| | | left join product p on p.object_id = sto.id |
| | | left join standard_tree st on st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | where (p.id = (select pp.product_id |
| | | from product_part pp |
| | | where pp.part_no = #{partNo}) |
| | | or sto.id = (select sto.test_object_id |
| | | from structure_test_object_part sto |
| | | where sto.part_no = #{partNo})) |
| | | order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id |
| | | </select> |
| | | |
| | | <sql id="getIfsOrder"> |
| | | select * |
| | | from (SELECT ifs.*, |
| | | COALESCE(io1.create_user, io2.create_user) create_user, |
| | | COALESCE(io1.entrust_code, io2.entrust_code) entrust_code, |
| | | COALESCE(io1.send_time, io2.send_time) send_time, |
| | | io1.id enter_order_id, |
| | | ir1.id enter_report_id, |
| | | ir1.url enter_url, |
| | | ir1.url_s enter_url_s, |
| | | io2.id quarter_order_id, |
| | | ir2.id quarter_report_id, |
| | | ir2.url quarter_url, |
| | | ir2.url_s quarter_url_s, |
| | | group_concat(distinct isa.sample_code, ' ') sample_code, |
| | | group_concat(distinct isa.sample, ' ') sample_name, |
| | | group_concat(distinct isa.model, ' ') sample_model, |
| | | COALESCE(io1.state, io2.state) order_state, |
| | | COALESCE(isu.userName, COALESCE(u1.name, u2.name)) user_name, |
| | | group_concat(distinct iuh.unqualified_desc, ' ') unqualified_desc, |
| | | io1.is_exemption |
| | | FROM ifs_inventory_quantity ifs |
| | | LEFT JOIN ins_order io1 ON io1.ifs_inventory_id = ifs.id and io1.order_type = 'è¿åæ£éª' and io1.state != -1 |
| | | left join ins_report ir1 on io1.id = ir1.ins_order_id |
| | | left join user u1 on io1.create_user = u1.id |
| | | LEFT JOIN ins_order io2 ON io2.ifs_inventory_id = ifs.id and io2.order_type = 'Quarterly inspection' and io2.state != -1 |
| | | left join ins_report ir2 on io2.id = ir2.ins_order_id |
| | | left join user u2 on io2.create_user = u2.id |
| | | LEFT JOIN ins_sample isa ON COALESCE(io1.id, io2.id) = isa.ins_order_id |
| | | LEFT JOIN (SELECT ins_sample_id, GROUP_CONCAT(DISTINCT uu.name SEPARATOR ',') AS userName |
| | | FROM ins_sample_user u |
| | | LEFT JOIN user uu ON u.user_id = uu.id |
| | | WHERE u.state = 0 |
| | | GROUP BY ins_sample_id |
| | | ORDER BY ins_sample_id) isu ON isu.ins_sample_id = COALESCE(io1.id, io2.id) |
| | | left join ins_unqualified_handler iuh on iuh.inventory_quantity_id = ifs.id |
| | | group by ifs.id) a |
| | | </sql> |
| | | |
| | | <select id="getIfsByStateOne" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityDto"> |
| | | <include refid="getIfsOrder"/> |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectIfsPage" resultType="com.ruoyi.basic.pojo.IfsInventoryQuantity"> |
| | | SELECT * from ifs_inventory_quantity ifs |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="selectIfsInventoryQuantity" resultType="com.ruoyi.basic.dto.IfsInventoryQuantityCheckDto"> |
| | | SELECT * from ifs_inventory_quantity ifs |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getIfsByOver" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |
| | | select * from (<include refid="getIfsOrder"/> |
| | | <where> |
| | | <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> |
| | | send_time between #{beginDeclareDate} and #{endDeclareDate} |
| | | </if> |
| | | </where> |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getIfsByOverList" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |
| | | select * from (<include refid="getIfsOrder"/> |
| | | <where> |
| | | <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> |
| | | send_time between #{beginDeclareDate} and #{endDeclareDate} |
| | | </if> |
| | | </where> |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | </select> |
| | | <select id="getIfsByQuarter" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |
| | | select * from (<include refid="getIfsOrder"/> |
| | | <where> |
| | | and (quarter_order_id is not null) |
| | | <if test="beginDeclareDate != null and beginDeclareDate != '' and endDeclareDate != null and endDeclareDate != ''"> |
| | | and send_time between #{beginDeclareDate} and #{endDeclareDate} |
| | | </if> |
| | | </where> |
| | | ) a |
| | | <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.basic.mapper.StructureItemParameterMapper"> |
| | | <delete id="removeNoSample"> |
| | | delete |
| | | from structure_item_parameter |
| | | where sample like concat('%', #{sample}, '%') |
| | | </delete> |
| | | <select id="selectItemParameterList" resultType="com.ruoyi.basic.pojo.StructureItemParameter"> |
| | | select * from (select A.id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | laboratory, |
| | | unit, |
| | | price, |
| | | man_hour, |
| | | man_hour_group, |
| | | inspection_item_type, |
| | | checkout_number, |
| | | section, |
| | | A.create_user, |
| | | A.update_user, |
| | | A.create_time, |
| | | A.update_time, |
| | | method, |
| | | man_day, |
| | | bsm, |
| | | sample, |
| | | inspection_value_type, |
| | | dic, |
| | | template_id, |
| | | son_laboratory, |
| | | ask, |
| | | ask_tell, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | code, |
| | | radius_list, |
| | | rates |
| | | from (select *, |
| | | CASE |
| | | WHEN INSTR(sample, ',') > 0 THEN |
| | | SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1) |
| | | when sample = '[""]' then null |
| | | when sample = '[]' then null |
| | | ELSE |
| | | TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)) |
| | | END AS samples |
| | | from structure_item_parameter) A |
| | | left join structure_test_object sto on samples = specimen_name |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if>)B |
| | | order by CASE |
| | | WHEN code IS NULL THEN 1 |
| | | ELSE 0 |
| | | END, |
| | | CAST(code AS UNSIGNED), |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 妿以æ°åå¼å¤´ï¼åæç
§æ°åå¤§å°æåº |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- æå忝åé¢çæ°åé¨å |
| | | ,id asc |
| | | </select> |
| | | |
| | | <resultMap id="getInsProductions" type="map"> |
| | | <result property="name" column="sample"/> |
| | | <collection property="children" resultMap="itemClass" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="itemClass" type="map"> |
| | | <result property="name" column="item_class"/> |
| | | <collection property="children" resultMap="item" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="item" type="map"> |
| | | <result property="name" column="inspection_item"/> |
| | | <collection property="children" resultMap="itemSubClass" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="itemSubClass" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="subclass"/> |
| | | </resultMap> |
| | | <select id="getInsProduction" resultMap="getInsProductions"> |
| | | select distinct id, |
| | | CASE |
| | | WHEN INSTR(sample, ',') > 0 THEN |
| | | SUBSTRING_INDEX(SUBSTRING_INDEX(sample, '","', 1), '"', -1) |
| | | when sample = '[""]' then '*' |
| | | ELSE |
| | | TRIM(BOTH '["]' FROM SUBSTRING_INDEX(REPLACE(sample, '[["', ''), '"]]', 1)) |
| | | END |
| | | as sample, |
| | | inspection_item, |
| | | case |
| | | when inspection_item_subclass is null or inspection_item_subclass = '' then inspection_item |
| | | else inspection_item_subclass end as subclass, |
| | | case |
| | | when inspection_item_class is null or inspection_item_class = '' then inspection_item |
| | | else inspection_item_class end as item_class |
| | | from structure_item_parameter |
| | | </select> |
| | | <select id="getItemTree" resultMap="itemDto"> |
| | | select sto.id sId, sto.specimen_name sName, p.id pId, p.name pName |
| | | from structure_test_object sto |
| | | left join product p on p.object_id = sto.id |
| | | </select> |
| | | |
| | | <resultMap id="itemDto" type="com.ruoyi.basic.dto.TestItemDto"> |
| | | <result column="sId" property="id"/> |
| | | <result column="sName" property="name"/> |
| | | <collection property="children" resultMap="productDto"/> |
| | | </resultMap> |
| | | <resultMap id="productDto" type="com.ruoyi.basic.dto.ProductDto"> |
| | | <result column="pId" property="id"/> |
| | | <result column="pName" property="name"/> |
| | | </resultMap> |
| | | </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.basic.mapper.StructureTestObjectMapper"> |
| | | |
| | | <select id="selectTestObjectList" resultType="com.ruoyi.basic.dto.PageTestObjectDto"> |
| | | select * from ( |
| | | select sto.id, |
| | | sto.specimen_name, |
| | | u1.name create_user_name, |
| | | sto.create_time, |
| | | u2.name update_user_name, |
| | | sto.update_time, |
| | | sto.code, |
| | | sto.laboratory_id, |
| | | GROUP_CONCAT(p.name) product, |
| | | sto.specimen_name_en, |
| | | sto.object_type |
| | | from structure_test_object sto |
| | | left join user u1 on sto.create_user = u1.id |
| | | left join user u2 on sto.update_user = u2.id |
| | | left join product p on p.object_id = sto.id |
| | | left join product_part pp on pp.product_id = p.id |
| | | left join structure_test_object_part stop ON stop.test_object_id = sto.id |
| | | <if test="partNo != null and partNo != ''" > |
| | | where pp.part_no = #{partNo} or stop.part_no = #{partNo} |
| | | </if> |
| | | group by sto.id |
| | | ) a |
| | | <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.basic.mapper.StructureTestObjectPartMapper"> |
| | | <select id="selectListByTestObjectId" resultType="com.ruoyi.basic.pojo.StructureTestObjectPart"> |
| | | SELECT * from structure_test_object_part pp |
| | | where pp.test_object_id = #{testObjectId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off |
| | | echo. |
| | | echo [ä¿¡æ¯] æ¸
çå·¥ç¨targetçæè·¯å¾ã |
| | | echo. |
| | | |
| | | %~d0 |
| | | cd %~dp0 |
| | | |
| | | cd .. |
| | | call mvn clean |
| | | |
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off |
| | | echo. |
| | | echo [ä¿¡æ¯] æå
Webå·¥ç¨ï¼çæwar/jarå
æä»¶ã |
| | | echo. |
| | | |
| | | %~d0 |
| | | cd %~dp0 |
| | | |
| | | cd .. |
| | | call mvn clean package -Dmaven.test.skip=true |
| | | |
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @echo off |
| | | echo. |
| | | echo [ä¿¡æ¯] 使ç¨Jarå½ä»¤è¿è¡Webå·¥ç¨ã |
| | | echo. |
| | | |
| | | cd %~dp0 |
| | | cd ../ruoyi-admin/target |
| | | |
| | | set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m |
| | | |
| | | java -jar %JAVA_OPTS% ruoyi-admin.jar |
| | | |
| | | cd bin |
| | | pause |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>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> |
| | | </properties> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£éªæ ·å |
| | | * @TableName ins_sample |
| | | */ |
| | | @TableName(value ="ins_sample") |
| | | @Data |
| | | public class InsSample implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 1ï¼åæ ¼ 0ï¼ä¸åæ ¼ |
| | | */ |
| | | private Integer insResult; |
| | | |
| | | /** |
| | | * å¤é®ï¼ins_order表id |
| | | */ |
| | | private Integer insOrderId; |
| | | |
| | | /** |
| | | * é
奿 ·ååå· |
| | | */ |
| | | private String joinModel; |
| | | |
| | | /** |
| | | * é
奿 ·ååç§° |
| | | */ |
| | | private String joinName; |
| | | |
| | | /** |
| | | * é
奿 ·åæ°é |
| | | */ |
| | | private Integer joinNum; |
| | | |
| | | /** |
| | | * æ ·åç¼ç |
| | | */ |
| | | private String sampleCode; |
| | | |
| | | /** |
| | | * æ£éªå·¥å |
| | | */ |
| | | private String factory; |
| | | |
| | | /** |
| | | * å®éªå®¤åç§° |
| | | */ |
| | | private String laboratory; |
| | | |
| | | /** |
| | | * æ ·åç±»å |
| | | */ |
| | | private String sampleType; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | */ |
| | | private String sample; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String model; |
| | | |
| | | /** |
| | | * æ£éªç¶æ(0ï¼å¾
æ£éª1:æ£éªä¸ 2:å·²æ£éª3ï¼å¾
夿 ¸4ï¼å¤æ ¸æªéè¿5ï¼å¤æ ¸éè¿) |
| | | */ |
| | | private Integer insState; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | private Integer standardMethodListId; |
| | | |
| | | @ApiModelProperty("æ ·ååä½") |
| | | private String unit; |
| | | |
| | | private Integer cellId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | private Integer parentId; |
| | | |
| | | @ApiModelProperty("æ°é") |
| | | private Integer quantity; |
| | | |
| | | @ApiModelProperty("ç¹æ®æ åæ¹æ³") |
| | | private String specialStandardMethod; |
| | | |
| | | @TableField(select = false,exist = false) |
| | | private Integer num=1; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>3.8.9</version> |
| | | |
| | | <name>ruoyi</name> |
| | | <url>http://www.ruoyi.vip</url> |
| | | <description>è¥ä¾ç®¡çç³»ç»</description> |
| | | |
| | | <properties> |
| | | <ruoyi.version>3.8.9</ruoyi.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>1.8</java.version> |
| | | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| | | <spring-boot.version>2.5.15</spring-boot.version> |
| | | <druid.version>1.2.23</druid.version> |
| | | <bitwalker.version>1.21</bitwalker.version> |
| | | <swagger.version>3.0.0</swagger.version> |
| | | <kaptcha.version>2.3.3</kaptcha.version> |
| | | <pagehelper.boot.version>1.4.7</pagehelper.boot.version> |
| | | <fastjson.version>2.0.53</fastjson.version> |
| | | <oshi.version>6.6.5</oshi.version> |
| | | <commons.io.version>2.13.0</commons.io.version> |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <jwt.version>0.9.1</jwt.version> |
| | | <!-- override dependency version --> |
| | | <tomcat.version>9.0.96</tomcat.version> |
| | | <logback.version>1.2.13</logback.version> |
| | | <spring-security.version>5.7.12</spring-security.version> |
| | | <spring-framework.version>5.3.39</spring-framework.version> |
| | | <mybatis-plus.version>3.5.3.1</mybatis-plus.version> |
| | | <freemarker.version>2.3.30</freemarker.version> |
| | | <knife4j-spring-ui.version>3.0.3</knife4j-spring-ui.version> |
| | | <core.version>3.4.1</core.version> |
| | | <javase.version>3.4.1</javase.version> |
| | | <minio.version>8.4.3</minio.version> |
| | | <okhttp.version>4.9.0</okhttp.version> |
| | | <hutool.version>5.8.18</hutool.version> |
| | | <easyexcel.version>3.3.2</easyexcel.version> |
| | | </properties> |
| | | |
| | | <!-- ä¾èµå£°æ --> |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | |
| | | <!-- è¦çSpringFrameworkçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-framework-bom</artifactId> |
| | | <version>${spring-framework.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <!-- è¦çSpringSecurityçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-bom</artifactId> |
| | | <version>${spring-security.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <!-- SpringBootçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | | <version>${spring-boot.version}</version> |
| | | <type>pom</type> |
| | | <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> |
| | | <artifactId>logback-core</artifactId> |
| | | <version>${logback.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>ch.qos.logback</groupId> |
| | | <artifactId>logback-classic</artifactId> |
| | | <version>${logback.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è¦çtomcatçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>org.apache.tomcat.embed</groupId> |
| | | <artifactId>tomcat-embed-core</artifactId> |
| | | <version>${tomcat.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.tomcat.embed</groupId> |
| | | <artifactId>tomcat-embed-el</artifactId> |
| | | <version>${tomcat.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.tomcat.embed</groupId> |
| | | <artifactId>tomcat-embed-websocket</artifactId> |
| | | <version>${tomcat.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- é¿éæ°æ®åºè¿æ¥æ± --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è§£æå®¢æ·ç«¯æä½ç³»ç»ãæµè§å¨ç --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | <version>${bitwalker.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- pagehelper å页æä»¶ --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | <version>${pagehelper.boot.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è·åç³»ç»ä¿¡æ¯ --> |
| | | <dependency> |
| | | <groupId>com.github.oshi</groupId> |
| | | <artifactId>oshi-core</artifactId> |
| | | <version>${oshi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- Swagger3ä¾èµ --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>${swagger.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- io常ç¨å·¥å
·ç±» --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>${commons.io.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- excelå·¥å
· --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- velocity代ç çæä½¿ç¨æ¨¡æ¿ --> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>${velocity.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- é¿éJSONè§£æå¨ --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- Tokençæä¸è§£æ--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>${jwt.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- éªè¯ç --> |
| | | <dependency> |
| | | <groupId>pro.fessional</groupId> |
| | | <artifactId>kaptcha</artifactId> |
| | | <version>${kaptcha.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 宿¶ä»»å¡--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-quartz</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 代ç çæ--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-generator</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- æ ¸å¿æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- ç³»ç»æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-system</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- éç¨å·¥å
·--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- minio --> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | <version>${minio.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <!-- minioä¾èµokhttp ä¸ç¶æ¥é --> |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | <version>${okhttp.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <!-- å
¨å±å¼å
¥ --> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>${easyexcel.version}</version> |
| | | </dependency> |
| | | |
| | | <!--mybatis-plus--> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | |
| | | <!--mybatis-plus代ç çæå¨--> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.freemarker</groupId> |
| | | <artifactId>freemarker</artifactId> |
| | | <version>${freemarker.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- Swagger3ä¾èµ --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>${swagger.version}</version> |
| | | </dependency> |
| | | |
| | | <!--Swagger3-Uiç¾å--> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-spring-ui</artifactId> |
| | | <version>${knife4j-spring-ui.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>${core.version}</version> <!-- æè
æ´é«çæ¬ --> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>${javase.version}</version> <!-- æè
æ´é«çæ¬ --> |
| | | </dependency> |
| | | |
| | | <!--hutoolå·¥å
·å
--> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>${hutool.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>2.0.23</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <modules> |
| | | <module>ruoyi-admin</module> |
| | | <module>ruoyi-framework</module> |
| | | <module>ruoyi-system</module> |
| | | <module>ruoyi-quartz</module> |
| | | <module>ruoyi-generator</module> |
| | | <module>ruoyi-common</module> |
| | | <module>basic-server</module> |
| | | <module>inspect-server</module> |
| | | <module>performance-server</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>3.1</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${project.build.sourceEncoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>public</id> |
| | | <name>aliyun nexus</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | <pluginRepositories> |
| | | <pluginRepository> |
| | | <id>public</id> |
| | | <name>aliyun nexus</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | | <packaging>jar</packaging> |
| | | <artifactId>ruoyi-admin</artifactId> |
| | | |
| | | <description> |
| | | webæå¡å
¥å£ |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- spring-boot-devtools --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> <!-- 表示ä¾èµä¸ä¼ä¼ é --> |
| | | </dependency> |
| | | |
| | | <!-- swagger3--> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 鲿¢è¿å
¥swagger页颿¥ç±»å转æ¢éè¯¯ï¼æé¤3.0.0ä¸çå¼ç¨ï¼æå¨å¢å 1.6.2çæ¬ --> |
| | | <dependency> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-models</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <!-- Mysql驱å¨å
--> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | </dependency> |
| | | |
| | | <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-quartz</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 代ç çæ--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-generator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--åºç¡æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>basic-server</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!--ä¸å¡æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>inspect-server</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!--ç»©ææ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>performance-server</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ --> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <version>3.1.0</version> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.generator.FastAutoGenerator; |
| | | import com.baomidou.mybatisplus.generator.config.OutputFile; |
| | | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; |
| | | import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; |
| | | import com.baomidou.mybatisplus.generator.fill.Column; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Scanner; |
| | | |
| | | // æ¼ç¤ºä¾åï¼æ§è¡ main æ¹æ³æ§å¶å°è¾å
¥æ¨¡å表åå车èªå¨çæå¯¹åºé¡¹ç®ç®å½ä¸ |
| | | public class CodeGenerator { |
| | | |
| | | public static String database_url = "jdbc:mysql://114.132.189.42:9004/lims-zb"; |
| | | public static String database_username = "root"; |
| | | public static String database_password= "123456"; |
| | | public static String author = "è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸"; |
| | | public static String model_name = "/mes-technical"; // å¦æä¸ºåå¸å¼å¡«å模ååç§°ï¼å¦æä¸æ¯åå¸å¼ä¸ºç©ºå³å¯ |
| | | public static String setParent = "com.ruoyi.technical"; // å
è·¯å¾ |
| | | public static String tablePrefix = "technical"; // è®¾ç½®è¿æ»¤è¡¨åç¼ |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); |
| | | FastAutoGenerator.create(database_url, database_username, database_password) |
| | | // å
¨å±é
ç½® |
| | | .globalConfig(builder -> { |
| | | builder.author(author) // 设置ä½è
|
| | | .commentDate("yyyy-MM-dd hh:mm:ss") //æ³¨éæ¥æ |
| | | .outputDir(projectPath + model_name + "/src/main/java") // æå®è¾åºç®å½ |
| | | .disableOpenDir() //ç¦æ¢æå¼è¾åºç®å½ï¼é»è®¤æå¼ |
| | | .enableSwagger() // å¼å¯swagger |
| | | |
| | | ; |
| | | }) |
| | | // å
é
ç½® |
| | | .packageConfig(builder -> { |
| | | builder.entity("pojo"); |
| | | builder.parent(setParent) // 设置ç¶å
å |
| | | .pathInfo(Collections.singletonMap(OutputFile.xml, projectPath + model_name + "/src/main/resources/mapper")); // 设置mapperXmlçæè·¯å¾ |
| | | }) |
| | | // çç¥é
ç½® |
| | | .strategyConfig(builder -> { |
| | | builder.addInclude(scanner("表åï¼å¤ä¸ªç©ºæ ¼åå²").split(" ")) // 设置éè¦çæç表å |
| | | .addTablePrefix(tablePrefix) // è®¾ç½®è¿æ»¤è¡¨åç¼ |
| | | // Entity çç¥é
ç½® |
| | | .entityBuilder() |
| | | .enableLombok() //å¼å¯ Lombok |
| | | .naming(NamingStrategy.underline_to_camel) //æ°æ®åºè¡¨æ å°å°å®ä½çå½åçç¥ï¼ä¸åçº¿è½¬é©¼å³°å½ |
| | | .columnNaming(NamingStrategy.underline_to_camel) //æ°æ®åºè¡¨å段æ å°å°å®ä½çå½åçç¥ï¼ä¸åçº¿è½¬é©¼å³°å½ |
| | | .enableFileOverride() // è¦çå·²ç»çæçEntityæä»¶ |
| | | .logicDeleteColumnName("state") |
| | | .addTableFills( |
| | | new Column("create_time", FieldFill.INSERT), |
| | | new Column("update_time", FieldFill.INSERT_UPDATE), |
| | | new Column("create_user", FieldFill.INSERT), |
| | | new Column("update_user", FieldFill.INSERT_UPDATE) |
| | | ) |
| | | .idType(IdType.AUTO) // èªå¢ä¸»é® |
| | | |
| | | // Mapper çç¥é
ç½® |
| | | .mapperBuilder() |
| | | .enableFileOverride() // è¦çå·²çæMapperæä»¶ |
| | | .enableBaseResultMap() // èªå¨çæresultMap |
| | | // Service çç¥é
ç½® |
| | | .serviceBuilder() |
| | | .formatServiceFileName("%sService") //æ ¼å¼å service æ¥å£æä»¶åç§°ï¼%sè¿è¡å¹é
表åï¼å¦ UserService |
| | | .formatServiceImplFileName("%sServiceImpl") //æ ¼å¼å service å®ç°ç±»æä»¶åç§°ï¼%sè¿è¡å¹é
表åï¼å¦ UserServiceImpl |
| | | .enableFileOverride() // è¦çå·²çææä»¶ |
| | | |
| | | // Controller çç¥é
ç½® |
| | | .controllerBuilder() |
| | | .enableFileOverride() // è¦çå·²çææä»¶ |
| | | .enableRestStyle() // å¼å¯çæ@RestController æ§å¶å¨ |
| | | ; |
| | | }) |
| | | //5ãæ¨¡æ¿å¼æ |
| | | .templateEngine(new FreemarkerTemplateEngine()) //é»è®¤ |
| | | .execute(); |
| | | } |
| | | |
| | | /** |
| | | * <p> |
| | | * è¯»åæ§å¶å°å
容 |
| | | * </p> |
| | | */ |
| | | public static String scanner(String tip) { |
| | | Scanner scanner = new Scanner(System.in); |
| | | StringBuilder help = new StringBuilder(); |
| | | help.append("请è¾å
¥" + tip + "ï¼"); |
| | | System.out.println(help.toString()); |
| | | if (scanner.hasNext()) { |
| | | String ipt = scanner.next(); |
| | | |
| | | if (StringUtils.isNotBlank(ipt)) { |
| | | return ipt; |
| | | } |
| | | } |
| | | throw new MybatisPlusException("请è¾å
¥æ£ç¡®ç" + tip + "ï¼"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | |
| | | /** |
| | | * å¯å¨ç¨åº |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
| | | public class RuoYiApplication |
| | | { |
| | | public static void main(String[] args) |
| | | { |
| | | System.setProperty("spring.devtools.restart.enabled", "false"); |
| | | SpringApplication.run(RuoYiApplication.class, args); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * web容å¨ä¸è¿è¡é¨ç½² |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RuoYiServletInitializer extends SpringBootServletInitializer |
| | | { |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) |
| | | { |
| | | return application.sources(RuoYiApplication.class); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.sign.Base64; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * éªè¯ç æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class CaptchaController |
| | | { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | /** |
| | | * çæéªè¯ç |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) |
| | | { |
| | | return ajax; |
| | | } |
| | | |
| | | // ä¿åéªè¯ç ä¿¡æ¯ |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // çæéªè¯ç |
| | | String captchaType = RuoYiConfig.getCaptchaType(); |
| | | if ("math".equals(captchaType)) |
| | | { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } |
| | | else if ("char".equals(captchaType)) |
| | | { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // è½¬æ¢æµä¿¡æ¯ååº |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try |
| | | { |
| | | ImageIO.write(image, "jpg", os); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | |
| | | /** |
| | | * éç¨è¯·æ±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * éç¨ä¸è½½è¯·æ± |
| | | * |
| | | * @param fileName æä»¶åç§° |
| | | * @param delete æ¯å¦å é¤ |
| | | */ |
| | | @GetMapping("/download") |
| | | public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(fileName)) |
| | | { |
| | | throw new Exception(StringUtils.format("æä»¶åç§°({})éæ³ï¼ä¸å
许ä¸è½½ã ", fileName)); |
| | | } |
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); |
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName; |
| | | |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | if (delete) |
| | | { |
| | | FileUtils.deleteFile(filePath); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("ä¸è½½æä»¶å¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éç¨ä¸ä¼ 请æ±ï¼åä¸ªï¼ |
| | | */ |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // ä¸ä¼ æä»¶è·¯å¾ |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // ä¸ä¼ å¹¶è¿åæ°æä»¶åç§° |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | | ajax.put("newFileName", FileUtils.getName(fileName)); |
| | | ajax.put("originalFilename", file.getOriginalFilename()); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éç¨ä¸ä¼ 请æ±ï¼å¤ä¸ªï¼ |
| | | */ |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // ä¸ä¼ æä»¶è·¯å¾ |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) |
| | | { |
| | | // ä¸ä¼ å¹¶è¿åæ°æä»¶åç§° |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¬å°èµæºéç¨ä¸è½½ |
| | | */ |
| | | @GetMapping("/download/resource") |
| | | public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) |
| | | throws Exception |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(resource)) |
| | | { |
| | | throw new Exception(StringUtils.format("èµæºæä»¶({})éæ³ï¼ä¸å
许ä¸è½½ã ", resource)); |
| | | } |
| | | // æ¬å°èµæºè·¯å¾ |
| | | String localPath = RuoYiConfig.getProfile(); |
| | | // æ°æ®åºèµæºå°å |
| | | String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); |
| | | // ä¸è½½åç§° |
| | | String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("ä¸è½½æä»¶å¤±è´¥", e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.util.Set; |
| | | import java.util.TreeSet; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysCache; |
| | | |
| | | /** |
| | | * ç¼åçæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/cache") |
| | | public class CacheController |
| | | { |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | { |
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "ç¨æ·ä¿¡æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "é
置信æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "æ°æ®åå
¸")); |
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "éªè¯ç ")); |
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "é²éæäº¤")); |
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "éæµå¤ç")); |
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "å¯ç é误次æ°")); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(3); |
| | | result.put("info", info); |
| | | result.put("dbSize", dbSize); |
| | | |
| | | List<Map<String, String>> pieList = new ArrayList<>(); |
| | | commandStats.stringPropertyNames().forEach(key -> { |
| | | Map<String, String> data = new HashMap<>(2); |
| | | String property = commandStats.getProperty(key); |
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | pieList.add(data); |
| | | }); |
| | | result.put("commandStats", pieList); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getNames") |
| | | public AjaxResult cache() |
| | | { |
| | | return AjaxResult.success(caches); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getKeys/{cacheName}") |
| | | public AjaxResult getCacheKeys(@PathVariable String cacheName) |
| | | { |
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | return AjaxResult.success(new TreeSet<>(cacheKeys)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) |
| | | { |
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | return AjaxResult.success(sysCache); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheName/{cacheName}") |
| | | public AjaxResult clearCacheName(@PathVariable String cacheName) |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | public AjaxResult clearCacheKey(@PathVariable String cacheKey) |
| | | { |
| | | redisTemplate.delete(cacheKey); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheAll") |
| | | public AjaxResult clearCacheAll() |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.Server; |
| | | |
| | | /** |
| | | * æå¡å¨çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/server") |
| | | public class ServerController |
| | | { |
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Server server = new Server(); |
| | | server.copyTo(); |
| | | return AjaxResult.success(server); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPasswordService; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | |
| | | /** |
| | | * ç³»ç»è®¿é®è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | public class SysLogininforController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor) |
| | | { |
| | | startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysLogininfor logininfor) |
| | | { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | util.exportExcel(response, list, "ç»å½æ¥å¿"); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) |
| | | { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | logininforService.cleanLogininfor(); |
| | | return success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "è´¦æ·è§£é", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public AjaxResult unlock(@PathVariable("userName") String userName) |
| | | { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | |
| | | /** |
| | | * æä½æ¥å¿è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysOperLog operLog) |
| | | { |
| | | startPage(); |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysOperLog operLog) |
| | | { |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | util.exportExcel(response, list, "æä½æ¥å¿"); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/{operIds}") |
| | | public AjaxResult remove(@PathVariable Long[] operIds) |
| | | { |
| | | return toAjax(operLogService.deleteOperLogByIds(operIds)); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | operLogService.cleanOperLog(); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysUserOnline; |
| | | import com.ruoyi.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * å¨çº¿ç¨æ·çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | public class SysUserOnlineController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserOnlineService userOnlineService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) |
| | | { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(ipaddr)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |
| | | else |
| | | { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强éç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "å¨çº¿ç¨æ·", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.Custom; |
| | | import com.ruoyi.system.service.CustomService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 客æ·ç®¡ç |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | @Api(tags = "客æ·ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/system/custom") |
| | | public class CustomController { |
| | | |
| | | @Resource |
| | | private CustomService customService; |
| | | |
| | | @ApiOperation(value = "è·å客æ·å表") |
| | | @GetMapping("/selectCustomPageList") |
| | | public Result<IPage<Custom>> selectCustomPageList(Page page, Custom custom) throws Exception { |
| | | return Result.success(customService.selectCustomPageList(page, custom)); |
| | | } |
| | | @ApiOperation(value = "å é¤å®¢æ·ä¿¡æ¯") |
| | | @PostMapping("/delCustomById") |
| | | public Result delCustomById(Long id) { |
| | | return Result.success(customService.delCustomById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢å®¢æ·ä¿¡æ¯") |
| | | @PostMapping("/addCustom") |
| | | public Result addCustom(@RequestBody Custom custom) { |
| | | return Result.success(customService.addCustom(custom)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹å®¢æ·ä¿¡æ¯") |
| | | @PostMapping("/upCustom") |
| | | public Result upCustom(@RequestBody Custom custom) { |
| | | return Result.success(customService.upCustom(custom)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åå®¢æ·æä¸¾") |
| | | @GetMapping ("/selectCustomEnum") |
| | | public Result<List<Custom>> selectCustomEnum(){ |
| | | return Result.success(customService.selectCustomEnum()); |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * åæ°é
ç½® ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | public class SysConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * è·ååæ°é
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) |
| | | { |
| | | startPage(); |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) |
| | | { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | util.exportExcel(response, list, "åæ°æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) |
| | | { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°é®åæ¥è¯¢åæ°å¼ |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) |
| | | { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("æ°å¢åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("ä¿®æ¹åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) |
| | | { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åæ°ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * é¨é¨ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * è·åé¨é¨å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨åè¡¨ï¼æé¤èç¹ï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("æ°å¢é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼ä¸çº§é¨é¨ä¸è½æ¯èªå·±"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return error("该é¨é¨å
嫿ªåç¨çåé¨é¨ï¼"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | return toAjax(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return warn("åå¨ä¸çº§é¨é¨,ä¸å
许å é¤"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return warn("é¨é¨åå¨ç¨æ·,ä¸å
许å é¤"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return toAjax(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "åå
¸æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType) |
| | | { |
| | | startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) |
| | | { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | util.exportExcel(response, list, "åå
¸ç±»å"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸ç±»åè¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("æ°å¢åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("ä¿®æ¹åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åå
¸ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
¸éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * é¦é¡µ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysIndexController |
| | | { |
| | | /** ç³»ç»åºç¡é
ç½® */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** |
| | | * 访é®é¦é¡µï¼æç¤ºè¯ |
| | | */ |
| | | @RequestMapping("/") |
| | | public String index() |
| | | { |
| | | return StringUtils.format("欢è¿ä½¿ç¨{}åå°ç®¡çæ¡æ¶ï¼å½åçæ¬ï¼v{}ï¼è¯·éè¿å端å°å访é®ã", ruoyiConfig.getName(), ruoyiConfig.getVersion()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * ç»å½éªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysLoginController |
| | | { |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * ç»å½æ¹æ³ |
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // çæä»¤ç |
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, token); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getInfo") |
| | | public AjaxResult getInfo() |
| | | { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | // è§è²éå |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // æééå |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | if (!loginUser.getPermissions().equals(permissions)) |
| | | { |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * è·åè·¯ç±ä¿¡æ¯ |
| | | * |
| | | * @return è·¯ç±ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * èåä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | /** |
| | | * è·åèåå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menus); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®èåç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | | return success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * è·åèå䏿æ å表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * å 载对åºè§è²èåå表æ |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | return toAjax(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼ä¸çº§èåä¸è½éæ©èªå·±"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | return toAjax(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return warn("åå¨åèå,ä¸å
许å é¤"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return warn("èåå·²åé
,ä¸å
许å é¤"); |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * å
¬å ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | public class SysNoticeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * è·åéç¥å
¬åå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | | startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®éç¥å
¬åç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setCreateBy(getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setUpdateBy(getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:remove')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | | { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * å²ä½ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | public class SysPostController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * è·åå²ä½å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) |
| | | { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | util.exportExcel(response, list, "å²ä½æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å²ä½ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | | { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·åå²ä½éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.Map; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ ä¸å¡å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | public class SysProfileController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ |
| | | */ |
| | | @GetMapping |
| | | public AjaxResult profile() |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | AjaxResult ajax = AjaxResult.success(user); |
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhonenumber(user.getPhonenumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·ä¿¡æ¯ |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹ä¸ªäººä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public AjaxResult updatePwd(@RequestBody Map<String, String> params) |
| | | { |
| | | String oldPassword = params.get("oldPassword"); |
| | | String newPassword = params.get("newPassword"); |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| | | { |
| | | return error("ä¿®æ¹å¯ç å¤±è´¥ï¼æ§å¯ç é误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) |
| | | { |
| | | return error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | } |
| | | newPassword = SecurityUtils.encryptPassword(newPassword); |
| | | if (userService.resetUserPwd(userName, newPassword) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·å¯ç |
| | | loginUser.getUser().setPassword(newPassword); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹å¯ç å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * 头åä¸ä¼ |
| | | */ |
| | | @Log(title = "ç¨æ·å¤´å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception |
| | | { |
| | | if (!file.isEmpty()) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | // æ´æ°ç¼åç¨æ·å¤´å |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | return ajax; |
| | | } |
| | | } |
| | | return error("ä¸ä¼ å¾çå¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | 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.RestController; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.RegisterBody; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.SysRegisterService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 注åéªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class SysRegisterController extends BaseController |
| | | { |
| | | @Autowired |
| | | private SysRegisterService registerService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public AjaxResult register(@RequestBody RegisterBody user) |
| | | { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) |
| | | { |
| | | return error("å½åç³»ç»æ²¡æå¼å¯æ³¨ååè½ï¼"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | public class SysRoleController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysRole role) |
| | | { |
| | | startPage(); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:role:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysRole role) |
| | | { |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); |
| | | util.exportExcel(response, list, "è§è²æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return success(roleService.selectRoleById(roleId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysRole role) |
| | | { |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setCreateBy(getUsername()); |
| | | return toAjax(roleService.insertRole(role)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setUpdateBy(getUsername()); |
| | | |
| | | if (roleService.updateRole(role) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·æé |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) |
| | | { |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åæ°æ®æé |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return toAjax(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | role.setUpdateBy(getUsername()); |
| | | return toAjax(roleService.updateRoleStatus(role)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | public AjaxResult remove(@PathVariable Long[] roleIds) |
| | | { |
| | | return toAjax(roleService.deleteRoleByIds(roleIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·åè§è²éæ©æ¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | return success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) |
| | | { |
| | | return toAjax(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | return toAjax(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééæ©ç¨æ·ææ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·å对åºè§è²é¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | 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.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | public class SysUserController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * è·åç¨æ·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUser user) |
| | | { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.exportExcel(response, list, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:import')") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | List<SysUser> userList = util.importExcel(file.getInputStream()); |
| | | String operName = getUsername(); |
| | | String message = userService.importUser(userList, updateSupport, operName); |
| | | return success(message); |
| | | } |
| | | |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.importTemplateExcel(response, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping(value = { "/", "/{userId}" }) |
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | if (StringUtils.isNotNull(userId)) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | ajax.put(AjaxResult.DATA_TAG, sysUser); |
| | | ajax.put("postIds", postService.selectPostListByUserId(userId)); |
| | | ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); |
| | | } |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | return toAjax(userService.insertUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) |
| | | { |
| | | if (ArrayUtils.contains(userIds, getUserId())) |
| | | { |
| | | return error("å½åç¨æ·ä¸è½å é¤"); |
| | | } |
| | | return toAjax(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·åææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | roleService.checkRoleDataScope(roleIds); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) |
| | | { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | |
| | | import com.ruoyi.system.service.UserService; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è¡¨ |
| | | * |
| | | * @author zhuo |
| | | * @since 2025-02-13 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/newUser") |
| | | public class UserController { |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * swagger ç¨æ·æµè¯æ¹æ³ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api("ç¨æ·ä¿¡æ¯ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/test/user") |
| | | public class TestController extends BaseController |
| | | { |
| | | private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); |
| | | { |
| | | users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); |
| | | users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); |
| | | } |
| | | |
| | | @ApiOperation("è·åç¨æ·å表") |
| | | @GetMapping("/list") |
| | | public Result<List<UserEntity>> userList() |
| | | { |
| | | List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); |
| | | return Result.success(userList); |
| | | } |
| | | |
| | | @ApiOperation("è·åç¨æ·è¯¦ç»") |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @GetMapping("/{userId}") |
| | | public Result<UserEntity> getUser(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | return Result.success(users.get(userId)); |
| | | } |
| | | else |
| | | { |
| | | return Result.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·id", dataType = "Integer", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "username", value = "ç¨æ·åç§°", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "password", value = "ç¨æ·å¯ç ", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "mobile", value = "ç¨æ·ææº", dataType = "String", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/save") |
| | | public Result<String> save(UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return Result.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | users.put(user.getUserId(), user); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°ç¨æ·") |
| | | @PutMapping("/update") |
| | | public Result<String> update(@RequestBody UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return Result.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | if (users.isEmpty() || !users.containsKey(user.getUserId())) |
| | | { |
| | | return Result.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | users.remove(user.getUserId()); |
| | | users.put(user.getUserId(), user); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("å é¤ç¨æ·ä¿¡æ¯") |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @DeleteMapping("/{userId}") |
| | | public Result<String> delete(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | users.remove(userId); |
| | | return Result.success(); |
| | | } |
| | | else |
| | | { |
| | | return Result.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiModel(value = "UserEntity", description = "ç¨æ·å®ä½") |
| | | class UserEntity |
| | | { |
| | | @ApiModelProperty("ç¨æ·ID") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("ç¨æ·åç§°") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("ç¨æ·å¯ç ") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("ç¨æ·ææº") |
| | | private String mobile; |
| | | |
| | | public UserEntity() |
| | | { |
| | | |
| | | } |
| | | |
| | | public UserEntity(Integer userId, String username, String password, String mobile) |
| | | { |
| | | this.userId = userId; |
| | | this.username = username; |
| | | this.password = password; |
| | | this.mobile = mobile; |
| | | } |
| | | |
| | | public Integer getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getMobile() |
| | | { |
| | | return mobile; |
| | | } |
| | | |
| | | public void setMobile(String mobile) |
| | | { |
| | | this.mobile = mobile; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.ApiKey; |
| | | import springfox.documentation.service.AuthorizationScope; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.service.SecurityReference; |
| | | import springfox.documentation.service.SecurityScheme; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | /** |
| | | * Swagger2çæ¥å£é
ç½® |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | | public class SwaggerConfig |
| | | { |
| | | /** ç³»ç»åºç¡é
ç½® */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** æ¯å¦å¼å¯swagger */ |
| | | @Value("${swagger.enabled}") |
| | | private boolean enabled; |
| | | |
| | | /** |
| | | * å建API |
| | | */ |
| | | @Bean |
| | | public Docket createRestApi() |
| | | { |
| | | return new Docket(DocumentationType.OAS_30) |
| | | // æ¯å¦å¯ç¨Swagger |
| | | .enable(enabled) |
| | | // ç¨æ¥å建该APIçåºæ¬ä¿¡æ¯ï¼å±ç¤ºå¨ææ¡£ç页é¢ä¸ï¼èªå®ä¹å±ç¤ºçä¿¡æ¯ï¼ |
| | | .apiInfo(apiInfo()) |
| | | // 设置åªäºæ¥å£æ´é²ç»Swaggerå±ç¤º |
| | | .select() |
| | | // æ«æææææ³¨è§£çapiï¼ç¨è¿ç§æ¹å¼æ´çµæ´» |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | // æ«ææå®å
ä¸çswagger注解 |
| | | // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) |
| | | // æ«æææ .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | /* 设置å®å
¨æ¨¡å¼ï¼swaggerå¯ä»¥è®¾ç½®è®¿é®token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()); |
| | | } |
| | | |
| | | /** |
| | | * å®å
¨æ¨¡å¼ï¼è¿éæå®tokenéè¿Authorization头请æ±å¤´ä¼ é |
| | | */ |
| | | private List<SecurityScheme> securitySchemes() |
| | | { |
| | | List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); |
| | | apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); |
| | | return apiKeyList; |
| | | } |
| | | |
| | | /** |
| | | * å®å
¨ä¸ä¸æ |
| | | */ |
| | | private List<SecurityContext> securityContexts() |
| | | { |
| | | List<SecurityContext> securityContexts = new ArrayList<>(); |
| | | securityContexts.add( |
| | | SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .operationSelector(o -> o.requestMappingPattern().matches("/.*")) |
| | | .build()); |
| | | return securityContexts; |
| | | } |
| | | |
| | | /** |
| | | * é»è®¤çå®å
¨ä¸å¼ç¨ |
| | | */ |
| | | private List<SecurityReference> defaultAuth() |
| | | { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | List<SecurityReference> securityReferences = new ArrayList<>(); |
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); |
| | | return securityReferences; |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æè¦ä¿¡æ¯ |
| | | */ |
| | | private ApiInfo apiInfo() |
| | | { |
| | | // ç¨ApiInfoBuilderè¿è¡å®å¶ |
| | | return new ApiInfoBuilder() |
| | | // 设置æ é¢ |
| | | .title("æ é¢ï¼è¥ä¾ç®¡çç³»ç»_æ¥å£ææ¡£") |
| | | // æè¿° |
| | | .description("æè¿°ï¼ç¨äºç®¡çé墿ä¸å
¬å¸ç人åä¿¡æ¯,å
·ä½å
æ¬XXX,XXX模å...") |
| | | // ä½è
ä¿¡æ¯ |
| | | .contact(new Contact(ruoyiConfig.getName(), null, null)) |
| | | // çæ¬ |
| | | .version("çæ¬å·:" + ruoyiConfig.getVersion()) |
| | | .build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | restart.include.json=/com.alibaba.fastjson2.*.jar |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # æ°æ®æºé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | # url: jdbc:mysql://114.132.189.42:9004/lims-ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://127.0.0.1:3307/center-lims-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: D:/ruoyi/uploadPath |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 8002 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: debug |
| | | org.springframework: warn |
| | | |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: druid |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 10MB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 20MB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: true |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | host: localhost |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | password: 123456 |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 30 |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # mybatis-plusé
ç½® |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/**/*Mapper.xml |
| | | type-aliases-package: com.ruoyi.**.domain |
| | | global-config: |
| | | banner: off |
| | | db-config: |
| | | id-type: auto |
| | | configuration: |
| | | map-underscore-to-camel-case: true |
| | | cache-enabled: false |
| | | log-impl: # org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Application Version: ${ruoyi.version} |
| | | Spring Boot Version: ${spring-boot.version} |
| | | //////////////////////////////////////////////////////////////////// |
| | | // _ooOoo_ // |
| | | // o8888888o // |
| | | // 88" . "88 // |
| | | // (| ^_^ |) // |
| | | // O\ = /O // |
| | | // ____/`---'\____ // |
| | | // .' \\| |// `. // |
| | | // / \\||| : |||// \ // |
| | | // / _||||| -:- |||||- \ // |
| | | // | | \\\ - /// | | // |
| | | // | \_| ''\---/'' | | // |
| | | // \ .-\__ `-` ___/-. / // |
| | | // ___`. .' /--.--\ `. . ___ // |
| | | // ."" '< `.___\_<|>_/___.' >'"". // |
| | | // | | : `- \`.;`\ _ /`;.`/ - ` : | | // |
| | | // \ \ `-. \_ __\ /__ _/ .-` / / // |
| | | // ========`-.____`-.___\_____/___.-`____.-'======== // |
| | | // `=---=' // |
| | | // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // |
| | | // ä½ç¥ä¿ä½ æ°¸ä¸å®æº æ°¸æ BUG // |
| | | //////////////////////////////////////////////////////////////////// |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #éè¯¯æ¶æ¯ |
| | | not.null=* å¿
须填å |
| | | user.jcaptcha.error=éªè¯ç é误 |
| | | user.jcaptcha.expire=éªè¯ç 已失æ |
| | | user.not.exists=ç¨æ·ä¸åå¨/å¯ç é误 |
| | | user.password.not.match=ç¨æ·ä¸åå¨/å¯ç é误 |
| | | user.password.retry.limit.count=å¯ç è¾å
¥é误{0}次 |
| | | user.password.retry.limit.exceed=å¯ç è¾å
¥é误{0}次ï¼å¸æ·éå®{1}åé |
| | | user.password.delete=对ä¸èµ·ï¼æ¨çè´¦å·å·²è¢«å é¤ |
| | | user.blocked=ç¨æ·å·²å°ç¦ï¼è¯·è系管çå |
| | | role.blocked=è§è²å·²å°ç¦ï¼è¯·è系管çå |
| | | login.blocked=å¾éæ¾ï¼è®¿é®IP已被åå
¥ç³»ç»é»åå |
| | | user.logout.success=éåºæå |
| | | |
| | | length.not.valid=é¿åº¦å¿
é¡»å¨{min}å°{max}个å符ä¹é´ |
| | | |
| | | user.username.not.valid=* 2å°20个æ±åãåæ¯ãæ°åæä¸åçº¿ç»æï¼ä¸å¿
须以鿰åå¼å¤´ |
| | | user.password.not.valid=* 5-50个å符 |
| | | |
| | | user.email.not.valid=é®ç®±æ ¼å¼é误 |
| | | user.mobile.phone.number.not.valid=ææºå·æ ¼å¼é误 |
| | | user.login.success=ç»å½æå |
| | | user.register.success=注åæå |
| | | user.notfound=è¯·éæ°ç»å½ |
| | | user.forcelogout=管çå强å¶éåºï¼è¯·éæ°ç»å½ |
| | | user.unknown.error=æªç¥é误ï¼è¯·éæ°ç»å½ |
| | | |
| | | ##æä»¶ä¸ä¼ æ¶æ¯ |
| | | upload.exceed.maxSize=ä¸ä¼ çæä»¶å¤§å°è¶
åºéå¶çæä»¶å¤§å°ï¼<br/>å
许çæä»¶æå¤§å¤§å°æ¯ï¼{0}MBï¼ |
| | | upload.filename.exceed.length=ä¸ä¼ çæä»¶åæé¿{0}个å符 |
| | | |
| | | ##æé |
| | | no.permission=æ¨æ²¡ææ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.create.permission=æ¨æ²¡æåå»ºæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.update.permission=æ¨æ²¡æä¿®æ¹æ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.delete.permission=æ¨æ²¡æå 餿°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.export.permission=æ¨æ²¡æå¯¼åºæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.view.permission=æ¨æ²¡ææ¥çæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- æ¥å¿åæ¾è·¯å¾ --> |
| | | <property name="log.path" value="/home/ruoyi/logs" /> |
| | | <!-- æ¥å¿è¾åºæ ¼å¼ --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- æ§å¶å°è¾åº --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¥å¿è¾åº --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-info.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>INFO</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-error.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>ERROR</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- ç¨æ·è®¿é®æ¥å¿è¾åº --> |
| | | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æå¤©åæ» daily --> |
| | | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¨¡åæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Springæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»æä½æ¥å¿--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»ç¨æ·æä½æ¥å¿--> |
| | | <logger name="sys-user" level="info"> |
| | | <appender-ref ref="sys-user"/> |
| | | </logger> |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE configuration |
| | | PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| | | <configuration> |
| | | <!-- å
¨å±åæ° --> |
| | | <settings> |
| | | <!-- 使å
¨å±çæ å°å¨å¯ç¨æç¦ç¨ç¼å --> |
| | | <setting name="cacheEnabled" value="true" /> |
| | | <!-- å
许JDBC æ¯æèªå¨çæä¸»é® --> |
| | | <setting name="useGeneratedKeys" value="true" /> |
| | | <!-- é
ç½®é»è®¤çæ§è¡å¨.SIMPLEå°±æ¯æ®éæ§è¡å¨;REUSEæ§è¡å¨ä¼éç¨é¢å¤çè¯å¥(prepared statements);BATCHæ§è¡å¨å°éç¨è¯å¥å¹¶æ§è¡æ¹éæ´æ° --> |
| | | <setting name="defaultExecutorType" value="SIMPLE" /> |
| | | <!-- æå® MyBatis æç¨æ¥å¿çå
·ä½å®ç° --> |
| | | <setting name="logImpl" value="SLF4J" /> |
| | | <!-- 使ç¨é©¼å³°å½åæ³è½¬æ¢å段 --> |
| | | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --> |
| | | </settings> |
| | | |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ruoyi-common</artifactId> |
| | | |
| | | <description> |
| | | commonéç¨å·¥å
· |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- Springæ¡æ¶åºæ¬çæ ¸å¿å·¥å
· --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context-support</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringWeb模å --> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-web</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- spring security å®å
¨è®¤è¯ --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pagehelper å页æä»¶ --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- èªå®ä¹éªè¯æ³¨è§£ --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | |
| | | <!--常ç¨å·¥å
·ç±» --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- JSONå·¥å
·ç±» --> |
| | | <dependency> |
| | | <groupId>com.fasterxml.jackson.core</groupId> |
| | | <artifactId>jackson-databind</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- é¿éJSONè§£æå¨ --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- io常ç¨å·¥å
·ç±» --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- excelå·¥å
· --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- ymlè§£æå¨ --> |
| | | <dependency> |
| | | <groupId>org.yaml</groupId> |
| | | <artifactId>snakeyaml</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Tokençæä¸è§£æ--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Jaxb --> |
| | | <dependency> |
| | | <groupId>javax.xml.bind</groupId> |
| | | <artifactId>jaxb-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- redis ç¼åæä½ --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- pool å¯¹è±¡æ± --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-pool2</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- è§£æå®¢æ·ç«¯æä½ç³»ç»ãæµè§å¨ç --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- servletå
--> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- minio --> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- minioä¾èµokhttp ä¸ç¶æ¥é --> |
| | | <dependency> |
| | | <groupId>com.squareup.okhttp3</groupId> |
| | | <artifactId>okhttp</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <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.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * å¿å访é®ä¸é´ææ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Anonymous |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * æ°æ®æéè¿æ»¤æ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface DataScope |
| | | { |
| | | /** |
| | | * é¨é¨è¡¨çå«å |
| | | */ |
| | | public String deptAlias() default ""; |
| | | |
| | | /** |
| | | * ç¨æ·è¡¨çå«å |
| | | */ |
| | | public String userAlias() default ""; |
| | | |
| | | /** |
| | | * æéå符ï¼ç¨äºå¤ä¸ªè§è²å¹é
符åè¦æ±çæéï¼é»è®¤æ ¹æ®æé注解@ssè·åï¼å¤ä¸ªæéç¨éå·åé弿¥ |
| | | */ |
| | | public String permission() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.enums.DataSourceType; |
| | | |
| | | /** |
| | | * èªå®ä¹å¤æ°æ®æºåæ¢æ³¨è§£ |
| | | * |
| | | * ä¼å
级ï¼å
æ¹æ³ï¼åç±»ï¼å¦ææ¹æ³è¦çäºç±»ä¸çæ°æ®æºç±»åï¼ä»¥æ¹æ³ç为åï¼å¦å以类ä¸ç为å |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target({ ElementType.METHOD, ElementType.TYPE }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | @Inherited |
| | | public @interface DataSource |
| | | { |
| | | /** |
| | | * åæ¢æ°æ®æºåç§° |
| | | */ |
| | | public DataSourceType value() default DataSourceType.MASTER; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import java.math.BigDecimal; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.IndexedColors; |
| | | import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; |
| | | |
| | | /** |
| | | * èªå®ä¹å¯¼åºExcelæ°æ®æ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | public @interface Excel |
| | | { |
| | | /** |
| | | * å¯¼åºæ¶å¨excelä¸æåº |
| | | */ |
| | | public int sort() default Integer.MAX_VALUE; |
| | | |
| | | /** |
| | | * 导åºå°Excelä¸çåå. |
| | | */ |
| | | public String name() default ""; |
| | | |
| | | /** |
| | | * æ¥ææ ¼å¼, å¦: yyyy-MM-dd |
| | | */ |
| | | public String dateFormat() default ""; |
| | | |
| | | /** |
| | | * 妿æ¯åå
¸ç±»åï¼è¯·è®¾ç½®åå
¸çtypeå¼ (å¦: sys_user_sex) |
| | | */ |
| | | public String dictType() default ""; |
| | | |
| | | /** |
| | | * 读åå
å®¹è½¬è¡¨è¾¾å¼ (å¦: 0=ç·,1=女,2=æªç¥) |
| | | */ |
| | | public String readConverterExp() default ""; |
| | | |
| | | /** |
| | | * åé符ï¼è¯»åå符串ç»å
容 |
| | | */ |
| | | public String separator() default ","; |
| | | |
| | | /** |
| | | * BigDecimal 精度 é»è®¤:-1(é»è®¤ä¸å¼å¯BigDecimalæ ¼å¼å) |
| | | */ |
| | | public int scale() default -1; |
| | | |
| | | /** |
| | | * BigDecimal èå
¥è§å é»è®¤:BigDecimal.ROUND_HALF_EVEN |
| | | */ |
| | | public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; |
| | | |
| | | /** |
| | | * å¯¼åºæ¶å¨excel䏿¯ä¸ªåçé«åº¦ |
| | | */ |
| | | public double height() default 14; |
| | | |
| | | /** |
| | | * å¯¼åºæ¶å¨excel䏿¯ä¸ªåç宽度 |
| | | */ |
| | | public double width() default 16; |
| | | |
| | | /** |
| | | * æååç¼,å¦% 90 åæ90% |
| | | */ |
| | | public String suffix() default ""; |
| | | |
| | | /** |
| | | * å½å¼ä¸ºç©ºæ¶,åæ®µçé»è®¤å¼ |
| | | */ |
| | | public String defaultValue() default ""; |
| | | |
| | | /** |
| | | * æç¤ºä¿¡æ¯ |
| | | */ |
| | | public String prompt() default ""; |
| | | |
| | | /** |
| | | * æ¯å¦å
许å
容æ¢è¡ |
| | | */ |
| | | public boolean wrapText() default false; |
| | | |
| | | /** |
| | | * 设置åªè½éæ©ä¸è½è¾å
¥çåå
容. |
| | | */ |
| | | public String[] combo() default {}; |
| | | |
| | | /** |
| | | * æ¯å¦ä»åå
¸è¯»æ°æ®å°combo,é»è®¤ä¸è¯»å,å¦è¯»åéè¦è®¾ç½®dictType注解. |
| | | */ |
| | | public boolean comboReadDict() default false; |
| | | |
| | | /** |
| | | * æ¯å¦éè¦çºµååå¹¶åå
æ ¼,åºå¯¹éæ±:嫿listéååå
æ ¼) |
| | | */ |
| | | public boolean needMerge() default false; |
| | | |
| | | /** |
| | | * æ¯å¦å¯¼åºæ°æ®,åºå¯¹éæ±:ææ¶æä»¬éè¦å¯¼åºä¸ä»½æ¨¡æ¿,è¿æ¯æ é¢éè¦ä½å
容éè¦ç¨æ·æå·¥å¡«å. |
| | | */ |
| | | public boolean isExport() default true; |
| | | |
| | | /** |
| | | * å¦ä¸ä¸ªç±»ä¸ç屿§åç§°,æ¯æå¤çº§è·å,以尿°ç¹éå¼ |
| | | */ |
| | | public String targetAttr() default ""; |
| | | |
| | | /** |
| | | * æ¯å¦èªå¨ç»è®¡æ°æ®,卿å追å ä¸è¡ç»è®¡æ°æ®æ»å |
| | | */ |
| | | public boolean isStatistics() default false; |
| | | |
| | | /** |
| | | * 导åºç±»åï¼0æ°å 1å符串 2å¾çï¼ |
| | | */ |
| | | public ColumnType cellType() default ColumnType.STRING; |
| | | |
| | | /** |
| | | * 导åºåå¤´èæ¯é¢è² |
| | | */ |
| | | public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT; |
| | | |
| | | /** |
| | | * 导åºå头åä½é¢è² |
| | | */ |
| | | public IndexedColors headerColor() default IndexedColors.WHITE; |
| | | |
| | | /** |
| | | * 导åºåå
æ ¼èæ¯é¢è² |
| | | */ |
| | | public IndexedColors backgroundColor() default IndexedColors.WHITE; |
| | | |
| | | /** |
| | | * 导åºåå
æ ¼åä½é¢è² |
| | | */ |
| | | public IndexedColors color() default IndexedColors.BLACK; |
| | | |
| | | /** |
| | | * 导åºåæ®µå¯¹é½æ¹å¼ |
| | | */ |
| | | public HorizontalAlignment align() default HorizontalAlignment.CENTER; |
| | | |
| | | /** |
| | | * èªå®ä¹æ°æ®å¤çå¨ |
| | | */ |
| | | public Class<?> handler() default ExcelHandlerAdapter.class; |
| | | |
| | | /** |
| | | * èªå®ä¹æ°æ®å¤çå¨åæ° |
| | | */ |
| | | public String[] args() default {}; |
| | | |
| | | /** |
| | | * åæ®µç±»åï¼0ï¼å¯¼åºå¯¼å
¥ï¼1ï¼ä»
导åºï¼2ï¼ä»
导å
¥ï¼ |
| | | */ |
| | | Type type() default Type.ALL; |
| | | |
| | | public enum Type |
| | | { |
| | | ALL(0), EXPORT(1), IMPORT(2); |
| | | private final int value; |
| | | |
| | | Type(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | |
| | | public enum ColumnType |
| | | { |
| | | NUMERIC(0), STRING(1), IMAGE(2), TEXT(3); |
| | | private final int value; |
| | | |
| | | ColumnType(int value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int value() |
| | | { |
| | | return this.value; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * Excel注解é |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface Excels |
| | | { |
| | | public Excel[] value(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.OperatorType; |
| | | |
| | | /** |
| | | * èªå®ä¹æä½æ¥å¿è®°å½æ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Target({ ElementType.PARAMETER, ElementType.METHOD }) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Log |
| | | { |
| | | /** |
| | | * 模å |
| | | */ |
| | | public String title() default ""; |
| | | |
| | | /** |
| | | * åè½ |
| | | */ |
| | | public BusinessType businessType() default BusinessType.OTHER; |
| | | |
| | | /** |
| | | * æä½äººç±»å« |
| | | */ |
| | | public OperatorType operatorType() default OperatorType.MANAGE; |
| | | |
| | | /** |
| | | * æ¯å¦ä¿å请æ±çåæ° |
| | | */ |
| | | public boolean isSaveRequestData() default true; |
| | | |
| | | /** |
| | | * æ¯å¦ä¿åååºçåæ° |
| | | */ |
| | | public boolean isSaveResponseData() default true; |
| | | |
| | | /** |
| | | * æé¤æå®ç请æ±åæ° |
| | | */ |
| | | public String[] excludeParamNames() default {}; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.enums.LimitType; |
| | | |
| | | /** |
| | | * éæµæ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RateLimiter |
| | | { |
| | | /** |
| | | * éæµkey |
| | | */ |
| | | public String key() default CacheConstants.RATE_LIMIT_KEY; |
| | | |
| | | /** |
| | | * éæµæ¶é´,åä½ç§ |
| | | */ |
| | | public int time() default 60; |
| | | |
| | | /** |
| | | * éæµæ¬¡æ° |
| | | */ |
| | | public int count() default 100; |
| | | |
| | | /** |
| | | * éæµç±»å |
| | | */ |
| | | public LimitType limitType() default LimitType.DEFAULT; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Inherited; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * èªå®ä¹æ³¨è§£é²æ¢è¡¨åéå¤æäº¤ |
| | | * |
| | | * @author ruoyi |
| | | * |
| | | */ |
| | | @Inherited |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface RepeatSubmit |
| | | { |
| | | /** |
| | | * é´éæ¶é´(ms)ï¼å°äºæ¤æ¶é´è§ä¸ºéå¤æäº¤ |
| | | */ |
| | | public int interval() default 5000; |
| | | |
| | | /** |
| | | * æç¤ºæ¶æ¯ |
| | | */ |
| | | public String message() default "ä¸å
许éå¤æäº¤ï¼è¯·ç¨ååè¯"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.ruoyi.common.config.serializer.SensitiveJsonSerializer; |
| | | import com.ruoyi.common.enums.DesensitizedType; |
| | | |
| | | /** |
| | | * æ°æ®è±ææ³¨è§£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.FIELD) |
| | | @JacksonAnnotationsInside |
| | | @JsonSerialize(using = SensitiveJsonSerializer.class) |
| | | public @interface Sensitive |
| | | { |
| | | DesensitizedType desensitizedType(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.config; |
| | | |
| | | import io.minio.MinioClient; |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Configuration |
| | | @Component |
| | | @ConfigurationProperties(prefix = "minio") |
| | | @Data |
| | | public class MinioConfig { |
| | | private String endpoint; |
| | | private int port; |
| | | private String accessKey; |
| | | private String secretKey; |
| | | private Boolean secure; |
| | | |
| | | @Bean |
| | | public MinioClient getMinioClient() { |
| | | return MinioClient.builder().endpoint(endpoint, port, secure) |
| | | .credentials(accessKey, secretKey) |
| | | .build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 读å项ç®ç¸å
³é
ç½® |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "ruoyi") |
| | | public class RuoYiConfig |
| | | { |
| | | /** 项ç®åç§° */ |
| | | private String name; |
| | | |
| | | /** çæ¬ */ |
| | | private String version; |
| | | |
| | | /** çæå¹´ä»½ */ |
| | | private String copyrightYear; |
| | | |
| | | /** ä¸ä¼ è·¯å¾ */ |
| | | private static String profile; |
| | | |
| | | /** è·åå°åå¼å
³ */ |
| | | private static boolean addressEnabled; |
| | | |
| | | /** éªè¯ç ç±»å */ |
| | | private static String captchaType; |
| | | |
| | | public String getName() |
| | | { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) |
| | | { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getVersion() |
| | | { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) |
| | | { |
| | | this.version = version; |
| | | } |
| | | |
| | | public String getCopyrightYear() |
| | | { |
| | | return copyrightYear; |
| | | } |
| | | |
| | | public void setCopyrightYear(String copyrightYear) |
| | | { |
| | | this.copyrightYear = copyrightYear; |
| | | } |
| | | |
| | | public static String getProfile() |
| | | { |
| | | return profile; |
| | | } |
| | | |
| | | public void setProfile(String profile) |
| | | { |
| | | RuoYiConfig.profile = profile; |
| | | } |
| | | |
| | | public static boolean isAddressEnabled() |
| | | { |
| | | return addressEnabled; |
| | | } |
| | | |
| | | public void setAddressEnabled(boolean addressEnabled) |
| | | { |
| | | RuoYiConfig.addressEnabled = addressEnabled; |
| | | } |
| | | |
| | | public static String getCaptchaType() { |
| | | return captchaType; |
| | | } |
| | | |
| | | public void setCaptchaType(String captchaType) { |
| | | RuoYiConfig.captchaType = captchaType; |
| | | } |
| | | |
| | | /** |
| | | * è·å导å
¥ä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getImportPath() |
| | | { |
| | | return getProfile() + "/import"; |
| | | } |
| | | |
| | | /** |
| | | * è·å头åä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getAvatarPath() |
| | | { |
| | | return getProfile() + "/avatar"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸è½½è·¯å¾ |
| | | */ |
| | | public static String getDownloadPath() |
| | | { |
| | | return getProfile() + "/download/"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸ä¼ è·¯å¾ |
| | | */ |
| | | public static String getUploadPath() |
| | | { |
| | | return getProfile() + "/upload"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.config.serializer; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Objects; |
| | | import com.fasterxml.jackson.core.JsonGenerator; |
| | | import com.fasterxml.jackson.databind.BeanProperty; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.JsonSerializer; |
| | | import com.fasterxml.jackson.databind.SerializerProvider; |
| | | import com.fasterxml.jackson.databind.ser.ContextualSerializer; |
| | | import com.ruoyi.common.annotation.Sensitive; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.DesensitizedType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | /** |
| | | * æ°æ®è±æåºååè¿æ»¤ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer |
| | | { |
| | | private DesensitizedType desensitizedType; |
| | | |
| | | @Override |
| | | public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException |
| | | { |
| | | if (desensitization()) |
| | | { |
| | | gen.writeString(desensitizedType.desensitizer().apply(value)); |
| | | } |
| | | else |
| | | { |
| | | gen.writeString(value); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) |
| | | throws JsonMappingException |
| | | { |
| | | Sensitive annotation = property.getAnnotation(Sensitive.class); |
| | | if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) |
| | | { |
| | | this.desensitizedType = annotation.desensitizedType(); |
| | | return this; |
| | | } |
| | | return prov.findValueSerializer(property.getType(), property); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦éè¦è±æå¤ç |
| | | */ |
| | | private boolean desensitization() |
| | | { |
| | | try |
| | | { |
| | | LoginUser securityUser = SecurityUtils.getLoginUser(); |
| | | // 管çåä¸è±æ |
| | | return !securityUser.getUser().isAdmin(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * ç¼åçkey 常é |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class CacheConstants |
| | | { |
| | | /** |
| | | * ç»å½ç¨æ· redis key |
| | | */ |
| | | public static final String LOGIN_TOKEN_KEY = "login_tokens:"; |
| | | |
| | | /** |
| | | * éªè¯ç redis key |
| | | */ |
| | | public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; |
| | | |
| | | /** |
| | | * åæ°ç®¡ç cache key |
| | | */ |
| | | public static final String SYS_CONFIG_KEY = "sys_config:"; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç cache key |
| | | */ |
| | | public static final String SYS_DICT_KEY = "sys_dict:"; |
| | | |
| | | /** |
| | | * é²éæäº¤ redis key |
| | | */ |
| | | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
| | | |
| | | /** |
| | | * éæµ redis key |
| | | */ |
| | | public static final String RATE_LIMIT_KEY = "rate_limit:"; |
| | | |
| | | /** |
| | | * ç»å½è´¦æ·å¯ç éè¯¯æ¬¡æ° redis key |
| | | */ |
| | | public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | import java.util.Locale; |
| | | import io.jsonwebtoken.Claims; |
| | | |
| | | /** |
| | | * éç¨å¸¸éä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Constants |
| | | { |
| | | /** |
| | | * UTF-8 å符é |
| | | */ |
| | | public static final String UTF8 = "UTF-8"; |
| | | |
| | | /** |
| | | * GBK å符é |
| | | */ |
| | | public static final String GBK = "GBK"; |
| | | |
| | | /** |
| | | * ç³»ç»è¯è¨ |
| | | */ |
| | | public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE; |
| | | |
| | | /** |
| | | * www主å |
| | | */ |
| | | public static final String WWW = "www."; |
| | | |
| | | /** |
| | | * httpè¯·æ± |
| | | */ |
| | | public static final String HTTP = "http://"; |
| | | |
| | | /** |
| | | * httpsè¯·æ± |
| | | */ |
| | | public static final String HTTPS = "https://"; |
| | | |
| | | /** |
| | | * éç¨æåæ è¯ |
| | | */ |
| | | public static final String SUCCESS = "0"; |
| | | |
| | | /** |
| | | * éç¨å¤±è´¥æ è¯ |
| | | */ |
| | | public static final String FAIL = "1"; |
| | | |
| | | /** |
| | | * ç»å½æå |
| | | */ |
| | | public static final String LOGIN_SUCCESS = "Success"; |
| | | |
| | | /** |
| | | * 注é |
| | | */ |
| | | public static final String LOGOUT = "Logout"; |
| | | |
| | | /** |
| | | * 注å |
| | | */ |
| | | public static final String REGISTER = "Register"; |
| | | |
| | | /** |
| | | * ç»å½å¤±è´¥ |
| | | */ |
| | | public static final String LOGIN_FAIL = "Error"; |
| | | |
| | | /** |
| | | * æææéæ è¯ |
| | | */ |
| | | public static final String ALL_PERMISSION = "*:*:*"; |
| | | |
| | | /** |
| | | * 管çåè§è²æéæ è¯ |
| | | */ |
| | | public static final String SUPER_ADMIN = "admin"; |
| | | |
| | | /** |
| | | * è§è²æéåé符 |
| | | */ |
| | | public static final String ROLE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * æéæ è¯åé符 |
| | | */ |
| | | public static final String PERMISSION_DELIMETER = ","; |
| | | |
| | | /** |
| | | * éªè¯ç æææï¼åéï¼ |
| | | */ |
| | | public static final Integer CAPTCHA_EXPIRATION = 2; |
| | | |
| | | /** |
| | | * 令ç |
| | | */ |
| | | public static final String TOKEN = "token"; |
| | | |
| | | /** |
| | | * 令çåç¼ |
| | | */ |
| | | public static final String TOKEN_PREFIX = "Bearer "; |
| | | |
| | | /** |
| | | * 令çåç¼ |
| | | */ |
| | | public static final String LOGIN_USER_KEY = "login_user_key"; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | public static final String JWT_USERID = "userid"; |
| | | |
| | | /** |
| | | * ç¨æ·åç§° |
| | | */ |
| | | public static final String JWT_USERNAME = Claims.SUBJECT; |
| | | |
| | | /** |
| | | * ç¨æ·å¤´å |
| | | */ |
| | | public static final String JWT_AVATAR = "avatar"; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | public static final String JWT_CREATED = "created"; |
| | | |
| | | /** |
| | | * ç¨æ·æé |
| | | */ |
| | | public static final String JWT_AUTHORITIES = "authorities"; |
| | | |
| | | /** |
| | | * èµæºæ å°è·¯å¾ åç¼ |
| | | */ |
| | | public static final String RESOURCE_PREFIX = "/profile"; |
| | | |
| | | /** |
| | | * RMI è¿ç¨æ¹æ³è°ç¨ |
| | | */ |
| | | public static final String LOOKUP_RMI = "rmi:"; |
| | | |
| | | /** |
| | | * LDAP è¿ç¨æ¹æ³è°ç¨ |
| | | */ |
| | | public static final String LOOKUP_LDAP = "ldap:"; |
| | | |
| | | /** |
| | | * LDAPS è¿ç¨æ¹æ³è°ç¨ |
| | | */ |
| | | public static final String LOOKUP_LDAPS = "ldaps:"; |
| | | |
| | | /** |
| | | * èªå¨è¯å«json对象ç½ååé
ç½®ï¼ä»
å
许解æçå
åï¼èå´è¶å°è¶å®å
¨ï¼ |
| | | */ |
| | | public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" }; |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡ç½ååé
ç½®ï¼ä»
å
许访é®çå
åï¼å¦å
¶ä»éè¦å¯ä»¥èªè¡æ·»å ï¼ |
| | | */ |
| | | public static final String[] JOB_WHITELIST_STR = { "com.ruoyi.quartz.task" }; |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡è¿è§çå符 |
| | | */ |
| | | public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", |
| | | "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" }; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * 代ç çæéç¨å¸¸é |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GenConstants |
| | | { |
| | | /** å表ï¼å¢å æ¹æ¥ï¼ */ |
| | | public static final String TPL_CRUD = "crud"; |
| | | |
| | | /** æ 表ï¼å¢å æ¹æ¥ï¼ */ |
| | | public static final String TPL_TREE = "tree"; |
| | | |
| | | /** 主å表ï¼å¢å æ¹æ¥ï¼ */ |
| | | public static final String TPL_SUB = "sub"; |
| | | |
| | | /** æ ç¼ç åæ®µ */ |
| | | public static final String TREE_CODE = "treeCode"; |
| | | |
| | | /** æ ç¶ç¼ç åæ®µ */ |
| | | public static final String TREE_PARENT_CODE = "treeParentCode"; |
| | | |
| | | /** æ åç§°åæ®µ */ |
| | | public static final String TREE_NAME = "treeName"; |
| | | |
| | | /** ä¸çº§èåIDåæ®µ */ |
| | | public static final String PARENT_MENU_ID = "parentMenuId"; |
| | | |
| | | /** ä¸çº§èååç§°åæ®µ */ |
| | | public static final String PARENT_MENU_NAME = "parentMenuName"; |
| | | |
| | | /** æ°æ®åºå符串类å */ |
| | | public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; |
| | | |
| | | /** æ°æ®åºææ¬ç±»å */ |
| | | public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; |
| | | |
| | | /** æ°æ®åºæ¶é´ç±»å */ |
| | | public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; |
| | | |
| | | /** æ°æ®åºæ°åç±»å */ |
| | | public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", |
| | | "bit", "bigint", "float", "double", "decimal" }; |
| | | |
| | | /** 页é¢ä¸éè¦ç¼è¾å段 */ |
| | | public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; |
| | | |
| | | /** 页é¢ä¸éè¦æ¾ç¤ºçåè¡¨åæ®µ */ |
| | | public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time" }; |
| | | |
| | | /** 页é¢ä¸éè¦æ¥è¯¢å段 */ |
| | | public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", |
| | | "update_time", "remark" }; |
| | | |
| | | /** Entityåºç±»å段 */ |
| | | public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; |
| | | |
| | | /** Treeåºç±»å段 */ |
| | | public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; |
| | | |
| | | /** ææ¬æ¡ */ |
| | | public static final String HTML_INPUT = "input"; |
| | | |
| | | /** ææ¬å */ |
| | | public static final String HTML_TEXTAREA = "textarea"; |
| | | |
| | | /** ä¸ææ¡ */ |
| | | public static final String HTML_SELECT = "select"; |
| | | |
| | | /** åéæ¡ */ |
| | | public static final String HTML_RADIO = "radio"; |
| | | |
| | | /** å¤éæ¡ */ |
| | | public static final String HTML_CHECKBOX = "checkbox"; |
| | | |
| | | /** æ¥ææ§ä»¶ */ |
| | | public static final String HTML_DATETIME = "datetime"; |
| | | |
| | | /** å¾çä¸ä¼ æ§ä»¶ */ |
| | | public static final String HTML_IMAGE_UPLOAD = "imageUpload"; |
| | | |
| | | /** æä»¶ä¸ä¼ æ§ä»¶ */ |
| | | public static final String HTML_FILE_UPLOAD = "fileUpload"; |
| | | |
| | | /** å¯ææ¬æ§ä»¶ */ |
| | | public static final String HTML_EDITOR = "editor"; |
| | | |
| | | /** å符串类å */ |
| | | public static final String TYPE_STRING = "String"; |
| | | |
| | | /** æ´å */ |
| | | public static final String TYPE_INTEGER = "Integer"; |
| | | |
| | | /** é¿æ´å */ |
| | | public static final String TYPE_LONG = "Long"; |
| | | |
| | | /** æµ®ç¹å */ |
| | | public static final String TYPE_DOUBLE = "Double"; |
| | | |
| | | /** é«ç²¾åº¦è®¡ç®ç±»å */ |
| | | public static final String TYPE_BIGDECIMAL = "BigDecimal"; |
| | | |
| | | /** æ¶é´ç±»å */ |
| | | public static final String TYPE_DATE = "Date"; |
| | | |
| | | /** æ¨¡ç³æ¥è¯¢ */ |
| | | public static final String QUERY_LIKE = "LIKE"; |
| | | |
| | | /** ç¸çæ¥è¯¢ */ |
| | | public static final String QUERY_EQ = "EQ"; |
| | | |
| | | /** éè¦ */ |
| | | public static final String REQUIRE = "1"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * è¿åç¶æç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class HttpStatus |
| | | { |
| | | /** |
| | | * æä½æå |
| | | */ |
| | | public static final int SUCCESS = 200; |
| | | |
| | | /** |
| | | * 对象å建æå |
| | | */ |
| | | public static final int CREATED = 201; |
| | | |
| | | /** |
| | | * 请æ±å·²ç»è¢«æ¥å |
| | | */ |
| | | public static final int ACCEPTED = 202; |
| | | |
| | | /** |
| | | * æä½å·²ç»æ§è¡æåï¼ä½æ¯æ²¡æè¿åæ°æ® |
| | | */ |
| | | public static final int NO_CONTENT = 204; |
| | | |
| | | /** |
| | | * èµæºå·²è¢«ç§»é¤ |
| | | */ |
| | | public static final int MOVED_PERM = 301; |
| | | |
| | | /** |
| | | * éå®å |
| | | */ |
| | | public static final int SEE_OTHER = 303; |
| | | |
| | | /** |
| | | * èµæºæ²¡æè¢«ä¿®æ¹ |
| | | */ |
| | | public static final int NOT_MODIFIED = 304; |
| | | |
| | | /** |
| | | * åæ°å表é误ï¼ç¼ºå°ï¼æ ¼å¼ä¸å¹é
ï¼ |
| | | */ |
| | | public static final int BAD_REQUEST = 400; |
| | | |
| | | /** |
| | | * æªææ |
| | | */ |
| | | public static final int UNAUTHORIZED = 401; |
| | | |
| | | /** |
| | | * 访é®åéï¼ææè¿æ |
| | | */ |
| | | public static final int FORBIDDEN = 403; |
| | | |
| | | /** |
| | | * èµæºï¼æå¡æªæ¾å° |
| | | */ |
| | | public static final int NOT_FOUND = 404; |
| | | |
| | | /** |
| | | * ä¸å
许çhttpæ¹æ³ |
| | | */ |
| | | public static final int BAD_METHOD = 405; |
| | | |
| | | /** |
| | | * èµæºå²çªï¼æè
èµæºè¢«é |
| | | */ |
| | | public static final int CONFLICT = 409; |
| | | |
| | | /** |
| | | * 䏿¯æçæ°æ®ï¼åªä½ç±»å |
| | | */ |
| | | public static final int UNSUPPORTED_TYPE = 415; |
| | | |
| | | /** |
| | | * ç³»ç»å
é¨é误 |
| | | */ |
| | | public static final int ERROR = 500; |
| | | |
| | | /** |
| | | * æ¥å£æªå®ç° |
| | | */ |
| | | public static final int NOT_IMPLEMENTED = 501; |
| | | |
| | | /** |
| | | * ç³»ç»è¦åæ¶æ¯ |
| | | */ |
| | | public static final int WARN = 601; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * ä»»å¡è°åº¦éç¨å¸¸é |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class ScheduleConstants |
| | | { |
| | | public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; |
| | | |
| | | /** æ§è¡ç®æ key */ |
| | | public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; |
| | | |
| | | /** é»è®¤ */ |
| | | public static final String MISFIRE_DEFAULT = "0"; |
| | | |
| | | /** ç«å³è§¦åæ§è¡ */ |
| | | public static final String MISFIRE_IGNORE_MISFIRES = "1"; |
| | | |
| | | /** 触å䏿¬¡æ§è¡ */ |
| | | public static final String MISFIRE_FIRE_AND_PROCEED = "2"; |
| | | |
| | | /** ä¸è§¦åç«å³æ§è¡ */ |
| | | public static final String MISFIRE_DO_NOTHING = "3"; |
| | | |
| | | public enum Status |
| | | { |
| | | /** |
| | | * æ£å¸¸ |
| | | */ |
| | | NORMAL("0"), |
| | | /** |
| | | * æå |
| | | */ |
| | | PAUSE("1"); |
| | | |
| | | private String value; |
| | | |
| | | private Status(String value) |
| | | { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getValue() |
| | | { |
| | | return value; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.constant; |
| | | |
| | | /** |
| | | * ç¨æ·å¸¸éä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class UserConstants |
| | | { |
| | | /** |
| | | * å¹³å°å
ç³»ç»ç¨æ·çå¯ä¸æ å¿ |
| | | */ |
| | | public static final String SYS_USER = "SYS_USER"; |
| | | |
| | | /** æ£å¸¸ç¶æ */ |
| | | public static final String NORMAL = "0"; |
| | | |
| | | /** å¼å¸¸ç¶æ */ |
| | | public static final String EXCEPTION = "1"; |
| | | |
| | | /** ç¨æ·å°ç¦ç¶æ */ |
| | | public static final String USER_DISABLE = "1"; |
| | | |
| | | /** è§è²æ£å¸¸ç¶æ */ |
| | | public static final String ROLE_NORMAL = "0"; |
| | | |
| | | /** è§è²å°ç¦ç¶æ */ |
| | | public static final String ROLE_DISABLE = "1"; |
| | | |
| | | /** é¨é¨æ£å¸¸ç¶æ */ |
| | | public static final String DEPT_NORMAL = "0"; |
| | | |
| | | /** é¨é¨åç¨ç¶æ */ |
| | | public static final String DEPT_DISABLE = "1"; |
| | | |
| | | /** åå
¸æ£å¸¸ç¶æ */ |
| | | public static final String DICT_NORMAL = "0"; |
| | | |
| | | /** æ¯å¦ä¸ºç³»ç»é»è®¤ï¼æ¯ï¼ */ |
| | | public static final String YES = "Y"; |
| | | |
| | | /** æ¯å¦èåå¤é¾ï¼æ¯ï¼ */ |
| | | public static final String YES_FRAME = "0"; |
| | | |
| | | /** æ¯å¦èåå¤é¾ï¼å¦ï¼ */ |
| | | public static final String NO_FRAME = "1"; |
| | | |
| | | /** èåç±»åï¼ç®å½ï¼ */ |
| | | public static final String TYPE_DIR = "M"; |
| | | |
| | | /** èåç±»åï¼èåï¼ */ |
| | | public static final String TYPE_MENU = "C"; |
| | | |
| | | /** èåç±»åï¼æé®ï¼ */ |
| | | public static final String TYPE_BUTTON = "F"; |
| | | |
| | | /** Layoutç»ä»¶æ è¯ */ |
| | | public final static String LAYOUT = "Layout"; |
| | | |
| | | /** ParentViewç»ä»¶æ è¯ */ |
| | | public final static String PARENT_VIEW = "ParentView"; |
| | | |
| | | /** InnerLinkç»ä»¶æ è¯ */ |
| | | public final static String INNER_LINK = "InnerLink"; |
| | | |
| | | /** æ ¡éªæ¯å¦å¯ä¸çè¿åæ è¯ */ |
| | | public final static boolean UNIQUE = true; |
| | | public final static boolean NOT_UNIQUE = false; |
| | | |
| | | /** |
| | | * ç¨æ·åé¿åº¦éå¶ |
| | | */ |
| | | public static final int USERNAME_MIN_LENGTH = 2; |
| | | public static final int USERNAME_MAX_LENGTH = 20; |
| | | |
| | | /** |
| | | * å¯ç é¿åº¦éå¶ |
| | | */ |
| | | public static final int PASSWORD_MIN_LENGTH = 5; |
| | | public static final int PASSWORD_MAX_LENGTH = 20; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.controller; |
| | | |
| | | import java.beans.PropertyEditorSupport; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.WebDataBinder; |
| | | import org.springframework.web.bind.annotation.InitBinder; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.PageDomain; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.page.TableSupport; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.sql.SqlUtil; |
| | | |
| | | /** |
| | | * webå±éç¨æ°æ®å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseController |
| | | { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | /** |
| | | * å°åå°ä¼ éè¿æ¥çæ¥ææ ¼å¼çå符串ï¼èªå¨è½¬å为Dateç±»å |
| | | */ |
| | | @InitBinder |
| | | public void initBinder(WebDataBinder binder) |
| | | { |
| | | // Date ç±»åè½¬æ¢ |
| | | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() |
| | | { |
| | | @Override |
| | | public void setAsText(String text) |
| | | { |
| | | setValue(DateUtils.parseDate(text)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 设置请æ±åé¡µæ°æ® |
| | | */ |
| | | protected void startPage() |
| | | { |
| | | PageUtils.startPage(); |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è¯·æ±æåºæ°æ® |
| | | */ |
| | | protected void startOrderBy() |
| | | { |
| | | PageDomain pageDomain = TableSupport.buildPageRequest(); |
| | | if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) |
| | | { |
| | | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); |
| | | PageHelper.orderBy(orderBy); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¸
çå页ç线ç¨åé |
| | | */ |
| | | protected void clearPage() |
| | | { |
| | | PageUtils.clearPage(); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¯·æ±åé¡µæ°æ® |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("æ¥è¯¢æå"); |
| | | rspData.setRows(list); |
| | | rspData.setTotal(new PageInfo(list).getTotal()); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * è¿åæå |
| | | */ |
| | | public AjaxResult success() |
| | | { |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * è¿åå¤±è´¥æ¶æ¯ |
| | | */ |
| | | public AjaxResult error() |
| | | { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | */ |
| | | public AjaxResult success(String message) |
| | | { |
| | | return AjaxResult.success(message); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | */ |
| | | public AjaxResult success(Object data) |
| | | { |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åå¤±è´¥æ¶æ¯ |
| | | */ |
| | | public AjaxResult error(String message) |
| | | { |
| | | return AjaxResult.error(message); |
| | | } |
| | | |
| | | /** |
| | | * è¿åè¦åæ¶æ¯ |
| | | */ |
| | | public AjaxResult warn(String message) |
| | | { |
| | | return AjaxResult.warn(message); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¿åç»æ |
| | | * |
| | | * @param rows å½±åè¡æ° |
| | | * @return æä½ç»æ |
| | | */ |
| | | protected AjaxResult toAjax(int rows) |
| | | { |
| | | return rows > 0 ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¿åç»æ |
| | | * |
| | | * @param result ç»æ |
| | | * @return æä½ç»æ |
| | | */ |
| | | protected AjaxResult toAjax(boolean result) |
| | | { |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | /** |
| | | * 页é¢è·³è½¬ |
| | | */ |
| | | public String redirect(String url) |
| | | { |
| | | return StringUtils.format("redirect:{}", url); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ç¼åä¿¡æ¯ |
| | | */ |
| | | public LoginUser getLoginUser() |
| | | { |
| | | return SecurityUtils.getLoginUser(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½ç¨æ·id |
| | | */ |
| | | public Long getUserId() |
| | | { |
| | | return getLoginUser().getUserId(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½é¨é¨id |
| | | */ |
| | | public Long getDeptId() |
| | | { |
| | | return getLoginUser().getDeptId(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½ç¨æ·å |
| | | */ |
| | | public String getUsername() |
| | | { |
| | | return getLoginUser().getUsername(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Objects; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * æä½æ¶æ¯æé |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class AjaxResult extends HashMap<String, Object> |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ç¶æç */ |
| | | public static final String CODE_TAG = "code"; |
| | | |
| | | /** è¿åå
容 */ |
| | | public static final String MSG_TAG = "msg"; |
| | | |
| | | /** æ°æ®å¯¹è±¡ */ |
| | | public static final String DATA_TAG = "data"; |
| | | |
| | | /** |
| | | * åå§åä¸ä¸ªæ°å建ç AjaxResult 对象ï¼ä½¿å
¶è¡¨ç¤ºä¸ä¸ªç©ºæ¶æ¯ã |
| | | */ |
| | | public AjaxResult() |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * åå§åä¸ä¸ªæ°å建ç AjaxResult 对象 |
| | | * |
| | | * @param code ç¶æç |
| | | * @param msg è¿åå
容 |
| | | */ |
| | | public AjaxResult(int code, String msg) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | } |
| | | |
| | | /** |
| | | * åå§åä¸ä¸ªæ°å建ç AjaxResult 对象 |
| | | * |
| | | * @param code ç¶æç |
| | | * @param msg è¿åå
容 |
| | | * @param data æ°æ®å¯¹è±¡ |
| | | */ |
| | | public AjaxResult(int code, String msg, Object data) |
| | | { |
| | | super.put(CODE_TAG, code); |
| | | super.put(MSG_TAG, msg); |
| | | if (StringUtils.isNotNull(data)) |
| | | { |
| | | super.put(DATA_TAG, data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | * |
| | | * @return æåæ¶æ¯ |
| | | */ |
| | | public static AjaxResult success() |
| | | { |
| | | return AjaxResult.success("æä½æå"); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ°æ® |
| | | * |
| | | * @return æåæ¶æ¯ |
| | | */ |
| | | public static AjaxResult success(Object data) |
| | | { |
| | | return AjaxResult.success("æä½æå", data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @return æåæ¶æ¯ |
| | | */ |
| | | public static AjaxResult success(String msg) |
| | | { |
| | | return AjaxResult.success(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @param data æ°æ®å¯¹è±¡ |
| | | * @return æåæ¶æ¯ |
| | | */ |
| | | public static AjaxResult success(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.SUCCESS, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åè¦åæ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @return è¦åæ¶æ¯ |
| | | */ |
| | | public static AjaxResult warn(String msg) |
| | | { |
| | | return AjaxResult.warn(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * è¿åè¦åæ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @param data æ°æ®å¯¹è±¡ |
| | | * @return è¦åæ¶æ¯ |
| | | */ |
| | | public static AjaxResult warn(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.WARN, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åéè¯¯æ¶æ¯ |
| | | * |
| | | * @return éè¯¯æ¶æ¯ |
| | | */ |
| | | public static AjaxResult error() |
| | | { |
| | | return AjaxResult.error("æä½å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * è¿åéè¯¯æ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @return éè¯¯æ¶æ¯ |
| | | */ |
| | | public static AjaxResult error(String msg) |
| | | { |
| | | return AjaxResult.error(msg, null); |
| | | } |
| | | |
| | | /** |
| | | * è¿åéè¯¯æ¶æ¯ |
| | | * |
| | | * @param msg è¿åå
容 |
| | | * @param data æ°æ®å¯¹è±¡ |
| | | * @return éè¯¯æ¶æ¯ |
| | | */ |
| | | public static AjaxResult error(String msg, Object data) |
| | | { |
| | | return new AjaxResult(HttpStatus.ERROR, msg, data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åéè¯¯æ¶æ¯ |
| | | * |
| | | * @param code ç¶æç |
| | | * @param msg è¿åå
容 |
| | | * @return éè¯¯æ¶æ¯ |
| | | */ |
| | | public static AjaxResult error(int code, String msg) |
| | | { |
| | | return new AjaxResult(code, msg, null); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºæåæ¶æ¯ |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public boolean isSuccess() |
| | | { |
| | | return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºè¦åæ¶æ¯ |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public boolean isWarn() |
| | | { |
| | | return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºéè¯¯æ¶æ¯ |
| | | * |
| | | * @return ç»æ |
| | | */ |
| | | public boolean isError() |
| | | { |
| | | return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ä¾¿é¾å¼è°ç¨ |
| | | * |
| | | * @param key é® |
| | | * @param value å¼ |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public AjaxResult put(String key, Object value) |
| | | { |
| | | super.put(key, value); |
| | | return this; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | /** |
| | | * Entityåºç±» |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseEntity implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** æç´¢å¼ */ |
| | | @JsonIgnore |
| | | private String searchValue; |
| | | |
| | | /** å建è
*/ |
| | | private String createBy; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | private String updateBy; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** 夿³¨ */ |
| | | private String remark; |
| | | |
| | | /** 请æ±åæ° */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | private Map<String, Object> params; |
| | | |
| | | public String getSearchValue() |
| | | { |
| | | return searchValue; |
| | | } |
| | | |
| | | public void setSearchValue(String searchValue) |
| | | { |
| | | this.searchValue = searchValue; |
| | | } |
| | | |
| | | public String getCreateBy() |
| | | { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) |
| | | { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() |
| | | { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) |
| | | { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() |
| | | { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) |
| | | { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() |
| | | { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) |
| | | { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getRemark() |
| | | { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) |
| | | { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Map<String, Object> getParams() |
| | | { |
| | | if (params == null) |
| | | { |
| | | params = new HashMap<>(); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | public void setParams(Map<String, Object> params) |
| | | { |
| | | this.params = params; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MinioResult { |
| | | @ApiModelProperty("minioä¸çæä»¶åç§°") |
| | | private String bucketFileName; |
| | | |
| | | @ApiModelProperty("æºæä»¶åç§°") |
| | | private String originalName; |
| | | |
| | | @ApiModelProperty("é¢è§è·¯å¾") |
| | | private String previewExpiry; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | |
| | | /** |
| | | * ååºä¿¡æ¯ä¸»ä½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class Result<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** æå */ |
| | | public static final int SUCCESS = HttpStatus.SUCCESS; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = HttpStatus.ERROR; |
| | | |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private T data; |
| | | |
| | | public static <T> Result<T> success() |
| | | { |
| | | return restResult(null, SUCCESS, "æä½æå"); |
| | | } |
| | | |
| | | public static <T> Result<T> success(T data) |
| | | { |
| | | return restResult(data, SUCCESS, "æä½æå"); |
| | | } |
| | | |
| | | public static <T> Result<T> success(T data, String msg) |
| | | { |
| | | return restResult(data, SUCCESS, msg); |
| | | } |
| | | |
| | | public static <T> Result<T> fail() |
| | | { |
| | | return restResult(null, FAIL, "æä½å¤±è´¥"); |
| | | } |
| | | |
| | | public static <T> Result<T> fail(String msg) |
| | | { |
| | | return restResult(null, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> Result<T> fail(T data) |
| | | { |
| | | return restResult(data, FAIL, "æä½å¤±è´¥"); |
| | | } |
| | | |
| | | public static <T> Result<T> fail(T data, String msg) |
| | | { |
| | | return restResult(data, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> Result<T> fail(int code, String msg) |
| | | { |
| | | return restResult(null, code, msg); |
| | | } |
| | | |
| | | private static <T> Result<T> restResult(T data, int code, String msg) |
| | | { |
| | | Result<T> apiResult = new Result<>(); |
| | | apiResult.setCode(code); |
| | | apiResult.setData(data); |
| | | apiResult.setMsg(msg); |
| | | return apiResult; |
| | | } |
| | | |
| | | public int getCode() |
| | | { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) |
| | | { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() |
| | | { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) |
| | | { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() |
| | | { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) |
| | | { |
| | | this.data = data; |
| | | } |
| | | |
| | | public static <T> Boolean isError(Result<T> ret) |
| | | { |
| | | return !isSuccess(ret); |
| | | } |
| | | |
| | | public static <T> Boolean isSuccess(Result<T> ret) |
| | | { |
| | | return Result.SUCCESS == ret.getCode(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Treeåºç±» |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeEntity extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ç¶èååç§° */ |
| | | private String parentName; |
| | | |
| | | /** ç¶èåID */ |
| | | private Long parentId; |
| | | |
| | | /** æ¾ç¤ºé¡ºåº */ |
| | | private Integer orderNum; |
| | | |
| | | /** ç¥çº§å表 */ |
| | | private String ancestors; |
| | | |
| | | /** åé¨é¨ */ |
| | | private List<?> children = new ArrayList<>(); |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | public List<?> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<?> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * Treeselectæ ç»æå®ä½ç±» |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TreeSelect implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** èç¹ID */ |
| | | private Long id; |
| | | |
| | | /** èç¹åç§° */ |
| | | private String label; |
| | | |
| | | /** èç¹ç¦ç¨ */ |
| | | private boolean disabled = false; |
| | | |
| | | /** åèç¹ */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | private List<TreeSelect> children; |
| | | |
| | | public TreeSelect() |
| | | { |
| | | |
| | | } |
| | | |
| | | public TreeSelect(SysDept dept) |
| | | { |
| | | this.id = dept.getDeptId(); |
| | | this.label = dept.getDeptName(); |
| | | this.disabled = StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()); |
| | | this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public TreeSelect(SysMenu menu) |
| | | { |
| | | this.id = menu.getMenuId(); |
| | | this.label = menu.getMenuName(); |
| | | this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getLabel() |
| | | { |
| | | return label; |
| | | } |
| | | |
| | | public void setLabel(String label) |
| | | { |
| | | this.label = label; |
| | | } |
| | | |
| | | public boolean isDisabled() |
| | | { |
| | | return disabled; |
| | | } |
| | | |
| | | public void setDisabled(boolean disabled) |
| | | { |
| | | this.disabled = disabled; |
| | | } |
| | | |
| | | public List<TreeSelect> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<TreeSelect> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @TableName("custom") |
| | | public class Custom implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String company; |
| | | |
| | | @ApiModelProperty(value = "åä½å°å") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "å·¥åå") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "客æ·ç¼å·") |
| | | private String code2; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºæ¥æ") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "客æ·åä½EN") |
| | | private String companyEn; |
| | | |
| | | @ApiModelProperty(value = "åä½å°åEN") |
| | | private String addressEn; |
| | | |
| | | @ApiModelProperty(value = "å æ¥é¢åº¦") |
| | | private Integer num; |
| | | |
| | | @ApiModelProperty(value = "åä½çµè¯") |
| | | private String phone; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * é¨é¨è¡¨ sys_dept |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDept extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** é¨é¨ID */ |
| | | private Long deptId; |
| | | |
| | | /** ç¶é¨é¨ID */ |
| | | private Long parentId; |
| | | |
| | | /** ç¥çº§å表 */ |
| | | private String ancestors; |
| | | |
| | | /** é¨é¨åç§° */ |
| | | private String deptName; |
| | | |
| | | /** æ¾ç¤ºé¡ºåº */ |
| | | private Integer orderNum; |
| | | |
| | | /** è´è´£äºº */ |
| | | private String leader; |
| | | |
| | | /** èç³»çµè¯ */ |
| | | private String phone; |
| | | |
| | | /** é®ç®± */ |
| | | private String email; |
| | | |
| | | /** é¨é¨ç¶æ:0æ£å¸¸,1åç¨ */ |
| | | private String status; |
| | | |
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */ |
| | | private String delFlag; |
| | | |
| | | /** ç¶é¨é¨åç§° */ |
| | | private String parentName; |
| | | |
| | | /** åé¨é¨ */ |
| | | private List<SysDept> children = new ArrayList<SysDept>(); |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getParentId() |
| | | { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) |
| | | { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public String getAncestors() |
| | | { |
| | | return ancestors; |
| | | } |
| | | |
| | | public void setAncestors(String ancestors) |
| | | { |
| | | this.ancestors = ancestors; |
| | | } |
| | | |
| | | @NotBlank(message = "é¨é¨åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 30, message = "é¨é¨åç§°é¿åº¦ä¸è½è¶
è¿30个å符") |
| | | public String getDeptName() |
| | | { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) |
| | | { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | public Integer getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public String getLeader() |
| | | { |
| | | return leader; |
| | | } |
| | | |
| | | public void setLeader(String leader) |
| | | { |
| | | this.leader = leader; |
| | | } |
| | | |
| | | @Size(min = 0, max = 11, message = "èç³»çµè¯é¿åº¦ä¸è½è¶
è¿11个å符") |
| | | public String getPhone() |
| | | { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) |
| | | { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | @Email(message = "é®ç®±æ ¼å¼ä¸æ£ç¡®") |
| | | @Size(min = 0, max = 50, message = "é®ç®±é¿åº¦ä¸è½è¶
è¿50个å符") |
| | | public String getEmail() |
| | | { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) |
| | | { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getParentName() |
| | | { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) |
| | | { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public List<SysDept> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<SysDept> children) |
| | | { |
| | | this.children = children; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("deptId", getDeptId()) |
| | | .append("parentId", getParentId()) |
| | | .append("ancestors", getAncestors()) |
| | | .append("deptName", getDeptName()) |
| | | .append("orderNum", getOrderNum()) |
| | | .append("leader", getLeader()) |
| | | .append("phone", getPhone()) |
| | | .append("email", getEmail()) |
| | | .append("status", getStatus()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * åå
¸æ°æ®è¡¨ sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictData extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** åå
¸ç¼ç */ |
| | | @Excel(name = "åå
¸ç¼ç ", cellType = ColumnType.NUMERIC) |
| | | private Long dictCode; |
| | | |
| | | /** åå
¸æåº */ |
| | | @Excel(name = "åå
¸æåº", cellType = ColumnType.NUMERIC) |
| | | private Long dictSort; |
| | | |
| | | /** åå
¸æ ç¾ */ |
| | | @Excel(name = "åå
¸æ ç¾") |
| | | private String dictLabel; |
| | | |
| | | /** åå
¸é®å¼ */ |
| | | @Excel(name = "åå
¸é®å¼") |
| | | private String dictValue; |
| | | |
| | | /** åå
¸ç±»å */ |
| | | @Excel(name = "åå
¸ç±»å") |
| | | private String dictType; |
| | | |
| | | /** æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼ */ |
| | | private String cssClass; |
| | | |
| | | /** è¡¨æ ¼åå
¸æ ·å¼ */ |
| | | private String listClass; |
| | | |
| | | /** æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼ */ |
| | | @Excel(name = "æ¯å¦é»è®¤", readConverterExp = "Y=æ¯,N=å¦") |
| | | private String isDefault; |
| | | |
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨") |
| | | private String status; |
| | | |
| | | public Long getDictCode() |
| | | { |
| | | return dictCode; |
| | | } |
| | | |
| | | public void setDictCode(Long dictCode) |
| | | { |
| | | this.dictCode = dictCode; |
| | | } |
| | | |
| | | public Long getDictSort() |
| | | { |
| | | return dictSort; |
| | | } |
| | | |
| | | public void setDictSort(Long dictSort) |
| | | { |
| | | this.dictSort = dictSort; |
| | | } |
| | | |
| | | @NotBlank(message = "åå
¸æ ç¾ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸æ ç¾é¿åº¦ä¸è½è¶
è¿100个å符") |
| | | public String getDictLabel() |
| | | { |
| | | return dictLabel; |
| | | } |
| | | |
| | | public void setDictLabel(String dictLabel) |
| | | { |
| | | this.dictLabel = dictLabel; |
| | | } |
| | | |
| | | @NotBlank(message = "åå
¸é®å¼ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸é®å¼é¿åº¦ä¸è½è¶
è¿100个å符") |
| | | public String getDictValue() |
| | | { |
| | | return dictValue; |
| | | } |
| | | |
| | | public void setDictValue(String dictValue) |
| | | { |
| | | this.dictValue = dictValue; |
| | | } |
| | | |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åé¿åº¦ä¸è½è¶
è¿100个å符") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | @Size(min = 0, max = 100, message = "æ ·å¼å±æ§é¿åº¦ä¸è½è¶
è¿100个å符") |
| | | public String getCssClass() |
| | | { |
| | | return cssClass; |
| | | } |
| | | |
| | | public void setCssClass(String cssClass) |
| | | { |
| | | this.cssClass = cssClass; |
| | | } |
| | | |
| | | public String getListClass() |
| | | { |
| | | return listClass; |
| | | } |
| | | |
| | | public void setListClass(String listClass) |
| | | { |
| | | this.listClass = listClass; |
| | | } |
| | | |
| | | public boolean getDefault() |
| | | { |
| | | return UserConstants.YES.equals(this.isDefault); |
| | | } |
| | | |
| | | public String getIsDefault() |
| | | { |
| | | return isDefault; |
| | | } |
| | | |
| | | public void setIsDefault(String isDefault) |
| | | { |
| | | this.isDefault = isDefault; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictCode", getDictCode()) |
| | | .append("dictSort", getDictSort()) |
| | | .append("dictLabel", getDictLabel()) |
| | | .append("dictValue", getDictValue()) |
| | | .append("dictType", getDictType()) |
| | | .append("cssClass", getCssClass()) |
| | | .append("listClass", getListClass()) |
| | | .append("isDefault", getIsDefault()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.core.domain.entity; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | import javax.validation.constraints.Size; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.annotation.Excel.ColumnType; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * åå
¸ç±»å表 sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class SysDictType extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** åå
¸ä¸»é® */ |
| | | @Excel(name = "åå
¸ä¸»é®", cellType = ColumnType.NUMERIC) |
| | | private Long dictId; |
| | | |
| | | /** åå
¸åç§° */ |
| | | @Excel(name = "åå
¸åç§°") |
| | | private String dictName; |
| | | |
| | | /** åå
¸ç±»å */ |
| | | @Excel(name = "åå
¸ç±»å") |
| | | private String dictType; |
| | | |
| | | /** ç¶æï¼0æ£å¸¸ 1åç¨ï¼ */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "0=æ£å¸¸,1=åç¨") |
| | | private String status; |
| | | |
| | | public Long getDictId() |
| | | { |
| | | return dictId; |
| | | } |
| | | |
| | | public void setDictId(Long dictId) |
| | | { |
| | | this.dictId = dictId; |
| | | } |
| | | |
| | | @NotBlank(message = "åå
¸åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»ååç§°é¿åº¦ä¸è½è¶
è¿100个å符") |
| | | public String getDictName() |
| | | { |
| | | return dictName; |
| | | } |
| | | |
| | | public void setDictName(String dictName) |
| | | { |
| | | this.dictName = dictName; |
| | | } |
| | | |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åç±»åé¿åº¦ä¸è½è¶
è¿100个å符") |
| | | @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "åå
¸ç±»åå¿
须以忝å¼å¤´ï¼ä¸åªè½ä¸ºï¼å°ååæ¯ï¼æ°åï¼ä¸æ»çº¿ï¼") |
| | | public String getDictType() |
| | | { |
| | | return dictType; |
| | | } |
| | | |
| | | public void setDictType(String dictType) |
| | | { |
| | | this.dictType = dictType; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("dictId", getDictId()) |
| | | .append("dictName", getDictName()) |
| | | .append("dictType", getDictType()) |
| | | .append("status", getStatus()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remark", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/User.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/DesensitizedType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/BlackListException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
ruoyi-common/src/main/java/com/ruoyi/common/handler/MybatisHandler.java
ruoyi-common/src/main/java/com/ruoyi/common/numgen/LambdaUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGenerator.java
ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberGeneratorModelHelper.java
ruoyi-common/src/main/java/com/ruoyi/common/numgen/NumberTableInfo.java
ruoyi-common/src/main/java/com/ruoyi/common/numgen/SerializedLambda.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/JackSonUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/QueryWrappers.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MinioUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java
ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java
ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java
ruoyi-framework/pom.xml
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBaseMapper.java
ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MyBatisPlusConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/mybatis_config/MySqlInjector.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java
ruoyi-generator/pom.xml
ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
ruoyi-generator/src/main/resources/generator.yml
ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
ruoyi-generator/src/main/resources/vm/java/domain.java.vm
ruoyi-generator/src/main/resources/vm/java/mapper.java.vm
ruoyi-generator/src/main/resources/vm/java/service.java.vm
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm
ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm
ruoyi-generator/src/main/resources/vm/js/api.js.vm
ruoyi-generator/src/main/resources/vm/sql/sql.vm
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm
ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
ruoyi-quartz/pom.xml
ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
ruoyi-system/pom.xml
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CustomMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/service/CustomService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/UserService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CustomServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserServiceImpl.java
ruoyi-system/src/main/resources/mapper/system/CustomMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
ry.bat
ry.sh |