Browse Source

airbottle模块代码合并

linfutong 2 years ago
parent
commit
01c1caabd4

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/AlarmRecordController.java

@@ -84,7 +84,7 @@ public class AlarmRecordController extends BaseController<AlarmRecord> {
         List<AlarmRecordVo> recordVos = TransferUtils.transferList(list, AlarmRecordVo.class);
         if (!recordVos.isEmpty()) {
             alarmRecordService.getRecordInfo(recordVos);
-            recordVos.forEach(r -> r.setCurrentPressureValue(StringUtils.convertDoubleToString(r.getCurrentPressure()) + "MPa"));
+            recordVos.forEach(r -> r.setCurrentPressureValue(r.getCurrentPressure()!=null?r.getCurrentPressure()+ "MPa":""));
         }
 
         util.exportExcel(response, recordVos, "报警记录数据");

+ 2 - 2
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpBottleStorageController.java

@@ -267,10 +267,10 @@ public class QpBottleStorageController extends BaseController {
         List<QpBottleStorageVO> list = qpBottleStorageService.selectQpTaskListIndex(storageInfoVo);
         for (int i=0;i<list.size();i++){
 
-            QpTaskVO task =   qpTaskService.selectQpTaskById(list.get(i).getTaskId());
+            /*QpTaskVO task =   qpTaskService.selectQpTaskById(list.get(i).getTaskId());
             list.get(i).setCampus(task.getCampus());//校区
             list.get(i).setBuilding(task.getBuilding());//楼栋
-            list.get(i).setRoom(task.getRoom());//房间号
+            list.get(i).setRoom(task.getRoom());//房间号*/
 
             if("gq".equals(list.get(i).getRemark())){
                 QpTaskDetail qpTaskDetail = new QpTaskDetail();

+ 3 - 2
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpRfidTagController.java

@@ -111,8 +111,9 @@ public class QpRfidTagController extends BaseController<QpRfidTag> {
                 strTag.append(tag.getTagCode()+",");
             }
         }
-        if(StringUtils.isNotNull(strTag)){
-            throw new ServiceException(strTag+"已被绑定");
+        if(StringUtils.isNotBlank(strTag)){
+            String substring = strTag.substring(0, strTag.length() - 1);
+            throw new ServiceException("标签:"+substring+"处于绑定状态!");
         }
         return ResultData.result(qpRfidTagService.deleteQpRfidTagByIds(ids));
     }

+ 10 - 7
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/domain/QpTaskDetail.java

@@ -13,7 +13,7 @@ import java.util.Date;
 
 /**
  * 【请填写功能名称】对象 qp_task_detail
- * 
+ *
  * @author zd
  * @date 2022-05-11
  */
@@ -86,31 +86,34 @@ public class QpTaskDetail extends BaseEntity
     @ApiModelProperty(value = "处理时间")
     private Date disposeTime;
 
-    public void setId(Long id) 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date disposeTime2;
+
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
 
-    public void setTaskId(Long taskId) 
+    public void setTaskId(Long taskId)
     {
         this.taskId = taskId;
     }
 
-    public Long getTaskId() 
+    public Long getTaskId()
     {
         return taskId;
     }
-    public void setBottleNumber(Long bottleNumber) 
+    public void setBottleNumber(Long bottleNumber)
     {
         this.bottleNumber = bottleNumber;
     }
 
-    public Long getBottleNumber() 
+    public Long getBottleNumber()
     {
         return bottleNumber;
     }

+ 3 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/AlarmRecordServiceImpl.java

@@ -102,10 +102,12 @@ public class AlarmRecordServiceImpl implements IAlarmRecordService {
         String electronicTag = alarmRecord.getElectronicTag();
         QpBottleStorageRVo storageRVo = storageService.getByElectronicTag(electronicTag);
         if (storageRVo != null) {
-            if (hardwareRfidDto!=null){
+            if (hardwareRfidDto!=null && storageRVo.getStorageStatus() == 1){
                 //RFID设备报警
                 R<Boolean> alarm = remoteRfidService.alarm(hardwareRfidDto);
                 log.info("==================>{},{}",alarm.getCode(),alarm.getMsg());
+            }else {
+                return 0;
             }
             Long id = storageRVo.getId();
             String key = RFID_CODE + electronicTag + id;

+ 8 - 8
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpAirGoogsMapper.xml

@@ -48,18 +48,18 @@
     <select id="selectQpAirGoogsList" parameterType="com.zd.airbottle.domain.QpAirGoogs" resultMap="QpAirGoogsResult">
         <include refid="selectQpAirGoogsListVo"/>
         <where>
-            <if test="goodsName != null  and goodsName != ''">and goods_name like concat('%', #{goodsName}, '%')</if>
-            <if test="searchValue != null  and searchValue != ''">and goods_name like concat('%', #{searchValue}, '%')
+            <if test="goodsName != null  and goodsName != ''">and t.goods_name like concat('%', #{goodsName}, '%')</if>
+            <if test="searchValue != null  and searchValue != ''">and t.goods_name like concat('%', #{searchValue}, '%')
             </if>
-            <if test="typeId != null ">and type_id = #{typeId}</if>
-            <if test="userId != null ">and user_id = #{userId}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
-            <if test="deptName != null ">and dept_name = #{deptName}</if>
+            <if test="typeId != null ">and t.type_id = #{typeId}</if>
+            <if test="userId != null ">and t.user_id = #{userId}</if>
+            <if test="deptId != null ">and t.dept_id = #{deptId}</if>
+            <if test="deptName != null ">and t.dept_name = #{deptName}</if>
             <if test="startTime != null  and endTime">
-                and date_format( create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
+                and date_format( t.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
             </if>
             <if test="ids !=null and ids.size>0">
-                and id in
+                and t.id in
                 <foreach item="id" collection="ids" open="(" separator="," close=")">
                     #{id}
                 </foreach>

+ 131 - 33
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpBottleStorageMapper.xml

@@ -120,21 +120,21 @@
                t.air_bottle_name,
                t.specification_name,
                t.air_bottle_config_id,
-               (select nick_name from sys_user u where u.user_id = t.storage_userid)           storageUser,
-               (select phonenumber from sys_user u where u.user_id = t.storage_userid)         storageUserPhone,
-               (select l.room room
-                from lab_subject s,
-                     lab_subject_layout l
-                where s.layout_id = l.id
-                  and s.id = (select ta.location_id
-                              from qp_bottle_storage bs,
-                                   qp_task ta
-                              where bs.task_id = ta.id
-                                and bs.task_detail_id = t.task_detail_id
-                              LIMIT 1))                                                        room,
-               (select location from qp_task ta where ta.id = t.task_id)                       location,
-               (select phonenumber from sys_user u where u.user_id = t.rejection_apply_userid) refusePhonen,
-               (select nick_name from sys_user u where u.user_id = t.rejection_apply_userid)   refuseName
+               (select nick_name from sys_user u where u.user_id = t.storage_userid)   storageUser,
+               (select phonenumber from sys_user u where u.user_id = t.storage_userid) storageUserPhone,
+               (select  fl.room_num from  qp_task ta,lab_build_floor_layout fl where ta.id=t.task_id and ta.location_id = fl.sub_id) room,
+               (
+        select location
+        from qp_task ta
+        where ta.id = t.task_id) location
+            , (
+        select phonenumber
+        from sys_user u
+        where u.user_id = t.rejection_apply_userid) refusePhonen
+            , (
+        select nick_name
+        from sys_user u
+        where u.user_id = t.rejection_apply_userid) refuseName
         from qp_bottle_storage as t
     </sql>
     <sql id="whereSql">
@@ -216,8 +216,8 @@
         select * from (
         <include refid="selectQpBottleStorageListVo"/>
         ) t2 LEFT JOIN qp_task ta on t2.task_id=ta.id
-        LEFT JOIN   sys_dept d on   ta.dept_id=d.dept_id
-        LEFT JOIN sys_user u on  ta.user_id=u.user_id
+        LEFT JOIN sys_dept d on ta.dept_id=d.dept_id
+        LEFT JOIN sys_user u on ta.user_id=u.user_id
         <where>
             <if test="searchValue != null  and searchValue != ''">
                 and ( t2.storageUser like concat('%', #{searchValue}, '%')
@@ -236,10 +236,10 @@
                 AND DATE_FORMAT(t2.create_time,'%Y-%m-%d') &lt;=DATE_FORMAT(#{endTime},'%Y-%m-%d')
             </if>
             <if test="ids != null ">
-            and t2.id in
-            <foreach item="id" collection="ids" open="(" separator="," close=")">
-                #{id}
-            </foreach>
+                and t2.id in
+                <foreach item="id" collection="ids" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
             </if>
             <!-- 数据范围过滤 -->
             ${params.dataScope}
@@ -291,13 +291,13 @@
     <select id="calcLocationStorage" resultType="com.zd.airbottle.domain.vo.report.AirAmount"
             parameterType="java.lang.String">
         select * from (SELECT
-        ls.room `name`,
+        fl.room_num `name`,
         COUNT( 1 ) in_num
         FROM
         qp_bottle_storage qs
         INNER JOIN qp_task qt ON qt.id=qs.task_id
         INNER JOIN lab_subject su on su.id = qt.location_id
-        INNER JOIN lab_subject_layout ls on ls.id=su.layout_id
+        INNER JOIN lab_build_floor_layout fl on fl.sub_id = qt.location_id
         WHERE
         DATE_FORMAT( qs.create_time, '%Y-%m' )> DATE_FORMAT( date_sub( curdate(), INTERVAL 12 MONTH ), '%Y-%m' )
         AND qs.air_status=0
@@ -305,7 +305,7 @@
             AND qs.air_bottle_name LIKE concat('%', #{airName}, '%')
         </if>
         GROUP BY
-        ls.id
+        fl.id
         ) t ORDER BY t.in_num desc
     </select>
 
@@ -458,13 +458,31 @@
     </delete>
 
     <!-- 入库表实验室关联查询 -->
-    <select id="selectQpBottleStorageByRelationSubject" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO" resultMap="QpBottleStorageResult">
+    <select id="selectQpBottleStorageByRelationSubject" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
+            resultMap="QpBottleStorageResult">
         select t.id,t.task_id,t.task_detail_id, t.create_time,
-        (select d.dept_class_name from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t.location_id)
+        (select f.name
+        from lab_build_floor f
+        where f.type = 1
+        and f.id = (
+        select f.parent_id
+        from lab_build_floor f
+        where f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t.location_id)))
         campus,
-        (select d.dept_name building from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t.location_id)
+        (select f.`name`
+        from lab_build_floor f
+        where f.type = 2
+        and f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t.location_id))
         building,
-        (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=t.location_id) room
+        (select bfl.room_num
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t.location_id) room
         from (
         select bs.*,ta.location_id from qp_bottle_storage bs, qp_task ta,qp_task_detail td
         where bs.task_id = ta.id and bs.task_detail_id = td.id
@@ -557,22 +575,100 @@
     <select id="selectQpTaskListIndex" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
             resultMap="QpBottleStorageResult">
         select *
-        from (select distinct ta.id, ta.id task_id, '' task_detail_id, 'gq' remark, ta.create_time
+        from (select distinct ta.id,
+                              ta.id                               task_id,
+                              ''                                  task_detail_id,
+                              'gq'                                remark,
+                              ta.create_time,
+                              (select bfl.room_num
+                               from lab_build_floor_layout bfl
+                               where bfl.sub_id = ta.location_id) room,
+                              (
+                                  select f.`name`
+                                  from lab_build_floor f
+                                  where f.type = 2
+                                    and f.id =
+                                        (select bfl.build_id
+                                         from lab_build_floor_layout bfl
+                                         where bfl.sub_id = ta.location_id)
+                              )                                   building,
+                              (
+                                  select f.name
+                                  from lab_build_floor f
+                                  where f.type = 1
+                                    and f.id = (
+                                      select f.parent_id
+                                      from lab_build_floor f
+                                      where f.id =
+                                            (select bfl.build_id
+                                             from lab_build_floor_layout bfl
+                                             where bfl.sub_id = ta.location_id))
+                              )                                   campus
               from qp_task ta,
                    qp_task_detail td
               where ta.id = td.task_id
                 and td.is_dispose = 0
                 and td.supplier_id = #{companyId}
               UNION all
-              select bso.id, bs.task_id, bs.task_detail_id, 'hs' remark, bso.create_time
+              select bso.id,
+                     bs.task_id,
+                     bs.task_detail_id,
+                     'hs'                                                                                    remark,
+                     bso.create_time,
+                     (select bfl.room_num from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id) room,
+                     (
+                         select f.`name`
+                         from lab_build_floor f
+                         where f.type = 2
+                           and f.id =
+                               (select bfl.build_id from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id)
+                     )                                                                                       building,
+                     (
+                         select f.name
+                         from lab_build_floor f
+                         where f.type = 1
+                           and f.id = (
+                             select f.parent_id
+                             from lab_build_floor f
+                             where f.id =
+                                   (select bfl.build_id
+                                    from lab_build_floor_layout bfl
+                                    where bfl.sub_id = tk.location_id))
+                     )                                                                                       campus
               from qp_bottle_storage_out bso
                        LEFT JOIN qp_bottle_storage bs on bso.storage_id = bs.id
                        LEFT JOIN qp_task_detail td on td.id = bs.task_detail_id
+                       LEFT JOIN qp_task tk on tk.id = bs.task_id
               where bso.out_status = 0
                 and td.supplier_id = #{companyId}
               UNION all
-              select bs.id, bs.task_id, bs.task_detail_id, 'wt' remark, bs.create_time
+              select bs.id,
+                     bs.task_id,
+                     bs.task_detail_id,
+                     'wt'                                                                                    remark,
+                     bs.create_time,
+                     (select bfl.room_num from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id) room,
+                     (
+                         select f.`name`
+                         from lab_build_floor f
+                         where f.type = 2
+                           and f.id =
+                               (select bfl.build_id from lab_build_floor_layout bfl where bfl.sub_id = tk.location_id)
+                     )                                                                                       building,
+                     (
+                         select f.name
+                         from lab_build_floor f
+                         where f.type = 1
+                           and f.id = (
+                             select f.parent_id
+                             from lab_build_floor f
+                             where f.id =
+                                   (select bfl.build_id
+                                    from lab_build_floor_layout bfl
+                                    where bfl.sub_id = tk.location_id))
+                     )                                                                                       campus
               from qp_bottle_storage bs
+                       LEFT JOIN qp_task tk on tk.id = bs.task_id
                        LEFT JOIN qp_task_detail td
                                  on bs.task_detail_id = td.id
               where bs.air_status = 1
@@ -585,7 +681,7 @@
     <select id="selectIntoStorageList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageVO"
             resultMap="QpBottleStorageResult">
         select * from qp_bottle_storage bs,qp_task ta
-        where bs.task_id = ta.id and bs.task_id = ta.id and  bs.storage_status!=3  and bs.air_status=0
+        where bs.task_id = ta.id and bs.task_id = ta.id and bs.storage_status!=3 and bs.air_status=0
         <if test="subjectId != null ">and ta.location_id=#{subjectId}</if>
         <if test="userId != null ">and ta.user_id=#{userId}</if>
     </select>
@@ -608,7 +704,9 @@
 
     <!-- 查询实验室负责人-->
     <select id="selectSubectDetalsById" resultType="java.util.Map">
-        select admin_id adminId from lab_subject where id= #{subjectId};
+        select admin_id adminId
+        from lab_subject
+        where id = #{subjectId};
     </select>
 
 </mapper>

+ 23 - 6
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpBottleStorageOutMapper.xml

@@ -33,9 +33,7 @@
                t.storage_id, t.car_id, t.car_number, t.transport_id, t.transport_name,
                t.dispose_userid, t.dispose_username, t.dispose_time, t.complete_time,
                t.complete_userid, t.complete_username, t.pressure,t.out_status,
-               (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=
-               ( select location_id from qp_bottle_storage bs , qp_task ta where bs.id=t.storage_id
-                                                                            and bs.task_id = ta.id) ) room
+               (select fl.room_num from lab_build_floor_layout fl where fl.sub_id=ta.location_id) room
         from  qp_bottle_storage_out  t
             LEFT JOIN qp_bottle_storage bs on t.storage_id=bs.id
             LEFT JOIN qp_task ta on bs.task_id=ta.id
@@ -44,6 +42,7 @@
     </sql>
     <select id="selectQpBottleStorageOutList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageOutVO" resultMap="QpBottleStorageOutResult">
         <include refid="selectQpBottleStorageOutListVo"/>
+        <where>
             <if test="searchValue != null  and searchValue != ''">
                 and ( t.apply_user_name like concat('%', #{searchValue}, '%')
                 or t.phone like concat('%', #{searchValue}, '%')
@@ -74,6 +73,7 @@
                 #{id}
             </foreach>
          </if>
+        </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
         order by t.create_time desc
@@ -164,9 +164,26 @@
     <!-- 回收单 实验室关联查询-->
     <select id="selectQpBottleStorageOutRelationSubject" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageOutVO" resultMap="QpBottleStorageOutResult">
         select t2.id,t2.storage_id,t2.task_id, t2.create_time,taskDetailId,
-               (select d.dept_class_name  from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t2.location_id) campus,
-               (select d.dept_name building from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=t2.location_id) building,
-               (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=t2.location_id) room
+        (select f.name
+        from lab_build_floor f
+        where f.type = 1
+        and f.id = (
+        select f.parent_id
+        from lab_build_floor f
+        where f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t2.location_id))) campus,
+        (select f.`name`
+        from lab_build_floor f
+        where f.type = 2
+        and f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t2.location_id)) building,
+        (select bfl.room_num
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = t2.location_id) room
         from (
                  select *, (select ta.location_id from qp_task ta where ta.id=t.task_id ) location_id from (
                    select * from (

+ 2 - 2
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpFlowDetailMapper.xml

@@ -69,8 +69,8 @@
             <if test="flowType != null ">and t.flow_type = #{flowType}</if>
             <if test="userName != null  and userName != ''">and t.user_name like concat('%', #{userName}, '%')</if>
             <if test="userTelephone != null  and userTelephone != ''">and t.user_telephone = #{userTelephone}</if>
-            <if test="deptId != null ">and ( dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
-                ,ancestors )) or dept_id = #{deptId} )
+            <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                ,ancestors )) or t.dept_id = #{deptId} )
             </if>
             <!-- 数据范围过滤 -->
             ${params.dataScope}

+ 14 - 7
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpQualificationApplyMapper.xml

@@ -75,7 +75,7 @@
                t.center_audit_status, t.center_audit_userid,t.center_audit_username,
                t.center_audit_time, t.center_audit_cause,
                t.create_time,
-               (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=t.subject_id) room,
+               (select fl.room_num from lab_build_floor_layout fl where fl.sub_id=t.subject_id) room,
                ( select sum(d.bottle_number) from qp_qualification_apply_detail d where d.qualificate_apply_id = t.id) bottle_number,
                ( select admin_id from lab_subject  su where  su.id=t.subject_id ) admin_id
         from qp_qualification_apply as t
@@ -98,8 +98,15 @@
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
-            <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
-            <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
+            <if test="startTime != null  and endTime != null">
+                and (
+                #{startTime} BETWEEN  t.start_time and  t.end_time
+                or #{endTime} BETWEEN  t.start_time and  t.end_time
+                or t.start_time BETWEEN  #{startTime} and #{endTime}
+                )
+            </if>
+            <!--<if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
+            <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>-->
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>
             <if test="applyCertificate != null  and applyCertificate != ''"> and t.apply_certificate = #{applyCertificate}</if>
             <if test="safetyPrecautions != null  and safetyPrecautions != ''"> and t.safety_precautions = #{safetyPrecautions}</if>
@@ -238,7 +245,7 @@
     <select id="selectQpApplyList" parameterType="com.zd.airbottle.domain.QpQualificationApply" resultMap="QpQualificationApplyResultVO">
         select * from (
         select qa.id,qa.location,qa.apply_user,qa.create_time,qa.lead_audit_status,qa.center_audit_status,'zg' remark,
-        (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=qa.subject_id) room
+        (select fl.room_num  from lab_build_floor_layout fl where fl.sub_id = qa.subject_id) room
         from qp_qualification_apply qa where 1=1
         <if test="auditStatus == 0"> and qa.lead_audit_status=0 or center_audit_status=0</if> /**待审核 **/
         <if test="auditStatus == 1"> and qa.center_audit_status=1</if> /** 通过 **/
@@ -246,7 +253,7 @@
         <if test="auditStatus == 3"> and (qa.lead_audit_status!=0 or  qa.center_audit_status!=0) </if> /** 已审核 **/
         UNION ALL
         select ua.id,ua.location,ua.apply_user,ua.create_time,ua.lead_audit_staus,ua.center_audit_status,'yq' remark,
-        (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=ua.subject_id) room
+        (select fl.room_num  from lab_build_floor_layout fl where fl.sub_id = ua.subject_id) room
         from qp_usegas_apply ua where 1=1
         <if test="auditStatus == 0"> and ua.lead_audit_staus=0 or ua.center_audit_status=0</if>/**待审核 **/
         <if test="auditStatus == 1"> and ua.center_audit_status=1 </if> /** 通过 **/
@@ -259,7 +266,7 @@
     <select id="selectQpApplyListManageApp" parameterType="com.zd.airbottle.domain.QpQualificationApply" resultMap="QpQualificationApplyResultVO">
         select * from (
                           select qa.id,qa.location,qa.apply_user,qa.create_time,qa.lead_audit_status,qa.center_audit_status,'zg' remark,
-                          (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=qa.subject_id) room
+                          (select fl.room_num from lab_build_floor_layout fl  where fl.sub_id = qa.subject_id) room
                           from qp_qualification_apply qa where 1=1
                             <if test="ids == null">
                                 <if test="zgBoolean == false">
@@ -287,7 +294,7 @@
 
                           UNION ALL
                           select ua.id,ua.location,ua.apply_user,ua.create_time,ua.lead_audit_staus,ua.center_audit_status,'yq' remark,
-                           (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=ua.subject_id) room
+                           (select fl.room_num from lab_build_floor_layout fl  where fl.sub_id = ua.subject_id) room
                           from qp_usegas_apply ua where 1=1
                             <if test="ids == null">
                                 <if test="yqBoolean == false">

+ 1 - 0
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpRfidTagMapper.xml

@@ -30,6 +30,7 @@
             <if test="tagCode != null  and tagCode != ''">and tag_code = #{tagCode}</if>
             <if test="isBind != null ">and is_bind = #{isBind}</if>
         </where>
+        order by create_time desc
     </select>
 
     <select id="selectQpRfidTagById" resultMap="QpRfidTagResult">

+ 1 - 1
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpTaskDetailMapper.xml

@@ -47,7 +47,7 @@
 
 
     <sql id="selectQpTaskDetailVo">
-        select id, air_bottle_config_id, task_id, bottle_number, qp_status, apply_describe, supplier_id, car_id, car_number, transport_id, transport_name, is_dispose, dispose_user, dispose_userid, dispose_time, create_time from qp_task_detail
+        select id, air_bottle_config_id, task_id, bottle_number, qp_status, apply_describe, supplier_id, car_id, car_number, transport_id, transport_name, is_dispose, dispose_user, dispose_userid, dispose_time, dispose_time disposeTime2, create_time from qp_task_detail
     </sql>
 
     <sql id="selectQpTaskDetailListVo">

+ 56 - 32
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpTaskMapper.xml

@@ -44,42 +44,49 @@
                t.dept_name,
                t.type,
                t.create_time,
-               (select d.dept_class_name
-                from lab_subject s,
-                     sys_dept d
-                where s.build_id = d.dept_id
-                  and s.id = t.location_id)                                                              campus,/**校区**/
-               (select d.dept_name building
-                from lab_subject s,
-                     sys_dept d
-                where s.build_id = d.dept_id
-                  and s.id = t.location_id)                                                              building,/**楼栋*/
-               (select l.room room
-                from lab_subject s,
-                     lab_subject_layout l
-                where s.layout_id = l.id
-                  and s.id = t.location_id)                                                              room,/*房间号**/
+               (select f.name
+                from lab_build_floor f
+                where f.type = 1
+                  and f.id = (
+                    select f.parent_id
+                    from lab_build_floor f
+                    where f.id =
+                          (select bfl.build_id
+                           from lab_build_floor_layout bfl
+                           where bfl.sub_id = t.location_id)))                               campus,/**校区**/
+               (select f.`name`
+                from lab_build_floor f
+                where f.type = 2
+                  and f.id =
+                      (select bfl.build_id
+                       from lab_build_floor_layout bfl
+                       where bfl.sub_id = t.location_id))                                    building,/**楼栋*/
+               (select bfl.room_num
+                from lab_build_floor_layout bfl
+                where bfl.sub_id = t.location_id)                                            room,/*房间号**/
                (select COALESCE(sum(bottle_number), 0)
                 from qp_task_detail d
-                where d.task_id = t.id)                                                                  applyNum, /**申请总数**/
+                where d.task_id = t.id)                                                      applyNum, /**申请总数**/
                (select count(1)
                 from qp_bottle_storage st
                 where st.task_id = t.id
-                  and st.air_status = 0)                                                                 storageNum, /** 入库总数 **/
+                  and st.air_status = 0)                                                     storageNum, /** 入库总数 **/
                (select count(1)
                 from qp_bottle_storage st
                 where st.task_id = t.id
-                  and st.air_status = 1)                                                                 refuseNum, /** 拒收总数 **/
+                  and st.air_status = 1)                                                     refuseNum, /** 拒收总数 **/
                (select COALESCE(sum(bottle_number), 0)
                 from qp_task_detail td
-                where td.task_id = t.id and qp_status = 0)                                               wpsNum,/** 未派送总数 **/
+                where td.task_id = t.id
+                  and qp_status = 0)                                                         wpsNum,/** 未派送总数 **/
                ((select ifnull((SELECT sum(td.bottle_number)
-                        FROM qp_task_detail td
-                         WHERE td.task_id = t.id
-                         AND qp_status = 1),0) from dual) - (select  count(1) from qp_bottle_storage where task_id=t.id))    drkNum /** 待入库总数 **/
+                                FROM qp_task_detail td
+                                WHERE td.task_id = t.id
+                                  AND qp_status = 1), 0)
+                 from dual) - (select count(1) from qp_bottle_storage where task_id = t.id)) drkNum /** 待入库总数 **/
         from qp_task as t
-        LEFT JOIN   sys_dept d on   t.dept_id=d.dept_id
-        LEFT JOIN sys_user u on  t.user_id=u.user_id
+                 LEFT JOIN sys_dept d on t.dept_id = d.dept_id
+                 LEFT JOIN sys_user u on t.user_id = u.user_id
     </sql>
     <select id="selectQpTaskList" parameterType="com.zd.airbottle.domain.vo.QpTaskVO" resultMap="QpTaskResult">
         <include refid="selectQpTaskListVo"/>
@@ -107,7 +114,7 @@
                 AND DATE_FORMAT(t.create_time,'%Y-%m-%d') &lt;= date_format(#{endTime},'%Y-%m-%d')
             </if>
             <if test="ids !=null">
-                AND  t.id in
+                AND t.id in
                 <foreach item="id" collection="ids" open="(" separator="," close=")">
                     #{id}
                 </foreach>
@@ -206,7 +213,7 @@
                    qp_task_detail td
               where bso.storage_id = bs.id
                 and bs.task_detail_id = td.id
-                and bso.out_status=0
+                and bso.out_status = 0
                 and td.supplier_id = #{companyId}
               GROUP BY date_format(bso.create_time, '%Y-%m-%d')) t
         GROUP BY t.create_time
@@ -265,11 +272,28 @@
             resultMap="QpTaskResult">
         select
         ta.id,ta.create_time,
-        (select d.dept_class_name from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=ta.location_id)
+        (select f.name
+        from lab_build_floor f
+        where f.type = 1
+        and f.id = (
+        select f.parent_id
+        from lab_build_floor f
+        where f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = ta.location_id)))
         campus,
-        (select d.dept_name building from lab_subject s,sys_dept d where s.build_id=d.dept_id and s.id=ta.location_id)
+        (select f.`name`
+        from lab_build_floor f
+        where f.type = 2
+        and f.id =
+        (select bfl.build_id
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = ta.location_id))
         building,
-        (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=ta.location_id)
+        (select bfl.room_num
+        from lab_build_floor_layout bfl
+        where bfl.sub_id = ta.location_id)
         room
         from qp_task ta where 1=1
         <if test="id != null">and ta.id = #{id}</if>
@@ -282,7 +306,7 @@
         <if test="isDispose != null">and (ta.id in (select td.task_id from qp_task_detail td where
             td.is_dispose=#{isDispose}
             <if test="companyId != null">
-                 and td.supplier_id=#{companyId}) )
+                and td.supplier_id=#{companyId}) )
             </if>
         </if>
     </select>
@@ -291,14 +315,14 @@
     <select id="selectUseRecord" parameterType="com.zd.airbottle.domain.vo.QpTaskVO" resultMap="QpTaskResult">
         select
         ta.location,ta.location_id,
-        (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=ta.location_id)
+        (select  l.room_num from lab_build_floor_layout l where l.sub_id=ta.location_id)
         room
         from qp_bottle_storage bs
         left JOIN qp_task ta on ta.id = bs.task_id
         left join qp_task_detail td on td.task_id=ta.id
         left JOIN qp_use_record ur on ur.storage_id=bs.id
         where bs.air_status=0 and (bs.storage_status=1 or bs.storage_status=2 )
-        <if test="companyId != null">td.supplier_id=#{companyId} </if>
+        <if test="companyId != null">td.supplier_id=#{companyId}</if>
         <if test="userId != null">and ta.user_id=#{userId}</if>
         GROUP BY ta.location,ta.location_id
     </select>

+ 10 - 3
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUsegasApplyMapper.xml

@@ -48,7 +48,7 @@
                t.lead_audit_userid, t.lead_audit_username, t.lead_audit_time, t.lead_audit_cause,
                t.center_audit_status, t.center_audit_userid, t.center_audit_username, t.center_audit_time,
                t.center_audit_cause, t.create_time,
-               (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=t.subject_id) room,
+               (select fl.room_num from lab_build_floor_layout fl where fl.sub_id = t.subject_id) room,
                ( select admin_id from lab_subject  su where  su.id=t.subject_id ) admin_id
         from qp_usegas_apply as t
                  LEFT JOIN   sys_dept d on   t.dept_id=d.dept_id
@@ -70,8 +70,15 @@
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
-            <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
-            <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
+            <if test="startTime != null  and endTime != null">
+                and (
+                #{startTime} BETWEEN  t.start_time and  t.end_time
+                or #{endTime} BETWEEN  t.start_time and  t.end_time
+                or t.start_time BETWEEN  #{startTime} and #{endTime}
+                )
+            </if>
+            <!--<if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
+            <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>-->
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>
             <if test="applyCertificate != null  and applyCertificate != ''"> and t.apply_certificate = #{applyCertificate}</if>
             <if test="safetyPrecautions != null  and safetyPrecautions != ''"> and t.safety_precautions = #{safetyPrecautions}</if>