| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moral.api.entity.ManageRole; |
| | | import com.moral.api.entity.Sensor; |
| | | import com.moral.api.entity.SysDictData; |
| | | import com.moral.api.entity.VersionSensorUnit; |
| | | import com.moral.api.mapper.SensorMapper; |
| | | import com.moral.api.mapper.SysDictDataMapper; |
| | | import com.moral.api.mapper.VersionSensorUnitMapper; |
| | | import com.moral.api.service.SensorService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.moral.constant.Constants; |
| | | import com.moral.constant.RedisConstants; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.util.TokenUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private VersionSensorUnitMapper versionSensorUnitMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private SysDictDataMapper sysDictDataMapper; |
| | | |
| | | @Autowired |
| | | LogUtils logUtils; |
| | |
| | | sensorMap.put("createTime",createTime); |
| | | sensorMap.put("updateTime",updateTime); |
| | | sensorMap.put("key",sensor.getId()); |
| | | if (sensor.getDefaultUnitKey()!=null&&sensor.getDefaultUnitKey()!=""){ |
| | | QueryWrapper<SysDictData> wrapper_VSU = new QueryWrapper(); |
| | | wrapper_VSU.eq("is_delete",0); |
| | | wrapper_VSU.eq("dataKey",sensor.getDefaultUnitKey()); |
| | | wrapper_VSU.eq("dict_type_id",14); |
| | | sensorMap.put("default_unit_key",sysDictDataMapper.selectOne(wrapper_VSU).getDataValue()); |
| | | } |
| | | sensorList.add(sensorMap); |
| | | } |
| | | resultMap.put("manageRoles",sensorList); |
| | | resultMap.put("sensors",sensorList); |
| | | resultMap.put("totalNumber",totleNum); |
| | | resultMap.put("current",current); |
| | | int totalPageNumber = totleNum/size; |
| | |
| | | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); |
| | | //刷新缓存 |
| | | refreshCache(); |
| | | //注销token |
| | | TokenUtils.destoryToken(Integer.parseInt(map.get("id").toString())); |
| | | return resultMap; |
| | | } |
| | | |
| | |
| | | sensorMap.put("createTime",createTime); |
| | | sensorMap.put("updateTime",updateTime); |
| | | sensorMap.put("key",sensor.getId()); |
| | | if (sensor.getDefaultUnitKey()!=null&&sensor.getDefaultUnitKey()!=""){ |
| | | QueryWrapper<SysDictData> wrapper_VSU = new QueryWrapper(); |
| | | wrapper_VSU.eq("is_delete",0); |
| | | wrapper_VSU.eq("dataKey",sensor.getDefaultUnitKey()); |
| | | wrapper_VSU.eq("dict_type_id",14); |
| | | sensorMap.put("default_unit_key",sysDictDataMapper.selectOne(wrapper_VSU).getDataValue()); |
| | | } |
| | | sensorList.add(sensorMap); |
| | | } |
| | | resultMap.put("manageRoles",sensorList); |
| | | resultMap.put("sensors",sensorList); |
| | | resultMap.put("totalNumber",totleNum); |
| | | resultMap.put("current",current); |
| | | int totalPageNumber = totleNum/size; |