Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| | |
| | | |
| | | /** |
| | | * 分析状态与报警 |
| | | * @param bs |
| | | * @param index |
| | | * @param bs 上报数据的字节数组 |
| | | * @param index 当前解析数组下标位置 |
| | | * @return |
| | | */ |
| | | public static void parseAlarmAndState(byte[] bs, int index, AlarmVo vo){ |
| | | byte b = bs[index] ; |
| | | vo.statePump = (byte)(b & 0x1) ; |
| | | vo.alarmWaterRemain = (byte)(b >> 1 & 1) ; |
| | | vo.alarm0WaterRemain = (byte)(b >> 2 & 1) ; |
| | | vo.alarmExceedYear = (byte)(b >> 3 & 1) ; |
| | | vo.alarmWaterMeterFault = (byte)(b >> 4 & 1) ; |
| | | vo.alarmSteal = (byte)(b >> 5 & 1) ; |
| | | vo.alarmWaterMeterBreak = (byte)(b >> 6 & 1) ; |
| | | vo.alarmEleMeterFault = (byte)(b >> 7 & 1) ; |
| | | vo.alarmWaterRemain = (byte)((b >> 1) & 1) ; |
| | | vo.alarm0WaterRemain = (byte)((b >> 2) & 1) ; |
| | | vo.alarmExceedYear = (byte)((b >> 3) & 1) ; |
| | | vo.alarmWaterMeterFault = (byte)((b >> 4) & 1) ; |
| | | vo.alarmSteal = (byte)((b >> 5) & 1) ; |
| | | vo.alarmWaterMeterBreak = (byte)((b >> 6) & 1) ; |
| | | vo.alarmEleMeterFault = (byte)((b >> 7) & 1) ; |
| | | |
| | | b = bs[index + 1] ; |
| | | vo.alarm0MoneyRemain = (byte)(b & 0x1) ; |
| | | vo.alarmInnerDoor = (byte)(b >> 1 & 1) ; |
| | | vo.alarmOuterDoor = (byte)(b >> 2 & 1) ; |
| | | vo.alarmEleMiss = (byte)(b >> 3 & 1) ; |
| | | vo.alarmEleExceed = (byte)(b >> 4 & 1) ; |
| | | vo.alarmEleLowVolt = (byte)(b >> 5 & 1) ; |
| | | vo.stateIcEnable = (byte)(b >> 6 & 1) ; |
| | | vo.alarmInnerDoor = (byte)((b >> 1) & 1) ; |
| | | vo.alarmOuterDoor = (byte)((b >> 2) & 1) ; |
| | | vo.alarmEleMiss = (byte)((b >> 3) & 1) ; |
| | | vo.alarmEleExceed = (byte)((b >> 4) & 1) ; |
| | | vo.alarmEleLowVolt = (byte)((b >> 5) & 1) ; |
| | | vo.stateIcEnable = (byte)((b >> 6) & 1) ; |
| | | } |
| | | |
| | | public static String parseTp(byte[] bs, short index){ |
| | |
| | | public static long BCD2Long_LE(byte[] b, int startIndex, int endIndex)throws Exception { |
| | | String str = ""; |
| | | str = decodeBCD_LE(b, startIndex, endIndex - startIndex + 1); |
| | | long n = Long.parseLong(str); |
| | | return n; |
| | | return Long.parseLong(str); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaBlock; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClientType; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaPrivilege; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public List<?> roleList ; |
| | | |
| | | /** |
| | | * 用户所拥有的权限,针对登录应用 |
| | | */ |
| | | @Schema(hidden = true) |
| | | @TableField(exist = false) |
| | | @JSONField(serialize = false) |
| | | public List<Integer> privileges; |
| | | |
| | | /** |
| | | * 所属片区名称 |
| | | */ |
| | | @Schema(description = "所属片区名称,用于显示,表单不用填写", requiredMode = Schema.RequiredMode.NOT_REQUIRED) |
| | |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city","name", null, false, null) ; |
| | | distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city","num", null, false, null) ; |
| | | distriLevel = configXml.getSetAttrPlusInt(doc, "config.orgs.org" + num + ".districts.province.city","level", null, 1, 99,null) ; |
| | | supperId = this.saveDistrict(null, distriName, distriNum, distriLevel); |
| | | supperId = this.saveDistrict(supperId, distriName, distriNum, distriLevel); |
| | | if(supperId != null && configXml.existElement(doc, "config.orgs.org" + num + ".districts.province.city.country")) { |
| | | distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city.country", "name", null, false, null); |
| | | distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city.country", "num", null, false, null); |
| | |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | listenerRegistrationBean.setOrder(order_idSetSuffix); |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | listenerRegistrationBean.setOrder(order_idSetSuffix); |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |
| | |
| | | if(userPo != null){ |
| | | vo.dataSourceName = userPo.orgTag ; |
| | | vo.logined = true ; |
| | | vo.hasPower = true ;//默认有权限 |
| | | vo.hasPower = true ;//默认有权限。2023-12-21 经商议,由前端鉴权 |
| | | }else{ |
| | | vo.logined = false ; |
| | | vo.hasPower = true ;//默认有权限 |
| | | vo.hasPower = true ;//默认有权限。2023-12-21 经商议,由前端鉴权 |
| | | } |
| | | return vo ; |
| | | } |
| | |
| | | package com.dy.sso.busi; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaPrivilegeMapper; |
| | | import com.dy.pipIrrGlobal.daoBa.BaUserMapper; |
| | | import com.dy.pipIrrGlobal.pojoBa.BaUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public class SsoSv { |
| | | |
| | | private BaUserMapper baUserMapper; |
| | | private BaPrivilegeMapper baPrivilegeMapper; |
| | | |
| | | @Autowired |
| | | private void setBaUserMapper(BaUserMapper baUserMapper){ |
| | | this.baUserMapper = baUserMapper ; |
| | | } |
| | | |
| | | @Autowired |
| | | private void setBaPrivilegeMapper(BaPrivilegeMapper baPrivilegeMapper){ |
| | | this.baPrivilegeMapper = baPrivilegeMapper ; |
| | | } |
| | | |
| | | |
| | |
| | | @Transactional |
| | | @Cacheable(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid", sync=true) |
| | | public BaUser loginWithMapperXml(String uuid, String phone, String password){ |
| | | BaUser baUser = this.baUserMapper.login(phone, password) ; |
| | | if(baUser != null && baUser.id != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; |
| | | } |
| | | return baUser; |
| | | return this.baUserMapper.login(phone, password) ; |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq("deleted", 0) |
| | | .eq("phone", phone) |
| | | .eq("password", password); |
| | | BaUser baUser = this.baUserMapper.selectOne(qw) ; |
| | | if(baUser != null && baUser.id != null){ |
| | | baUser.privileges = this.baPrivilegeMapper.selectPrivilegeByUserId(baUser.id) ; |
| | | } |
| | | return baUser; |
| | | return this.baUserMapper.selectOne(qw) ; |
| | | } |
| | | |
| | | @CacheEvict(cacheNames=CacheConstants.cacheNames, key="'" + CacheConstants.loginUserKeyPrefix + "' + #uuid") |
| | |
| | | /** |
| | | * 内部提供listener |
| | | * @return 注册Bean |
| | | */ |
| | | @Bean |
| | | public ServletListenerRegistrationBean<? extends ServletContextListener> reqSsoListener() { |
| | | ServletListenerRegistrationBean<SsoListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | |
| | | listenerRegistrationBean.setOrder(order_sso); |
| | | return listenerRegistrationBean; |
| | | } |
| | | */ |
| | | } |
| | |
| | | */ |
| | | //private static final int order_config = 0 ; |
| | | private static final int order_idSetSuffix = 1 ; |
| | | //private static final int order_init = 2 ; |
| | | |
| | | /* |
| | | * 解析各种***.config配置的ConfigListener,暂时不采用此种配置方式 |
| | |
| | | return listenerRegistrationBean; |
| | | } |
| | | |
| | | // /** |
| | | // * 内部提供listener,该listener在系统启动时,初始化数据库数据 |
| | | // * @return 注册Bean |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<? extends ServletContextListener> regInitListener() { |
| | | // ServletListenerRegistrationBean<InitListener> listenerRegistrationBean = new ServletListenerRegistrationBean<>(); |
| | | // listenerRegistrationBean.setListener(new InitListener()); |
| | | // listenerRegistrationBean.setOrder(order_init); |
| | | // return listenerRegistrationBean; |
| | | // } |
| | | } |