Merge remote-tracking branch 'origin/master'
已修改32个文件
已重命名3个文件
已删除8个文件
已添加49个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | | |
| | | <groupId>com.yuanchu.limslaboratory</groupId> |
| | | <artifactId>cnas-server</artifactId> |
| | | <packaging>jar</packaging> |
| | | |
| | | <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>${project.parent.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.12</version> |
| | | </dependency> |
| | | <!--åºä¸åä¸ªé½æ¯poiä¾èµ--> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-scratchpad</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yunchu.limslaboratory</groupId> |
| | | <artifactId>user-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-scratchpad</artifactId> |
| | | <version>4.1.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo; |
| | | import com.yuanchu.limslaboratory.service.CnasAnnualPlanService; |
| | | 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.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®¡æ ¸å¹´åº¦è®¡å表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-10 11:50:11 |
| | | */ |
| | | @Api(tags = "CNAS管ç-->å®¡æ ¸å¹´åº¦è®¡å") |
| | | @RestController |
| | | @RequestMapping("/cnasAnnualPlan") |
| | | public class CnasAnnualPlanController { |
| | | |
| | | @Resource |
| | | private CnasAnnualPlanService cnasAnnualPlanService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å®¡æ¥è®¡å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "page", value = "åå§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "planTime", value = "æ£éªå¼å§æ¶é´", dataTypeClass = Date.class), |
| | | }) |
| | | @GetMapping("/selectAllList") |
| | | public Result selectAllList(Integer page, Integer pageSize, @DateTimeFormat(pattern = "yyyy-MM") Date planTime) { |
| | | IPage<CnasAnnualPlanVo> reportPage = cnasAnnualPlanService.selectAllList(new Page(page, pageSize), planTime); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", reportPage.getTotal()); |
| | | map.put("row", reportPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢å®¡æ¥è®¡å") |
| | | @PostMapping("/addCnasAnnualPlan") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "CnasAnnualPlan", value = "审æ¥å¯¹è±¡", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public Result addCnasAnnualPlan(@RequestHeader("X-Token") String token, @RequestBody CnasAnnualPlan cnasAnnualPlan) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | String name = (String) unmarshal.get("name"); |
| | | cnasAnnualPlan.setKeyboarder(name); |
| | | //todo:è·ånameæé®é¢ |
| | | cnasAnnualPlanService.save(cnasAnnualPlan); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ éä»¶") |
| | | @PostMapping("/addAccessory") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "auditTime", value = "å®¡æ ¸æ¥æ", dataTypeClass = Date.class, required = true), |
| | | @ApiImplicitParam(name = "file", value = "éä»¶æä»¶", dataTypeClass = MultipartFile.class, required = true) |
| | | }) |
| | | public Result addAccessory(@RequestHeader("X-Token") String token, Date auditTime, MultipartFile file) throws Exception { |
| | | //è§£æå½åç»å½ç¨æ· |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | String name = (String) unmarshal.get("name"); |
| | | cnasAnnualPlanService.addAccessory(name, auditTime, file); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤å¹´åº¦è®¡å") |
| | | @GetMapping("/deleteCnasAnnualPlan") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "planId", value = "å®¡æ ¸æ¥æ", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | public Result deleteCnasAnnualPlan(Integer planId) { |
| | | Integer isDeleteSuccess = cnasAnnualPlanService.deleteCnasAnnualPlan(planId); |
| | | if (isDeleteSuccess == 1){ |
| | | return Result.success("å 餿å"); |
| | | } else { |
| | | return Result.fail("å é¤å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyPageDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasSatisfactionSurveyVo; |
| | | import com.yuanchu.limslaboratory.service.CnasSatisfactionSurveyService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/cnasSatisfactionSurvey") |
| | | @Api(tags = "CNAS-->满æåº¦è°æ¥") |
| | | public class CnasSatisfactionSurveyController { |
| | | |
| | | @Resource |
| | | private CnasSatisfactionSurveyService service; |
| | | |
| | | /** |
| | | * è·å满æåº¦è°æ¥ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è·å满æåº¦è°æ¥") |
| | | @GetMapping("/getCnasSatisfactionSurvey") |
| | | public Result<CnasSatisfactionSurveyVo>getCnasSatisfactionSurvey(CnasSatisfactionSurveyPageDto cnasSatisfactionSurveyPageDto){ |
| | | return Result.success(service.getCnasSatisfactionSurvey(cnasSatisfactionSurveyPageDto)); |
| | | } |
| | | |
| | | @GetMapping("/getFillNameAndId") |
| | | @ApiOperation(value = "è·åå½åå½å人") |
| | | public Result<Map>getFillNameAndId(@RequestHeader("X-Token")String token){ |
| | | return Result.success(service.getFillNameAndTd(token)); |
| | | } |
| | | |
| | | /** |
| | | * éä»¶ä¸ä¼ |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "éä»¶ä¸ä¼ ") |
| | | @PostMapping(value = "/uploadFile",consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = {MediaType.APPLICATION_JSON_VALUE}) |
| | | public Result<Map>wordParse(MultipartFile file){ |
| | | return Result.success(service.wordParse(file)); |
| | | } |
| | | |
| | | @ApiOperation(value = "满æåº¦è°æ¥æ°å¢") |
| | | @PostMapping("/addSurvey") |
| | | public Result<Boolean>addSurvey(@RequestBody CnasSatisfactionSurvey cnasSatisfactionSurvey){ |
| | | System.out.println(cnasSatisfactionSurvey+"============="); |
| | | return Result.success(service.addSurvey(cnasSatisfactionSurvey)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®¡æ ¸å¹´åº¦è®¡å表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-10 11:50:11 |
| | | */ |
| | | public interface CnasAnnualPlanMapper extends BaseMapper<CnasAnnualPlan> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡æ ¸è®¡å |
| | | * @return |
| | | */ |
| | | IPage<CnasAnnualPlanVo> selectAllList(Page<Object> objectPage, Integer year, Integer month); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @Repository |
| | | public interface CnasSatisfactionSurveyMapper extends BaseMapper<CnasSatisfactionSurvey> { |
| | | |
| | | IPage<CnasSatisfactionSurvey>selectCnasSatisfactionSurvey(Page<CnasSatisfactionSurvey>page, String surveyDate,String entryDate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®¡æ ¸å¹´åº¦è®¡å表 |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-10 11:50:11 |
| | | */ |
| | | @Data |
| | | @TableName("cnas_annual_plan") |
| | | @ApiModel(value="CnasAnnualPlan对象", description="") |
| | | public class CnasAnnualPlan implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主é®id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æ§è´¨,0:å
审,1:管çè¯å®¡") |
| | | private Integer auditType; |
| | | |
| | | @ApiModelProperty(value = "é¨é¨") |
| | | private String department; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç®ç") |
| | | private String auditPurpose; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç»é¿") |
| | | private String auditLeader; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç»å") |
| | | private String auditEmp; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ä¾æ®") |
| | | private String auditPursuant; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸èå´") |
| | | private String auditScope; |
| | | |
| | | @ApiModelProperty(value = "ç¼å¶äººå") |
| | | private String writeUser; |
| | | |
| | | @ApiModelProperty(value = "å½å
¥äººå") |
| | | private String keyboarder; |
| | | |
| | | @ApiModelProperty(value = "è®¡åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date planTime; |
| | | |
| | | @ApiModelProperty(value = "ä¸åæ ¼é¡¹ç®æ°") |
| | | private Integer count; |
| | | |
| | | @TableLogic(value = "1", delval = "0") |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date auditTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "ç¼å¶æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @Data |
| | | @TableName("cnas_satisfaction_survey") |
| | | public class CnasSatisfactionSurvey implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主é®id |
| | | */ |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | private String projectName; |
| | | |
| | | /** |
| | | * è°æ¥æ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date surveyDate; |
| | | |
| | | /** |
| | | * 客æ·åä½åç§° |
| | | */ |
| | | private String userUnit; |
| | | |
| | | ///** |
| | | // * æ¥æ |
| | | // */ |
| | | //@DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | //@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | //private Date dateInfo; |
| | | |
| | | /** |
| | | * å¡«å人å§å |
| | | */ |
| | | private String fillName; |
| | | |
| | | /** |
| | | * èä½ |
| | | */ |
| | | private String post; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | private String telephone; |
| | | |
| | | /** |
| | | * å½å
¥æ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date entryDate; |
| | | |
| | | /** |
| | | * å½å
¥äººid |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * å½å
¥äººåç§° |
| | | */ |
| | | private String userName; |
| | | |
| | | /** |
| | | * éä»¶å°å |
| | | */ |
| | | private String fileUrl; |
| | | |
| | | /** |
| | | * æå¡æåº¦ |
| | | */ |
| | | private String serviceAttitude; |
| | | |
| | | /** |
| | | * ææ¯è½å |
| | | */ |
| | | private String technicalPower; |
| | | |
| | | /** |
| | | * æ£æµå·¥ä½ |
| | | */ |
| | | private String testJob; |
| | | |
| | | /** |
| | | * æ¹è¿è¦æ± |
| | | */ |
| | | private String improvementRequirements; |
| | | |
| | | /** |
| | | * å
¶ä»è¡¥å
|
| | | */ |
| | | private String otherSupplements; |
| | | |
| | | @TableLogic(value = "1") |
| | | private Integer state; |
| | | |
| | | |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private LocalDateTime createdTime; |
| | | |
| | | |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private LocalDateTime updatedTime; |
| | | |
| | | /** |
| | | * æ¶è´¹åçæ§ |
| | | */ |
| | | private String reasonableCharge; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 java.io.Serializable; |
| | | import java.sql.Date; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="CnasSatisfactionSurveyDto", description="") |
| | | public class CnasSatisfactionSurveyPageDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "è°æ¥æ¥æ", example = "2020-01-02") |
| | | private Date surveyDate; |
| | | |
| | | @ApiModelProperty(value = "å½å
¥æ¥æ", example = "2025-06-08") |
| | | private Date entryDate; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class CnasAnnualPlanVo extends CnasAnnualPlan implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "年份") |
| | | private Integer year; |
| | | |
| | | @ApiModelProperty(value = "æä»½") |
| | | private Integer month; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç¶æ,0:å³å°å¼å§,1:宿,2:龿") |
| | | private Integer auditState; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @Data |
| | | public class CnasSatisfactionSurveyVo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @JsonSerialize |
| | | private List<CnasSatisfactionSurvey> cnasSatisfactionSurveyList; |
| | | |
| | | @JsonSerialize |
| | | private Long total; |
| | | |
| | | public CnasSatisfactionSurveyVo(List<CnasSatisfactionSurvey> cnasSatisfactionSurveyList, Long total) { |
| | | this.cnasSatisfactionSurveyList = cnasSatisfactionSurveyList; |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.CnasAnnualPlan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®¡æ ¸å¹´åº¦è®¡å表 æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-10 11:50:11 |
| | | */ |
| | | public interface CnasAnnualPlanService extends IService<CnasAnnualPlan> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡æ ¸è®¡å |
| | | * @return |
| | | */ |
| | | IPage<CnasAnnualPlanVo> selectAllList(Page<Object> objectPage, Date planTime); |
| | | |
| | | /** |
| | | * ä¸ä¼ éä»¶ |
| | | */ |
| | | void addAccessory(String name, Date auditTime, MultipartFile file); |
| | | |
| | | /** |
| | | * å é¤å¹´åº¦è®¡å |
| | | * @return |
| | | */ |
| | | Integer deleteCnasAnnualPlan(Integer planId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyPageDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasSatisfactionSurveyVo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | public interface CnasSatisfactionSurveyService{ |
| | | |
| | | /** |
| | | * è·å满æåº¦è°æ¥ä¿¡æ¯ |
| | | * @param cnasSatisfactionSurveyPageDto |
| | | * @return |
| | | */ |
| | | CnasSatisfactionSurveyVo getCnasSatisfactionSurvey(CnasSatisfactionSurveyPageDto cnasSatisfactionSurveyPageDto); |
| | | |
| | | /** |
| | | * è·åå½åå½å
¥äºº |
| | | * @return |
| | | */ |
| | | Map<String, Object> getFillNameAndTd(String token); |
| | | |
| | | /** |
| | | * è§£æword |
| | | * @param file |
| | | * @return |
| | | */ |
| | | Map<String, String> wordParse(MultipartFile file); |
| | | |
| | | /** |
| | | * æ°å¢æ»¡æåº¦è°æ¥ |
| | | * @param cnasSatisfactionSurvey |
| | | * @return |
| | | */ |
| | | Boolean addSurvey(CnasSatisfactionSurvey cnasSatisfactionSurvey); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.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.CnasAnnualPlan; |
| | | import com.yuanchu.limslaboratory.mapper.CnasAnnualPlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo; |
| | | import com.yuanchu.limslaboratory.service.CnasAnnualPlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * å®¡æ ¸å¹´åº¦è®¡å表 æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-10 11:50:11 |
| | | */ |
| | | @Service |
| | | public class CnasAnnualPlanServiceImpl extends ServiceImpl<CnasAnnualPlanMapper, CnasAnnualPlan> implements CnasAnnualPlanService { |
| | | |
| | | @Resource |
| | | private CnasAnnualPlanMapper cnasAnnualPlanMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¡æ ¸è®¡å |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<CnasAnnualPlanVo> selectAllList(Page<Object> objectPage, Date planTime) { |
| | | //夿æ¯å¦ææ¥æ |
| | | Integer yearTime = null; |
| | | Integer monthTime = null; |
| | | if (planTime != null) { |
| | | yearTime = DateUtil.year(planTime); |
| | | monthTime = DateUtil.month(planTime) + 2; |
| | | } |
| | | IPage<CnasAnnualPlanVo> page = cnasAnnualPlanMapper.selectAllList(objectPage, yearTime, monthTime); |
| | | page.getRecords().forEach(cnasAnnualPlanVo -> { |
| | | //è·åè®¡åæ¶é´ |
| | | Date time = cnasAnnualPlanVo.getPlanTime(); |
| | | //æ·»å å¹´æ |
| | | cnasAnnualPlanVo.setYear(DateUtil.year(time)); |
| | | cnasAnnualPlanVo.setMonth(DateUtil.month(time) + 1); |
| | | //å¤æå®¡æ ¸ç¶æ |
| | | //è·åå½åæ¶é´ |
| | | Date nowDate = new Date(); |
| | | //è·åå½åçå¹´æ |
| | | int year = DateUtil.year(nowDate); |
| | | int month = DateUtil.month(nowDate) + 1; |
| | | if (cnasAnnualPlanVo.getAuditTime() == null && month > cnasAnnualPlanVo.getMonth() || year > cnasAnnualPlanVo.getYear()) { |
| | | cnasAnnualPlanVo.setAuditState(2); |
| | | } else if (cnasAnnualPlanVo.getAuditTime() != null) { |
| | | cnasAnnualPlanVo.setAuditState(1); |
| | | } else { |
| | | cnasAnnualPlanVo.setAuditState(0); |
| | | } |
| | | }); |
| | | return page; |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ éä»¶ |
| | | */ |
| | | @Override |
| | | public void addAccessory(String name, Date auditTime, MultipartFile file) { |
| | | //todo: ä¸ä¼ éä»¶æªå®æ |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¹´åº¦è®¡å |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer deleteCnasAnnualPlan(Integer planId) { |
| | | LambdaUpdateWrapper<CnasAnnualPlan> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(CnasAnnualPlan::getId, planId); |
| | | updateWrapper.set(CnasAnnualPlan::getState, 0); |
| | | return cnasAnnualPlanMapper.update(new CnasAnnualPlan(), updateWrapper); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.CnasSatisfactionSurveyMapper; |
| | | import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyPageDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.CnasSatisfactionSurveyVo; |
| | | import com.yuanchu.limslaboratory.service.CnasSatisfactionSurveyService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.MultipartFileToFileUtil; |
| | | import org.apache.poi.hwpf.HWPFDocument; |
| | | import org.apache.poi.hwpf.extractor.WordExtractor; |
| | | import org.apache.poi.xwpf.extractor.XWPFWordExtractor; |
| | | import org.apache.poi.xwpf.usermodel.XWPFDocument; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/10 |
| | | */ |
| | | @Service |
| | | public class CnasSatisfactionSurveyServiceImpl implements CnasSatisfactionSurveyService { |
| | | |
| | | private static final List<String> SELECT_LIST = Arrays.asList( "âæ»¡æ=0", "âä¸è¬=1", "â䏿»¡æ=2"); |
| | | |
| | | |
| | | @Resource |
| | | private CnasSatisfactionSurveyMapper mapper; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public CnasSatisfactionSurveyVo getCnasSatisfactionSurvey(CnasSatisfactionSurveyPageDto cnasSatisfactionSurveyPageDto) { |
| | | Page<CnasSatisfactionSurvey>page=new Page<>(cnasSatisfactionSurveyPageDto.getCurrentPage(), cnasSatisfactionSurveyPageDto.getPageNum(),true); |
| | | String surveyDate=DateUtil.format(cnasSatisfactionSurveyPageDto.getSurveyDate(), "yyyyMMdd"); |
| | | String entryDate=DateUtil.format(cnasSatisfactionSurveyPageDto.getEntryDate(), "yyyyMMdd");; |
| | | IPage<CnasSatisfactionSurvey> cnasSatisfactionSurveyIPage = mapper.selectCnasSatisfactionSurvey(page,surveyDate,entryDate); |
| | | return new CnasSatisfactionSurveyVo(cnasSatisfactionSurveyIPage.getRecords(),cnasSatisfactionSurveyIPage.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¿¡æ¯ |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> getFillNameAndTd(String token) { |
| | | Map<String, Object> userInfo = userService.getUserInfo(token); |
| | | return userInfo; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, String> wordParse(MultipartFile file) { |
| | | Map<String, String>result=null; |
| | | File multipartFileToFile = null; |
| | | try { |
| | | multipartFileToFile=MultipartFileToFileUtil.multipartFileToFile(file); |
| | | result=parseWord(multipartFileToFile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | MultipartFileToFileUtil.delteTempFile(multipartFileToFile); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean addSurvey(CnasSatisfactionSurvey cnasSatisfactionSurvey) { |
| | | cnasSatisfactionSurvey.setCreatedTime(DateUtil.toLocalDateTime(DateUtil.date())); |
| | | return mapper.insert(cnasSatisfactionSurvey)>1; |
| | | } |
| | | |
| | | /** |
| | | * è§£æword |
| | | * @param file |
| | | * @return |
| | | */ |
| | | public static Map<String,String> parseWord(File file){ |
| | | String info = ""; |
| | | try { |
| | | FileInputStream fis = new FileInputStream(file); |
| | | String[] split = file.getName().split("\\."); |
| | | if ("doc".equals(split[split.length-1])) { |
| | | // 读ådocæä»¶ |
| | | HWPFDocument doc = new HWPFDocument(fis); |
| | | WordExtractor docExtractor = new WordExtractor(doc); |
| | | String text = docExtractor.getText(); |
| | | info = text.trim(); |
| | | docExtractor.close(); |
| | | } else if ("docx".equals(split[split.length-1])) { |
| | | // 读ådocxæä»¶ |
| | | XWPFDocument docx = new XWPFDocument(fis); |
| | | XWPFWordExtractor docxExtractor = new XWPFWordExtractor(docx); |
| | | String text = docxExtractor.getText(); |
| | | System.out.println("docx:"); |
| | | info = text.trim(); |
| | | docxExtractor.close(); |
| | | } else { |
| | | System.out.println("䏿¯wordæä»¶"); |
| | | } |
| | | fis.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<String> infoList = new ArrayList<String>(); |
| | | String[] split = info.split("\n"); |
| | | for (int i = 0; i < split.length; i++) { |
| | | if (i > 2) { |
| | | infoList.add(split[i] |
| | | .replaceAll("\r","") |
| | | .replaceAll(" ","") |
| | | .replaceAll("\t","") |
| | | .replaceAll("\\s","").replaceAll(" +","")); |
| | | } |
| | | } |
| | | Map<String, String> result = new HashMap<>(); |
| | | //第ä¸è¡ |
| | | String unitName="åä½åç§°Unitname"; |
| | | String projectName="项ç®åç§°Projectname"; |
| | | String[] one = infoList.get(0).replace(unitName, "").split(projectName); |
| | | result.put("unitName",one[0]); |
| | | result.put("projectName",one[1]); |
| | | String fillName="填表人å§åï¼æ¥æName/dateofthepersonfillingintheform"; |
| | | String post="èä½Posts"; |
| | | String telephone="èç³»çµè¯Contactnumber"; |
| | | String email="é®ç¼Zip"; |
| | | String[] split1 = infoList.get(1).replace(fillName, "").split(post); |
| | | result.put("fillName",split1[0]); |
| | | String[] split2 = split1[1].split(telephone); |
| | | result.put("post",split2[0]); |
| | | String[] split3 = split2[1].split(email); |
| | | result.put("telephone",split3[0]); |
| | | result.put("email",split3[1]); |
| | | //第äºè¡ |
| | | String serviceAttitude="æå¡æåº¦Serviceattitude"; |
| | | //æå¡æåº¦å建议 |
| | | String two = getSelectAndAdvise(infoList.get(2), serviceAttitude); |
| | | result.put("serviceAttitude",two); |
| | | //第ä¸è¡ |
| | | String technicalPower="ææ¯è½åTechnicalcompetence"; |
| | | String three = getSelectAndAdvise(infoList.get(3), technicalPower); |
| | | result.put("technicalPower",three); |
| | | //第åè¡ |
| | | String testJob="æ£æµå·¥ä½Inspectionwork"; |
| | | String four = getSelectAndAdvise(infoList.get(4), testJob); |
| | | result.put("testJob",four); |
| | | //第äºè¡ |
| | | String reasonableCharge="æ¶è´¹åçæ§Reasonablefees"; |
| | | String five = getSelectAndAdvise(infoList.get(5), reasonableCharge); |
| | | result.put("reasonableCharge",five); |
| | | //第å
è¡ |
| | | String improvementRequirements="æ¹è¿çè¦æ±ï¼"; |
| | | String requirementsForImprovement="Requirementsforimprovement:"; |
| | | String six = infoList.get(6).replace(improvementRequirements, "").replace(requirementsForImprovement, ""); |
| | | result.put("improvementRequirements",six); |
| | | //第ä¸è¡ |
| | | String otherSupplements="æ¨å¯¹æä»¬ç叿ï¼"; |
| | | String otherEnglish="Whatyouwantfromus:"; |
| | | String seven = infoList.get(7).replace(otherSupplements, "").replace(otherEnglish, ""); |
| | | result.put("otherSupplements",seven); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·å鿩以å建议 |
| | | * @param str |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public static String getSelectAndAdvise(String str,String type){ |
| | | String adviseInfo="建议ï¼"; |
| | | String suggestion="Suggestion:"; |
| | | String satisfied="Satisfied"; |
| | | String general="General"; |
| | | String dissatisfied="Dissatisfied"; |
| | | String[] split4 = str.replace(type, "").replace(suggestion, "").split(adviseInfo); |
| | | List<String>select=new ArrayList<>(); |
| | | String advise=split4[1]; |
| | | String[] split5 = split4[0].split(satisfied); |
| | | select.add(split5[0]); |
| | | String[] split6 = split5[1].split(general); |
| | | select.add(split6[0]); |
| | | select.add(split6[1].replace(dissatisfied,"")); |
| | | String selected = getSelected(select); |
| | | return selected+"/$"+advise; |
| | | } |
| | | |
| | | public static String getSelected(List<String> select){ |
| | | String collect = SELECT_LIST.stream().filter(item -> select.stream() |
| | | .map(e -> e).collect(Collectors.toList()) |
| | | .contains(item.split("=")[0])).collect(Collectors.joining()); |
| | | return collect.split("=")[1]; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.CnasAnnualPlanMapper"> |
| | | <!--æ¥è¯¢å®¡æ ¸è®¡å--> |
| | | <select id="selectAllList" resultType="com.yuanchu.limslaboratory.pojo.vo.CnasAnnualPlanVo"> |
| | | select id, |
| | | audit_type, |
| | | department, |
| | | audit_purpose, |
| | | audit_leader, |
| | | audit_emp, |
| | | audit_pursuant, |
| | | audit_scope, |
| | | write_user, |
| | | keyboarder, |
| | | plan_time, |
| | | count, |
| | | state, |
| | | audit_time, |
| | | update_time |
| | | from cnas_annual_plan |
| | | where state = 1 |
| | | <if test="year != null and month != null"> |
| | | and year(plan_time) = #{year} |
| | | and month(plan_time) = #{month} |
| | | </if> |
| | | order by id desc |
| | | </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.CnasSatisfactionSurveyMapper"> |
| | | |
| | | <select id="selectCnasSatisfactionSurvey" |
| | | resultType="CnasSatisfactionSurvey"> |
| | | SELECT |
| | | css.id id, |
| | | css.project_name projectName, |
| | | css.survey_date surveyDate, |
| | | css.user_unit userUnit, |
| | | css.`fill_name` fillName, |
| | | css.post post, |
| | | css.telephone telephone, |
| | | css.entry_date entryDate, |
| | | u.`name` userName, |
| | | css.service_attitude serviceAttitude, |
| | | css.technical_power technicalPower, |
| | | css.test_job testJob, |
| | | css.reasonable_charge reasonableCharge, |
| | | css.improvement_requirements improvementRequirements, |
| | | css.other_supplements otherSupplements |
| | | FROM |
| | | cnas_satisfaction_survey css, |
| | | `user` u |
| | | WHERE |
| | | 1 = 1 |
| | | AND css.user_id = u.id |
| | | and css.state=1 |
| | | <if test="surveyDate!=null"> |
| | | and date_format(css.survey_date,'%Y%m%d') = ${surveyDate} |
| | | </if> |
| | | <if test="entryDate!=null"> |
| | | and date_format(css.entry_date,'%Y%m%d') = ${entryDate} |
| | | </if> |
| | | order by css.id Desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>framework</name> |
| | | <description>framework</description> |
| | | |
| | | <packaging>jar</packaging> |
| | | <dependencies> |
| | | <!--æ°æ®åºè¿æ¥æ± --> |
| | |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | <version>${commons.lang3}</version> |
| | | </dependency> |
| | | <!-- mysqlé©±å¨ --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.18</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2022/8/5 |
| | | */ |
| | | @Slf4j |
| | | public class MultipartFileToFileUtil { |
| | | /** |
| | | * MultipartFile 转 File |
| | | * |
| | | * @param file |
| | | * @throws Exception |
| | | */ |
| | | public static File multipartFileToFile(MultipartFile file) throws Exception { |
| | | |
| | | File toFile = null; |
| | | if (file.equals("") || file.getSize() <= 0) { |
| | | file = null; |
| | | } else { |
| | | InputStream ins = null; |
| | | ins = file.getInputStream(); |
| | | toFile = new File(file.getOriginalFilename()); |
| | | inputStreamToFile(ins, toFile); |
| | | ins.close(); |
| | | } |
| | | return toFile; |
| | | } |
| | | |
| | | //è·åæµæä»¶ |
| | | private static void inputStreamToFile(InputStream ins, File file) { |
| | | try { |
| | | OutputStream os = new FileOutputStream(file); |
| | | int bytesRead = 0; |
| | | byte[] buffer = new byte[8192]; |
| | | while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | os.close(); |
| | | ins.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å 餿¬å°ä¸´æ¶æä»¶ |
| | | * @param file |
| | | */ |
| | | public static void delteTempFile(File file) { |
| | | if (file != null) { |
| | | String name = file.getName(); |
| | | File del = new File(file.toURI()); |
| | | if (del.delete()){ |
| | | log.info("å é¤ä¸´æ¶æä»¶"+name+"æå!"); |
| | | }else { |
| | | log.error("å é¤ä¸´æ¶æä»¶"+name+"失败!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getTimeSixNumberCode(String prefix){ |
| | | public static String getTimeSixNumberCode(String prefix,String name){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format = simpleDateFormat.format(new Date()); |
| | | String timeStr = format.replace("-", ""); |
| | | long incrNum = RedisUtil.incr("num", 1); |
| | | long incrNum = RedisUtil.incr(name, 1); |
| | | if(incrNum == 1){ |
| | | RedisUtil.expire("num", 60 * 60 * 24); |
| | | RedisUtil.expire(name, 60 * 60 * 24); |
| | | } |
| | | String sixIncr = String.format("%06d", incrNum); |
| | | return prefix + timeStr + sixIncr; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import org.apache.commons.lang3.concurrent.BasicThreadFactory; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.ScheduledThreadPoolExecutor; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | |
| | | /** |
| | | * çº¿ç¨æ± é
ç½® |
| | | * |
| | | * @author å¼ å®¾ |
| | | **/ |
| | | @Configuration |
| | | public class ThreadPoolConfig |
| | | { |
| | | // æ ¸å¿çº¿ç¨æ± å¤§å° |
| | | private int corePoolSize = 50; |
| | | |
| | | // æå¤§å¯å建ççº¿ç¨æ° |
| | | private int maxPoolSize = 200; |
| | | |
| | | // éåæå¤§é¿åº¦ |
| | | private int queueCapacity = 1000; |
| | | |
| | | // çº¿ç¨æ± ç»´æ¤çº¿ç¨æå
许çç©ºé²æ¶é´ |
| | | private int keepAliveSeconds = 300; |
| | | |
| | | @Bean(name = "threadPoolTaskExecutor") |
| | | public ThreadPoolTaskExecutor threadPoolTaskExecutor() |
| | | { |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | | executor.setMaxPoolSize(maxPoolSize); |
| | | executor.setCorePoolSize(corePoolSize); |
| | | executor.setQueueCapacity(queueCapacity); |
| | | executor.setKeepAliveSeconds(keepAliveSeconds); |
| | | // çº¿ç¨æ± 对æç»ä»»å¡(æ 线ç¨å¯ç¨)çå¤ççç¥ |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | return executor; |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡å¨ææ§æå®æ¶ä»»å¡ |
| | | */ |
| | | @Bean(name = "scheduledExecutorService") |
| | | protected ScheduledExecutorService scheduledExecutorService() |
| | | { |
| | | return new ScheduledThreadPoolExecutor(corePoolSize, |
| | | new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) |
| | | { |
| | | @Override |
| | | protected void afterExecute(Runnable r, Throwable t) |
| | | { |
| | | super.afterExecute(r, t); |
| | | Threads.printException(r, t); |
| | | } |
| | | }; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.utils; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.concurrent.*; |
| | | |
| | | /** |
| | | * 线ç¨ç¸å
³å·¥å
·ç±». |
| | | * |
| | | * @author å¼ å®¾ |
| | | */ |
| | | public class Threads |
| | | { |
| | | private static final Logger logger = LoggerFactory.getLogger(Threads.class); |
| | | |
| | | /** |
| | | * sleepçå¾
,åä½ä¸ºæ¯«ç§ |
| | | */ |
| | | public static void sleep(long milliseconds) |
| | | { |
| | | try |
| | | { |
| | | Thread.sleep(milliseconds); |
| | | } |
| | | catch (InterruptedException e) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åæ¢çº¿ç¨æ± |
| | | * å
使ç¨shutdown, åæ¢æ¥æ¶æ°ä»»å¡å¹¶å°è¯å®æææå·²åå¨ä»»å¡. |
| | | * 妿è¶
æ¶, åè°ç¨shutdownNow, åæ¶å¨workQueueä¸Pendingçä»»å¡,并䏿ææé»å¡å½æ°. |
| | | * 妿ä»äººè¶
æï¼åå¼·å¶éåº. |
| | | * å¦å¯¹å¨shutdownæ¶çº¿ç¨æ¬èº«è¢«è°ç¨ä¸æåäºå¤ç. |
| | | */ |
| | | public static void shutdownAndAwaitTermination(ExecutorService pool) |
| | | { |
| | | if (pool != null && !pool.isShutdown()) |
| | | { |
| | | pool.shutdown(); |
| | | try |
| | | { |
| | | if (!pool.awaitTermination(120, TimeUnit.SECONDS)) |
| | | { |
| | | pool.shutdownNow(); |
| | | if (!pool.awaitTermination(120, TimeUnit.SECONDS)) |
| | | { |
| | | logger.info("Pool did not terminate"); |
| | | } |
| | | } |
| | | } |
| | | catch (InterruptedException ie) |
| | | { |
| | | pool.shutdownNow(); |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æå°çº¿ç¨å¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | public static void printException(Runnable r, Throwable t) |
| | | { |
| | | if (t == null && r instanceof Future<?>) |
| | | { |
| | | try |
| | | { |
| | | Future<?> future = (Future<?>) r; |
| | | if (future.isDone()) |
| | | { |
| | | future.get(); |
| | | } |
| | | } |
| | | catch (CancellationException ce) |
| | | { |
| | | t = ce; |
| | | } |
| | | catch (ExecutionException ee) |
| | | { |
| | | t = ee.getCause(); |
| | | } |
| | | catch (InterruptedException ie) |
| | | { |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | if (t != null) |
| | | { |
| | | logger.error(t.getMessage(), t); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | |
| | | @GetMapping("/selectAll") |
| | | public Result selectAll(Integer type) { |
| | | switch (type) { |
| | | case 0 : |
| | | case 0: |
| | | //åææ |
| | | return Result.success(rawMaterialService.selectRawmaAll()); |
| | | case 1 : |
| | | case 1: |
| | | //å§æå |
| | | return Result.success(linkBasicInformationService.selectLinkAll()); |
| | | case 2 : |
| | | case 2: |
| | | //æåæ£éª |
| | | return Result.success("请è¾å
¥æ£éªä¿¡æ¯!"); |
| | | } |
| | |
| | | }) |
| | | @GetMapping("/selectRawmaById") |
| | | public Result selectRawmaById(Integer id, String startTime, String endTime) throws ParseException { |
| | | return Result.success(rawMaterialService.selectRawmaById(id,startTime,endTime)); |
| | | return Result.success(rawMaterialService.selectRawmaById(id, startTime, endTime)); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(name = "bid", value = "å§ææ¥æ£åid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "did", value = "å§ææ¥æ£æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | |
| | | |
| | | @GetMapping("/selectLinkByid") |
| | | public Result selectLinkByid(Integer bid, Integer did) { |
| | | return Result.success(linkBasicInformationService.selectLinkByid(bid, did)); |
| | |
| | | } |
| | | return Result.success(inspectionService.updateInspectsById(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformanceReview; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformanceReviewVo; |
| | | import com.yuanchu.limslaboratory.service.NonConformanceReviewService; |
| | | 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/9 |
| | | */ |
| | | @Api(tags = "è¯éªç®¡ç-->ä¸åæ ¼åè¯å®¡") |
| | | @RestController |
| | | @RequestMapping("/nonConformanceReview") |
| | | public class NonConformanceReviewController { |
| | | |
| | | @Resource |
| | | private NonConformanceReviewService service; |
| | | |
| | | |
| | | @GetMapping("/getNonConformanceReview") |
| | | @ApiOperation("ä¸åæ ¼ååé¦-->è·åä¸åæ ¼åè¯å®¡ä¿¡æ¯") |
| | | public Result<NonConformanceReviewVo> getNonConformanceReview(NonConformingFeedbackDto nonConformingFeedbackDto){ |
| | | |
| | | return Result.success(service.getNonConformanceReviewVo(nonConformingFeedbackDto)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformingFeedbackVo; |
| | | import com.yuanchu.limslaboratory.service.NonConformingFeedbackService; |
| | | 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/9 |
| | | */ |
| | | @Api(tags = "è¯éªç®¡ç-->ä¸åæ ¼ååé¦") |
| | | @RestController |
| | | @RequestMapping("/non-conforming-feedback") |
| | | public class NonConformingFeedbackController { |
| | | |
| | | @Resource |
| | | private NonConformingFeedbackService service; |
| | | |
| | | @GetMapping("/getNonConformingFeedback") |
| | | @ApiOperation("ä¸åæ ¼ååé¦-->è·åä¸åæ ¼åä¿¡æ¯") |
| | | public Result<NonConformingFeedbackVo> getNonConformingFeedback(NonConformingFeedbackDto nonConformingFeedbackDto){ |
| | | return Result.success(service.getNonConformingFeedback(nonConformingFeedbackDto)); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | 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.format.annotation.DateTimeFormat; |
| | | 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; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-09 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªè®¡å") |
| | | @RestController |
| | | @RequestMapping("/plan") |
| | | public class PlanController { |
| | | |
| | | @Resource |
| | | private PlanService planService; |
| | | |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªè®¡å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "device", value = "设å¤åç§°Id", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "beginTime", value = "æ£éªå¼å§æ¶é´", dataTypeClass = Date.class), |
| | | @ApiImplicitParam(name = "endTime", value = "æ£éªç»ææ¶é´", dataTypeClass = Date.class), |
| | | @ApiImplicitParam(name = "user", value = "æ£éªäºº", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllPlan") |
| | | public Result selectAllPlan(String device, @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, String user) { |
| | | List<PlanVo> planVoList = planService.selectAllPlan(device, beginTime, endTime, user); |
| | | return Result.success(planVoList); |
| | | } |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/ReportCheckController.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.service.ReportCheckService; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.service.ReportAuditingService; |
| | | 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 javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->æ¥åå®¡æ ¸") |
| | | @RestController |
| | | @RequestMapping("/reportCheck") |
| | | public class ReportCheckController { |
| | | @RequestMapping("/reportAuditing") |
| | | public class ReportAuditingController { |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Autowired |
| | | private ReportCheckService reportCheckService; |
| | | @Resource |
| | | private ReportAuditingService reportAuditingService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æ¥åå®¡æ ¸å
容") |
| | | @ApiImplicitParams(value = { |
| | |
| | | @ApiImplicitParam(name = "status", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "name", value = "æç´¢ä¿¡æ¯", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllReportCheck") |
| | | @GetMapping("/selectAllReportAuditing") |
| | | public Result selectAllReportCheck(Integer page, Integer pageSize, Integer status, String name) { |
| | | IPage<ReportCheckVo> reportPage = reportCheckService.selectAllReportCheck(new Page<Object>(page, pageSize), status, name); |
| | | IPage<ReportAuditingVo> reportPage = reportAuditingService.selectAllReportAuditing(new Page<Object>(page, pageSize), status, name); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", reportPage.getTotal()); |
| | | map.put("row", reportPage.getRecords()); |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | /** |
| | | * æå¡å¯¹è±¡ |
| | | */ |
| | | @Autowired |
| | | @Resource |
| | | private ReportService reportService; |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªæ¥å") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformanceReviewDto; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformanceReview; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Repository |
| | | public interface NonConformanceReviewMapper extends BaseMapper<NonConformanceReview> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mybatis_config.MyBaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Repository |
| | | public interface NonConformingFeedbackMapper extends BaseMapper<NonConformingFeedback> { |
| | | |
| | | IPage<NonConformingFeedback> selectNonConformingFeedback(@Param("nonConformingFeedbackDto") NonConformingFeedbackDto nonConformingFeedbackDto, Page page); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface PlanMapper { |
| | | /** |
| | | * æ¥è¯¢æ£éªè®¡å |
| | | * @return |
| | | */ |
| | | List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user); |
| | | } |
| | |
| | | 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.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportVo; |
| | | |
| | | /** |
| | |
| | | * æ¥è¯¢æ¥åå®¡æ ¸ |
| | | * @return |
| | | */ |
| | | IPage<ReportCheckVo> selectAllReportCheck(Page<Object> page, Integer status, String name); |
| | | IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.Dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="NonConformanceReviewDto对象", description="") |
| | | public class NonConformanceReviewDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034", required = true) |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼", required = true) |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH", required = true) |
| | | private String inspectionCode; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.Dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="NonConformingFeedbackDto对象", description="") |
| | | public class NonConformingFeedbackDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | |
| | | @ApiModelProperty(value = "å页å¤å°æ¡", example = "10", required = true) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·", example = "1680929494813868034", required = true) |
| | | private String materialCode; |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°", example = "çµçº¿çµç¼", required = true) |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "ç³è¯·åå·", example = "XG-UGYUGH", required = true) |
| | | private String inspectionCode; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Date; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="ä¸ç¬¦ååè¯å®¡å¯¹è±¡", description="") |
| | | @TableName("tb_non_conformance_review") |
| | | public class NonConformanceReview implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ ·åç¼å· |
| | | */ |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | */ |
| | | private String materialName; |
| | | |
| | | /** |
| | | * ç³è¯·åå· |
| | | */ |
| | | private String inspectionCode; |
| | | |
| | | /** |
| | | * ç»è®°æ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * å®éªè´è´£äºº |
| | | */ |
| | | private String testManager; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | private String createdUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private LocalDateTime createdTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | private String updatedUser; |
| | | |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | @JsonFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | | private LocalDateTime updatedTime; |
| | | |
| | | /** |
| | | * é»è¾å é¤ |
| | | */ |
| | | @TableLogic(value = "1") |
| | | private Integer state; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Date; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class NonConformingFeedback implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * æ ·åç¼å· |
| | | */ |
| | | private String materialCode; |
| | | |
| | | /** |
| | | * æ ·ååç§° |
| | | */ |
| | | private String materialName; |
| | | |
| | | /** |
| | | * ç³è¯·åå· |
| | | */ |
| | | private String inspectionCode; |
| | | |
| | | /** |
| | | * ç»è®°æ¥æ |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * å®éªè´è´£äºº |
| | | */ |
| | | private String testManager; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String specifications; |
| | | |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="InspectionReport对象", description="") |
| | | @TableName("inspection_report") |
| | | @ApiModel(value="Report对象", description="") |
| | | @TableName("report") |
| | | public class Report implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty(value = "å®¡æ ¸ç»è®º") |
| | | private String conclusion; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ ¸äººid") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "å®¡æ ¸äºº") |
| | | private String approver; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç³è¯·è¡¨id") |
| | | private Integer inspectionId; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformanceReview; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | public class NonConformanceReviewVo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @JsonSerialize |
| | | private List<NonConformanceReview> nonConformanceReviewList; |
| | | |
| | | @JsonSerialize |
| | | private Long total; |
| | | |
| | | public NonConformanceReviewVo(List<NonConformanceReview> nonConformanceReviewList, Long total) { |
| | | this.nonConformanceReviewList = nonConformanceReviewList; |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterial; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Data |
| | | public class NonConformingFeedbackVo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @JsonSerialize |
| | | private List<NonConformingFeedback> nonConformingFeedbackList; |
| | | |
| | | @JsonSerialize |
| | | private Long total; |
| | | |
| | | public NonConformingFeedbackVo(List<NonConformingFeedback> nonConformingFeedbackList, Long total) { |
| | | this.nonConformingFeedbackList = nonConformingFeedbackList; |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * æ£éªè®¡åVO |
| | | */ |
| | | @Data |
| | | public class PlanVo { |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | @JsonSerialize |
| | | private String device; |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | @JsonSerialize |
| | | private String samplename; |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private String sampleid; |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | @JsonSerialize |
| | | private String modelandspecification; |
| | | @ApiModelProperty(value = "åä½") |
| | | @JsonSerialize |
| | | private String unit; |
| | | @ApiModelProperty(value = "æ°é") |
| | | @JsonSerialize |
| | | private Integer amount; |
| | | @ApiModelProperty(value = "æ£éªé¡¹ç®") |
| | | @JsonSerialize |
| | | private String checkproject; |
| | | @ApiModelProperty(value = "æ£éªäºº") |
| | | @JsonSerialize |
| | | private String checker; |
| | | @ApiModelProperty(value = "计åå·¥æ") |
| | | @JsonSerialize |
| | | private Integer duration; |
| | | @ApiModelProperty(value = "æ£éªè¿åº¦0:æªåé
, 50:æ£éªä¸, 100:已宿") |
| | | @JsonSerialize |
| | | private Integer progress; |
| | | @ApiModelProperty(value = "计åå¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date starttime; |
| | | @ApiModelProperty(value = "计åç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date finishtime; |
| | | |
| | | //夿项ç®ç¶æ |
| | | private Integer state; |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/vo/ReportCheckVo.java ÐÞ¸Ä |
| | |
| | | * æ¥åå®¡æ ¸ |
| | | */ |
| | | @Data |
| | | public class ReportCheckVo { |
| | | public class ReportAuditingVo { |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private String materialCode; |
| | |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | @ApiModelProperty(value = "æäº¤æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date submitTime; |
| | | @ApiModelProperty(value = "å®¡æ ¸æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date checkTime; |
| | | } |
| | |
| | | @ApiModelProperty(value = "审æ¹äºº") |
| | | @JsonSerialize |
| | | private Integer approver; |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å¾
ç¾åï¼3ï¼å·²å®æ") |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0ï¼å¾
æäº¤ 1ï¼å¾
å®¡æ ¸ï¼2ï¼å·²å®¡æ ¸") |
| | | @JsonSerialize |
| | | private Integer status; |
| | | @ApiModelProperty(value = "æ£éªç»è®º") |
| | |
| | | private String conclusion; |
| | | @ApiModelProperty(value = "ç¼å¶äºº") |
| | | @JsonSerialize |
| | | private Integer userId; |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformanceReviewVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformingFeedbackVo; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | public interface NonConformanceReviewService { |
| | | |
| | | /** |
| | | * å¾å°ä¸åæ ¼åæäº¤ä¿¡æ¯ |
| | | * @param nonConformingFeedbackDto |
| | | * @return |
| | | */ |
| | | NonConformanceReviewVo getNonConformanceReviewVo(NonConformingFeedbackDto nonConformingFeedbackDto); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformingFeedbackVo; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | public interface NonConformingFeedbackService { |
| | | |
| | | /** |
| | | * å¾å°ä¸åæ ¼ååé¦ä¿¡æ¯ |
| | | * @param nonConformingFeedbackDto |
| | | * @return |
| | | */ |
| | | NonConformingFeedbackVo getNonConformingFeedback(NonConformingFeedbackDto nonConformingFeedbackDto); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-09 |
| | | */ |
| | | public interface PlanService { |
| | | /** |
| | | * æ¥è¯¢æ£éªè®¡å |
| | | * @return |
| | | */ |
| | | List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user); |
| | | |
| | | } |
ÎļþÃû´Ó inspection-server/src/main/java/com/yuanchu/limslaboratory/service/ReportCheckService.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportCheckVo; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-07 |
| | | */ |
| | | public interface ReportCheckService extends IService<Report> { |
| | | public interface ReportAuditingService extends IService<Report> { |
| | | |
| | | /** |
| | | * 项ç®å®¡æ ¸è¡¨æ¥è¯¢ |
| | | * @return |
| | | */ |
| | | IPage<ReportCheckVo> selectAllReportCheck(Page<Object> page, Integer status, String name); |
| | | IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name); |
| | | } |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | ReportMapper reportMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªç³è¯·åå表 |
| | |
| | | .build(); |
| | | 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; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) { |
| | | String code = MyUtil.getTimeSixNumberCode("SL"); |
| | | String code = MyUtil.getTimeSixNumberCode("SL","SL"); |
| | | linkBasicInformation.setEntrustCoding(code); |
| | | int insert = linkBasicInformationMapper.insert(linkBasicInformation); |
| | | if (insert == 1) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.NonConformanceReviewMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformanceReview; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformanceReviewVo; |
| | | import com.yuanchu.limslaboratory.service.NonConformanceReviewService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Service |
| | | public class NonConformanceReviewServiceImpl implements NonConformanceReviewService { |
| | | |
| | | @Resource |
| | | private NonConformanceReviewMapper mapper; |
| | | |
| | | @Override |
| | | 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())); |
| | | } |
| | | if (StringUtils.hasText(nonConformingFeedbackDto.getMaterialName())){ |
| | | queryWrapper.lambda().and(a->a.eq(NonConformanceReview::getMaterialName,nonConformingFeedbackDto.getMaterialName())); |
| | | } |
| | | if (StringUtils.hasText(nonConformingFeedbackDto.getInspectionCode())){ |
| | | queryWrapper.lambda().and(a->a.eq(NonConformanceReview::getInspectionCode,nonConformingFeedbackDto.getInspectionCode())); |
| | | } |
| | | Page<NonConformanceReview> page = new Page<>(nonConformingFeedbackDto.getCurrentPage(), nonConformingFeedbackDto.getPageNum(), true); |
| | | IPage<NonConformanceReview> iPage = mapper.selectPage(page, queryWrapper); |
| | | return new NonConformanceReviewVo(iPage.getRecords(),iPage.getTotal()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.NonConformingFeedbackMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Dto.NonConformingFeedbackDto; |
| | | import com.yuanchu.limslaboratory.pojo.NonConformingFeedback; |
| | | import com.yuanchu.limslaboratory.pojo.vo.NonConformingFeedbackVo; |
| | | import com.yuanchu.limslaboratory.service.NonConformingFeedbackService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/9 |
| | | */ |
| | | @Service |
| | | public class NonConformingFeedbackServiceImpl implements NonConformingFeedbackService { |
| | | |
| | | @Resource |
| | | private NonConformingFeedbackMapper mapper; |
| | | |
| | | @Override |
| | | public NonConformingFeedbackVo getNonConformingFeedback(NonConformingFeedbackDto nonConformingFeedbackDto) { |
| | | Page<Object> page = new Page<>(nonConformingFeedbackDto.getCurrentPage(), nonConformingFeedbackDto.getPageNum(), true); |
| | | IPage<NonConformingFeedback> iPage = mapper.selectNonConformingFeedback(nonConformingFeedbackDto, page); |
| | | return new NonConformingFeedbackVo(iPage.getRecords(),iPage.getTotal()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-09 |
| | | */ |
| | | @Service |
| | | public class PlanServiceImpl implements PlanService { |
| | | |
| | | @Resource |
| | | private PlanMapper planMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£éªè®¡å |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PlanVo> selectAllPlan(String device, Date beginTime, Date endTime, String user) { |
| | | //è·åæ°æ®åºæ°æ® |
| | | List<PlanVo> planVos = planMapper.selectAllPlan(device, beginTime, endTime, user); |
| | | //æ·»å 计åå·¥æåæ£éªè¿åº¦ |
| | | planVos.forEach(planVo -> { |
| | | //æ·»å æ£éªè¿åº¦ |
| | | //夿æ¯å¦æ¯å·²å®æ |
| | | if (planVo.getState() != null) { |
| | | planVo.setProgress(100); |
| | | } |
| | | //夿æ¯å¦æ¯æªåé
|
| | | if (planVo.getCheckproject() == null) { |
| | | planVo.setProgress(0); |
| | | } |
| | | //夿æ¯å¦æ¯è¿è¡ä¸ |
| | | if (planVo.getState() == null && planVo.getCheckproject() != null) { |
| | | planVo.setProgress(50); |
| | | } |
| | | //æ·»å 计åå·¥æ |
| | | if (planVo.getFinishtime() != null && planVo.getStarttime() != null) { |
| | | long startTimeInMillis = planVo.getStarttime().getTime(); |
| | | long endTimeInMillis = planVo.getFinishtime().getTime(); |
| | | long durationInMillis = endTimeInMillis - startTimeInMillis; |
| | | long duration = durationInMillis / (1000 * 60 * 60); |
| | | planVo.setDuration(Integer.valueOf((int) duration)); |
| | | } |
| | | }); |
| | | return planVos; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.ReportMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.ReportAuditingVo; |
| | | import com.yuanchu.limslaboratory.service.ReportAuditingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-08-07 |
| | | */ |
| | | @Service |
| | | public class ReportAuditingServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportAuditingService { |
| | | |
| | | @Resource |
| | | private ReportMapper reportMapper; |
| | | |
| | | /** |
| | | * 项ç®å®¡æ ¸è¡¨æ¥è¯¢ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ReportAuditingVo> selectAllReportAuditing(Page<Object> page, Integer status, String name) { |
| | | return reportMapper.selectAllReportAuditing(page, status, name); |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | |
| | | @Service |
| | | public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements ReportService { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private ReportMapper reportMapper; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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 |
| | | FROM |
| | | inspection i, |
| | | inspection_material im, |
| | | `user` u |
| | | WHERE |
| | | 1 = 1 |
| | | AND 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},"%") |
| | | </if> |
| | | <if test="nonConformingFeedbackDto.materialName!=null and 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},"%") |
| | | </if> |
| | | 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"> |
| | | |
| | | <!--æ¥è¯¢æ£éªè®¡å--> |
| | | <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo"> |
| | | select i.equipment_name device, |
| | | im.name samplename, |
| | | im.code sampleid, |
| | | im.specifications modelandspecification, |
| | | im.unit unit, |
| | | im.num amount, |
| | | ip.name checkproject, |
| | | u.name checker, |
| | | ip.start_time starttime, |
| | | ip.end_time finishtime, |
| | | ip.test_state state |
| | | from instrument i |
| | | left join (select ip.* |
| | | from inspection_product ip |
| | | right join (select instrument_id, max(ip.end_time) t |
| | | from inspection_product ip |
| | | group by instrument_id) it |
| | | on ip.instrument_id = it.instrument_id and ip.end_time = it.t) ip |
| | | on i.id = ip.instrument_id |
| | | left join inspection_material im on im.id = ip.inspection_material_id |
| | | left join user u on u.id = ip.user_id |
| | | <where> |
| | | <if test="device != null and device != null"> |
| | | and i.equipment_name = #{device} |
| | | </if> |
| | | <if test="user != null and user != null"> |
| | | and u.name = #{user} |
| | | </if> |
| | | <if test="beginTime != null and endTime != null"> |
| | | and ip.start_time between #{beginTime} and #{endTime} |
| | | </if> |
| | | </where> |
| | | </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.ReportMapper"> |
| | | |
| | | <!--æ¥è¯¢æ£éªæ¥å--> |
| | | <select id="selectAllReport" resultType="com.yuanchu.limslaboratory.pojo.vo.ReportVo">select 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 |
| | | <where> |
| | | r.state = 1 |
| | | <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 r.code like concat('%', #{name}, '%') |
| | | </if> |
| | | </where> |
| | | </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> |
| | |
| | | public Result<?> addClassifyInformation(@RequestBody Classify classify) { |
| | | Integer isAddClassifySuccess = classifyService.addClassifyInformation(classify); |
| | | if (isAddClassifySuccess == 1) { |
| | | return Result.success("æ·»å åç±»ã"+ classify.getSonName() +"ãæåï¼"); |
| | | return Result.success("1-$æ·»å åç±»ã"+ classify.getSonName() +"ãæåï¼"); |
| | | } else if (isAddClassifySuccess == 2) { |
| | | return Result.fail("æ±æé夿·»å åç±»åç§°ã"+ classify.getSonName() +"ãï¼æ·»å 失败ï¼"); |
| | | return Result.success("2-$æ±æé夿·»å åç±»åç§°ã"+ classify.getSonName() +"ãï¼æ·»å 失败ï¼"); |
| | | } |
| | | return Result.fail("æ·»å åç±»ã"+ classify.getSonName() +"ã失败ï¼"); |
| | | return Result.success("0-$æ·»å åç±»ã"+ classify.getSonName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("å类侧边æ å表ï¼å¦æsonName为空ï¼å带çfather_nameçIdè¿è¡ç¹å»æä½") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetPlanMeasureInstrumentDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeteringPlanDto; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | |
| | | } |
| | | |
| | | @ApiOperation("计é计åå页æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "measureCodeOrNameOrUnit", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/plan_page_list") |
| | | public Result<?> pagingQueryOfMeteringPlan(Integer pageNo, Integer pageSize, String measureCodeOrNameOrUnit) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeteringPlan(measureCodeOrNameOrUnit, new Page<Objects>(pageNo, pageSize)); |
| | | return Result.success(page); |
| | | public Result<?> pagingQueryOfMeteringPlan(SelectMeteringPlanDto dto) { |
| | | return Result.success(meteringPlanService.pagingQueryOfMeteringPlan(dto)); |
| | | } |
| | | |
| | | @ApiOperation("计éå°è´¦å页æ¥è¯¢") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageNo", value = "èµ·å§é¡µ", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯ä¸é¡µæ°é", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/standing_page_list") |
| | | public Result<?> pagingQueryOfMeasurementLedger(Integer pageNo, Integer pageSize) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(new Page<Objects>(pageNo, pageSize)); |
| | | public Result<?> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto selectMeasurementLedgerDto) { |
| | | IPage<Map<String, Object>> page = meteringPlanService.pagingQueryOfMeasurementLedger(selectMeasurementLedgerDto); |
| | | return Result.success(page); |
| | | } |
| | | |
| | | @ApiOperation("å询计åä¿¡æ¯") |
| | | @GetMapping("/getPlanMeasureInstrument") |
| | | public Result<?> getPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto){ |
| | | return Result.success(meteringPlanService.getPlanMeasureInstrument(dto)); |
| | | } |
| | | |
| | | @ApiOperation("计åä¿¡æ¯ä¹ä¸å页") |
| | | @GetMapping("/limitGetPlanMeasureInstrument") |
| | | public Result<?> limitGetPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto){ |
| | | return Result.success(meteringPlanService.limitGetPlanMeasureInstrument(dto)); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Classify; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | |
| | | */ |
| | | public interface ClassifyMapper extends BaseMapper<Classify> { |
| | | |
| | | List<Classify> selectOneByName(Classify classify); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetPlanMeasureInstrumentDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeteringPlanDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | */ |
| | | public interface MeteringPlanMapper extends BaseMapper<MeteringPlan> { |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page); |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page,@Param("dto") SelectMeasurementLedgerDto dto); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¡å |
| | | * @param dto |
| | | * @param limitPage |
| | | * @return |
| | | */ |
| | | List<MeteringPlanAndInfo>limitConditionMeteringPlan(@Param("dto")SelectMeteringPlanDto dto, @Param("limitPage") LimitPage limitPage); |
| | | |
| | | |
| | | Map<String, Object>getTotal(@Param("dto")SelectMeteringPlanDto dto); |
| | | |
| | | MeteringPlanAndInfoAndIns getPlanMeasureInstrument(@Param("limitPage") LimitPage limitPage,Long id); |
| | | |
| | | List<MetricalInfoAndIns> limitGetPlanMeasureInstrument(@Param("limitPage")LimitPage limitPage, Long id); |
| | | |
| | | Map<String, Object> countPlanMeasurIns(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/17 |
| | | */ |
| | | @Data |
| | | public class LimitPage implements Serializable { |
| | | |
| | | private Long start, end; |
| | | |
| | | public LimitPage(Long start, Long end) { |
| | | this.start = start; |
| | | this.end = end; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | 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 java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="MeteringPlanAndInfo", description="") |
| | | public class MeteringPlanAndInfo implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| | | private String createPerson; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | @ApiModelProperty(value = "å¼å§æ¥æ", example = "2023-07-06", required = true, dataType = "date") |
| | | private Date beginTime; |
| | | |
| | | private String plannedOrderNumber; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | @ApiModelProperty(value = "ç»ææ¥æ", example = "2023-07-06", required = true, dataType = "date") |
| | | private Date endTime; |
| | | |
| | | private String unit; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | private Date createTime; |
| | | |
| | | private String measurePerson; |
| | | |
| | | private Integer status; |
| | | |
| | | private List<MetricalInformation>resultList; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="MeteringPlanAndInfoAndIns对象", description="") |
| | | public class MeteringPlanAndInfoAndIns extends MeteringPlanAndInfo implements Serializable { |
| | | |
| | | List<MetricalInfoAndIns>metricalInfoAndInsList; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | 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 java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="MeteringPlanAndInfoAndIns对象", description="") |
| | | public class MetricalInfoAndIns extends Instrument implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "计éç¼å·", example = "1", required = true) |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "计éåä½", example = "GB", required = true) |
| | | private String measurementUnit; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ", example = "2026-07-06", required = true, dataType = "date") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ç»æ: 1ï¼åæ ¼ï¼2ï¼ç«æ£åå¯ç¨ï¼3ï¼ä¸åæ ¼", example = "1", required = true) |
| | | private Integer result; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd", iso = DateTimeFormat.ISO.DATE_TIME) |
| | | private Date imCreateTime; |
| | | |
| | | private String measurementName; |
| | | |
| | | private String imCreateName; |
| | | |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "计éç¼å·", example = "1", required = true) |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·å
³èId", example = "7", required = true) |
| | | private Integer userId; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "GetPlanMeasureInstrumentDto对象", description = "") |
| | | public class GetPlanMeasureInstrumentDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | @ApiModelProperty(value = "æ¯é¡µå¤å°æ¡", example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "计åid", example = "10", required = true) |
| | | private Long id; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "selectMeasurementLedgerDto对象", description = "") |
| | | public class SelectMeasurementLedgerDto implements Serializable { |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | @ApiModelProperty(value = "æ¯é¡µå¤å°æ¡", example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "仪å¨ç¼ç ", required = false) |
| | | private String code; |
| | | @ApiModelProperty(value = "仪å¨åç§°", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "计éåä½", required = false) |
| | | private String unit; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author å¼ å®¾ |
| | | * @Date 2023/8/16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "SelectMeteringPlanDto", description = "") |
| | | public class SelectMeteringPlanDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "å½å页", example = "1", required = true) |
| | | private Long currentPage; |
| | | @ApiModelProperty(value = "æ¯é¡µå¤å°æ¡", example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "计ååå·", required = false) |
| | | private String plannedOrderNumber; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlanAndInfoAndIns; |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInfoAndIns; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetPlanMeasureInstrumentDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeteringPlanDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | Integer addMeteringPlanInformation(MeteringPlan meteringPlan); |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeteringPlan(String measureCodeOrNameOrUnit, Page<Objects> page); |
| | | Map<String, Object> pagingQueryOfMeteringPlan(SelectMeteringPlanDto dto); |
| | | |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page); |
| | | IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto selectMeasurementLedgerDto); |
| | | |
| | | Map<String, Object> getPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto); |
| | | |
| | | Map<String, Object> limitGetPlanMeasureInstrument(GetPlanMeasureInstrumentDto 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.Classify; |
| | |
| | | |
| | | @Override |
| | | public Integer addClassifyInformation(Classify classify) { |
| | | LambdaQueryWrapper<Classify> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Classify::getFatherName, classify.getFatherName()); |
| | | wrapper.eq(Classify::getSonName, classify.getSonName()); |
| | | wrapper.eq(Classify::getState, 1); |
| | | Classify classify1 = classifyMapper.selectOne(wrapper); |
| | | if (ObjectUtils.isEmpty(classify1)){ |
| | | return classifyMapper.insert(classify); |
| | | } else { |
| | | List<Classify> classify1 = classifyMapper.selectOneByName(classify); |
| | | if (classify1.size()>0){ |
| | | return 2; |
| | | } else { |
| | | classify.setCreateTime(DateUtil.date()); |
| | | return classifyMapper.insert(classify); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.yuanchu.limslaboratory.pojo.MeteringPlan; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.mapper.MeteringPlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.GetPlanMeasureInstrumentDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeasurementLedgerDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.SelectMeteringPlanDto; |
| | | import com.yuanchu.limslaboratory.service.MeteringPlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Override |
| | | public Integer addMeteringPlanInformation(MeteringPlan meteringPlan) { |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P"); |
| | | String timeSixNumber = MyUtil.getTimeSixNumberCode("P","P"); |
| | | meteringPlan.setPlannedOrderNumber(timeSixNumber); |
| | | return meteringPlanMapper.insert(meteringPlan); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeteringPlan(String measureCodeOrNameOrUnit, Page<Objects> page) { |
| | | return null; |
| | | public Map<String, Object> pagingQueryOfMeteringPlan(SelectMeteringPlanDto dto) { |
| | | List<MeteringPlanAndInfo> page= meteringPlanMapper |
| | | .limitConditionMeteringPlan(dto,new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize(), dto.getPageSize())); |
| | | page.forEach(l->{ |
| | | l.getResultList().forEach(r->{ |
| | | if (r.getResult() < 1) { |
| | | l.setStatus(0); |
| | | }else { |
| | | l.setStatus(1); |
| | | } |
| | | }); |
| | | l.setResultList(null); |
| | | }); |
| | | Map<String, Object>all=new HashMap<>(2); |
| | | all.put("total",meteringPlanMapper.getTotal(dto).get("num")); |
| | | all.put("list",page); |
| | | return all; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(Page<Objects> page) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(page); |
| | | public IPage<Map<String, Object>> pagingQueryOfMeasurementLedger(SelectMeasurementLedgerDto dto) { |
| | | return meteringPlanMapper.pagingQueryOfMeasurementLedger(new Page<>(dto.getCurrentPage(),dto.getPageSize(),true),dto); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto) { |
| | | MeteringPlanAndInfoAndIns planMeasureInstrument = |
| | | meteringPlanMapper.getPlanMeasureInstrument |
| | | (new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize(), |
| | | dto.getPageSize()), dto.getId()); |
| | | Map<String, Object> map = meteringPlanMapper.countPlanMeasurIns(dto.getId()); |
| | | map.put("list",planMeasureInstrument); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> limitGetPlanMeasureInstrument(GetPlanMeasureInstrumentDto dto) { |
| | | Map<String, Object> map = meteringPlanMapper.countPlanMeasurIns(dto.getId()); |
| | | map.put("list",meteringPlanMapper |
| | | .limitGetPlanMeasureInstrument(new LimitPage((dto.getCurrentPage()-1)*dto.getPageSize() |
| | | ,dto.getPageSize()),dto.getId())); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | String fileName = FileSaveUtil.StoreFile(file); |
| | | metricalInformation.setFilePath(fileName); |
| | | } |
| | | metricalInformation.setCode(MyUtil.getTimeSixNumberCode("METRICALCODE","METRICALCODE")); |
| | | return metricalInformationMapper.insert(metricalInformation); |
| | | } |
| | | |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.ClassifyMapper"> |
| | | |
| | | <select id="selectOneByName" resultType="com.yuanchu.limslaboratory.pojo.Classify"> |
| | | SELECT id |
| | | FROM classify |
| | | WHERE state = 1 |
| | | <if test="fatherName!=null and fatherName!=''"> |
| | | AND father_name = #{fatherName} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MeteringPlanMapper"> |
| | | |
| | | <select id="pagingQueryOfMeasurementLedger" resultType="map"> |
| | | SELECT i.`equipment_code`, i.`equipment_name`, i.`specifications_models`, m.`create_time`, m.`uncertainty`, |
| | | m.`end_date`, i.`term_validity`, i.`storage_place`, i.`conditions` |
| | | FROM instrument i, metrical_information m |
| | | WHERE i.`id` = m.`instrument_id` |
| | | SELECT |
| | | i.`equipment_code` equipmentCode, |
| | | i.`equipment_name` equipmentName, |
| | | m.measurement_unit measurementUnit, |
| | | i.measuring_range measuringRange, |
| | | i.term_validity termValidity, |
| | | m.result result, |
| | | m.end_date endDate, |
| | | u.NAME name , |
| | | m.`create_time` createTime, |
| | | m.code code |
| | | FROM |
| | | metrical_information m |
| | | LEFT JOIN `user` u ON u.id = m.user_id |
| | | LEFT JOIN instrument i ON i.`id` = m.`instrument_id` |
| | | WHERE 1=1 |
| | | and (m.state=1 and i.state=1 and m.result is not null) |
| | | <if test="dto.code!=null and dto.code!=''"> |
| | | and i.`equipment_code` like concat('%',#{dto.code},'%') |
| | | </if> |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.`equipment_name` like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="dto.name!=null and dto.name!=''"> |
| | | and i.measurement_unit like concat('%',#{dto.unit},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="limitConditionMeteringPlan" resultMap="MeteringPlanAndInfoMap"> |
| | | SELECT p.id id, |
| | | u.`name` createName, |
| | | p.planned_order_number plannedOrderNumber, |
| | | p.begin_time beginTime, |
| | | p.end_time endTime, |
| | | IF(IFNULL(i.result, 0) > 0, 1, 0) status, |
| | | (SELECT name FROM `user` u WHERE p.measure_person = u.id) measureName, |
| | | i.`code` iCode, |
| | | p.unit unit, |
| | | p.create_time createTime |
| | | FROM (SELECT id, unit ,measure_person, create_Person, begin_Time, end_Time, planned_order_number, create_time |
| | | from metering_plan |
| | | where 1=1 |
| | | <if test="dto.plannedOrderNumber!=null and dto.plannedOrderNumber!=''"> |
| | | and planned_order_number=#{plannedOrderNumber} |
| | | </if> |
| | | LIMIT #{limitPage.start},#{limitPage.end}) p |
| | | LEFT JOIN metrical_information i ON p.id = i.plan |
| | | LEFT JOIN `user` u ON p.create_Person = u.id |
| | | where 1 = 1 |
| | | </select> |
| | | <select id="getTotal" resultType="java.util.Map"> |
| | | select count(id) num from metering_plan where 1=1 |
| | | <if test="dto.plannedOrderNumber!=null and dto.plannedOrderNumber!=''"> |
| | | and planned_order_number=#{plannedOrderNumber} |
| | | </if> |
| | | </select> |
| | | <select id="getPlanMeasureInstrument" |
| | | resultMap="measureInsAndPlanMap"> |
| | | SELECT m.planned_order_number plannedOrderNumber, |
| | | (SELECT NAME FROM USER WHERE id = m.measure_person) measureName, |
| | | m.begin_time beginTime, |
| | | m.end_time endTime, |
| | | m.unit unit, |
| | | u.`name` createName, |
| | | m.create_time createTime, |
| | | im.equipment_code equipmentCode, |
| | | im.equipment_name equipmentName, |
| | | im.measuring_range measuringRange, |
| | | im.term_validity termValidity, |
| | | im.result result, |
| | | im.end_date endDate, |
| | | im.imName imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode |
| | | 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, |
| | | i.term_validity, |
| | | im.result, |
| | | im.end_date, |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | | im.create_time, |
| | | im.measurement_unit, |
| | | im.`code`, |
| | | im.plan |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} |
| | | LIMIT #{limitPage.start} |
| | | , #{limitPage.end} |
| | | ) im ON m.id = im.plan |
| | | WHERE 1 = 1 |
| | | AND m.id = #{id} |
| | | </select> |
| | | <select id="limitGetPlanMeasureInstrument" resultMap="MetricalInfoAndInsMap"> |
| | | SELECT i.equipment_code equipmentCode, |
| | | i.equipment_name equipmentName, |
| | | i.measuring_range measuringRange, |
| | | i.term_validity termValidity, |
| | | im.result result, |
| | | im.end_date endDate, |
| | | (SELECT NAME FROM USER WHERE id = im.user_id) imName, |
| | | im.create_time imCreateTime, |
| | | im.measurement_unit imUnit, |
| | | im.`code` imCode |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} LIMIT #{limitPage.start} |
| | | , #{limitPage.end} |
| | | </select> |
| | | <select id="countPlanMeasurIns" resultType="java.util.Map"> |
| | | SELECT count(im.id) total |
| | | FROM metrical_information im, |
| | | metering_plan m, |
| | | instrument i |
| | | WHERE im.instrument_id = i.id |
| | | and m.id = im.plan |
| | | and im.plan = #{id} |
| | | </select> |
| | | |
| | | <resultMap id="MetricalInfoAndInsMap" type="MetricalInfoAndIns"> |
| | | <result property="code" column="imCode"/> |
| | | <result property="measurementUnit" column="imUnit"/> |
| | | <result property="imCreateTime" column="imCreateTime"/> |
| | | <result property="measurementName" column="imName"/> |
| | | <result property="endDate" column="endDate"/> |
| | | <result property="result" column="result"/> |
| | | <result property="termValidity" column="termValidity"/> |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="measureInsAndPlanMap" type="meteringPlanAndInfoAndIns"> |
| | | <result property="id" column="id"/> |
| | | <result property="createPerson" column="createName"/> |
| | | <result property="beginTime" column="beginTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <result property="plannedOrderNumber" column="plannedOrderNumber"/> |
| | | <result property="measurePerson" column="measureName"/> |
| | | <result property="createTime" column="createTime"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="metricalInfoAndInsList" ofType="metricalInfoAndIns"> |
| | | <result property="code" column="imCode"/> |
| | | <result property="measurementUnit" column="imUnit"/> |
| | | <result property="imCreateTime" column="imCreateTime"/> |
| | | <result property="measurementName" column="imName"/> |
| | | <result property="endDate" column="endDate"/> |
| | | <result property="result" column="result"/> |
| | | <result property="termValidity" column="termValidity"/> |
| | | <result property="measuringRange" column="measuringRange"/> |
| | | <result property="equipmentName" column="equipmentName"/> |
| | | <result property="equipmentCode" column="equipmentCode"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <resultMap id="MeteringPlanAndInfoMap" type="meteringPlanAndInfo"> |
| | | <result property="id" column="id"/> |
| | | <result property="createPerson" column="createName"/> |
| | | <result property="beginTime" column="beginTime"/> |
| | | <result property="endTime" column="endTime"/> |
| | | <result property="plannedOrderNumber" column="plannedOrderNumber"/> |
| | | <result property="measurePerson" column="measureName"/> |
| | | <result property="createTime" column="createTime"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="resultList" ofType="MetricalInformation"> |
| | | <result property="code" column="iCode"/> |
| | | <result property="result" column="status"/> |
| | | </collection> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | FROM metrical_information m, `user` u |
| | | WHERE m.`user_id` = u.`id` |
| | | AND m.`state` = 1 |
| | | and result is not Null |
| | | AND m.`instrument_id` = #{InstrumentId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <module>standard-server</module> |
| | | <module>inspection-server</module> |
| | | <module>laboratory-server</module> |
| | | <module>cnas-server</module> |
| | | </modules> |
| | | |
| | | <properties> |
| | |
| | | <openfeign.version>3.1.3</openfeign.version> |
| | | <feign-okhttp.version>11.0</feign-okhttp.version> |
| | | <shiro.version>1.5.3</shiro.version> |
| | | |
| | | <commons.lang3>3.12.0</commons.lang3> |
| | | <!-- æå
å导åºçè·¯å¾ --> |
| | | <package.path>${project.build.directory}/LIMS</package.path> |
| | | </properties> |
| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MaterialMapper"> |
| | | |
| | | <select id="selectMaterialLimit" resultType="Map"> |
| | | select id,code, name |
| | | select id, code, name |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | and type = #{type} |
| | | and type = #{type} |
| | | order by create_time desc |
| | | limit #{num1},#{num2} |
| | | limit #{num1}, #{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | |
| | | lims_laboratory.serial_number sn |
| | | where m.specifications_id = s.id |
| | | and s.serial_id = sn.id |
| | | and m.id=#{materialId} |
| | | and m.id = #{materialId} |
| | | </select> |
| | | |
| | | <resultMap id="OneLevelTreeMap" type="Map"> |
| | |
| | | |
| | | <select id="FourTree" resultMap="OneLevelTreeMap"> |
| | | SELECT m.`id` materialId, m.`name` materialName, s.`id` standardId, s.`name` standardName, |
| | | f.`id` specificationsId, f.`name` specificationsName, p.`id` productId, p.`name` productName |
| | | f.`id` specificationsId, f.`name` specificationsName, p.`id` productId, p.`name` productName |
| | | FROM material m |
| | | LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM standard s WHERE s.`state` = 1) s ON m.id = s.`material_id` |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM specifications f WHERE f.`state` = 1 |
| | | <if test="specificationsName != null and specificationsName != ''"> |
| | | AND f.`name` = #{specificationsName} |
| | | </if> |
| | | ) f ON s.`id` = f.`standard_id` |
| | | LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM product p WHERE p.`state` = 1) p ON f.`id` = p.`specifications_id` |
| | | LEFT JOIN (SELECT s.`id`, s.`name`, s.`material_id` FROM standard s WHERE s.`state` = 1) s ON m.id = |
| | | s.`material_id` |
| | | LEFT JOIN (SELECT f.`id`, f.`name`, f.`standard_id` FROM specifications f WHERE f.`state` = 1 |
| | | <if test="specificationsName != null and specificationsName != ''"> |
| | | AND f.`name` = #{specificationsName} |
| | | </if> |
| | | ) f ON s.`id` = f.`standard_id` |
| | | LEFT JOIN (SELECT p.`id`, p.`name`, p.`specifications_id` FROM product p WHERE p.`state` = 1) p ON f.`id` = |
| | | p.`specifications_id` |
| | | WHERE m.`state` = 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | <artifactId>framework</artifactId> |
| | | <version>${project.parent.version}</version> |
| | | </dependency> |
| | | <!--cnas模å--> |
| | | <dependency> |
| | | <groupId>com.yuanchu.limslaboratory</groupId> |
| | | <artifactId>cnas-server</artifactId> |
| | | <version>${project.parent.version}</version> |
| | | </dependency> |
| | | |
| | | <!--ç¨æ·æå¡æ¨¡å--> |
| | | <dependency> |
| | |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- framework: mybatis-plus代ç çæéè¦ä¸ä¸ªæ¨¡æ¿å¼æ --> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity-engine-core --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-freemarker</artifactId> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>2.3</version> |
| | | </dependency> |
| | | |
| | | |
| | | <!--mysql--> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | |
| | | // æ¼ç¤ºä¾åï¼æ§è¡ main æ¹æ³æ§å¶å°è¾å
¥æ¨¡å表åå车èªå¨çæå¯¹åºé¡¹ç®ç®å½ä¸ |
| | | public class CodeGenerator { |
| | | |
| | | public static String database_url = "jdbc:mysql://localhost:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"; |
| | | public static String database_username = "root"; |
| | | public static String database_url = "jdbc:mysql://192.168.110.209:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"; |
| | | public static String database_username = "user"; |
| | | public static String database_password= "123456"; |
| | | public static String author = "æ±èéµ·éç½ç»ç§ææéå
¬å¸"; |
| | | public static String model_name = "/inspect-server"; // å¦æä¸ºåå¸å¼å¡«å模ååç§°ï¼å¦æä¸æ¯åå¸å¼ä¸ºç©ºå³å¯ |
| | | public static String setParent = "com.yuanchu.mom"; // å
è·¯å¾ |
| | | public static String model_name = "/cnas-server"; // å¦æä¸ºåå¸å¼å¡«å模ååç§°ï¼å¦æä¸æ¯åå¸å¼ä¸ºç©ºå³å¯ |
| | | public static String setParent = "com.yuanchu.limslaboratory"; // å
è·¯å¾ |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); |
| | | System.out.println(projectPath+"==================="); |
| | | String s = projectPath + "/lims-after" + model_name + "/src/main/java"; |
| | | String s1 = projectPath + "/lims-after" + model_name + "/src/main/resources/mapper"; |
| | | System.out.println(); |
| | | FastAutoGenerator.create(database_url, database_username, database_password) |
| | | // å
¨å±é
ç½® |
| | | .globalConfig(builder -> { |
| | | builder.author(author) // 设置ä½è
|
| | | .commentDate("yyyy-MM-dd hh:mm:ss") //æ³¨éæ¥æ |
| | | .outputDir(projectPath + model_name + "/src/main/java") // æå®è¾åºç®å½ |
| | | .outputDir(s) // æå®è¾åºç®å½ |
| | | .disableOpenDir() //ç¦æ¢æå¼è¾åºç®å½ï¼é»è®¤æå¼ |
| | | ; |
| | | }) |
| | |
| | | .packageConfig(builder -> { |
| | | builder.entity("pojo"); |
| | | builder.parent(setParent) // 设置ç¶å
å |
| | | .pathInfo(Collections.singletonMap(OutputFile.xml, projectPath + model_name + "/src/main/resources/mapper")); // 设置mapperXmlçæè·¯å¾ |
| | | .pathInfo(Collections.singletonMap(OutputFile.xml, s1)); // 设置mapperXmlçæè·¯å¾ |
| | | }) |
| | | // çç¥é
ç½® |
| | | .strategyConfig(builder -> { |
| | |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: root |
| | | url: jdbc:mysql://192.168.110.209:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 |
| | | username: user |
| | | password: 123456 |
| | | druid: |
| | | # Druidæ°æ®æºé
ç½® |
| | |
| | | # redisæ°æ®åºç´¢å¼(é»è®¤ä¸º0)ï¼æä»¬ä½¿ç¨ç´¢å¼ä¸º3çæ°æ®åºï¼é¿å
åå
¶ä»æ°æ®åºå²çª |
| | | database: 0 |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | host: localhost |
| | | host: 192.168.110.209 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6380 |
| | | port: 6379 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |
| | | password: null |
| | | # redisè¿æ¥è¶
æ¶æ¶é´ï¼å使¯«ç§ï¼ |
| | | timeout: 5 |
| | | timeout: 50 |
| | | # redisè¿æ¥æ± é
ç½® |
| | | pool: |
| | | # æå¤§å¯ç¨è¿æ¥æ°ï¼é»è®¤ä¸º8ï¼è´æ°è¡¨ç¤ºæ éï¼ |
| | | max-active: 8 |
| | | max-active: 20 |
| | | # æå¤§ç©ºé²è¿æ¥æ°ï¼é»è®¤ä¸º8ï¼è´æ°è¡¨ç¤ºæ éï¼ |
| | | max-idle: 8 |
| | | # æå°ç©ºé²è¿æ¥æ°ï¼é»è®¤ä¸º0ï¼è¯¥å¼åªæä¸ºæ£æ°ææç¨ï¼ |
| | | min-idle: 0 |
| | | min-idle: 5 |
| | | # ä»è¿æ¥æ± ä¸è·åè¿æ¥æå¤§çå¾
æ¶é´ï¼é»è®¤ä¸º-1ï¼åä½ä¸ºæ¯«ç§ï¼è´æ°è¡¨ç¤ºæ éï¼ |
| | | max-wait: -1 |
| | | |
| | |
| | | package com.yuanchu.limslaboratory; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.apache.poi.hwpf.HWPFDocument; |
| | | import org.apache.poi.hwpf.extractor.WordExtractor; |
| | | import org.apache.poi.xwpf.extractor.XWPFWordExtractor; |
| | | import org.apache.poi.xwpf.usermodel.XWPFDocument; |
| | | import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @SpringBootTest |
| | | class SysApplicationTests { |
| | | |
| | | @Resource |
| | | private PlanService planService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | |
| | | System.out.println("newString === " + newString); |
| | | |
| | | } |
| | | |
| | | @Test |
| | | void TT() { |
| | | Map<String, Object> userInfo = userService.getUserInfo("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYzhiMWFhYWNlYzM2NmMyNGU1ZDE4YzdlZWE5ZTU1MWIiLCJleHAiOjE2OTE3Mzk4MjV9.IZyU5jhTzpxedmmL25dhpkzQS7hth7gt-bzCx9fZyOk"); |
| | | System.out.println(userInfo.get("name")); |
| | | } |
| | | |
| | | @Test |
| | | void uploading() { |
| | | // æ¿æ¢ä¸ºdocædocxæä»¶çè·¯å¾ |
| | | String filePath = "D:\\20892\\desktop\\QR-14-01-02+++å
é¨å®¡æ ¸å¹´åº¦è®¡å.doc"; |
| | | String info = ""; |
| | | try { |
| | | FileInputStream fis = new FileInputStream(filePath); |
| | | if (filePath.endsWith(".doc")) { |
| | | // 读ådocæä»¶ |
| | | HWPFDocument doc = new HWPFDocument(fis); |
| | | WordExtractor docExtractor = new WordExtractor(doc); |
| | | String text = docExtractor.getText(); |
| | | System.out.println("doc:"); |
| | | info = text.trim(); |
| | | docExtractor.close(); |
| | | } else if (filePath.endsWith(".docx")) { |
| | | // 读ådocxæä»¶ |
| | | XWPFDocument docx = new XWPFDocument(fis); |
| | | XWPFWordExtractor docxExtractor = new XWPFWordExtractor(docx); |
| | | String text = docxExtractor.getText(); |
| | | System.out.println("docx:"); |
| | | info = text.trim(); |
| | | docxExtractor.close(); |
| | | } else { |
| | | System.out.println("䏿¯wordæä»¶"); |
| | | } |
| | | fis.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<String> infoList = new ArrayList<String>(); |
| | | String[] split = info.split("\n"); |
| | | for (int i = 0; i < split.length; i++) { |
| | | System.out.println("======>" + split[i]); |
| | | if (i > 2) { |
| | | infoList.add(split[i]); |
| | | } |
| | | } |
| | | Map<String, String> result = new HashMap<>(); |
| | | //客æ·åä½/项ç®åç§° |
| | | String[] proAndUnit = infoList.get(0).split("\t"); |
| | | for (int i = 0; i < proAndUnit.length; i++) { |
| | | if (i == 1) { |
| | | result.put("unitName", proAndUnit[i]); |
| | | } |
| | | if (i == 3) { |
| | | result.put("projectName", proAndUnit[i]); |
| | | } |
| | | } |
| | | //填表人å§å/èä½/èç³»çµè¯/é®ç¼ |
| | | String npty = infoList.get(1); |
| | | String nameAndDate = npty.split("form")[1].split("èä½")[0]; |
| | | //å§å/æ¥æ |
| | | result.put("nameAndDate", nameAndDate.trim()); |
| | | //èä½ |
| | | String post = npty.split("Posts")[1].split("èç³»çµè¯")[0]; |
| | | result.put("post", post.trim()); |
| | | //èç³»çµè¯ |
| | | String phone = npty.split("number")[1].split("é®ç¼")[0]; |
| | | result.put("telephone", phone); |
| | | //é®ç¼ |
| | | String email = npty.split("é®ç¼")[1].split("\t")[1]; |
| | | result.put("email", email); |
| | | //æå¡æåº¦ |
| | | String replace = infoList.get(2).replace(" ", "").replace("\t", ""); |
| | | System.out.println(replace); |
| | | String[] split1 = replace.split("â"); |
| | | for (int i = 0; i < split1.length; i++) { |
| | | System.out.println(split1[i]); |
| | | } |
| | | result.forEach((k, v) -> { |
| | | System.out.println("k======>" + k); |
| | | System.out.println("v======>" + v); |
| | | }); |
| | | } |
| | | |
| | | @Test |
| | | void upload() throws Exception { |
| | | String filePath = "D:\\20892\\desktop\\QR-14-01-02+++å
é¨å®¡æ ¸å¹´åº¦è®¡å.doc"; |
| | | |
| | | String info = ""; |
| | | |
| | | FileInputStream fis = new FileInputStream(filePath); |
| | | if (filePath.endsWith(".doc")) { |
| | | // 读ådocæä»¶ |
| | | HWPFDocument doc = new HWPFDocument(fis); |
| | | WordExtractor docExtractor = new WordExtractor(doc); |
| | | String text = docExtractor.getText(); |
| | | System.out.println("doc:"); |
| | | info = text.trim(); |
| | | docExtractor.close(); |
| | | } else if (filePath.endsWith(".docx")) { |
| | | // 读ådocxæä»¶ |
| | | XWPFDocument docx = new XWPFDocument(fis); |
| | | XWPFWordExtractor docxExtractor = new XWPFWordExtractor(docx); |
| | | String text = docxExtractor.getText(); |
| | | System.out.println("docx:"); |
| | | info = text.trim(); |
| | | docxExtractor.close(); |
| | | } else { |
| | | System.out.println("䏿¯wordæä»¶"); |
| | | } |
| | | // System.out.println(info); |
| | | List<String> infoList = new ArrayList<>(); |
| | | String[] split = info.split("\n"); |
| | | for (int i = 0; i < split.length; i++) { |
| | | System.out.println("======>" + split[i]); |
| | | if (i > 2) { |
| | | infoList.add(split[i]); |
| | | } |
| | | } |
| | | } |
| | | @Test |
| | | void testRedis(){ |
| | | boolean b=true; |
| | | if (b) { |
| | | this.contextLoads(); |
| | | } else { |
| | | this.TT(); |
| | | } |
| | | System.out.println(2024%100); |
| | | new Thread(()->{ |
| | | String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | System.out.println(timeSixNumberCode); |
| | | }).start(); |
| | | //new Thread(()->{ |
| | | // String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | // System.out.println(timeSixNumberCode); |
| | | //}).start(); |
| | | //new Thread(()->{ |
| | | // String timeSixNumberCode = MyUtil.getTimeSixNumberCode("CS", "number"); |
| | | // System.out.println(timeSixNumberCode); |
| | | //}).start(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "å¹´é¾") |
| | | private Integer age; |
| | | private String age; |
| | | |
| | | @ApiModelProperty(value = "个æ§ç¾å") |
| | | private String info; |
| | |
| | | } |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name",loginUser.get("name")); |
| | | data.put("id",loginUser.get("id")); |
| | | data.put("remind", remind); |
| | | return data; |
| | | } |
| | |
| | | User user = new User() |
| | | .setName(newPersonnelVo.getName()) |
| | | .setAccount(newPersonnelVo.getAccount()) |
| | | .setAge(newPersonnelVo.getAge()) |
| | | .setAge(String.valueOf(newPersonnelVo.getAge())) |
| | | .setPhone(newPersonnelVo.getPhone()) |
| | | .setEmail(newPersonnelVo.getEmail()) |
| | | .setRoleId(newPersonnelVo.getRole_id()) |
| | |
| | | User user = new User() |
| | | .setName(updatePersonnelVo.getName()) |
| | | .setAccount(updatePersonnelVo.getAccount()) |
| | | .setAge(updatePersonnelVo.getAge()) |
| | | .setAge(String.valueOf(updatePersonnelVo.getAge())) |
| | | .setPhone(updatePersonnelVo.getPhone()) |
| | | .setEmail(updatePersonnelVo.getEmail()) |
| | | .setRoleId(updatePersonnelVo.getRole_id()) |
| | |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "å¹´é¾", example = "23") |
| | | private Integer age; |
| | | private String age; |
| | | |
| | | @ApiModelProperty(value = "ææºå·", example = "12345678981") |
| | | private String phone; |
| | |
| | | IFNULL(u.`phone`, '---') phone, IFNULL(u.`email`, '---') email, u.`job_state` |
| | | FROM `user` u, role r |
| | | WHERE u.`role_id` = r.`id` |
| | | <if test="name != null"> |
| | | <if test="name != null and name!=''"> |
| | | AND u.name = #{name} |
| | | </if> |
| | | </select> |