Fixiaobai
2023-09-05 c9da1b0da1178911e383ddcaebecd1e088fa6004
修改bug
已修改13个文件
133 ■■■■■ 文件已修改
framework/src/main/java/com/yuanchu/limslaboratory/handler/GlobalExceptionHandler.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionMaterial.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/LinkBasicInformationServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/PlanMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspection-server/src/main/resources/mapper/ReportMapper.xml 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/InstrumentController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sys/src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/resources/mapper/RoleManangeMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/limslaboratory/handler/GlobalExceptionHandler.java
@@ -3,6 +3,7 @@
import com.yuanchu.limslaboratory.exception.AuthException;
import com.yuanchu.limslaboratory.exception.MyFileException;
import com.yuanchu.limslaboratory.utils.MyUtil;
import com.yuanchu.limslaboratory.utils.ServletUtils;
import com.yuanchu.limslaboratory.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException;
@@ -62,6 +63,11 @@
        log.error(String.valueOf(e));
        String message = e.getCause().getMessage();
        String[] split = message.split("'");
        String servletPath = ServletUtils.getRequest().getServletPath();
        System.out.println(servletPath);
        if("/user/add_new_personnel".equals(servletPath)){
            return Result.fail("账号重复,添加失败,请核对后操作。");
        }
        return Result.fail("重复添加:【" + split[1] + "】操作失败!");
    }
