|
@@ -4,6 +4,7 @@ package com.bootdo.datas.controller;
|
|
import com.bootdo.common.annotation.Log;
|
|
import com.bootdo.common.annotation.Log;
|
|
import com.bootdo.common.utils.PageUtils;
|
|
import com.bootdo.common.utils.PageUtils;
|
|
import com.bootdo.common.utils.Query;
|
|
import com.bootdo.common.utils.Query;
|
|
|
|
+import com.bootdo.common.utils.R;
|
|
import com.bootdo.datas.dto.GyDataImportDTO;
|
|
import com.bootdo.datas.dto.GyDataImportDTO;
|
|
import com.bootdo.datas.service.GyDataService;
|
|
import com.bootdo.datas.service.GyDataService;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -12,10 +13,8 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+import org.springframework.ui.Model;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -48,4 +47,30 @@ public class DataEntryController {
|
|
int total = gyDataService.dataEntryCountTotal(query);
|
|
int total = gyDataService.dataEntryCountTotal(query);
|
|
return new PageUtils(dataList, total);
|
|
return new PageUtils(dataList, total);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/remove")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RequiresPermissions("datas:data:remove")
|
|
|
|
+ public R remove(Long id) {
|
|
|
|
+ //判断一下该条数据是否被风评系统使用
|
|
|
|
+ int cnt = gyDataService.countAaAssData(id);
|
|
|
|
+ if(cnt > 0){
|
|
|
|
+ return R.error("该条数据已经被风评系统使用,不能删除!");
|
|
|
|
+ }
|
|
|
|
+ Long[] longArray = new Long[]{id};
|
|
|
|
+ gyDataService.batchRemove(longArray);
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping("/edit/{id}")
|
|
|
|
+ @RequiresPermissions("datas:data:edit")
|
|
|
|
+ String edit(@PathVariable("id") Long id, Model model) {
|
|
|
|
+ GyDataImportDTO data = gyDataService.get(id);
|
|
|
|
+ model.addAttribute("data", data);
|
|
|
|
+ return "datas/data/edit";
|
|
|
|
+ }
|
|
}
|
|
}
|