| | |
| | | * @param limitType 时限类型 |
| | | * @return List |
| | | */ |
| | | public Integer getTimeLimit(String limitTable, String limitType){ |
| | | public Integer getTimeLimitHour(String limitType){ |
| | | int timeTerm = 0; |
| | | try{ |
| | | ReturnBO returnBo = sysClient.getTimeLimit(limitTable, limitType); |
| | | ReturnBO returnBo = sysClient.getExpireTime(limitType); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | timeTerm = (int)returnBo.getData(); |
| | | SyTimeLimitDTO syTimeLimitDTO = objectMapper.convertValue(returnBo.getData(), SyTimeLimitDTO.class); |
| | | if (ObjectUtils.isNotEmpty(syTimeLimitDTO)){ |
| | | if (ObjectUtils.isNotEmpty(syTimeLimitDTO)){ |
| | | if (TimeUnitConsts.TIME_UNIT_1.equals(syTimeLimitDTO.getTermUnit())){ |
| | | timeTerm = syTimeLimitDTO.getTimeTerm()*24*365; |
| | | } |
| | | if (TimeUnitConsts.TIME_UNIT_2.equals(syTimeLimitDTO.getTermUnit())){ |
| | | timeTerm = syTimeLimitDTO.getTimeTerm()*24*30; |
| | | } |
| | | if (TimeUnitConsts.TIME_UNIT_3.equals(syTimeLimitDTO.getTermUnit())){ |
| | | timeTerm = syTimeLimitDTO.getTimeTerm()*24; |
| | | } |
| | | if (TimeUnitConsts.TIME_UNIT_4.equals(syTimeLimitDTO.getTermUnit())){ |
| | | timeTerm = syTimeLimitDTO.getTimeTerm(); |
| | | } |
| | | if (TimeUnitConsts.TIME_UNIT_5.equals(syTimeLimitDTO.getTermUnit())){ |
| | | timeTerm = syTimeLimitDTO.getTimeTerm()/60; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | public Date getExpireTime(Date computeTime, String limitType){ |
| | | Date expireTime = null; |
| | | try{ |
| | | ReturnBO returnBo = sysClient.getExpireTime(computeTime, limitType); |
| | | ReturnBO returnBo = sysClient.getExpireTime(limitType); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | if (ObjectUtils.isNotEmpty(returnBo.getData())){ |
| | | SyTimeLimitDTO syTimeLimitDTO = objectMapper.convertValue(returnBo.getData(), SyTimeLimitDTO.class); |