inspection-server/src/main/java/com/yuanchu/limslaboratory/pojo/InspectionMaterial.java
@@ -59,7 +59,7 @@
    /**
     * 型号id
     */
    private String specificationId;
    private String specificationsId;
    /**
     * 规格名称-型号名称
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InspectionServiceImpl.java
@@ -153,7 +153,7 @@
                .num(inspectionVo.getNum())
                .unit(inspectionVo.getUnit())
                .supplier(inspectionVo.getSupplier())
                .specificationId(inspectionVo.getSpecificationId())
                .specificationsId(inspectionVo.getSpecificationId())
                .specifications(inspectionVo.getSpecifications())
                .formTime(inspectionVo.getFormTime())
                .inspectionId(inspection.getId())
inspection-server/src/main/java/com/yuanchu/limslaboratory/service/impl/LinkBasicInformationServiceImpl.java
@@ -58,21 +58,22 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) {
        System.err.println(linkBasicInformation);
        System.out.println("============>");
        QueryWrapper<LinkBasicInformation> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().select(LinkBasicInformation::getId).eq(LinkBasicInformation::getUid, linkBasicInformation.getUid());
        LinkBasicInformation linkBasicInformation1 = linkBasicInformationMapper.selectOne(queryWrapper);
        Optional<Integer> optionalId = Optional.ofNullable(linkBasicInformation1)
                .map(LinkBasicInformation::getId);
        AtomicBoolean b=new AtomicBoolean(true);
        AtomicBoolean b=new AtomicBoolean(false);
        optionalId.ifPresent(l->{
            QueryWrapper<LinkDetection>queryWrapperLd = new QueryWrapper<>();
            queryWrapperLd.lambda().select(LinkDetection::getInspectionStatus).eq(LinkDetection::getLinkBasicId,linkBasicInformation1.getId());
            List<LinkDetection> linkDetections = linkDetectionMapper.selectList(queryWrapperLd).stream().filter(ld->ld.getInspectionStatus()==2).collect(Collectors.toList());
            if(linkDetections.size()<1){
            if(linkDetections.isEmpty()){
                //执行删除
                linkDetectionMapper.deleteByLinkbasic(linkBasicInformation1.getId());
                linkBasicInformationMapper.deleteByID(linkBasicInformation1.getId());
                b.set(false);
            }else {
                b.set(true);
            }
inspection-server/src/main/resources/mapper/PlanMapper.xml
@@ -18,8 +18,11 @@
        <result property="internal" column="internal"/>
        <result property="testValue" column="testValue"/>
        <result property="testState" column="testState"/>
        <result property="uId" column="uId"/>
        <result property="checker" column="checker"/>
        <result property="isuId" column="isuId"/>
        <result property="instrumentname" column="instrumentname"/>
        <result property="classId" column="classId"/>
    </resultMap>
    <!--查询检验计划-->
    <select id="selectAllPlan" resultMap="selectAllPlanMap">
@@ -36,7 +39,10 @@
        internal,
        test_value testValue,
        test_state testState,
        u.id   uId,
        u.name checker,
        isu.id  isuId,
        isu.classify_id classId,
        equipment_name instrumentname
        from lims_laboratory.inspection_product ip
        left join lims_laboratory.inspection_material im on ip.inspection_material_id = im.id
inspection-server/src/main/resources/mapper/ReportMapper.xml
@@ -46,7 +46,9 @@
        <result property="checkTime" column="check_time"/>
        <result property="inspectionStatus" column="inspection_status"/>
        <result property="notes" column="notes"/>
        <result property="iUserName" column="iUserName"/>
        <collection property="products" resultMap="products" javaType="java.util.List"/>
        <collection property="equipment" resultMap="equipment" javaType="java.util.List"/>
    </resultMap>
    <resultMap id="products" type="map">
@@ -58,40 +60,55 @@
        <result property="testState" column="test_state"/>
        <result property="ipName" column="ipName"/>
    </resultMap>
    <resultMap id="equipment" type="map">
        <result property="eId" column="eId"/>
        <result property="eName" column="eName"/>
        <result property="eType" column="eType"/>
        <result property="eCode" column="eCode"/>
        <result property="validty" column="validty"/>
    </resultMap>
    <select id="getReportContext" resultMap="report">
        SELECT
            r.`code` rcode,
            date_format( r.create_time, '%Y-%m-%d' ) create_time,
            date_format( r.check_time, '%Y-%m-%d' ) check_time,
            i.inspection_status,
            im.`name`,
            im.num,
            im.specifications,
            im.supplier,
            im.`code` im_code,
            i.`code` ins_code,
            i.type,
            ip.id,
            ip.`name` ip_name,
            im.form_time formTime,
            ip.unit,
            ip.required,
            ip.test_value,
            ip.test_state,
            u.`name` ipName,
            im.notes
        FROM
            report r
                LEFT JOIN inspection i ON r.inspection_id = i.id
                LEFT JOIN inspection_material im ON im.inspection_id = i.id
                LEFT JOIN inspection_product ip ON ip.inspection_material_id = im.id
                LEFT JOIN `user` u on ip.user_id =u.id
        WHERE
            ip.state != 0
        SELECT r.`code`                                                                         rcode,
               date_format(r.create_time, '%Y-%m-%d')                                           create_time,
               date_format(r.check_time, '%Y-%m-%d')                                            check_time,
               i.inspection_status,
               im.`name`,
               im.num,
               im.specifications,
               im.supplier,
               im.`code`                                                                        im_code,
               i.`code`                                                                         ins_code,
               i.type,
               ip.id,
               ip.`name`                                                                        ip_name,
               im.form_time                                                                     formTime,
               ip.unit,
               ip.required,
               ip.test_value,
               ip.test_state,
               (SELECT u.`name` FROM `user` u WHERE u.id = i.user_id)                           iUserName,
               im.notes,
               ins.id                                                                           eId,
               ins.equipment_name                                                               eName,
               ins.specifications_models                                                        eType,
               ins.equipment_code                                                               eCode,
               DATE_FORMAT(DATE_ADD(mi.end_date, INTERVAL ins.term_validity MONTH), '%Y-%m-%d') validty
        FROM report r
                 LEFT JOIN inspection i ON r.inspection_id = i.id
                 LEFT JOIN inspection_material im ON im.inspection_id = i.id
                 LEFT JOIN inspection_product ip ON ip.inspection_material_id = im.id
                 LEFT JOIN `user` u ON ip.user_id = u.id
                 LEFT JOIN instrument ins ON ip.instrument_id = ins.id
                 LEFT JOIN metrical_information mi on ins.id = mi.instrument_id
        WHERE ip.state != 0
    AND im.state != 0
    AND ins.state != 0
    AND u.state != 0
    AND i.state != 0
    AND r.`code` = #{code}
        ORDER BY mi.end_date DESC
            LIMIT 1
    </select>
</mapper>
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/InstrumentController.java
@@ -108,8 +108,7 @@
    @GetMapping("/get_instrument")
    @AuthHandler
    public Result<?> getIdInstrumentInformation(Integer InstrumentId) {
        Instrument idInstrumentInformation = instrumentService.getIdInstrumentInformation(InstrumentId);
        return Result.success(idInstrumentInformation);
        return Result.success(instrumentService.getIdInstrumentInformation(InstrumentId));
    }
    @ApiOperation("根据仪器Id更新数据")
laboratory-server/src/main/java/com/yuanchu/limslaboratory/mapper/InstrumentMapper.java
@@ -28,4 +28,6 @@
    List<Map<String, Object>> chooseinstum();
    List<ClassAndInsTree> getInstrument();
    Map<String, Object> getInstrumentAndUser();
}
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/InstrumentService.java
@@ -31,7 +31,7 @@
     * @param instrumentId
     * @return
     */
    Instrument getIdInstrumentInformation(Integer instrumentId);
    Map<String, Object> getIdInstrumentInformation(Integer instrumentId);
    Integer updateEquipmentPointInformation(Instrument instrument);
