|
@@ -170,6 +170,16 @@ public class MonitorInfoController {
|
|
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public AjaxMessage<Integer> addMonitorInfo(@ApiParam(value = "标签信息", required = true) @RequestBody MonitorInfoEntity monitorInfo) {
|
|
|
+ if (monitorInfo == null) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.DEVICE_PARENT_ALREADY_EXISTS);
|
|
|
+ }
|
|
|
+ LoginUser currentUser = UserUtil.getCurrentUser();
|
|
|
+ monitorInfo.setTenantId(currentUser.getTenantId());
|
|
|
+ monitorInfo.setStatus(1);
|
|
|
+ monitorInfo.setDateCreate(new Date());
|
|
|
+ monitorInfo.setDateUpdate(new Date());
|
|
|
+ monitorInfo.setCreateBy(currentUser.getName());
|
|
|
+ monitorInfo.setUpdateBy(currentUser.getName());
|
|
|
//校验参数
|
|
|
int result = monitorInfoService.addMonitorInfo(monitorInfo) ? 1 : 0;
|
|
|
return new AjaxMessage<>(ResultStatus.OK, result);
|
|
@@ -182,6 +192,9 @@ public class MonitorInfoController {
|
|
|
@ApiOperation(value = "批量新增或修改(按设备)")
|
|
|
public AjaxMessage<Integer> addMonitorInfo(@ApiParam(value = "标签信息", required = true) @RequestBody ArrayList<MonitorInfoEntity> monitorInfos) {
|
|
|
LoginUser currentUser = UserUtil.getCurrentUser();
|
|
|
+ if (monitorInfos.size() == 0) {
|
|
|
+ return new AjaxMessage<>(ResultStatus.DEVICE_PARENT_ALREADY_EXISTS);
|
|
|
+ }
|
|
|
for (MonitorInfoEntity item : monitorInfos) {
|
|
|
item.setTenantId(currentUser.getTenantId());
|
|
|
item.setStatus(1);
|