瀏覽代碼

柜锁设置生效

liubo 3 年之前
父節點
當前提交
290744fa89

+ 11 - 6
zd-modules/zd-chemical/src/main/java/com/zd/chemical/controller/HxpAIOController.java

@@ -22,11 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import javax.validation.Valid;
 import javax.validation.Valid;
-import java.math.BigDecimal;
 import java.text.DateFormat;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
  * 化学品智能终端Controller
  * 化学品智能终端Controller
@@ -96,7 +94,8 @@ public class HxpAIOController extends BaseController {
     @Autowired
     @Autowired
     private IHxpAlarmRecordService hxpAlarmRecordService;
     private IHxpAlarmRecordService hxpAlarmRecordService;
 
 
-    /**-------------------------------------BASE 说明---------------------------------------*/
+    /**-------------------------------------BASE 说明---------------------------------------
+     * @return*/
 
 
     /*
     /*
      * 1.获取功能配置基本信息和logo: /system/logo/config/getLogoInfo (无 token 验证,GET)
      * 1.获取功能配置基本信息和logo: /system/logo/config/getLogoInfo (无 token 验证,GET)
@@ -106,7 +105,12 @@ public class HxpAIOController extends BaseController {
     // D:\project\lab2.0\lab-distributed-java-2.0\zd-modules\zd-chemical\src\
     // D:\project\lab2.0\lab-distributed-java-2.0\zd-modules\zd-chemical\src\
     // chemical     化学品
     // chemical     化学品
 
 
-    public String getTerminalNum(){
+    private boolean getCabinetLock(){
+        LoginUser user = tokenService.getLoginUser();
+        return user.isCabinetLock();
+    }
+
+    private String getTerminalNum(){
         LoginUser user = tokenService.getLoginUser();
         LoginUser user = tokenService.getLoginUser();
         if(user == null || StringUtils.isBlank(user.getMachineCode())){
         if(user == null || StringUtils.isBlank(user.getMachineCode())){
             throw new ServiceException("未获取到设备编号,无效操作!");
             throw new ServiceException("未获取到设备编号,无效操作!");
@@ -114,7 +118,7 @@ public class HxpAIOController extends BaseController {
         return user.getMachineCode();
         return user.getMachineCode();
     }
     }
 
 
-    public Long getSubIdByTerminalNum(){
+    private Long getSubIdByTerminalNum(){
         Long subId = hxpSmartTerminalService.selectSubIdByTerminalNum(getTerminalNum());
         Long subId = hxpSmartTerminalService.selectSubIdByTerminalNum(getTerminalNum());
         if(subId == null){
         if(subId == null){
             throw new ServiceException("设备未匹配到实验室,请确认设备信息后重新登录!");
             throw new ServiceException("设备未匹配到实验室,请确认设备信息后重新登录!");
@@ -122,7 +126,7 @@ public class HxpAIOController extends BaseController {
         return subId;
         return subId;
     }
     }
 
 
-    public Long getSubIdByTerminalNum(String machineCode){
+    private Long getSubIdByTerminalNum(String machineCode){
 
 
         machineCode = StringUtils.isBlank(machineCode) ? getTerminalNum():machineCode;
         machineCode = StringUtils.isBlank(machineCode) ? getTerminalNum():machineCode;
 
 
@@ -485,6 +489,7 @@ public class HxpAIOController extends BaseController {
     @ApiOperation(value = "查询机柜柜锁列表")
     @ApiOperation(value = "查询机柜柜锁列表")
     public R<List<AioCabinetLockVo>> queryCabinetLockList(@RequestBody AioCabinetLockVo aioCabinetLockVo) {
     public R<List<AioCabinetLockVo>> queryCabinetLockList(@RequestBody AioCabinetLockVo aioCabinetLockVo) {
         aioCabinetLockVo.setSubId(getSubIdByTerminalNum());
         aioCabinetLockVo.setSubId(getSubIdByTerminalNum());
+        aioCabinetLockVo.setCabinetLock(getCabinetLock());
         List<AioCabinetLockVo> list = hxpCabinetService.queryCabinetLockList(aioCabinetLockVo);
         List<AioCabinetLockVo> list = hxpCabinetService.queryCabinetLockList(aioCabinetLockVo);
         return R.ok(list);
         return R.ok(list);
     }
     }

+ 11 - 0
zd-modules/zd-chemical/src/main/java/com/zd/chemical/domain/vo/AioCabinetLockVo.java

@@ -47,6 +47,9 @@ public class AioCabinetLockVo {
     @ApiModelProperty(value = "出入库ID")
     @ApiModelProperty(value = "出入库ID")
     private Long stockId;
     private Long stockId;
 
 
+    @ApiModelProperty(value = "是否设置柜锁")
+    private boolean cabinetLock = false;
+
     public Long getId() {
     public Long getId() {
         return id;
         return id;
     }
     }
@@ -142,4 +145,12 @@ public class AioCabinetLockVo {
     public void setStockId(Long stockId) {
     public void setStockId(Long stockId) {
         this.stockId = stockId;
         this.stockId = stockId;
     }
     }
+
+    public boolean isCabinetLock() {
+        return cabinetLock;
+    }
+
+    public void setCabinetLock(boolean cabinetLock) {
+        this.cabinetLock = cabinetLock;
+    }
 }
 }

+ 3 - 0
zd-modules/zd-chemical/src/main/resources/mapper/chemical/HxpCabinetMapper.xml

@@ -146,6 +146,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from
         from
             lab_hardware h left join hxp_cabinet ca on h.join_cabinet = ca.id
             lab_hardware h left join hxp_cabinet ca on h.join_cabinet = ca.id
         where h.type = 9 and ca.id = #{cabinetId} and h.subject_id = #{subId}
         where h.type = 9 and ca.id = #{cabinetId} and h.subject_id = #{subId}
+        <if test="cabinetLock">
+            and ca.id is not null
+        </if>
     </select>
     </select>
 
 
     <select id="querySubInfo" resultType="com.zd.chemical.domain.vo.AioSubInfoVo">
     <select id="querySubInfo" resultType="com.zd.chemical.domain.vo.AioSubInfoVo">