| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | |
| | | @ApiImplicitParam(name = "id", value = "委托样品id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delLink") |
| | | @AuthHandler |
| | | @AuthHandler(type = InterfaceType.DELETE,menuId = MenuEnums.commissionInspection,isAdd = true) |
| | | public Result<?> delLink(Integer id){ |
| | | linkBasicInformationService.delLink(id); |
| | | return Result.success("删除成功!"); |
| | |
| | | |
| | | LinkBasicInformation getLinkBasicInformation(@Param("uid")String uid); |
| | | |
| | | int deleteByID(Integer id); |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.lang.Snowflake; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | RawMaterial rawMaterial = new RawMaterial(); |
| | | rawMaterial.setId(inspectionVo.getId()); |
| | | rawMaterial.setType(1); |
| | | rawMaterial.setInspectionDate(DateUtil.date()); |
| | | rawMaterial.setSurveyor(userMapper.selectById(id).getName()); |
| | | rawMaterialMapper.updateById(rawMaterial); |
| | | } |
| | |
| | | QueryWrapper<LinkBasicInformation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(LinkBasicInformation::getId).eq(LinkBasicInformation::getUid, linkBasicInformation.getUid()); |
| | | LinkBasicInformation linkBasicInformation1 = linkBasicInformationMapper.selectOne(queryWrapper); |
| | | Optional.ofNullable(linkBasicInformation.getId()).ifPresent(l->{ |
| | | Optional.ofNullable(linkBasicInformation1.getId()).ifPresent(l->{ |
| | | //执行删除 |
| | | linkDetectionMapper.deleteByLinkbasic(linkBasicInformation1.getId()); |
| | | linkBasicInformationMapper.deleteById(linkBasicInformation1.getId()); |
| | | linkBasicInformationMapper.deleteByID(linkBasicInformation1.getId()); |
| | | }); |
| | | //委托编号 |
| | | String code = MyUtil.getTimeSixNumberCode("SL", "SL"); |
| | |
| | | <?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.LinkBasicInformationMapper"> |
| | | <delete id="deleteByID"> |
| | | delete from link_basic_information where id=#{id} |
| | | </delete> |
| | | <select id="getLinkBasicPage" resultType="map"> |
| | | SELECT d.`id`, l.`entrust_coding`, l.`entrusted`, d.`samples_number`, d.`sample_name`, |
| | | d.`specifications_models`, |
| | |
| | | ld.unit unit, |
| | | ld.samples_number samplesNumber, |
| | | ld.remarks remarks |
| | | FROM link_basic_information lb, |
| | | FROM link_basic_information lb left join |
| | | link_detection ld |
| | | WHERE lb.id = ld.link_basic_id |
| | | AND lb.uid = #{uid} |
| | | on lb.id = ld.link_basic_id |
| | | where lb.uid = #{uid} |
| | | and lb.state = 1 |
| | | AND ld.state = 1 |
| | | </select> |
| | | |
| | | <resultMap id="getLinkBasicInformationMap" type="com.yuanchu.limslaboratory.pojo.LinkBasicInformation"> |
| | |
| | | @Autowired |
| | | private RoleManageMapper roleManageMapper; |
| | | |
| | | @Autowired |
| | | private MenuMapper menuMapper; |
| | | |
| | | @SneakyThrows |
| | | @Override |
| | | public void run(String... args) throws Exception { |
| | |
| | | .noneMatch(value2 -> value2.equals(map1.get("url"))) // 查找不同的值 |
| | | ).collect(Collectors.toList()); |
| | | if(differentMaps.size()>0){ |
| | | |
| | | int insertInterfaceList = roleManageMapper.insertInterfaceList(differentMaps); |
| | | if (insertInterfaceList>0) log.info("新增接口成功!"); |
| | | if (insertInterfaceList>0) log.info(String.valueOf(differentMaps));log.info("新增接口成功!"); |
| | | }else { |
| | | log.info("无需增加新的接口!"); |
| | | } |