Merge remote-tracking branch 'origin/master'
已修改13个文件
已重命名5个文件
已删除1个文件
已添加13个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/LineChartVO.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/LineSeriesVO.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/HomeService.java ÐÞ¸Ä |
| | |
| | | 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; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/HomeServiceImpl.java ÐÞ¸Ä |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | |
| | | Map map= JsonUtil.jsonToPojo(JsonUtil.jsonToString(o),Map.class); |
| | | return String.valueOf(map.get("supplier")); |
| | | } |
| | | |
| | | public static String comparingByCode(Object o){ |
| | | Map map= JsonUtil.jsonToPojo(JsonUtil.jsonToString(o),Map.class); |
| | | return String.valueOf(map.get("code")); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | private String imName; |
| | | |
| | | private String iCode; |
| | | private String imCode; |
| | | |
| | | private Integer inspectionStatus; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | private String approver; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8") |
| | |
| | | public NonConformanceReviewVo getNonConformanceReviewVo(NonConformingFeedbackDto nonConformingFeedbackDto) { |
| | | QueryWrapper<NonConformanceReview>queryWrapper= new QueryWrapper<>(); |
| | | if (StringUtils.hasText(nonConformingFeedbackDto.getMaterialCode())){ |
| | | queryWrapper.lambda().and(a->a.eq(NonConformanceReview::getMaterialCode,nonConformingFeedbackDto.getMaterialCode())); |
| | | queryWrapper.lambda().and(a->a.like(NonConformanceReview::getMaterialCode,nonConformingFeedbackDto.getMaterialCode())); |
| | | } |
| | | if (StringUtils.hasText(nonConformingFeedbackDto.getMaterialName())){ |
| | | queryWrapper.lambda().and(a->a.eq(NonConformanceReview::getMaterialName,nonConformingFeedbackDto.getMaterialName())); |
| | | queryWrapper.lambda().and(a->a.like(NonConformanceReview::getMaterialName,nonConformingFeedbackDto.getMaterialName())); |
| | | } |
| | | if (StringUtils.hasText(nonConformingFeedbackDto.getInspectionCode())){ |
| | | queryWrapper.lambda().and(a->a.eq(NonConformanceReview::getInspectionCode,nonConformingFeedbackDto.getInspectionCode())); |
| | | queryWrapper.lambda().and(a->a.like(NonConformanceReview::getInspectionCode,nonConformingFeedbackDto.getInspectionCode())); |
| | | } |
| | | Page<NonConformanceReview> page = new Page<>(nonConformingFeedbackDto.getCurrentPage(), nonConformingFeedbackDto.getPageNum(), true); |
| | | IPage<NonConformanceReview> iPage = mapper.selectPage(page, queryWrapper); |
| | |
| | | |
| | | 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; |
| | |
| | | return allMap; |
| | | } |
| | | imInfos.forEach(l->{ |
| | | NameList.add(l.getICode()+"-"+l.getImName()); |
| | | projectByCodeAndNameDtos.add(new SelectProjectByCodeAndNameDto(l.getICode(),l.getImName())); |
| | | NameList.add(l.getImCode()+"-"+l.getImName()); |
| | | projectByCodeAndNameDtos.add(new SelectProjectByCodeAndNameDto(l.getImCode(),l.getImName())); |
| | | }); |
| | | List<ImInfo> imInfosAll = qualificationRateStatisticsMapper.selectProjection(projectByCodeAndNameDtos,dto); |
| | | int total = imInfosAll.size(); |
| | |
| | | AtomicInteger i=new AtomicInteger(0); |
| | | NameList.forEach(n->{ |
| | | imInfos.stream() |
| | | .filter(im-> Objects.equals(n,im.getICode()+"-"+im.getImName())) |
| | | .filter(im-> Objects.equals(n,im.getImCode()+"-"+im.getImName())) |
| | | .forEach(im->{ |
| | | i.set(im.getIprInfos().size()); |
| | | }); |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getSampleOptions() { |
| | | return qualificationRateStatisticsMapper.getSampleOptions(); |
| | | List<Map<String, Object>> sampleOptions = qualificationRateStatisticsMapper.getSampleOptions(); |
| | | //å»éæ ·å |
| | | List<Map<String, Object>> sampleOptionsDistinct = ArrayListUtil.oneObjectsDistinctByProperty(MapHandlerDto::comparingByCode, sampleOptions); |
| | | sampleOptionsDistinct.forEach(System.out::println); |
| | | return sampleOptionsDistinct; |
| | | } |
| | | |
| | | public static String getPercent(long x, long y) { |
| | |
| | | i.end_time endTime |
| | | FROM inspection i |
| | | INNER JOIN inspection_material im ON i.id = im.inspection_id |
| | | where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1) |
| | | where (i.state = 1 and im.state=1) |
| | | <if test="dto.beginDate!=null and dto.endDate!=null"> |
| | | DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate} |
| | | AND #{dto.endDate} |
| | |
| | | and im.name=#{dto.sample} |
| | | </if> |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.code=#{dto.code} |
| | | and im.code=#{dto.code} |
| | | </if> |
| | | </select> |
| | | <select id="selectProjectionsByCondition" resultMap="ImInfoMap"> |
| | |
| | | ipr.id iprId, |
| | | ipr.`name` iprName, |
| | | ipr.test_state testState, |
| | | i.code iCode, |
| | | im.code imCode, |
| | | i.type type |
| | | FROM |
| | | inspection i, |
| | |
| | | and im.name=#{dto.sample} |
| | | </if> |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.code=#{dto.code} |
| | | and im.code=#{dto.code} |
| | | </if> |
| | | </select> |
| | | <select id="selectProjection" resultMap="ImInfoMap"> |
| | |
| | | AND i.state = 1 |
| | | AND im.state = 1 |
| | | AND ipr.state = 1 |
| | | AND i.inspection_status is NOT NULL |
| | | AND ipr.test_state is not null |
| | | <if test="dto.beginDate!=null and dto.endDate!=null"> |
| | | DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate} |
| | | AND #{dto.endDate} |
| | |
| | | and im.name=#{dto.sample} |
| | | </if> |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.code=#{dto.code} |
| | | and im.code=#{dto.code} |
| | | </if> |
| | | and i.code in |
| | | and im.code in |
| | | <foreach collection="list" item="l" open="(" close=")" separator="," > |
| | | #{l.code} |
| | | </foreach> |
| | |
| | | i.end_time endTime |
| | | FROM inspection i |
| | | INNER JOIN inspection_material im ON i.id = im.inspection_id |
| | | where (i.state = 1 AND i.inspection_status is NOT NULL and im.state=1) |
| | | where (i.state = 1 and im.state=1) |
| | | <if test="dto.beginDate!=null and dto.endDate!=null"> |
| | | DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate} |
| | | AND #{dto.endDate} |
| | |
| | | and im.name=#{dto.sample} |
| | | </if> |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.code=#{dto.code} |
| | | and im.code=#{dto.code} |
| | | </if> |
| | | </select> |
| | | <select id="getSampleOptions" resultType="java.util.Map"> |
| | |
| | | i.inspection_status inspectionStatus, |
| | | i.start_time startTime, |
| | | i.end_time endTime, |
| | | i.`code` |
| | | im.`code` code |
| | | FROM |
| | | inspection i |
| | | INNER JOIN inspection_material im ON i.id = im.inspection_id |
| | | WHERE |
| | | ( i.state = 1 AND i.inspection_status IS NOT NULL AND im.state = 1 ) |
| | | ( i.state = 1 AND im.state = 1 ) |
| | | </select> |
| | | |
| | | <resultMap id="ImInfoMap" type="com.yuanchu.limslaboratory.pojo.ImInfo"> |
| | | <result property="imId" column="imId"/> |
| | | <result property="iCode" column="iCode"/> |
| | | <result property="imCode" column="imCode"/> |
| | | <result property="imName" column="imName"/> |
| | | <result property="startTime" column="startTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | |
| | | im.name materialName, |
| | | r.conclusion , |
| | | r.status , |
| | | r.approver approver, |
| | | check_time, |
| | | u.name |
| | | from lims_laboratory.report r |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | 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; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Api(tags = "å®éªå®¤-->3ãè§è²ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/role-manager") |
| | | public class RoleMangerController { |
| | | |
| | | @Resource |
| | | private RoleManagerService roleManagerService; |
| | | |
| | | @ApiOperation("è·åèååè½æ ") |
| | | @GetMapping("/getMenusTree") |
| | | public Result<?>getMenusTree() { |
| | | return Result.success(roleManagerService.getMenusTree()); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Menu; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Repository |
| | | public interface MenuMapper extends BaseMapper<Menu> { |
| | | |
| | | List<Menu> getMenuList(); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Data |
| | | public class Menu implements Serializable { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | private Integer value; |
| | | |
| | | /** |
| | | * èåå |
| | | */ |
| | | private String label; |
| | | |
| | | |
| | | /** |
| | | * ç¶çº§id |
| | | */ |
| | | private Integer parentId; |
| | | |
| | | /** |
| | | * å级èåä¿¡æ¯ |
| | | */ |
| | | private List<Menu> children; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Data |
| | | public class Role implements Serializable { |
| | | |
| | | |
| | | private Integer id; |
| | | |
| | | private Integer name; |
| | | |
| | | private LocalDateTime createTime; |
| | | |
| | | private LocalDateTime updateTime; |
| | | |
| | | private Integer state; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | public interface RoleManagerService { |
| | | Object getMenusTree(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.MenuMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Menu; |
| | | import com.yuanchu.limslaboratory.service.RoleManagerService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/23 |
| | | */ |
| | | @Service |
| | | public class RoleManagerServiceImpl implements RoleManagerService { |
| | | |
| | | @Resource |
| | | private MenuMapper menuMapper; |
| | | |
| | | @Override |
| | | public Object getMenusTree() { |
| | | List<Menu> menus = menuMapper.getMenuList(); |
| | | return menus.stream() |
| | | .filter(t -> t.getParentId() == 0) |
| | | .peek((menu) -> menu.setChildren(this.getEnumChildren(menu, menus))) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | private List<Menu> getEnumChildren(Menu root, List<Menu> all) { |
| | | return all.stream() |
| | | .filter(t -> Objects.equals(t.getParentId(), root.getValue())) |
| | | .peek(g -> { |
| | | //æ¾åèå |
| | | g.setChildren(getEnumChildren(g, all)); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.MenuMapper"> |
| | | |
| | | <select id="getMenuList" resultType="com.yuanchu.limslaboratory.pojo.Menu"> |
| | | select id value,name label,parent_id parentId |
| | | from menu |
| | | where state =1 |
| | | </select> |
| | | </mapper> |
| | |
| | | <module>inspection-server</module> |
| | | <module>laboratory-server</module> |
| | | <module>cnas-server</module> |
| | | <module>chart-server</module> |
| | | </modules> |
| | | |
| | | <properties> |
| | |
| | | @Autowired |
| | | private ProductModelService productModelService; |
| | | |
| | | |
| | | @ApiOperation(value = "éæ©æ ·ååç§°") |
| | | @GetMapping("/selectmater") |
| | | public Result selectmater() { |
| | | return Result.success(productModelService.selectmater()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ å-->鿩项ç®åç»") |
| | | @GetMapping("/selectfather") |
| | |
| | | public interface ProductModelService extends IService<ProductModel> { |
| | | |
| | | |
| | | /** |
| | | * éæ©æ ·å |
| | | * @return |
| | | */ |
| | | List<String> selectmater(); |
| | | |
| | | /** |
| | | * æ·»å æ å-->鿩项ç®åç» |
| | |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | |
| | | //éæ©æ ·å |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return productModelMapper.selectmater(); |
| | | } |
| | | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | | @Override |
| | | public List<String> selectfather() { |
| | |
| | | <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> |