laboratory-server/src/main/java/com/yuanchu/limslaboratory/service/impl/InstrumentServiceImpl.java
@@ -4,10 +4,13 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.mapper.UserMapper;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.mapper.InstrumentMapper;
import com.yuanchu.limslaboratory.pojo.User;
import com.yuanchu.limslaboratory.service.InstrumentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.limslaboratory.utils.JsonUtil;
import com.yuanchu.limslaboratory.utils.MyUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@@ -30,6 +33,9 @@
    @Resource
    private InstrumentMapper instrumentMapper;
    @Resource
    private UserMapper userMapper;
    @Override
    public Integer addInstrumentInformation(Instrument instrument) {
@@ -60,10 +66,14 @@
    }
    @Override
    public Instrument getIdInstrumentInformation(Integer instrumentId) {
    public Map<String, Object> getIdInstrumentInformation(Integer instrumentId) {
        LambdaQueryWrapper<Instrument> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Instrument::getId, instrumentId);
        return instrumentMapper.selectOne(wrapper);
        Instrument instrument = instrumentMapper.selectOne(wrapper);
        User user = userMapper.selectById(instrument.getUserId());
        Map<String, Object> map = JsonUtil.jsonToPojo(JsonUtil.jsonToString(instrument), Map.class);
        map.put("userName",user.getName());
        return map;
    }
    @Override
laboratory-server/src/main/resources/mapper/InstrumentMapper.xml
@@ -69,6 +69,9 @@
            f.father_name = s.cFatherName
          AND f.son_name IS NULL
    </select>
    <select id="getInstrumentAndUser" resultType="java.util.Map">
    </select>
    <resultMap id="treeMapClassAndInstrument" type="com.yuanchu.limslaboratory.pojo.ClassAndInsTree" >
        <result property="fatherId" column="id"/>
sys/src/main/resources/application-dev.yml
@@ -43,7 +43,7 @@
#    url: jdbc:mysql://192.168.110.209:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
#    username: user
#    password: 123456
    url: jdbc:mysql://192.168.73.113:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    url: jdbc:mysql://192.168.65.113:3306/lims_laboratory?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    username: user
    password: 123456
    druid:
@@ -69,7 +69,7 @@
    database: 0
    # redis服务器地址(默认为localhost)
#    host: 192.168.110.209
    host: 192.168.73.113
    host: 192.168.65.113
    # redis端口(默认为6379)
    port: 6379
    # redis访问密码(默认为空)
user-server/src/main/resources/mapper/RoleManangeMapper.xml
@@ -34,7 +34,7 @@
        delete
        from role_menu
        where role_id = #{id}
        and menu_id !=39
          and menu_id !=39
    </delete>
    <select id="getAssertName" resultType="com.yuanchu.limslaboratory.pojo.RoleInfo">
        select id
@@ -104,6 +104,7 @@
    <select id="getUserListRole" resultType="map">
        SELECT CONCAT(r.`id`, '') id, r.`name`
        FROM role r
        where state!=0
    </select>
    <select id="selctInterFaceType" resultType="java.util.Map">
        select type, menu_id menuId
@@ -122,7 +123,9 @@
        from interface_info
    </select>
    <select id="getRoleMenuByRoleId" resultType="com.yuanchu.limslaboratory.pojo.RoleMenu">
        select id from role_menu where role_id =#{roleId}
        select id
        from role_menu
        where role_id = #{roleId}
    </select>
    <resultMap id="roleAndMenuById" type="com.yuanchu.limslaboratory.pojo.dto.RoleAndMenuDto">
        <result property="roleName" column="roleName"/>