1.1.3 监控单元Controller修改

dev
zhouhy 1 year ago
parent e1cc7df3be
commit 8854095388

@ -17,14 +17,7 @@ import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
@ -57,7 +50,7 @@ public class HwMonitorPlatformController extends BaseController {
* @return list
* @throws
* */
@PostMapping("/treeList")
@GetMapping("/treeList")
public TableDataInfo treeList(List<HwMonitorUnit> hwMonitorUnits){
List<HwMonitorUnit> list = hwMonitorUnitService.selectTreeList(hwMonitorUnits);
return getDataTable(list);
@ -91,9 +84,11 @@ public class HwMonitorPlatformController extends BaseController {
@PostMapping("/selectDeviceByDeviceModeByMonitorUnitId")
public Map<String, Map<String, Object>> selectDeviceByDeviceModeByMonitorUnitId(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceByDeviceModeByMonitorUnitId(monitorUnitId);
return maps;
}
/**
*
* @param monitorUnitId id
@ -101,6 +96,7 @@ public class HwMonitorPlatformController extends BaseController {
@PostMapping("/selectDeviceModeFunctionByFunctionType")
public Map<String, Map<String, Object>> selectDeviceModeFunctionByFunctionType(Long monitorUnitId){
startPage();
Map<String, Map<String, Object>> maps = hwDeviceService.selectDeviceModeFunctionByFunctionType(monitorUnitId);
return maps;
}

@ -5,6 +5,7 @@ import com.ruoyi.business.domain.HwDeviceMode;
import com.ruoyi.business.domain.HwDeviceModeFunction;
import com.ruoyi.business.domain.HwDeviceModeParameter;
import com.ruoyi.business.mapper.HwDeviceMapper;
import com.ruoyi.business.mapper.HwDeviceModeFunctionMapper;
import com.ruoyi.business.mapper.HwDeviceModeMapper;
import com.ruoyi.business.service.IHwDeviceModeService;
import com.ruoyi.common.core.constant.HwDictConstants;

@ -77,6 +77,9 @@ public class HwDeviceServiceImpl implements IHwDeviceService
Integer value = 0;
if (list.size() > 10) {
for (int i = 9; i < list.size(); i++) {
if (list.get(i).sum==null){
list.get(i).sum = 0;
}
value = value + list.get(i).sum;
}
}
@ -85,6 +88,9 @@ public class HwDeviceServiceImpl implements IHwDeviceService
hwMonitorUnitTypeVo.setSum(value);
Integer sums = 0;
for (int i = 0; i < list.size();i++){
if (list.get(i).sum==null){
list.get(i).sum = 0;
}
sums = sums+list.get(i).sum;
}
for (int i=0;i<list.size();i++){

@ -78,10 +78,16 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
Integer sums = 0;
if (list.size()>5){
for (int i = 4; i < list.size(); i++){
if (list.get(i).sum==null){
list.get(i).sum = 0;
}
value = value+list.get(i).sum;
}
}
for (int i = 0; i < list.size();i++){
if (list.get(i).sum==null){
list.get(i).sum = 0;
}
sums = sums+list.get(i).sum;
}
for (int i=0;i<list.size();i++){
@ -130,12 +136,7 @@ public class HwMonitorUnitServiceImpl implements IHwMonitorUnitService
return vo;
}
public static void main(String[] args) {
String str1 = "1";
String str2 = null;
int q = Integer.valueOf(str2);
System.out.println(q);
}
@Override
public List<AllNumsVo> selectSenceAllNums() {

Loading…
Cancel
Save