Quellcode durchsuchen

2023-11-10 移除被注释的代码。

chaiyunlong vor 2 Jahren
Ursprung
Commit
5fbc6b7493

+ 18 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabGradeManageRuleMapper.java

@@ -65,13 +65,31 @@ public interface LabGradeManageRuleMapper
 
     int deleteByGradeManageId(Long gradeManageId);
 
+    /**
+     *
+     * @param subId
+     * @param userId
+     * @return
+     */
     @Deprecated
     List<LabGradeManageWorkDetailVO> selectMyLabGradeManageWorkDetailByType3(@Param("subId") Long subId, @Param("userId") Long userId);
 
+    /**
+     *
+     * @param ruleUserIds
+     * @param userId
+     * @param subId
+     * @return
+     */
     @Deprecated
     List<LabGradeManageWorkDetailVO> selectMyLabGradeManageWorkDetailByType1(
             @Param("list") List<Long> ruleUserIds, @Param("userId") Long userId, @Param("subId")Long subId);
 
+    /**
+     *
+     * @param labGradeManageRuleUser
+     * @return
+     */
     @Deprecated
     List<LabGradeManageWorkDetailVO> selectMyLabGradeManageWorkDetailByType2(LabGradeManageRuleUser labGradeManageRuleUser);
 

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSubjectMapper.java

@@ -258,6 +258,11 @@ public interface LabSubjectMapper {
 
     LabSubjectDetailVO queryByLayoutId(Long layoutId);
 
+    /**
+     *
+     * @param subId
+     * @return
+     */
     @Deprecated
     LabGradeManageWorkVO selectSubInfoByMyGradeManageWork(Long subId);
 

+ 2 - 4
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mqtt/config/MqttConfig.java

@@ -260,7 +260,7 @@ public class MqttConfig {
                     ReturnMessageProcessing(message, receivedTopic);
                 }
             } catch (Exception e) {
-                //e.printStackTrace();
+                logger.error("消息通道异常");
             }
         };
     }
