|
@@ -1,6 +1,7 @@
|
|
package com.steerinfo.ems.tcm0316.controller;
|
|
package com.steerinfo.ems.tcm0316.controller;
|
|
|
|
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
|
|
+import com.steerinfo.ems.tcm0316.mapper.TCm0316Mapper;
|
|
import com.steerinfo.ems.tcm0316.model.TCm0316;
|
|
import com.steerinfo.ems.tcm0316.model.TCm0316;
|
|
import com.steerinfo.ems.tcm0316.service.ITCm0316Service;
|
|
import com.steerinfo.ems.tcm0316.service.ITCm0316Service;
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
@@ -26,6 +27,9 @@ public class TCm0316Controller extends BaseRESTfulController {
|
|
@Autowired
|
|
@Autowired
|
|
ITCm0316Service tCm0316Service;
|
|
ITCm0316Service tCm0316Service;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ TCm0316Mapper tCm0316Mapper ;
|
|
|
|
+
|
|
@ApiOperation(value="获取列表", notes="分页查询")
|
|
@ApiOperation(value="获取列表", notes="分页查询")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
@@ -94,25 +98,12 @@ public class TCm0316Controller extends BaseRESTfulController {
|
|
@ApiOperation(value="删除", notes="根据url的id来指定删除对象")
|
|
@ApiOperation(value="删除", notes="根据url的id来指定删除对象")
|
|
@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
|
|
@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
|
|
//@RequiresPermissions("trmunit:delete")
|
|
//@RequiresPermissions("trmunit:delete")
|
|
- @DeleteMapping(value = "/{id}")
|
|
|
|
- public RESTfulResult delete(@PathVariable String id){
|
|
|
|
- String[] array = id.split(",");
|
|
|
|
- if(array.length == 1){
|
|
|
|
- LOGGER.info("动力监测点表要删除的数据是" + tCm0316Service.getById(id).toString());
|
|
|
|
- tCm0316Service.delete(id);
|
|
|
|
- return success();
|
|
|
|
- }
|
|
|
|
- else if(array.length > 1) {
|
|
|
|
- for (int i = 0; i < array.length; i++) {
|
|
|
|
- LOGGER.info("动力监测点表要删除的第" + (i + 1) + "条数据是" + tCm0316Service.getById(array[i]).toString());
|
|
|
|
- tCm0316Service.delete(array[i]);
|
|
|
|
- }
|
|
|
|
- LOGGER.info("动力监测点表要删除数据共" + array.length + "条。");
|
|
|
|
- return success();
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- return failed(null, "请输入要删除的id");
|
|
|
|
|
|
+ @DeleteMapping(value = "/",produces = "application/json;charset=UTF-8")
|
|
|
|
+ public RESTfulResult delete(@RequestBody TCm0316[] models){
|
|
|
|
+ for (TCm0316 model : models) {
|
|
|
|
+ tCm0316Mapper.deleteByPrimaryKey(model.getPowermonitorcode());
|
|
}
|
|
}
|
|
|
|
+ return success();
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value="监测点下拉框", notes="查询id和name")
|
|
@ApiOperation(value="监测点下拉框", notes="查询id和name")
|