Sfoglia il codice sorgente

1.获取日报接口新增类型区分是化验室还是连续监测类型 2.获取日报的化验时间和化验编号一致,取化验开始的时间

王苗苗 5 mesi fa
parent
commit
cfeb319ce6

+ 1 - 1
ruoyi-admin/src/main/resources/application-local.yml

@@ -15,7 +15,7 @@ spring:
                 # 从数据源开关/默认关闭
                 enabled: true
                 driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
-                url: jdbc:sqlserver://10.0.0.20:1433;DatabaseName=HS_TEST
+                url: jdbc:sqlserver://10.0.0.20:1433;DatabaseName=Water
                 username: sa
                 password: Abc123456
             # 初始连接数

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/business/req/AssayReq.java

@@ -17,4 +17,7 @@ public class AssayReq {
     private String timeEnd;//化验日期-截止
 
     private String deviceNo;//设备编号
+
+    //2024年10月28日14:28:16 新增请求参数,区分是化验室设备还是连续监测设备
+    private String type;// 1化验室,2:连续检测
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusinessServiceImpl.java

@@ -101,6 +101,14 @@ public class BusinessServiceImpl implements IBusinessService {
     @Override
     public List<AssayDetailRes> assayPageListByDeviceNoAndDate(AssayReq assayReq) {
         //通过设备编号和日期获取质控样的化验记录的明细化验时间和化验编号
+        //2024年10月28日14:51:33 化验室设备还是连续监测设备是分开的,不可以同时出现
+        if(StringUtils.isBlank(assayReq.getType()))
+            throw new RuntimeException("请输入一种设备类型");
+        String nowDate = DateUtils.getDate();
+        if(StringUtils.isBlank(assayReq.getTimeBegin()))
+            assayReq.setTimeBegin(nowDate);
+        if(StringUtils.isBlank(assayReq.getTimeEnd()))
+            assayReq.setTimeEnd(nowDate);
         List<AssayDetailRes> list = this.zAssayMapper.assayPageListByDeviceNoAndDate(assayReq);
         if(!CollectionUtils.isEmpty(list)){
             for (AssayDetailRes assayDetailRes : list) {

+ 10 - 7
ruoyi-system/src/main/resources/mapper/business/ZAssayMapper.xml

@@ -172,14 +172,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="assayPageListByDeviceNoAndDate" parameterType="com.ruoyi.business.req.AssayReq" resultType="com.ruoyi.business.res.AssayDetailRes">
         SELECT DISTINCT
-            update_time assayTime,
-            device_no deviceNo,
-            assay_no assayNo
+        <!-- 2024年10月28日15:17:31 和化验编号对应上,化验编号就是拼接的化验室设备+开始时间,所以这里的数据取开始时间 -->
+        za.begin_time assayTime,
+        za.device_no deviceNo,
+        za.assay_no assayNo
         FROM
-            z_assay
+        z_assay za
+        LEFT JOIN biz_device bd ON za.device_no = bd.device_no
         WHERE
-            1 = 1
-          AND assay_date between #{timeBegin} and #{timeEnd}
-        <if test="deviceNo != null  and deviceNo != ''"> and device_no = #{deviceNo}</if>
+        1 = 1
+        AND bd.type = #{type}
+        AND za.assay_date between #{timeBegin} and #{timeEnd}
+        <if test="deviceNo != null  and deviceNo != ''"> and za.device_no = #{deviceNo}</if>
     </select>
 </mapper>