@@ -281,7 +281,6 @@ public class MqttConfig {
             public void handleMessage(Message<?> message) throws MessagingException {
                 MessageHeaders messageHeaders = message.getHeaders();
                 String receivedTopic = (String) messageHeaders.get(MqttHeaders.RECEIVED_TOPIC);
-				//logger.info("[通道] - [{}],[{}]", receivedTopic,message.getPayload());
                 String messageStr = message.getPayload().toString();
                 if (receivedTopic.startsWith(devicePrefix)) {
                     if (receivedTopic.contains("788D4C6C6187ABC")) {
@@ -343,7 +342,6 @@ public class MqttConfig {
      */
     public void ReturnMessageProcessing(Message<?> message, String receivedTopic) {
         logger.info("灭火消息处理器:" + message.getPayload().toString());
-        //String type = topic.substring(topic.lastIndexOf("/")+1, topic.length());
         String messageStr = bytes2HexString((byte[]) message.getPayload());
         logger.info("灭火消息,主机回复指令:" + messageStr);
         //返回非指令时不向下执行
@@ -353,7 +351,7 @@ public class MqttConfig {
         }
 
         //获取采集器编号
-        receivedTopic = receivedTopic.substring(receivedTopic.lastIndexOf("/") + 1, receivedTopic.length());
+        receivedTopic = receivedTopic.substring(receivedTopic.lastIndexOf("/") + 1);
         //根据状态指令获取主机状态
         JSONObject jsonObject = FireLaborUtil.getFireStatus(messageStr);
         logger.info("灭火主机状态:" + jsonObject + "采集器编号" + receivedTopic + ",响应时间key:" + CacheConstants.FIRE_DEVICE_RESPOND_TIME + receivedTopic);

+ 0 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/netty/MessageCodec.java

@@ -16,7 +16,6 @@ public class MessageCodec extends MessageToMessageCodec<ByteBuf, String> {
     protected void encode(ChannelHandlerContext channelHandlerContext, String msg, List<Object> list) throws Exception {
         log.info("netty消息正在编码 " + msg);
         list.add(Unpooled.copiedBuffer(ReUtil.hexStringToByteArray(msg)));
-//        list.add(ReUtil.hexStringToByteArray(msg));
     }
 
     @Override

+ 0 - 3
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/netty/NettyClient.java

@@ -27,9 +27,6 @@ public class NettyClient {
                     @Override
                     protected void initChannel(SocketChannel socketChannel) throws Exception {
 
-                        //6、向pipeline中添加自定的的解码编码handler
-//                        socketChannel.pipeline().addLast(new MessageDecoder());
-//                        socketChannel.pipeline().addLast(new MessageEncoder());
                         //6、向pipeline中添加编解码器
                         socketChannel.pipeline().addLast(new com.zd.laboratory.netty.MessageCodec());
 

+ 4 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/netty/NettyPushMsgService.java

@@ -7,6 +7,10 @@ import java.io.IOException;
 
 public class NettyPushMsgService {
 
+    private NettyPushMsgService(){
+
+    }
+
     public static void push(String relayCode, byte[] bytes) throws IOException {
         // 客户端ID
         ChannelHandlerContext channelHandlerContext = ChannelMap.getChannel(relayCode);

+ 0 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/netty/NettyServerHandler.java

@@ -117,7 +117,6 @@ public class NettyServerHandler implements ChannelInboundHandler {
      */
     @Override
     public void exceptionCaught(ChannelHandlerContext channelHandlerContext, Throwable throwable) throws Exception {
-        //throwable.printStackTrace();
         channelHandlerContext.close();
     }
 

+ 1 - 50
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/onemachine/controller/OneMachineController.java

@@ -27,8 +27,6 @@ import com.zd.model.constant.HttpStatus;
 import com.zd.model.constant.SecurityConstants;
 import com.zd.model.domain.R;
 import com.zd.model.domain.ResultData;
-import com.zd.model.domain.per.PerFun;
-import com.zd.model.domain.per.PerPrefix;
 import com.zd.model.entity.SysUser;
 import com.zd.model.enums.HardwareTypeEnum;
 import com.zd.model.enums.SignEnum;
@@ -111,12 +109,6 @@ public class OneMachineController extends BaseController {
     @Autowired
     private ILabCheckMachineMsgService labCheckMachineMsgService;
 
-//    /**
-//     * 最低危险等级
-//     */
-//    @Autowired
-//    private LabSubClassVO getNONELabSubClassVO;
-
 
     @ApiOperation("实验室信息-登录获取实验室信息(待完善)")
     @GetMapping("/{id}")
@@ -139,13 +131,6 @@ public class OneMachineController extends BaseController {
         return ResultData.success(subSimpleVO);
     }
 
-//    @ApiOperation("实验室安全信息")
-//    @GetMapping("/safe/{subId}")
-//    public ResultData<LabSafeClasstype> querySecurityInfoById(@PathVariable("subId") Long subId) {
-//        //获取实验室安全等级,如果没,则获取最低危险等级
-//        LabSafeClasstype labSafeClasstype = safeClasstypeService.selectLabSafeClasstypeById(getNONELabSubClassVO.getClasstypeId());
-//        return ResultData.success(labSafeClasstype);
-//    }
 
     @ApiOperation("实验室传感器信息")
     @GetMapping("/{subId}/sensor/val/list")
@@ -251,23 +236,7 @@ public class OneMachineController extends BaseController {
             throw new ServiceException("用户:" + sysUser.getNickName() + " 账户停用,请联系管理员");
         }
 
-        /*String url="";
-        String baseUrl=request.getServerName() ;
-        if(baseUrl.contains("192.168")){
-            url=fileConfigUtils.getLocalUrl()+sysUser.getAvatar();
-        }else {
-            url=fileConfigUtils.getRemoteUrl()+sysUser.getAvatar();
-        }*/
-//        //通过配置动态加载域名
-//        String url = fileConfigUtils.getFileDomainApp() + sysUser.getAvatar();
-//        String imgUrl = UrlFormatUtils.getHttpsORHttpUrl(url);
-//        sysUser.setAvatar(imgUrl);
-
-        //判断当天是否已签到,没有签出
-//        int num=labSubjectAccessRecordService.getRecordNoOut(userResult.getData().getUserId());
-//        if(num==0){
-//            return ResultData.fail(600,"你已经签到了,无法进行重复签到!");
-//        }
+
         //签证前置信息
         return ResultData.success(oneMachineService.createSignInPerInfoVO(subId, userResult.getData(), SignEnum.SIGN_IN));
     }
@@ -315,7 +284,6 @@ public class OneMachineController extends BaseController {
     @ApiOperation("签到提交-字符串特征码")
     @PostMapping("/{code}/strFace/SignIn")
     public ResultData postSignIn(@PathVariable @ApiParam("验证码") String code, @RequestBody @ApiParam("特征数据") String data) {
-//        return oneMachineService.faceCompare(2l, data.getBytes());
         return oneMachineService.postSign(code, SignEnum.SIGN_IN, data.getBytes());
     }
 
@@ -357,12 +325,6 @@ public class OneMachineController extends BaseController {
      * @return
      */
     private R<SysUser> getSysUserR(@PathVariable("username") String username) {
-//        //查询卡号转换到16位后去数据库查询
-//        if(StringUtils.isNumeric(username)) {
-//            Long carNum10 = Long.parseLong(username);
-//            String carNum16 = Long.toHexString(carNum10).toUpperCase();
-//            username = carNum16;
-//        }
         //通过des生成对称加密卡号
         String desCardNum = DESUtils.encrypt(username);
         username = desCardNum;
@@ -402,11 +364,6 @@ public class OneMachineController extends BaseController {
         logger.error("一体机查询实验室人员信息RequestUrl:" + request.getRequestURL());
         String url="";
         for(SysUser sysUser: sysList){
-            /*if(baseUrl.contains("192.168")){
-                url=fileConfigUtils.getLocalUrl()+sysUser.getAvatar();
-            }else {
-                url=fileConfigUtils.getRemoteUrl()+sysUser.getAvatar();
-            }*/
             //通过配置动态加载域名
             if(sysUser.getAvatar()!=null && !"".equals(sysUser.getAvatar())){
                 url = fileConfigUtils.getFileDomainApp() + sysUser.getAvatar();
@@ -429,13 +386,7 @@ public class OneMachineController extends BaseController {
     public ResultData<List<LabRotationChart>> rotationChart(String hardwareNum, HttpServletRequest request) {
         List<LabRotationChart> list=labRotationChartService.selectChartFiveList(hardwareNum);
         String url="";
-        String baseUrl=request.getServerName() ;
         for(LabRotationChart rotationChart:list){
-           /*if(baseUrl.contains("192.168")){
-               url=fileConfigUtils.getLocalUrl()+rotationChart.getImgUrl();
-           }else {
-               url=fileConfigUtils.getRemoteUrl()+rotationChart.getImgUrl();
-           }*/
             //通过配置动态加载域名
             url = fileConfigUtils.getFileDomainApp() + rotationChart.getImgUrl();
             String imgUrl = UrlFormatUtils.getHttpsORHttpUrl(url);