| | |
| | | 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; |
| | |
| | | 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] + "】操作失败!"); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 型号id |
| | | */ |
| | | private String specificationId; |
| | | private String specificationsId; |
| | | |
| | | /** |
| | | * 规格名称-型号名称 |
| | |
| | | .num(inspectionVo.getNum()) |
| | | .unit(inspectionVo.getUnit()) |
| | | .supplier(inspectionVo.getSupplier()) |
| | | .specificationId(inspectionVo.getSpecificationId()) |
| | | .specificationsId(inspectionVo.getSpecificationId()) |
| | | .specifications(inspectionVo.getSpecifications()) |
| | | .formTime(inspectionVo.getFormTime()) |
| | | .inspectionId(inspection.getId()) |
| | |
| | | @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); |
| | | } |
| | |
| | | <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"> |
| | |
| | | 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 |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | @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更新数据") |
| | |
| | | List<Map<String, Object>> chooseinstum(); |
| | | |
| | | List<ClassAndInsTree> getInstrument(); |
| | | |
| | | Map<String, Object> getInstrumentAndUser(); |
| | | } |
| | |
| | | * @param instrumentId |
| | | * @return |
| | | */ |
| | | Instrument getIdInstrumentInformation(Integer instrumentId); |
| | | Map<String, Object> getIdInstrumentInformation(Integer instrumentId); |
| | | |
| | | Integer updateEquipmentPointInformation(Instrument instrument); |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | @Resource |
| | | private InstrumentMapper instrumentMapper; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Override |
| | | public Integer addInstrumentInformation(Instrument instrument) { |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | 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"/> |
| | |
| | | # 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: |
| | |
| | | database: 0 |
| | | # redis服务器地址(默认为localhost) |
| | | # host: 192.168.110.209 |
| | | host: 192.168.73.113 |
| | | host: 192.168.65.113 |
| | | # redis端口(默认为6379) |
| | | port: 6379 |
| | | # redis访问密码(默认为空) |
| | |
| | | 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 |
| | |
| | | <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 |
| | |
| | | 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"/> |