guoshilong
2024-03-31 a4cd27af8c445e2b043aa146ee38f04222c992e7
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztdw/controller/DbPersonReportController.java
@@ -2,20 +2,21 @@
import cn.gistack.sm.sjztdw.excel.DbExcel;
import cn.gistack.sm.sjztdw.excel.DbExcelImport;
import cn.gistack.sm.sjztdw.service.IDbPersonReportService;
import cn.gistack.sm.sjztdw.service.IDwsResFormDiService;
import cn.gistack.sm.sjztdw.vo.DbExcelVO;
import cn.gistack.sm.sjztdw.vo.ListVO;
import io.undertow.websockets.jsr.annotated.DecoderUtils;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
/**
@@ -26,7 +27,7 @@
@AllArgsConstructor
public class DbPersonReportController extends BladeController {
   private IDbPersonReportService dbPersonReportService;
   private IDwsResFormDiService dbPersonReportService;
   /**
    * 导入模板
@@ -52,12 +53,31 @@
    * @return
    */
   @PostMapping("import-data")
   public R importData(MultipartFile file,String resGuid,String ch) {
   public R importData(MultipartFile file,String resGuid,@RequestParam("ch") String ch) {
      DbExcelImport dbExcelImport = new DbExcelImport(dbPersonReportService,resGuid,ch);
      ExcelUtil.save(file, dbExcelImport, DbExcel.class);
      return R.success("操作成功");
   }
   @PostMapping("/update")
   public R update(@RequestBody DbExcelVO dbExcel){
      Boolean b = dbPersonReportService.update(dbExcel);
      return R.status(b);
   }
   @PostMapping("/remove")
   public R remove(@RequestBody DbExcelVO dbExcelVO){
      Boolean b = dbPersonReportService.remove(dbExcelVO);
      return R.status(b);
   }
   @PostMapping("/removeBatch")
   public R removeBatch(@RequestBody ListVO list){
      Boolean b = dbPersonReportService.removeBatch(list.getList());
      return R.status(b);
   }