zss
2023-08-23 36488ef509030773381ea67de9d1aa00ce25caf6
8-23 修改3.0
已修改6个文件
已重命名5个文件
已删除1个文件
已添加6个文件
1002 ■■■■■ 文件已修改
chart-server/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/controller/HomeController.java 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/controller/WorkController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/mapper/WorkMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/pojo/LineChartVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/pojo/LineSeriesVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/service/HomeService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/service/WorkService.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/service/impl/HomeServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/java/com/yuanchu/limslaboratory/service/impl/WorkServiceImpl.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/src/main/resources/mapper/WorkMapper.xml 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/PlanServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/lims.sql 590 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductModelController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductModelService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
chart-server/pom.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
<?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>lims-laboratory</artifactId>
        <groupId>com.yuanchu</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>chart-server</artifactId>
    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.yunchu.limslaboratory</groupId>
            <artifactId>framework</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.yunchu.limslaboratory</groupId>
            <artifactId>inspection-server</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>
</project>
chart-server/src/main/java/com/yuanchu/limslaboratory/controller/HomeController.java
chart-server/src/main/java/com/yuanchu/limslaboratory/controller/WorkController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.pojo.vo.ProjectNumVo;
import com.yuanchu.limslaboratory.service.WorkService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "智能图表-->工作统计")
@RestController
@RequestMapping("/work")
public class WorkController {
    @Resource
    WorkService workService;
    @ApiOperation("责任人项目数统计")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "startTime", value = "检验开始日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "endTime", value = "检验结束日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "type", value = "检验类型(0:原材料;1:成品;2:委托品)", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/dutyMater")
    public Result dutyMater(String startTime,String endTime,Integer type) {
        return Result.success(workService.dutyMater(startTime,endTime,type));
    }
    @ApiOperation("执行人项目数统计")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "startTime", value = "检验开始日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "endTime", value = "检验结束日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "type", value = "检验类型(0:原材料;1:成品;2:委托品)", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/executeMater")
    public Result executeMater(String startTime,String endTime,Integer type) {
        return Result.success(workService.executeMater(startTime,endTime,type));
    }
    @ApiOperation("责任人及时率")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "startTime", value = "检验开始日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "endTime", value = "检验结束日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "type", value = "检验类型(0:原材料;1:成品;2:委托品)", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/dutytimely")
    public Result dutytimely(String startTime,String endTime,Integer type) {
        return Result.success(workService.dutytimely(startTime,endTime,type));
    }
    @ApiOperation("执行人及时率")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "startTime", value = "检验开始日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "endTime", value = "检验结束日期", dataTypeClass = String.class, required = true),
            @ApiImplicitParam(name = "type", value = "检验类型(0:原材料;1:成品;2:委托品)", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/executetimely")
    public Result executetimely(String startTime,String endTime,Integer type) {
        return Result.success(workService.executetimely(startTime,endTime,type));
    }
}
chart-server/src/main/java/com/yuanchu/limslaboratory/mapper/WorkMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.yuanchu.limslaboratory.mapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface WorkMapper {
    //责任人项目数统计
    List<Map<String, Object>> dutyMater(String startTime, String endTime, Integer type);
    //执行人项目数统计
    List<Map<String, Object>> executeMater(String startTime, String endTime, Integer type);
    //责任人及时率
    List<Map<String, Object>> dutytimely(String startTime, String endTime, Integer type);
    //执行人及时率
    List<Map<String, Object>> executetimely(String startTime, String endTime, Integer type);
}
chart-server/src/main/java/com/yuanchu/limslaboratory/pojo/LineChartVO.java
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/LineChartVO.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.yuanchu.limslaboratory.pojo.vo;
package com.yuanchu.limslaboratory.pojo;
import lombok.Data;
chart-server/src/main/java/com/yuanchu/limslaboratory/pojo/LineSeriesVO.java
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/LineSeriesVO.java ÐÞ¸Ä
@@ -1,4 +1,4 @@
package com.yuanchu.limslaboratory.pojo.vo;
package com.yuanchu.limslaboratory.pojo;
import lombok.Data;
chart-server/src/main/java/com/yuanchu/limslaboratory/service/HomeService.java
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/HomeService.java ÐÞ¸Ä
@@ -1,6 +1,6 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.pojo.vo.LineChartVO;
import com.yuanchu.limslaboratory.pojo.LineChartVO;
import com.yuanchu.limslaboratory.pojo.vo.ProjectNumVo;
import com.yuanchu.limslaboratory.pojo.vo.StatisticsDataVo;
chart-server/src/main/java/com/yuanchu/limslaboratory/service/WorkService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.pojo.LineChartVO;
import java.util.List;
import java.util.Map;
public interface WorkService {
    /**
     * è´£ä»»äººé¡¹ç›®æ•°ç»Ÿè®¡
     * @param startTime
     * @param endTime
     * @param type
     * @return
     */
    List<Map<String,Object>> dutyMater(String startTime, String endTime, Integer type);
    /**
     * æ‰§è¡Œäººé¡¹ç›®æ•°ç»Ÿè®¡
     * @param startTime
     * @param endTime
     * @param type
     * @return
     */
    List<Map<String,Object>> executeMater(String startTime, String endTime, Integer type);
    /**
     * è´£ä»»äººåŠæ—¶çއ
     * @param startTime
     * @param endTime
     * @param type
     * @return
     */
    List<Map<String,Object>> dutytimely(String startTime, String endTime, Integer type);
    /**
     * æ‰§è¡ŒäººåŠæ—¶çއ
     * @param startTime
     * @param endTime
     * @param type
     * @return
     */
    List<Map<String,Object>> executetimely(String startTime, String endTime, Integer type);
}
chart-server/src/main/java/com/yuanchu/limslaboratory/service/impl/HomeServiceImpl.java
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/HomeServiceImpl.java ÐÞ¸Ä
@@ -2,8 +2,8 @@
import com.yuanchu.limslaboratory.mapper.InspectionMapper;
import com.yuanchu.limslaboratory.mapper.InspectionProductMapper;
import com.yuanchu.limslaboratory.pojo.vo.LineChartVO;
import com.yuanchu.limslaboratory.pojo.vo.LineSeriesVO;
import com.yuanchu.limslaboratory.pojo.LineChartVO;
import com.yuanchu.limslaboratory.pojo.LineSeriesVO;
import com.yuanchu.limslaboratory.pojo.vo.ProjectNumVo;
import com.yuanchu.limslaboratory.pojo.vo.StatisticsDataVo;
import com.yuanchu.limslaboratory.service.HomeService;
@@ -17,7 +17,6 @@
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
chart-server/src/main/java/com/yuanchu/limslaboratory/service/impl/WorkServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
package com.yuanchu.limslaboratory.service.impl;
import com.yuanchu.limslaboratory.mapper.WorkMapper;
import com.yuanchu.limslaboratory.pojo.LineChartVO;
import com.yuanchu.limslaboratory.service.WorkService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class WorkServiceImpl implements WorkService {
    @Resource
    WorkMapper workMapper;
    //责任人项目数统计
    @Override
    public List<Map<String,Object>> dutyMater(String startTime, String endTime, Integer type) {
        return  workMapper.dutyMater(startTime,endTime,type);
    }
    //执行人项目数统计
    @Override
    public List<Map<String,Object>> executeMater(String startTime, String endTime, Integer type) {
        return workMapper.executeMater(startTime,endTime,type);
    }
    //责任人及时率
    @Override
    public List<Map<String, Object>> dutytimely(String startTime, String endTime, Integer type) {
        return workMapper.dutytimely(startTime,endTime,type);
    }
    //执行人及时率
    @Override
    public List<Map<String, Object>> executetimely(String startTime, String endTime, Integer type) {
        return workMapper.executetimely(startTime,endTime,type);
    }
}
chart-server/src/main/resources/mapper/WorkMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,165 @@
<?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.yuanchu.limslaboratory.mapper.WorkMapper">
    <!--责任人项目数统计-->
    <select id="dutyMater" resultType="java.util.Map">
        select n.name, æœªå®Œæˆ, å·²å®Œæˆ
        from (select distinct user.name, count(inspection_product.id) '未完成'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
              where state = 1
                and test_state is null
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) n,
             (select distinct user.name, count(inspection_product.id) '已完成'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
              where state = 1
                and test_state is not null
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) y
        where n.name = y.name
    </select>
    <!--执行人项目数统计-->
    <select id="executeMater" resultType="java.util.Map">
        select n.name, æœªå®Œæˆ, å·²å®Œæˆ
        from (select distinct user.name, count(inspection_product.id) '未完成'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_id = user.id
              where state = 1
                and test_state is null
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) n,
             (select distinct user.name, count(inspection_product.id) '已完成'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_id = user.id
              where state = 1
                and test_state is not null
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) y
        where n.name = y.name
    </select>
    <!--责任人执行率-->
    <select id="dutytimely" resultType="java.util.Map">
        select n.name, é¡¹ç›®æ€»æ•°, åŠæ—¶å®Œæˆæ•° / é¡¹ç›®æ€»æ•° * 100 '及时率'
        from (select distinct user.name, count(inspection_product.id) '项目总数'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
              where state = 1
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) n,
             (select distinct user.name, count(inspection_product.id) '及时完成数'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user
                                 on inspection_product.user_pro_id = user.id
                       left join lims_laboratory.inspection_material im
                                 on inspection_product.inspection_material_id = im.id
                       left join lims_laboratory.inspection
                                 on im.inspection_id = inspection.id
              where inspection_product.state = 1
                and test_state is not null
                and inspection_product.update_time between start_time and end_time
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) y
        where n.name = y.name
    </select>
    <!--执行人及时率-->
    <select id="executetimely" resultType="java.util.Map">
        select n.name, é¡¹ç›®æ€»æ•°, åŠæ—¶å®Œæˆæ•° / é¡¹ç›®æ€»æ•° * 100 '及时率'
        from (select distinct user.name, count(inspection_product.id) '项目总数'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_id = user.id
              where state = 1
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from lims_laboratory.inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) n,
             (select distinct user.name, count(inspection_product.id) '及时完成数'
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user
                                 on inspection_product.user_id = user.id
                       left join lims_laboratory.inspection_material im
                                 on inspection_product.inspection_material_id = im.id
                       left join lims_laboratory.inspection
                                 on im.inspection_id = inspection.id
              where inspection_product.state = 1
                and test_state is not null
                and inspection_product.update_time between start_time and end_time
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
                     where inspection_material.state = 1
                       and inspection_id in
                           (select id
                            from inspection
                            where inspection.state = 1
                              and type = #{type}
                              and start_time between #{startTime} and #{endTime}))
              group by user.name) y
        where n.name = y.name
    </select>
</mapper>
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/PlanServiceImpl.java
@@ -11,6 +11,7 @@
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
pom.xml
@@ -23,6 +23,7 @@
        <module>inspection-server</module>
        <module>laboratory-server</module>
        <module>cnas-server</module>
        <module>chart-server</module>
    </modules>
    <properties>
sql/lims.sql
ÎļþÒÑɾ³ý
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/ProductModelController.java
@@ -34,7 +34,11 @@
    @Autowired
    private ProductModelService productModelService;
    @ApiOperation(value = "选择样品名称")
    @GetMapping("/selectmater")
    public Result selectmater() {
        return Result.success(productModelService.selectmater());
    }
    @ApiOperation(value = "添加标准-->选择项目分组")
    @GetMapping("/selectfather")
standard-server/src/main/java/com/yuanchu/limslaboratory/service/ProductModelService.java
@@ -18,6 +18,11 @@
public interface ProductModelService extends IService<ProductModel> {
    /**
     * é€‰æ‹©æ ·å“
     * @return
     */
    List<String> selectmater();
    /**
     * æ·»åŠ æ ‡å‡†-->选择项目分组
standard-server/src/main/java/com/yuanchu/limslaboratory/service/impl/ProductModelServiceImpl.java
@@ -29,6 +29,12 @@
    ProductModelMapper productModelMapper;
    //选择样品
    @Override
    public List<String> selectmater() {
        return productModelMapper.selectmater();
    }
    //添加标准-->选择项目分组
    @Override
    public List<String> selectfather() {
sys/pom.xml
@@ -56,6 +56,12 @@
            <artifactId>laboratory-server</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <!--智能图表模块-->
        <dependency>
            <groupId>com.yuanchu</groupId>
            <artifactId>chart-server</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <!--druid-->
        <dependency>