Browse Source

# 设备巡检内容批量更新接口

zhongwei
haungxing 1 year ago
parent
commit
0bacf3efe1
  1. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java

11
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ContentController.java

@ -1,5 +1,7 @@
package com.hnac.hzinfo.inspect.obj.web; package com.hnac.hzinfo.inspect.obj.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -7,6 +9,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ContentEntity;
import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity; import com.hnac.hzinfo.inspect.obj.entity.ProjectContentEntity;
import com.hnac.hzinfo.inspect.obj.services.ProjectContentService; import com.hnac.hzinfo.inspect.obj.services.ProjectContentService;
@ -23,6 +26,7 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -115,4 +119,11 @@ public class ContentController {
contentService.databaseCopyBatch(Func.toLongList(ids), pre); contentService.databaseCopyBatch(Func.toLongList(ids), pre);
return R.success("操作成功"); return R.success("操作成功");
} }
@PutMapping("/updateBatch")
@ApiOperation(value = "根据ids 数据库批量复制", notes = "传入id集合")
public R updateBatch(@RequestBody List<ContentDTO> contentList) {
List<ContentEntity> contentEntityList = JSONArray.parseArray(JSON.toJSONString(contentList), ContentEntity.class);
return R.status(contentService.updateBatchById(contentEntityList));
}
} }

Loading…
Cancel
Save