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>