| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moral.api.entity.Device; |
| | | import com.moral.api.entity.MonitorPoint; |
| | | import com.moral.api.entity.Organization; |
| | | import com.moral.api.entity.SysArea; |
| | | import com.moral.api.mapper.DeviceMapper; |
| | | import com.moral.api.mapper.MonitorPointMapper; |
| | | import com.moral.api.mapper.OrganizationMapper; |
| | | import com.moral.api.mapper.SysAreaMapper; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private SysAreaMapper sysAreaMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private DeviceMapper deviceMapper; |
| | | |
| | | @Autowired |
| | | LogUtils logUtils; |
| | |
| | | } |
| | | } |
| | | monitorPointMapper.updateMonitorPoint(updateMap); |
| | | String deviceContent = ""; |
| | | if (!ObjectUtils.isEmpty(parameterMap.get("organizationId")) && parameterMap.get("organizationId") != null){ |
| | | Device device = new Device(); |
| | | device.setOrganizationId(Integer.parseInt(parameterMap.get("organizationId").toString())); |
| | | QueryWrapper<Device> deviceWrapper = new QueryWrapper(); |
| | | deviceWrapper.eq("monitor_point_id",oldMonitorPoint.getId()); |
| | | deviceWrapper.eq("is_delete",Constants.NOT_DELETE); |
| | | List<Device> devices = deviceMapper.selectList(deviceWrapper); |
| | | deviceMapper.update(device, deviceWrapper); |
| | | if (devices.size()>0){ |
| | | for (Device dev:devices) { |
| | | deviceContent = deviceContent+"修改了设备:"+dev.getName()+";organizationId:"+dev.getOrganizationId()+"->"+parameterMap.get("organizationId"); |
| | | } |
| | | } |
| | | } |
| | | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
| | | String content = "修改了站点:"+oldMonitorPoint.getName()+";"; |
| | | for (Object key:updateMap.keySet()) { |
| | |
| | | content = content+"描述:"+oldMonitorPoint.getDesc()+"->"+updateMap.get(key)+";"; |
| | | } |
| | | } |
| | | content = content+deviceContent; |
| | | logUtils.saveOperationForManage(request,content,Constants.UPDATE_OPERATE_TYPE); |
| | | resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode()); |
| | | resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg()); |