JYW
2024-04-23 7dcb6f8665db1334940dca300c4b83c6cd81373d
2024-04-23 印章后端关联实验室
已修改10个文件
64 ■■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/LaboratoryController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/SealController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/mapper/SealMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/Seal.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/SealService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/impl/SealServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/SealMapper.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
@@ -126,6 +126,5 @@
    public Result selectDeviceByCategory(String category) {
        return Result.success(deviceService.selectDeviceByCategory(category));
    }
}
cnas-server/src/main/java/com/yuanchu/mom/controller/LaboratoryController.java
@@ -12,6 +12,9 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.annotation.Resources;
import java.util.Map;
/**
@@ -25,7 +28,7 @@
    @Value("${file.path}")
    private String filePath;
    @Resource
    private LaboratoryService laboratoryService;
    @ApiOperation(value = "查询实验室管理列表")
cnas-server/src/main/java/com/yuanchu/mom/controller/SealController.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.Laboratory;
import com.yuanchu.mom.pojo.Seal;
import com.yuanchu.mom.service.SealService;
import com.yuanchu.mom.utils.JackSonUtil;
@@ -10,6 +11,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
@@ -32,7 +34,15 @@
    @ApiOperation(value = "添加印章参数")
    @PostMapping("/addSeal")
    public Result addSeal(@RequestBody Seal seal) {
        return Result.success(sealService.addSeal(seal));
        int i = sealService.addSeal(seal);
        if(i>0){
            Integer labId = seal.getLabId();
            List<Laboratory> laboratory = sealService.Laboratory(labId);
            return Result.success(laboratory);
        }else{
            return Result.fail();
        }
    }
    @ApiOperation(value = "修改印章参数")
    @PostMapping("/upSeal")
@@ -42,11 +52,8 @@
    @ApiOperation(value="查询印章列表")
    @PostMapping("/selectSeal")
    public  Result selectSeal(@RequestBody Map<String, Object> data) throws Exception {
        //获取当前页数
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        //获取当前印章信息
        Seal seal = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Seal.class);
        //获取分页数据
        return Result.success(sealService.selectSeal(page,seal));
    }
}
cnas-server/src/main/java/com/yuanchu/mom/mapper/SealMapper.java
@@ -6,8 +6,14 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.Certification;
import com.yuanchu.mom.pojo.Laboratory;
import com.yuanchu.mom.pojo.Seal;
import java.util.List;
import java.util.Map;
public interface SealMapper extends BaseMapper<Seal> {
    IPage<Seal> selectSeal(Page page, QueryWrapper<Seal> ew);
    IPage<Seal>selectSeal(Page page, QueryWrapper<Seal> ew);
    List<Laboratory> selectLaboratory (Integer labId);
}
cnas-server/src/main/java/com/yuanchu/mom/pojo/Seal.java
@@ -20,9 +20,11 @@
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ValueTableShow(1)
    @ApiModelProperty(value = "实验室id")
    private Integer labId;
    @ValueTableShow(2)
    @ApiModelProperty(value = "印章地址")
    @ApiModelProperty(value = "印章图片")
    private String address;
    @ValueTableShow(3)
@@ -38,5 +40,6 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
cnas-server/src/main/java/com/yuanchu/mom/service/SealService.java
@@ -6,6 +6,7 @@
import com.yuanchu.mom.pojo.Laboratory;
import com.yuanchu.mom.pojo.Seal;
import java.util.List;
import java.util.Map;
public interface SealService extends IService<Seal> {
@@ -19,5 +20,7 @@
    //查询
    Map<String, Object> selectSeal(Page page, Seal seal);
    List<Laboratory>  Laboratory(Integer id);
}
cnas-server/src/main/java/com/yuanchu/mom/service/impl/SealServiceImpl.java
@@ -14,6 +14,7 @@
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@@ -42,9 +43,10 @@
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(Seal.class));
        map.put("body", sealMapper.selectSeal(page, QueryWrappers.queryWrappers(seal)));
        System.out.println(page);
        return map;
    }
    @Override
    public List<Laboratory> Laboratory(Integer labId) {
        return sealMapper.selectLaboratory(labId);
    }
}
cnas-server/src/main/resources/mapper/SealMapper.xml
@@ -3,14 +3,15 @@
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.SealMapper">
    <select id="selectSeal" resultType="com.yuanchu.mom.mapper.SealMapper">
        select s.address,s.type,u.`name`,s.create_time
        from seal s
            LEFT JOIN `user` u
                on s.create_user=u.id
    <select id="selectSeal" resultType="com.yuanchu.mom.pojo.Seal">
        select * from seal
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="selectLaboratory" resultType="com.yuanchu.mom.pojo.Laboratory">
        SELECT *
        from laboratory
        WHERE id =#{labId}
    </select>
</mapper>
system-run/src/main/resources/application-dev.yml
@@ -67,7 +67,7 @@
    # redis端口(默认为6379)
    port: 6379
    # redis访问密码(默认为空)
    password: null
    password: 123456
    # redis连接超时时间(单位毫秒)
    timeout: 50
    # redis连接池配置
system-run/src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 8002
  port: 8001
spring:
  profiles:
    active: dev