Fixiaobai
2023-08-14 b081758449c9d491adf1c70a030461b24dc163fe
满意度调查word解析
人员管理
已修改12个文件
已重命名1个文件
已添加1个文件
405 ■■■■ 文件已修改
cnas-server/pom.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/controller/CnasSatisfactionSurveyController.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/mapper/CnasSatisfactionSurveyMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/pojo/CnasSatisfactionSurvey.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/pojo/Dto/CnasSatisfactionSurveyPageDto.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/service/CnasSatisfactionSurveyService.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/limslaboratory/service/impl/CnasSatisfactionSurveyServiceImpl.java 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/CnasSatisfactionSurveyMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/utils/MultipartFileToFileUtil.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-dev.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/pojo/User.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/limslaboratory/vo/PagePersonnelVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/resources/mapper/UserMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/pom.xml
@@ -50,6 +50,31 @@
            <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>
cnas-server/src/main/java/com/yuanchu/limslaboratory/controller/CnasSatisfactionSurveyController.java
@@ -1,16 +1,18 @@
package com.yuanchu.limslaboratory.controller;
import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyDto;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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 å¼ å®¾
@@ -30,9 +32,32 @@
     */
    @ApiOperation(value = "获取满意度调查")
    @GetMapping("/getCnasSatisfactionSurvey")
    public Result<CnasSatisfactionSurveyVo>getCnasSatisfactionSurvey(CnasSatisfactionSurveyDto cnasSatisfactionSurveyDto){
        return Result.success(service.getCnasSatisfactionSurvey(cnasSatisfactionSurveyDto));
    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));
    }
}
cnas-server/src/main/java/com/yuanchu/limslaboratory/mapper/CnasSatisfactionSurveyMapper.java
@@ -4,8 +4,6 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.pojo.CnasSatisfactionSurvey;
import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
@@ -15,5 +13,5 @@
@Repository
public interface CnasSatisfactionSurveyMapper extends BaseMapper<CnasSatisfactionSurvey> {
    IPage<CnasSatisfactionSurvey>selectCnasSatisfactionSurvey(Page<CnasSatisfactionSurvey>page, @Param("dto") CnasSatisfactionSurveyDto dto);
    IPage<CnasSatisfactionSurvey>selectCnasSatisfactionSurvey(Page<CnasSatisfactionSurvey>page, String surveyDate,String entryDate);
}
cnas-server/src/main/java/com/yuanchu/limslaboratory/pojo/CnasSatisfactionSurvey.java
@@ -9,7 +9,7 @@
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.sql.Date;
import java.util.Date;
import java.time.LocalDateTime;
/**
@@ -45,12 +45,12 @@
     */
    private String userUnit;
    /**
     * æ—¥æœŸ
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date dateInfo;
    ///**
    // * æ—¥æœŸ
    // */
    //@DateTimeFormat(pattern = "yyyy-MM-dd")
    //@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    //private Date dateInfo;
    /**
     * å¡«å†™äººå§“名
@@ -134,5 +134,10 @@
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private LocalDateTime updatedTime;
    /**
     * æ”¶è´¹åˆç†æ€§
     */
    private String reasonableCharge;
}
cnas-server/src/main/java/com/yuanchu/limslaboratory/pojo/Dto/CnasSatisfactionSurveyPageDto.java
ÎļþÃû´Ó cnas-server/src/main/java/com/yuanchu/limslaboratory/pojo/Dto/CnasSatisfactionSurveyDto.java ÐÞ¸Ä
@@ -8,7 +8,7 @@
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.sql.Date;
/**
 * @Author å¼ å®¾
@@ -17,7 +17,7 @@
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="CnasSatisfactionSurveyDto", description="")
public class CnasSatisfactionSurveyDto implements Serializable {
public class CnasSatisfactionSurveyPageDto implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "当前页", example = "1", required = true)
@@ -27,13 +27,9 @@
    private Long pageNum;
    @ApiModelProperty(value = "调查日期", example = "2020-01-02", required = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date surveyDate;
    @ApiModelProperty(value = "录入日期", example = "2025-06-08", required = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date entryDate;
}
cnas-server/src/main/java/com/yuanchu/limslaboratory/service/CnasSatisfactionSurveyService.java
@@ -1,7 +1,11 @@
package com.yuanchu.limslaboratory.service;
import com.yuanchu.limslaboratory.pojo.Dto.CnasSatisfactionSurveyDto;
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 å¼ å®¾
@@ -11,10 +15,28 @@
    /**
     * èŽ·å–æ»¡æ„åº¦è°ƒæŸ¥ä¿¡æ¯
     * @param cnasSatisfactionSurveyDto
     * @param cnasSatisfactionSurveyPageDto
     * @return
     */
    CnasSatisfactionSurveyVo getCnasSatisfactionSurvey(CnasSatisfactionSurveyDto cnasSatisfactionSurveyDto);
    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);
}
cnas-server/src/main/java/com/yuanchu/limslaboratory/service/impl/CnasSatisfactionSurveyServiceImpl.java
@@ -1,15 +1,28 @@
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.CnasSatisfactionSurveyDto;
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 å¼ å®¾
@@ -18,14 +31,176 @@
@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(CnasSatisfactionSurveyDto cnasSatisfactionSurveyDto) {
        Page<CnasSatisfactionSurvey>page=new Page<>(cnasSatisfactionSurveyDto.getCurrentPage(), cnasSatisfactionSurveyDto.getPageNum(),true);
        IPage<CnasSatisfactionSurvey> cnasSatisfactionSurveyIPage = mapper.selectCnasSatisfactionSurvey(page, cnasSatisfactionSurveyDto);
    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];
    }
}
cnas-server/src/main/resources/mapper/CnasSatisfactionSurveyMapper.xml
@@ -9,7 +9,6 @@
            css.project_name projectName,
            css.survey_date surveyDate,
            css.user_unit userUnit,
            css.date_info dateInfo,
            css.`fill_name` fillName,
            css.post post,
            css.telephone telephone,
