Merge remote-tracking branch 'origin/master'
# Conflicts:
# standard-server/src/main/resources/mapper/MaterialMapper.xml
已修改41个文件
已删除4个文件
已添加17个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Function; |
| | | import java.util.function.Predicate; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | */ |
| | | public class ArrayListUtil { |
| | | |
| | | /** |
| | | * åå¼éåå»é |
| | | * @param objList |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> List<T> singleValueDistinct(List<T>objList){ |
| | | return objList.stream().distinct().collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * åå¼éåæ¯è¾ ä¸»éåä¸ä¸æ¬¡éåä¸ç¸çæ°æ® |
| | | * @param mainList 主éå |
| | | * @param secondaryList 次è¦éå |
| | | * @param <T> |
| | | * @return 主éåä¸è·æ¬¡è¦éåä¸ç¸ççæ°æ® |
| | | */ |
| | | public static <T> List<T> compareNotEqualListBySingleValue(List<T>mainList,List<T>secondaryList){ |
| | | return mainList.stream().filter(item -> !secondaryList.stream() |
| | | .map(e -> e).distinct().collect(Collectors.toList()) |
| | | .contains(item)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * åå¼éåæ¯è¾ ä¸»éåä¸ä¸æ¬¡éåç¸çæ°æ® |
| | | * @param mainList 主éå |
| | | * @param secondaryList 次è¦éå |
| | | * @param <T> |
| | | * @return 主éåä¸è·æ¬¡è¦éåä¸ç¸ççæ°æ® |
| | | */ |
| | | public static <T> List<T> compareEqualListBySingleValue(List<T>mainList,List<T>secondaryList){ |
| | | return mainList.stream().filter(item -> secondaryList.stream() |
| | | .map(e -> e).collect(Collectors.toList()) |
| | | .contains(item)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * åå¼éååå¹¶ |
| | | * @param isDistinct |
| | | * @param values |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @SafeVarargs |
| | | public static <T> List<T> mergeListBySingleValue(boolean isDistinct, List<T>... values){ |
| | | //å»éåå¹¶ |
| | | if (isDistinct){ |
| | | return Stream.of(values).flatMap(Collection::stream).distinct().collect(Collectors.toList()); |
| | | } |
| | | return Stream.of(values).flatMap(Collection::stream).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * å个对象éåæ ¹æ®å¯¹è±¡å±æ§å»ééå |
| | | * @param keyExtractor |
| | | * @param objects |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> List<T> oneObjectsDistinctByProperty(Function<? super T, ?> keyExtractor,List<T> objects){ |
| | | List<T> newList = new ArrayList<>(); |
| | | objects.stream().filter(distinctByKey(keyExtractor)) //filterä¿çtrueçå¼ |
| | | .forEach(newList::add); |
| | | return newList; |
| | | } |
| | | |
| | | /** |
| | | * å¤å¯¹è±¡éååå¹¶æ ¹æ®å±æ§å»é |
| | | * @param objects |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @SafeVarargs |
| | | public static <T> List<T> mergeListByObjectsDistinct(Function<? super T, ?> keyExtractor,List<T>... objects){ |
| | | List<T> tList = mergeListByObjects(objects); |
| | | return oneObjectsDistinctByProperty(keyExtractor,tList); |
| | | } |
| | | |
| | | /** |
| | | * å¤å¯¹è±¡éååå¹¶æ éå»é éè½½ |
| | | * @param objects |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @SafeVarargs |
| | | public static <T> List<T> mergeListByObjectsDistinct(List<T>... objects){ |
| | | return mergeListByObjects(objects); |
| | | } |
| | | |
| | | private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
| | | Map<Object,Boolean> seen = new ConcurrentHashMap<>(); |
| | | //putIfAbsentæ¹æ³æ·»å é®å¼å¯¹ï¼å¦æmapéå䏿²¡æè¯¥key对åºçå¼ï¼åç´æ¥æ·»å ï¼å¹¶è¿ånullï¼å¦æå·²ç»åå¨å¯¹åºçå¼ï¼å便§ä¸ºåæ¥çå¼ã |
| | | //妿è¿ånullè¡¨ç¤ºæ·»å æ°æ®æå(ä¸éå¤)ï¼ä¸éå¤(null==null :TRUE) |
| | | return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; |
| | | } |
| | | |
| | | /** |
| | | * 对象éååå¹¶ |
| | | * @param objects |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | @SafeVarargs |
| | | private static <T> List<T> mergeListByObjects(List<T>... objects){ |
| | | return Stream.of(objects).flatMap(Collection::stream).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | */ |
| | | public class JsonUtil { |
| | | |
| | | private static ObjectMapper JSON_MAPPER = new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); |
| | | static { |
| | | JSON_MAPPER.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
| | | JSON_MAPPER.registerModule(new JavaTimeModule()); |
| | | } |
| | | |
| | | /** |
| | | * json转æ¢å¯¹åºå®ä½ |
| | | * @param json |
| | | * @param clazz |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> T jsonToPojo(String json, Class<T> clazz){ |
| | | T t=null; |
| | | try { |
| | | t=JSON_MAPPER.readValue(json,clazz); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return t; |
| | | } |
| | | |
| | | /** |
| | | * å®ä½è½¬æ¢æjsonå符 |
| | | * @param t |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | | public static <T> String jsonToString(T t){ |
| | | String result=null; |
| | | try { |
| | | result=JSON_MAPPER.writeValueAsString(t); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | */ |
| | | public class MapUtil{ |
| | | |
| | | |
| | | |
| | | /** |
| | | * Map䏿 ¹æ®keyæ¹éå é¤é®å¼å¯¹ |
| | | * @param map |
| | | * @param excludeKeys |
| | | * @param <K> |
| | | * @param <V> |
| | | * @return |
| | | */ |
| | | public static <K, V> Map removeEntries(Map<K, V> map, K[] excludeKeys) { |
| | | Iterator<K> iterator = map.keySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | K key = iterator.next(); |
| | | // 妿key å好å¨è¦æé¤çkeyçèå´ä¸ |
| | | if (ArrayUtils.contains(excludeKeys, key)) { |
| | | iterator.remove(); |
| | | map.remove(key); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | 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.stereotype.Service; |
| | | 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 zss |
| | | * @since 2023-08-03 13:03:36 |
| | | */ |
| | | @Api(tags = "é¦é¡µ") |
| | | @RestController |
| | | @RequestMapping("/home") |
| | | public class HomeController { |
| | | |
| | | @Resource |
| | | HomeService homeService; |
| | | |
| | | @ApiOperation("è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£") |
| | | @GetMapping("/checkProjectNum") |
| | | public Result checkProjectNum() { |
| | | ProjectNum projectNum=homeService.checkProjectNum(); |
| | | return Result.success(projectNum); |
| | | } |
| | | } |
| | |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.mapper.UserMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | |
| | | @Resource |
| | | LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªç³è¯·åå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | |
| | | case 0: |
| | | //åææ |
| | | return Result.success(rawMaterialService.selectRawmaAll()); |
| | | case 1: |
| | | case 2: |
| | | //å§æå |
| | | return Result.success(linkBasicInformationService.selectLinkAll()); |
| | | case 2: |
| | | case 1: |
| | | //æåæ£éª |
| | | return Result.success("请è¾å
¥æ£éªä¿¡æ¯!"); |
| | | } |
| | |
| | | return Result.success(inspectionService.selectInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "䏿¥(æ´æ°æ£éªç¶æ)") |
| | | @ApiOperation(value = "éæ©æ£éªé¡¹ç®ç责任人") |
| | | @GetMapping("/selectUser") |
| | | public Result selectUser() { |
| | | return Result.success(userMapper.selectUser()); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿åæ£éªé¡¹ç®è´£ä»»äºº") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªå项ç®id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userProId", value = "责任人id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseUseProId") |
| | | public Result chooseUseProId(Integer id,Integer userProId) { |
| | | return Result.success(inspectionService.chooseUseProId(id,userProId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½åºæ£éªå") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateInspectsById") |
| | | public Result updateInspectsById(Integer id) { |
| | | //妿已ç»ä¸æ¥äºä¸è½å䏿¬¡ä¸æ¥ |
| | | Inspection inspection = inspectionService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(inspection.getInspectionStatus())) { |
| | | return Result.fail("å·²ç»ä¸æ¥è¿äº,ä¸è½åæ¬¡ä¸æ¥!"); |
| | | } |
| | | return Result.success(inspectionService.updateInspectsById(id)); |
| | | @PostMapping("/delInspect") |
| | | public Result delInspect(Integer id) { |
| | | return Result.success(inspectionService.delInspect(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | |
| | | @ApiOperation("åé
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªé¡¹ç®id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userId", value = "æ£éªäººid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userId", value = "æ§è¡äººid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "instrumentId", value = "设å¤id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/distribution") |
| | | public Result distribution(Integer id, Integer userId, Integer instrumentId) { |
| | | return Result.success(planService.distribution(id, userId, instrumentId)); |
| | | } |
| | | |
| | | @ApiOperation("æ£éª") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªé¡¹ç®id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "value", value = "æ£éªå¼", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/check") |
| | | public Result check(Integer id, String value) { |
| | | return Result.success(planService.check(id, value)); |
| | | } |
| | | |
| | | @ApiOperation("䏿¥") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/reported") |
| | | public Result reported(Integer id) { |
| | | return Result.success(planService.reported(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SelectQualificationRateDto; |
| | | import com.yuanchu.limslaboratory.service.QualificationRateStatisticsService; |
| | | 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/21 |
| | | */ |
| | | @Api(tags = "è¯éªç®¡ç-->åæ ¼çç»è®¡") |
| | | @RequestMapping("/qualificationRate") |
| | | @RestController |
| | | public class QualificationRateStatisticsController { |
| | | |
| | | @Resource |
| | | private QualificationRateStatisticsService service; |
| | | |
| | | @ApiOperation("æ¥è¯¢ç³è¯·ç©æåä¾åºåå表") |
| | | @GetMapping("/getSupplierList") |
| | | public Result<?> getSupplierList() { |
| | | return Result.success(service.getSupplierList()); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªæ ·ååæ ¼çç»è®¡") |
| | | @GetMapping("/getTestSampleStatistics") |
| | | public Result<?> getTestSampleStatistics(SelectQualificationRateDto dto){ |
| | | return Result.success(service.getTestSampleStatistics(dto)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ä¾åºåä¸åæ ¼ç»è®¡æ¬¡æ°") |
| | | @GetMapping("/getSupplierNoPassStatistics") |
| | | public Result<?> getSupplierNoPassStatistics(SelectQualificationRateDto dto){ |
| | | return Result.success(service.getSupplierNoPassStatistics(dto)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ä¸åæ ¼é¡¹ç®ç»è®¡") |
| | | @GetMapping("/getNoPassProjectStatistics") |
| | | public Result<?> getNoPassProjectStatistics(SelectQualificationRateDto dto){ |
| | | return Result.success(service.getNoPassProjectStatistics(dto)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | import com.yuanchu.limslaboratory.service.ReportService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | |
| | | @RestController |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | |
| | | @Resource |
| | | private ReportService reportService; |
| | | |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("æäº¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ¥åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/submit") |
| | | public Result submit(Integer id) { |
| | | return Result.success(reportService.submit(id)); |
| | | } |
| | | |
| | | @ApiOperation("å®¡æ ¸") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ¥åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "result", value = "å®¡æ ¸ç»è®º", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/check") |
| | | public Result check(@RequestHeader("token") String token, Integer id, String result) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(reportService.check((String) unmarshal.get("name"), id, result)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªæ¥åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delreport") |
| | | public Result delreport(Integer id) { |
| | | return Result.success(reportService.delreport(id)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectInspectsList(Page<Object> page, String message); |
| | | |
| | | //计ç®å·²æ£éªæ£éªåæ°é |
| | | Integer seleCountIns(); |
| | | |
| | | //è®¡ç®æªæ£éªçæ°é |
| | | Integer seleCountUnIns(); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | |
| | | */ |
| | | public interface InspectionProductMapper extends BaseMapper<InspectionProduct> { |
| | | |
| | | //æ ¹æ®é¡¹ç®idå°å·²æçæ£éªç»è®ºæ¹ä¸ºnull |
| | | void upda(Integer id); |
| | | |
| | | //æ ¹æ®æ£éªåidæ¥è¯¢æ£éªé¡¹ç®çæ£éªç»æ |
| | | List<Integer> getresult(Integer id); |
| | | |
| | | //æ ¹æ®æ£éªæ ·åidä½åºæ£éªé¡¹ç® |
| | | void updat(Integer id); |
| | | |
| | | //计ç®å·²æ£éªé¡¹ç®æ°é |
| | | Integer seleCountInspro(); |
| | | |
| | | //è®¡ç®æªæ£éªé¡¹ç®æ°é |
| | | Integer seleCountUnInspro(); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SelectQualificationRateDto; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Repository |
| | | public interface QualificationRateStatisticsMapper { |
| | | |
| | | @MapKey("id") |
| | | List<Map<String, Object>>selectSupplierByCondition(@Param("dto") SelectQualificationRateDto dto); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | |
| | | /** |
| | |
| | | */ |
| | | IPage<ReportVo> selectAllReport(Page<Object> page, Integer status, String name); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¥åå®¡æ ¸ |
| | | * @return |
| | | */ |
| | | IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name); |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.Dto; |
| | | |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.JsonUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class MapHandlerDto { |
| | | |
| | | public static String comparingBySupplier(Object o){ |
| | | Map map= JsonUtil.jsonToPojo(JsonUtil.jsonToString(o),Map.class); |
| | | return String.valueOf(map.get("supplier")); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034", required = true) |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034") |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼", required = true) |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼") |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH", required = true) |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH") |
| | | private String inspectionCode; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.Dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value="æ¥è¯¢åæ ¼ç对象", description="") |
| | | public class SelectQualificationRateDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date beginDate; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endDate; |
| | | |
| | | /*** |
| | | * ç±»å |
| | | */ |
| | | @ApiModelProperty(value = "æ£éªç±»å") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * ä¾åºå |
| | | */ |
| | | @ApiModelProperty(value = "ä¾åºå") |
| | | private String supplier; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.Dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Data |
| | | public class SeriesDto implements Serializable { |
| | | |
| | | private String name; |
| | | private List<Long> data; |
| | | private String type; |
| | | private String stack; |
| | | |
| | | public SeriesDto(String name, List<Long> data) { |
| | | this.name = name; |
| | | this.data = data; |
| | | this.type = "bar"; |
| | | this.stack = "x"; |
| | | } |
| | | |
| | | public SeriesDto(String name) { |
| | | this.name = name; |
| | | this.type = "bar"; |
| | | this.stack = "x"; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | **/ |
| | | private Integer inspectionStatus; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | |
| | | private Integer inspectionMaterialId; |
| | | |
| | | /** |
| | | * å
³è ç¨æ·id è¯éªå |
| | | * å
³è ç¨æ·id æ§è¡äºº |
| | | **/ |
| | | private Integer userId; |
| | | |
| | |
| | | * å
³è 设å¤id |
| | | **/ |
| | | private Integer instrumentId; |
| | | |
| | | /** |
| | | * å
³è ç¨æ·id 责任人 |
| | | **/ |
| | | private Integer userProId; |
| | | } |
| | | |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer id; |
| | | |
| | | /** |
| | | * æ ·åç¼å· |
| | | */ |
| | |
| | | */ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * ç»è®º0:ä¸åæ ¼ ; 1:åæ ¼ |
| | | */ |
| | | private Integer result; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProjectNum { |
| | | |
| | | private int insNum; //å·²æ£éªçæ£éªåæ°é |
| | | private int insUnNum; //æªæ£éªçæ£éªåæ°é |
| | | private int insproNum; //å·²æ£éªçæ£éªé¡¹ç®æ°é |
| | | private int insproUnNum; //æªæ£éªçæ£éªé¡¹ç®æ°é |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
³è ç³è¯·è¡¨id") |
| | | private Integer inspectionId; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8") |
| | | private Date checkTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æ£éªæ¥å |
| | | */ |
| | | @Data |
| | | public class ReportVo { |
| | | |
| | | @ApiModelProperty(value = "æ£éªæ¥åid") |
| | | @JsonSerialize |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ¥ååå·") |
| | | @JsonSerialize |
| | | private String reportCode; |
| | | @ApiModelProperty(value = "ç³è¯·åå·") |
| | | |
| | | @ApiModelProperty(value = "æ£éªç³è¯·åå·") |
| | | @JsonSerialize |
| | | private String inspectionCode; |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å·²å®¡æ ¸") |
| | | @JsonSerialize |
| | | private Integer status; |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "æ£éªç»è®º") |
| | | @JsonSerialize |
| | | private String conclusion; |
| | | |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å·²éè¿ 3:ä¸éè¿") |
| | | @JsonSerialize |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8") |
| | | private Date checkTime; |
| | | |
| | | @ApiModelProperty(value = "ç¼å¶äºº") |
| | | @JsonSerialize |
| | | private String name; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | |
| | | public interface HomeService { |
| | | |
| | | /** |
| | | * è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£ |
| | | * @return |
| | | */ |
| | | ProjectNum checkProjectNum(); |
| | | |
| | | } |
| | |
| | | */ |
| | | InspectDetailVo selectInspectsListById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 䏿¥(æ´æ°æ£éªåæ£éªç»æ) |
| | | * ä½åºæ£éªå |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean updateInspectsById(Integer id); |
| | | String delInspect(Integer id); |
| | | |
| | | /** |
| | | * ä¿åæ£éªé¡¹ç®è´£ä»»äºº |
| | | * @param id |
| | | * @param userProId |
| | | * @return |
| | | */ |
| | | String chooseUseProId(Integer id, Integer userProId); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | String distribution(Integer id, Integer userId, Integer instrumentId); |
| | | |
| | | /** |
| | | * æ£éª |
| | | * @param id |
| | | * @param value |
| | | * @return |
| | | */ |
| | | String check(Integer id, String value); |
| | | |
| | | /** |
| | | * 䏿¥ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String reported(Integer id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SelectQualificationRateDto; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | public interface QualificationRateStatisticsService { |
| | | /** |
| | | * è·åç³è¯·ç©æå䏿æä¾åºåå表 |
| | | * @return |
| | | */ |
| | | List<InspectionMaterial> getSupplierList(); |
| | | |
| | | Map<String, Object> getTestSampleStatistics(SelectQualificationRateDto dto); |
| | | |
| | | Map<String, Object> getSupplierNoPassStatistics(SelectQualificationRateDto dto); |
| | | |
| | | Map<String, Object> getNoPassProjectStatistics(SelectQualificationRateDto dto); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | IPage<ReportVo> selectAllReport(Page<Object> page, Integer status, String name); |
| | | |
| | | /** |
| | | * æäº¤ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String submit(Integer id); |
| | | |
| | | /** |
| | | * å®¡æ ¸ |
| | | * @param name |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String check(String name, Integer id, String result); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String delreport(Integer id); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.ProjectNum; |
| | | import com.yuanchu.limslaboratory.service.HomeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Service |
| | | public class HomeServiceImpl implements HomeService { |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @Resource |
| | | InspectionProductMapper inspectionProductMapper; |
| | | |
| | | |
| | | //è®¡ç®æ£éªä¸æªæ£éªçååä¸é¡¹ç®çæ°éæ¥å£ |
| | | @Override |
| | | public ProjectNum checkProjectNum() { |
| | | ProjectNum projectNum = new ProjectNum(); |
| | | //å·²æ£éªçæ£éªåæ°é |
| | | projectNum.setInsNum(inspectionMapper.seleCountIns()); |
| | | //æªæ£éªçæ£éªåæ°é |
| | | projectNum.setInsUnNum(inspectionMapper.seleCountUnIns()); |
| | | //å·²æ£éªçæ£éªé¡¹ç®æ°é |
| | | projectNum.setInsproNum(inspectionProductMapper.seleCountInspro()); |
| | | //æªæ£éªçæ£éªé¡¹ç®æ°é |
| | | projectNum.setInsproUnNum(inspectionProductMapper.seleCountUnInspro()); |
| | | return projectNum; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InsProductVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | | * ç³è¯·åä¸ç©æä¸ç项ç®(InspectionProduct)表æå¡å®ç°ç±» |
| | |
| | | @Service |
| | | public class InspectionProductServiceImpl extends ServiceImpl<InspectionProductMapper, InspectionProduct> implements InspectionProductService { |
| | | |
| | | @Resource |
| | | InspectionProductMapper inspectionProductMapper; |
| | | |
| | | /* //æ´æ°æ£éªé¡¹ç® |
| | | @Override |
| | | public boolean updateInsProduct(Integer userId, InspectionProduct inspectionProduct) { |
| | | //èµå¼æ£éªåid |
| | | inspectionProduct.setUserId(userId); |
| | | //å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼0 |
| | | String testValue = inspectionProduct.getTestValue();//æ£éªå¼ |
| | | String required = inspectionProduct.getRequired();//æ åå¼ |
| | | String internal = inspectionProduct.getInternal();//å
æ§å¼ |
| | | inspectionProduct.setTestState(checkValues(required, internal, testValue)); |
| | | //æ ¹æ®æ£éªé¡¹ç®ååå
³èçæ£éªç©æidæ¥æ¥è¯¢æ£éªé¡¹ç®çæ°æ® |
| | | LambdaUpdateWrapper<InspectionProduct> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionProduct::getInspectionMaterialId, inspectionProduct.getInspectionMaterialId()) |
| | | .eq(InspectionProduct::getName, inspectionProduct.getName()); |
| | | inspectionProductMapper.update(inspectionProduct, updateWrapper); |
| | | return true; |
| | | }*/ |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | | boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr); |
| | | boolean isControlValueSatisfied = isValueSatisfied(controlValueStr, detectionValueStr); |
| | | |
| | | if (isStandardValueSatisfied && isControlValueSatisfied) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private boolean isValueSatisfied(String valueStr, String detectionValueStr) { |
| | | String substring = valueStr.substring(1, 2); |
| | | if (substring.equals("=")) { |
| | | String operator = valueStr.substring(0, 2); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(2)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">=": |
| | | return detectionValue >= standardValue; |
| | | case "<=": |
| | | return detectionValue <= standardValue; |
| | | default: |
| | | return false; |
| | | } |
| | | } else { |
| | | String operator = valueStr.substring(0, 1); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(1)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">": |
| | | return detectionValue > standardValue; |
| | | case "â¥": |
| | | return detectionValue >= standardValue; |
| | | case "â¤": |
| | | return detectionValue <= standardValue; |
| | | case "<": |
| | | return detectionValue < standardValue; |
| | | case "=": |
| | | return detectionValue.equals(standardValue); |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectDetailVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | ReportMapper reportMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | |
| | | return inspectDetailVo; |
| | | } |
| | | |
| | | //æ´æ°æ£éªåæ£éªç»æ |
| | | //ä½åºæ£éªå |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateInspectsById(Integer id) { |
| | | //æ´æ°æ£éªåéé¢çæ£éªç¶æåæ£éªç»è®º |
| | | InspectDetailVo inspectDetailVo = selectInspectsListById(id); |
| | | Inspection inspection = Inspection.builder() |
| | | .id(id) |
| | | .inspectionStatus(inspectDetailVo.getInspectionStatus()) |
| | | .build(); |
| | | public String delInspect(Integer id) { |
| | | /*ä½åºæ£éªå*/ |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setId(id); |
| | | inspection.setState(0); |
| | | inspectionMapper.updateById(inspection); |
| | | //çææ¥åå |
| | | Report report = new Report(); |
| | | //çææ¥ååå· |
| | | String code = MyUtil.getTimeSixNumberCode("BG","BG"); |
| | | //è·åæ£éªç»è®º |
| | | String conclusion = ""; |
| | | Inspection inspection1 = inspectionMapper.selectById(id); |
| | | if (inspection1.getInspectionStatus().equals(1)) { |
| | | conclusion = "åæ ¼"; |
| | | }else { |
| | | conclusion = "ä¸åæ ¼"; |
| | | } |
| | | report.setCode(code); |
| | | report.setStatus(0); |
| | | report.setConclusion(conclusion); |
| | | report.setInspectionId(id); |
| | | reportMapper.insert(report); |
| | | |
| | | return true; |
| | | /*ä½åºæ£éªæ ·å*/ |
| | | InspectionMaterial inspectionMaterial = inspectionMaterialMapper.selectOne(Wrappers.<InspectionMaterial>query().eq("inspection_id", id)); |
| | | inspectionMaterial.setState(0); |
| | | inspectionMaterialMapper.updateById(inspectionMaterial); |
| | | /*ä½åºæ£éªé¡¹ç®*/ |
| | | inspectionProductMapper.updat(inspectionMaterial.getId()); |
| | | return "ä½åºæå!"; |
| | | } |
| | | |
| | | //ä¿åæ£éªé¡¹ç®è´£ä»»äºº |
| | | @Override |
| | | public String chooseUseProId(Integer id, Integer userProId) { |
| | | InspectionProduct inspectionProduct = new InspectionProduct(); |
| | | inspectionProduct.setId(id); |
| | | inspectionProduct.setUserProId(userProId); |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | | return "ä¿åæå!"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.yuanchu.limslaboratory.service.NonConformanceReviewService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProduct; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.service.InstrumentService; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | InstrumentMapper instrumentMapper; |
| | | |
| | | @Resource |
| | | ReportMapper reportMapper; |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | //æ¥è¯¢æ£éªè®¡å |
| | | @Override |
| | | public List<Map<String,Object>> selectAllPlan(String code , String beginTime, String endTime,Integer status) { |
| | | return planMapper.selectAllPlan(code,beginTime,endTime,status); |
| | | public List<Map<String, Object>> selectAllPlan(String code, String beginTime, String endTime, Integer status) { |
| | | return planMapper.selectAllPlan(code, beginTime, endTime, status); |
| | | } |
| | | |
| | | //åé
-->éæ©æ£éªäºº |
| | |
| | | //åé
-->éæ©è®¾å¤ |
| | | @Override |
| | | public List<Map<String, Object>> chooseinstum() { |
| | | return null; |
| | | return instrumentMapper.chooseinstum(); |
| | | } |
| | | |
| | | //åé
人åä¸è®¾å¤ |
| | |
| | | public String distribution(Integer id, Integer userId, Integer instrumentId) { |
| | | InspectionProduct inspectionProduct = new InspectionProduct(); |
| | | inspectionProduct.setId(id); |
| | | //æ§è¡äºº |
| | | inspectionProduct.setUserId(userId); |
| | | inspectionProduct.setInstrumentId(instrumentId); |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | | return "åé
宿!"; |
| | | } |
| | | |
| | | //æ£éª |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String check(Integer id, String value) { |
| | | //妿æ£éªå¼ä¸ä¸ºç©º |
| | | if (StringUtils.isNotBlank(value)) { |
| | | InspectionProduct inspectionProduct = inspectionProductMapper.selectById(id); |
| | | //å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼0 |
| | | String required = inspectionProduct.getRequired();//æ åå¼ |
| | | String internal = inspectionProduct.getInternal();//å
æ§å¼ |
| | | inspectionProduct.setTestValue(value); |
| | | inspectionProduct.setTestState(checkValues(required, internal, value)); |
| | | inspectionProductMapper.updateById(inspectionProduct); |
| | | } else { |
| | | //妿æ£éªå¼ä¸ºç©º,å°åæçæ£éªç»è®ºè¦ç为null |
| | | inspectionProductMapper.upda(id); |
| | | } |
| | | return "æäº¤æå!"; |
| | | } |
| | | |
| | | //䏿¥ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String reported(Integer id) { |
| | | /*æ´æ°æ£éªåéé¢çæ£éªç»è®º*/ |
| | | //å
夿æ£éªç»æ |
| | | List<Integer> results = inspectionProductMapper.getresult(id); |
| | | int count = 0; |
| | | for (Integer result : results) { |
| | | if (result != null && result==1) { |
| | | count++; |
| | | } |
| | | } |
| | | //妿æ£éªé¡¹ç®ä¸çç»è®ºå
å«ä¸åæ ¼åæ£éªåä¸åæ ¼ |
| | | if (results.contains(0)) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setId(id); |
| | | inspection.setInspectionStatus(0); |
| | | inspectionMapper.updateById(inspection); |
| | | } else if (count == results.size()) { |
| | | Inspection inspection = new Inspection(); |
| | | inspection.setId(id); |
| | | inspection.setInspectionStatus(1); |
| | | inspectionMapper.updateById(inspection); |
| | | } else return "é¡¹ç®æªæ£éªå®!"; |
| | | //çææ¥åå |
| | | Report report = new Report(); |
| | | //çææ¥ååå· |
| | | String recode = MyUtil.getTimeSixNumberCode("BG", "BG"); |
| | | //è·åæ£éªç»è®º |
| | | String conclusion = ""; |
| | | Inspection inspection = inspectionMapper.selectById(id); |
| | | if (inspection.getInspectionStatus().equals(1)) { |
| | | conclusion = "åæ ¼"; |
| | | } else { |
| | | conclusion = "ä¸åæ ¼"; |
| | | } |
| | | report.setCode(recode); |
| | | report.setStatus(0); |
| | | report.setConclusion(conclusion); |
| | | report.setInspectionId(id); |
| | | reportMapper.insert(report); |
| | | return "䏿¥æå!"; |
| | | } |
| | | |
| | | |
| | | /*å¤ææ£æµå¼æ¯å¦æ»¡è¶³æ åå¼åå
æ§å¼çè¦æ±,妿䏿»¡è¶³åæ£éªç»è®ºä¸ºä¸åæ ¼*/ |
| | | private int checkValues(String standardValueStr, String controlValueStr, String detectionValueStr) { |
| | | boolean isStandardValueSatisfied = isValueSatisfied(standardValueStr, detectionValueStr); |
| | | boolean isControlValueSatisfied = isValueSatisfied(controlValueStr, detectionValueStr); |
| | | |
| | | if (isStandardValueSatisfied && isControlValueSatisfied) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | private boolean isValueSatisfied(String valueStr, String detectionValueStr) { |
| | | String substring = valueStr.substring(1, 2); |
| | | if (substring.equals("=")) { |
| | | String operator = valueStr.substring(0, 2); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(2)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">=": |
| | | return detectionValue >= standardValue; |
| | | case "<=": |
| | | return detectionValue <= standardValue; |
| | | default: |
| | | return false; |
| | | } |
| | | } else { |
| | | String operator = valueStr.substring(0, 1); |
| | | Double standardValue = Double.parseDouble(valueStr.substring(1)); |
| | | Double detectionValue = Double.parseDouble(detectionValueStr); |
| | | switch (operator) { |
| | | case ">": |
| | | return detectionValue > standardValue; |
| | | case "â¥": |
| | | return detectionValue >= standardValue; |
| | | case "â¤": |
| | | return detectionValue <= standardValue; |
| | | case "<": |
| | | return detectionValue < standardValue; |
| | | case "=": |
| | | return detectionValue.equals(standardValue); |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import cn.hutool.json.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialMapper; |
| | | import com.yuanchu.limslaboratory.mapper.QualificationRateStatisticsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.MapHandlerDto; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SelectQualificationRateDto; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.SeriesDto; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | import com.yuanchu.limslaboratory.service.QualificationRateStatisticsService; |
| | | import com.yuanchu.limslaboratory.utils.ArrayListUtil; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class QualificationRateStatisticsServiceImpl implements QualificationRateStatisticsService { |
| | | |
| | | @Resource |
| | | private InspectionMaterialMapper inspectionMaterialMapper; |
| | | |
| | | @Resource |
| | | private QualificationRateStatisticsMapper qualificationRateStatisticsMapper; |
| | | |
| | | @Override |
| | | public List<InspectionMaterial> getSupplierList() { |
| | | QueryWrapper<InspectionMaterial> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(InspectionMaterial::getSupplier) |
| | | .eq(InspectionMaterial::getState, 1).groupBy(InspectionMaterial::getSupplier); |
| | | return inspectionMaterialMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getTestSampleStatistics(SelectQualificationRateDto dto) { |
| | | System.out.println(dto); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getSupplierNoPassStatistics(SelectQualificationRateDto dto) { |
| | | Map<String, Object> allMap = new HashMap<>(16); |
| | | List<Map<String, Object>> mapList = qualificationRateStatisticsMapper.selectSupplierByCondition(dto); |
| | | mapList.forEach(System.out::println); |
| | | System.out.println("================================="); |
| | | //å»éååºä¾åºå |
| | | List<Map<String, Object>> supplierDistinct = ArrayListUtil.oneObjectsDistinctByProperty(MapHandlerDto::comparingBySupplier, mapList); |
| | | List<String> supplierList = new ArrayList<String>(); |
| | | supplierDistinct.forEach(l -> { |
| | | supplierList.add(String.valueOf(l.get("supplier"))); |
| | | }); |
| | | allMap.put("xAxis", supplierList); |
| | | List<SeriesDto>seriesDtoList=new ArrayList<SeriesDto>(2); |
| | | SeriesDto seriesDto2=new SeriesDto("ä¸åæ ¼æ°é"); |
| | | SeriesDto seriesDto=new SeriesDto("åæ ¼æ°é"); |
| | | // ååºå¯¹åºåæ ¼æ°éä¸åæ ¼æ°é |
| | | List<Long>pass=new ArrayList<>(); |
| | | List<Long>noPass=new ArrayList<>(); |
| | | AtomicLong integerPass=new AtomicLong(0L); |
| | | AtomicLong integerNoPass=new AtomicLong(0L); |
| | | supplierList.forEach(s -> { |
| | | mapList.stream() |
| | | .filter(l -> Objects.equals(l.get("supplier"), s)) |
| | | .forEach(l -> { |
| | | if(Objects.equals(l.get("inspectionStatus"),1)){ |
| | | integerPass.incrementAndGet(); |
| | | }else { |
| | | integerNoPass.incrementAndGet(); |
| | | } |
| | | }); |
| | | pass.add(integerPass.get()); |
| | | noPass.add(integerNoPass.get()); |
| | | integerNoPass.set(0L); |
| | | integerPass.set(0L); |
| | | }); |
| | | seriesDto.setData(pass); |
| | | seriesDto2.setData(noPass); |
| | | seriesDtoList.add(seriesDto); |
| | | seriesDtoList.add(seriesDto2); |
| | | System.out.println("æ°é=======>"); |
| | | System.out.println(seriesDtoList); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getNoPassProjectStatistics(SelectQualificationRateDto dto) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.mapper.RawMaterialMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param materialCoding |
| | | * @param materialName |
| | | * @param condition |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | import com.yuanchu.limslaboratory.service.ReportService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return reportMapper.selectAllReport(page, status, name); |
| | | } |
| | | |
| | | //æäº¤ |
| | | @Override |
| | | public String submit(Integer id) { |
| | | Report report = new Report(); |
| | | report.setId(id); |
| | | report.setStatus(1); |
| | | reportMapper.updateById(report); |
| | | return "æäº¤æå!"; |
| | | } |
| | | |
| | | //å®¡æ ¸ |
| | | @Override |
| | | public String check(String name, Integer id, String result) { |
| | | Report report = new Report(); |
| | | report.setId(id); |
| | | report.setApprover(name); |
| | | report.setCheckTime(new Date()); |
| | | if (result.equals("éè¿")){ |
| | | report.setStatus(2); |
| | | }else if (result.equals("ä¸éè¿")){ |
| | | report.setStatus(3); |
| | | } |
| | | reportMapper.updateById(report); |
| | | return "å®¡æ ¸æå!"; |
| | | } |
| | | |
| | | @Override |
| | | public String delreport(Integer id) { |
| | | Report report = new Report(); |
| | | report.setId(id); |
| | | report.setState(0); |
| | | reportMapper.updateById(report); |
| | | return "å 餿å!"; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | from lims_laboratory.inspection i |
| | | join lims_laboratory.user u on i.user_id = u.id |
| | | join lims_laboratory.inspection_material im on i.id = im.inspection_id |
| | | where i.state=1 |
| | | where i.state=1 |
| | | <if test="message!=null"> |
| | | and i.code like concat('%', #{message}, '%') |
| | | or im.name like concat('%', #{message}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--è®¡ç®æ£éªçæ£éªåæ°é--> |
| | | <select id="seleCountIns" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection |
| | | where state = 1 |
| | | and inspection_status in (0, 1) |
| | | </select> |
| | | |
| | | <!--è®¡ç®æªæ£éªçæ£éªåæ°é--> |
| | | <select id="seleCountUnIns" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection |
| | | where state = 1 |
| | | and inspection_status is null |
| | | </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.yuanchu.limslaboratory.mapper.InspectionProductMapper"> |
| | | <update id="upda"> |
| | | update lims_laboratory.inspection_product |
| | | set test_state=null |
| | | where id = #{id} |
| | | and state = 1 |
| | | </update> |
| | | |
| | | <!--æ ¹æ®æ£éªåidæ¥è¯¢æ£éªé¡¹ç®çæ£éªç»æ--> |
| | | <select id="getresult" resultType="java.lang.Integer"> |
| | | select test_state |
| | | from lims_laboratory.inspection_product |
| | | where state = 1 |
| | | and inspection_material_id = (select id from lims_laboratory.inspection_material where inspection_id = #{id}) |
| | | </select> |
| | | <!--æ ¹æ®æ£éªæ ·åidä½åºæ£éªé¡¹ç®--> |
| | | <update id="updat"> |
| | | update lims_laboratory.inspection_product |
| | | set state=0 |
| | | where inspection_material_id = #{id} |
| | | </update> |
| | | |
| | | <!--计ç®å·²æ£éªé¡¹ç®æ°é--> |
| | | <select id="seleCountInspro" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection_product |
| | | where state = 1 |
| | | and test_state in (0, 1) |
| | | </select> |
| | | |
| | | <!--è®¡ç®æªæ£éªé¡¹ç®æ°é--> |
| | | <select id="seleCountUnInspro" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from lims_laboratory.inspection_product |
| | | where state = 1 |
| | | and test_state is null |
| | | </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.yuanchu.limslaboratory.mapper.NonConformingFeedbackMapper"> |
| | | |
| | | <select id="selectNonConformingFeedback" resultType="nonConformingFeedback" parameterType="com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto"> |
| | | SELECT |
| | | im.`code` materialCode, |
| | | im.`name` materialName, |
| | | i.`code` inspectionCode, |
| | | i.create_time createTime, |
| | | u.`name` testManager, |
| | | im.specifications specifications |
| | | <select id="selectNonConformingFeedback" resultType="nonConformingFeedback" |
| | | parameterType="com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto"> |
| | | SELECT im.id, |
| | | im.`code` materialCode, |
| | | im.`name` materialName, |
| | | i.`code` inspectionCode, |
| | | i.create_time createTime, |
| | | u.`name` testManager, |
| | | im.specifications specifications, |
| | | inspection_status result |
| | | FROM |
| | | inspection i, |
| | | inspection_material im, |
| | | `user` u |
| | | lims_laboratory.inspection i, |
| | | lims_laboratory.inspection_material im, |
| | | lims_laboratory.`user` u |
| | | WHERE |
| | | 1 = 1 |
| | | AND i.id = im.inspection_id |
| | | AND i.user_id = u.id |
| | | i.id = im.inspection_id |
| | | AND i.user_id = u.id |
| | | <if test="nonConformingFeedbackDto.materialCode!=null and nonConformingFeedbackDto.materialCode!=''"> |
| | | and im.`code` like concat("%",#{nonConformingFeedbackDto.materialCode},"%") |
| | | and im.`code` like concat('%',#{nonConformingFeedbackDto.materialCode},'%') |
| | | </if> |
| | | <if test="nonConformingFeedbackDto.materialName!=null and nonConformingFeedbackDto.materialName!=''"> |
| | | and im.`name` like concat("%",#{nonConformingFeedbackDto.materialName},"%") |
| | | and im.`name` like concat('%',#{nonConformingFeedbackDto.materialName},'%') |
| | | </if> |
| | | <if test="nonConformingFeedbackDto.inspectionCode!=null and nonConformingFeedbackDto.inspectionCode!=''"> |
| | | and im.specifications like concat("%",#{nonConformingFeedbackDto.inspectionCode},"%") |
| | | and im.specifications like concat('%',#{nonConformingFeedbackDto.inspectionCode},'%') |
| | | </if> |
| | | and i.state=1 |
| | | and im.state=1 |
| | | and i.state=1 |
| | | and im.state=1 |
| | | and i.inspection_status =0 |
| | | </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.yuanchu.limslaboratory.mapper.PlanMapper"> |
| | | <resultMap id="selectAllPlanMap" type="map" > |
| | | <resultMap id="selectAllPlanMap" type="map"> |
| | | <id property="code" column="code"/> |
| | | <result property="id" column="id"/> |
| | | <result property="samplename" column="samplename"/> |
| | | <result property="inspectionStatus" column="inspectionStatus"/> |
| | | <result property="startTime" column="startTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <collection property="father" resultMap="selectAllPlanMapTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllPlanMapTowMap" type="map"> |
| | | <id property="samplename" column="samplename"/> |
| | | <collection property="chldren" resultMap="selectAllPlanMapTowsMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllPlanMapTowsMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | <id property="pid" column="pid"/> |
| | | <result property="name" column="name"/> |
| | | <result property="unit" column="unit"/> |
| | | <result property="required" column="required"/> |
| | |
| | | </resultMap> |
| | | <!--æ¥è¯¢æ£éªè®¡å--> |
| | | <select id="selectAllPlan" resultMap="selectAllPlanMap"> |
| | | select ip.id, |
| | | select i.id , |
| | | i.code, |
| | | inspection_status inspectionStatus, |
| | | DATE_FORMAT(start_time,'%Y-%m-%d') startTime, |
| | | DATE_FORMAT(end_time,'%Y-%m-%d') endTime, |
| | | im.name samplename, |
| | | ip.id pid, |
| | | ip.name, |
| | | ip.unit, |
| | | required, |
| | |
| | | left join lims_laboratory.inspection_material im on ip.inspection_material_id = im.id |
| | | left join lims_laboratory.inspection i on im.inspection_id = i.id |
| | | left join lims_laboratory.user u on ip.user_id = u.id |
| | | left join lims_laboratory.instrument isu on ip.instrument_id = isu.id |
| | | left join lims_laboratory.instrument isu on ip.instrument_id = isu.id |
| | | <where> |
| | | <if test="code != null and code != null"> |
| | | and i.code like concat('%',#{code},'%') |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.QualificationRateStatisticsMapper"> |
| | | <select id="selectSupplierByCondition" resultType="java.util.Map"> |
| | | SELECT i.id, |
| | | i.type, |
| | | im.`name`, |
| | | im.supplier, |
| | | i.inspection_status inspectionStatus, |
| | | i.start_time startTime, |
| | | i.end_time endTime |
| | | FROM inspection i |
| | | INNER JOIN inspection_material im ON i.id = im.inspection_id |
| | | where (i.state = 1 AND TRUE = IFNULL(i.inspection_status, FALSE)) |
| | | <if test="dto.beginDate!=null and dto.endDate!=null"> |
| | | DATE_FORMAT( i.end_time, '%Y-%m-%d' ) BETWEEN #{dto.beginDate} |
| | | AND #{dto.endDate} |
| | | AND DATE_FORMAT( i.start_time, '%Y-%m-%d' )>= #{dto.beginDate} |
| | | </if> |
| | | <if test="dto.type!=null"> |
| | | and i.type=#{dto.type} |
| | | </if> |
| | | <if test="dto.supplier!=null and dto.supplier!=''"> |
| | | and im.supplier=#{dto.supplier} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <!--æ¥è¯¢æ£éªæ¥å--> |
| | | <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo"> |
| | | select im.code materialCode, |
| | | select r.id, |
| | | im.code materialCode, |
| | | r.code reportCode, |
| | | i.code inspectionCode, |
| | | r.approver approver, |
| | | r.status status, |
| | | r.conclusion conclusion, |
| | | u.name name |
| | | from report r |
| | | join inspection i on r.inspection_id = i.id |
| | | join user u on i.user_id = u.id |
| | | join inspection_material im on i.id = im.inspection_id |
| | | im.name materialName, |
| | | r.conclusion , |
| | | r.status , |
| | | r.approver , |
| | | check_time, |
| | | u.name |
| | | from lims_laboratory.report r |
| | | join lims_laboratory.inspection i on r.inspection_id = i.id |
| | | join lims_laboratory.user u on i.user_id = u.id |
| | | join lims_laboratory.inspection_material im on i.id = im.inspection_id |
| | | <where> |
| | | r.state = 1 |
| | | <if test="status != null"> |
| | |
| | | or r.code like concat('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | order by r.id |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢æ¥åå®¡æ ¸--> |
| | | <select id="selectAllReportAuditing" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo"> |
| | | select im.code materialCode, |
| | | r.code reportCode, |
| | | im.name materialName, |
| | | r.status status, |
| | | r.approver approver, |
| | | DATE_FORMAT(r.`create_time`, '%Y-%m-%d') submitTime, |
| | | DATE_FORMAT(r.`check_time`, '%Y-%m-%d') checkTime |
| | | from report r |
| | | join inspection i on r.inspection_id = i.id |
| | | join inspection_material im on i.id = im.inspection_id |
| | | <where> |
| | | r.state = 1 |
| | | <if test="status == null"> |
| | | and r.status in (0, 1) |
| | | </if> |
| | | <if test="status != null"> |
| | | and r.status = #{status} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and im.code like concat('%', #{name}, '%') |
| | | or i.code like concat('%', #{name}, '%') |
| | | or im.name like concat('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdatedMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.service.MetricalInformationService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°è®¡éç»æ") |
| | | public Result<?> updateMetricalInformationResult(String code,Integer result){ |
| | | return null; |
| | | @PostMapping("/updateMetricalInformationInfo") |
| | | public Result<?> updateMetricalInformationInfo(@RequestBody UpdatedMetricalInformationDto dto){ |
| | | return Result.success(metricalInformationService.updateMetricalInformationInfo(dto)); |
| | | } |
| | | |
| | | } |
| | |
| | | IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page); |
| | | |
| | | |
| | | |
| | | //åé
-->éæ©è®¾å¤ |
| | | List<Map<String, Object>> chooseinstum(); |
| | | } |
| | |
| | | @ApiModel(value="MeteringPlanAndInfoAndIns对象", description="") |
| | | public class MetricalInfoAndIns extends Instrument implements Serializable { |
| | | |
| | | private Long imId; |
| | | |
| | | @ApiModelProperty(value = "计éç¼å·", example = "1", required = true) |
| | | private String code; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "UpdatedMetricalInformationDto对象", description = "") |
| | | public class UpdatedMetricalInformationDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主é®", example = "1", required = true) |
| | | private Integer id; |
| | | @ApiModelProperty(value = "ç¼ç ", example = "1", required = true) |
| | | private String code; |
| | | @ApiModelProperty(value = "ç»æ", example = "1", required = true) |
| | | private Integer result; |
| | | @ApiModelProperty(value = "è®¡éæ¥æ", example = "1", required = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | private Date date; |
| | | @ApiModelProperty(value = "ä¸ç¡®å®åº¦", example = "1", required = true) |
| | | private String uncertainty; |
| | | @ApiModelProperty(value = "æ§è½ææ ", example = "1", required = true) |
| | | private String performanceIndex; |
| | | @ApiModelProperty(value = "夿³¨", example = "1", required = true) |
| | | private String remarks; |
| | | //@ApiModelProperty(value = "æä»¶", example = "1", required = true) |
| | | //private MultipartFile[] file; |
| | | //@ApiModelProperty(value = "ææå¨æ", example = "1", required = true) |
| | | //private String termValidity; |
| | | } |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdatedMetricalInformationDto; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | Integer deleteMetricalInformation(Integer metricalInformationId); |
| | | |
| | | Integer updateMetricalInformation(MetricalInformation metricalInformation, MultipartFile file); |
| | | |
| | | boolean updateMetricalInformationInfo(UpdatedMetricalInformationDto dto); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.yuanchu.limslaboratory.mapper.MetricalInformationMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdatedMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.service.MetricalInformationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.FileSaveUtil; |
| | |
| | | } |
| | | return metricalInformationMapper.updateById(metricalInformation); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateMetricalInformationInfo(UpdatedMetricalInformationDto dto) { |
| | | System.out.println(dto); |
| | | MetricalInformation info = new MetricalInformation(); |
| | | info.setId(dto.getId()); |
| | | info.setRemarks(dto.getRemarks()); |
| | | info.setPerformanceIndex(dto.getPerformanceIndex()); |
| | | info.setResult(dto.getResult()); |
| | | info.setUncertainty(dto.getUncertainty()); |
| | | info.setEndDate(dto.getDate()); |
| | | info.setUpdateTime(DateUtil.date()); |
| | | System.out.println(info); |
| | | //æä»¶æ»¤è¿ |
| | | return metricalInformationMapper.updateById(info)>0; |
| | | } |
| | | } |
| | |
| | | <?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.InstrumentMapper"> |
| | | |
| | | <select id="getListInstrumentInformation" resultType="map"> |
| | | SELECT i.`id`, i.`equipment_code`, i.`equipment_name`, i.`specifications_models`, u.`name`, |
| | | DATE_FORMAT(DATE_ADD(i.`create_time`, INTERVAL i.`term_validity` MONTH), '%Y-%m-%d') termValidity, i.`conditions`, i.`storage_place` |
| | | DATE_FORMAT(DATE_ADD(i.`create_time`, INTERVAL i.`term_validity` MONTH), '%Y-%m-%d') termValidity, |
| | | i.`conditions`, i.`storage_place` |
| | | FROM instrument i, `user` u |
| | | WHERE i.`state` = 1 |
| | | AND i.`classify_id` = #{classifyId} |
| | | AND i.`classify_id` = #{classifyId} |
| | | <if test="conditions != null"> |
| | | AND i.`conditions` = #{conditions} |
| | | </if> |
| | | <if test="numberOrNameOrSpecifications != null and numberOrNameOrSpecifications != ''"> |
| | | AND CONCAT(i.`equipment_code`, i.`equipment_name`, i.`specifications_models`) LIKE CONCAT('%',#{numberOrNameOrSpecifications},'%') |
| | | AND CONCAT(i.`equipment_code`, i.`equipment_name`, i.`specifications_models`) LIKE |
| | | CONCAT('%',#{numberOrNameOrSpecifications},'%') |
| | | </if> |
| | | <if test="whetherWhether == true"> |
| | | AND DATE_FORMAT(DATE_ADD(i.`create_time`, INTERVAL i.`term_validity` MONTH), '%Y-%m-%d') <![CDATA[<]]> NOW() |
| | |
| | | AND i.`user_id` = u.`id` |
| | | </select> |
| | | |
| | | <!--éæ©è®¾å¤--> |
| | | <resultMap id="chooseinstumMap" type="map"> |
| | | <id property="father_name" column="father_name"/> |
| | | <collection property="father" resultMap="chooseinstumTowMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseinstumTowMap" type="map"> |
| | | <id property="son_name" column="son_name"/> |
| | | <collection property="chldren" resultMap="chooseinstumTowsMap" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseinstumTowsMap" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | </resultMap> |
| | | <select id="chooseinstum" resultMap="chooseinstumMap"> |
| | | select instrument.id, |
| | | father_name, |
| | | son_name, |
| | | equipment_name name |
| | | from lims_laboratory.instrument |
| | | left join lims_laboratory.classify c on c.id = instrument.classify_id |
| | | </select> |
| | | </mapper> |
| | |
| | | im.imName imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode |
| | | im.`code` imCode, |
| | | im.id imId, |
| | | im.uncertainty uncertainty , |
| | | im.performance_index performanceIndex , |
| | | im.remarks remarks |
| | | FROM metering_plan m |
| | | LEFT JOIN `user` u ON m.create_Person = u.id |
| | | LEFT JOIN ( |
| | | SELECT i.equipment_code, |
| | | i.equipment_name, |
| | | i.measuring_range, |
| | | im.id, |
| | | i.term_validity, |
| | | im.uncertainty, |
| | | im.performance_index, |
| | | im.remarks, |
| | | im.result, |
| | | im.end_date, |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode |
| | | im.`code` imCode, |
| | | im.id imId, |
| | | im.uncertainty uncertainty , |
| | | im.performance_index performanceIndex , |
| | | im.remarks remarks |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | <result property="imId" column="imId"/> |
| | | <result property="performanceIndex" column="performanceIndex"/> |
| | | <result property="uncertainty" column="uncertainty"/> |
| | | <result property="remarks" column="remarks"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="measureInsAndPlanMap" type="meteringPlanAndInfoAndIns"> |
| | |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | <result property="imId" column="imId"/> |
| | | <result property="performanceIndex" column="performanceIndex"/> |
| | | <result property="uncertainty" column="uncertainty"/> |
| | | <result property="remarks" column="remarks"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | // å级æ |
| | | List<Map<String, Object>> FourTree(String specificationsName); |
| | | |
| | | //éæ©æ ·ååç§° |
| | | List<String> selectmater(); |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | | List<String> selectfather(); |
| | | |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢é¡¹ç®æ¨¡çæ ¹æ®æ ·åå |
| | | List<Map<String, Object>> seleMode(String name); |
| | | |
| | | //éæ©æ ·ååç§° |
| | | List<String> selectmater(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer addMaterialInformation(AddMaterialDto addMaterialDto) { |
| | | Material material = materialMapper.selectOne(Wrappers.<Material>query().eq("name", addMaterialDto.getMaterialName())); |
| | | material.setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.updateById(material); |
| | | Material material = new Material() |
| | | .setCode("BZ" + IdWorker.getIdStr()) |
| | | .setName(addMaterialDto.getMaterialName()) |
| | | .setType(addMaterialDto.getType()); |
| | | int isInsertSuccess = materialMapper.insert(material); |
| | | if (isInsertSuccess > 0) { |
| | | Standard standard = new Standard() |
| | | .setMaterialId(material.getId()) |
| | |
| | | //æ·»å ææ -->éæ©æ ·ååç§° |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | return productModelMapper.selectmater(); |
| | | } |
| | | |
| | | |
| | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | @Resource |
| | | MaterialMapper materialMapper; |
| | | |
| | | //éæ©æ ·å |
| | | @Override |
| | | public List<String> selectmater() { |
| | | return materialMapper.selectmater(); |
| | | return productModelMapper.selectmater(); |
| | | } |
| | | |
| | | //æ·»å æ å-->鿩项ç®åç» |
| | |
| | | BeanUtils.copyProperties(productModelDto, productModel); |
| | | productModelMapper.insert(productModel); |
| | | } |
| | | //æ·»å ç©æäº§ååº |
| | | Material material = new Material(); |
| | | material.setName(productModelDto.getMaterial()).setCode(MyUtil.getTimeSixNumberCode("CP", "CP")); |
| | | materialMapper.insert(material); |
| | | } |
| | | |
| | | //æ¥è¯¢æ 忍¡çå表 |
| | |
| | | WHERE m.`state` = 1 |
| | | </select> |
| | | |
| | | |
| | | <!--æ·»å æ åéæ©æ ·ååç§°--> |
| | | <select id="selectmater" resultType="java.lang.String"> |
| | | select name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | unit |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | and material =#{name} |
| | | and material = #{name} |
| | | </select> |
| | | |
| | | <!--æ·»å æ åéæ©æ ·ååç§°--> |
| | | <select id="selectmater" resultType="java.lang.String"> |
| | | select material |
| | | from lims_laboratory.product_model |
| | | where state = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | import java.util.Map; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.sun.jmx.snmp.Timestamp; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | <select id="selectUser" resultType="Map"> |
| | | select id, name |
| | | from lims_laboratory.user |
| | | where job_state!=0 |
| | | </select> |
| | | </mapper> |