@@ -18,7 +17,9 @@
            css.service_attitude serviceAttitude,
            css.technical_power technicalPower,
            css.test_job testJob,
            css.improvement_requirements improvementRequirements
            css.reasonable_charge reasonableCharge,
            css.improvement_requirements improvementRequirements,
            css.other_supplements otherSupplements
        FROM
            cnas_satisfaction_survey css,
            `user` u
@@ -26,11 +27,12 @@
            1 = 1
          AND css.user_id = u.id
          and css.state=1
        <if test="dto.surveyDate!=null">
            and css.survey_date = ${dto.surveyDate}
        <if test="surveyDate!=null">
            and date_format(css.survey_date,'%Y%m%d') = ${surveyDate}
        </if>
        <if test="dto.entryDate!=null">
            and css.entry_date = ${dto.entryDate}
        <if test="entryDate!=null">
            and date_format(css.entry_date,'%Y%m%d') = ${entryDate}
        </if>
        order by css.id Desc
    </select>
</mapper>
framework/src/main/java/com/yuanchu/limslaboratory/utils/MultipartFileToFileUtil.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
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+"失败!");
            }
        }
    }
}
sys/src/main/resources/application-dev.yml
@@ -71,15 +71,15 @@
    # 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
user-server/src/main/java/com/yuanchu/limslaboratory/pojo/User.java
@@ -54,7 +54,7 @@
    private String email;
    @ApiModelProperty(value = "年龄")
    private Integer age;
    private String age;
    @ApiModelProperty(value = "个性签名")
    private String info;
user-server/src/main/java/com/yuanchu/limslaboratory/service/impl/UserServiceImpl.java
@@ -49,6 +49,7 @@
            }
            Map<String, Object> data = new HashMap<>();
            data.put("name",loginUser.get("name"));
            data.put("id",loginUser.get("id"));
            data.put("remind", remind);
            return data;
        }
@@ -103,7 +104,7 @@
        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())
@@ -117,7 +118,7 @@
        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())
user-server/src/main/java/com/yuanchu/limslaboratory/vo/PagePersonnelVo.java
@@ -26,7 +26,7 @@
    private Date createTime;
    @ApiModelProperty(value = "年龄", example = "23")
    private Integer age;
    private String age;
    @ApiModelProperty(value = "手机号", example = "12345678981")
    private String phone;
user-server/src/main/resources/mapper/UserMapper.xml
@@ -32,7 +32,7 @@
        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>