|
|
@@ -1,41 +1,25 @@
|
|
|
package org.jeecg.modules.medical.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import org.jeecg.common.api.vo.Result;
|
|
|
-import org.jeecg.common.system.query.QueryGenerator;
|
|
|
-import org.jeecg.common.util.oConvertUtils;
|
|
|
-import org.jeecg.modules.medical.entity.MaterialItems;
|
|
|
-import org.jeecg.modules.medical.service.IMaterialItemsService;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-
|
|
|
-import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
-import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
-import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.modules.medical.entity.MaterialItems;
|
|
|
+import org.jeecg.modules.medical.service.IMaterialItemsService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
-import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* @Description: material_items
|
|
|
@@ -50,7 +34,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
public class MaterialItemsController extends JeecgController<MaterialItems, IMaterialItemsService> {
|
|
|
@Autowired
|
|
|
private IMaterialItemsService materialItemsService;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
*
|
|
|
@@ -72,7 +56,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
IPage<MaterialItems> pageList = materialItemsService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
*
|
|
|
@@ -87,7 +71,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
materialItemsService.save(materialItems);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
|
|
@@ -102,7 +86,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
materialItemsService.updateById(materialItems);
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id删除
|
|
|
*
|
|
|
@@ -117,7 +101,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
materialItemsService.removeById(id);
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
|
@@ -132,7 +116,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
this.materialItemsService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id查询
|
|
|
*
|
|
|
@@ -156,7 +140,7 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
* @param request
|
|
|
* @param materialItems
|
|
|
*/
|
|
|
- @RequiresPermissions("medical:material_items:exportXls")
|
|
|
+// @RequiresPermissions("medical:material_items:exportXls")
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, MaterialItems materialItems) {
|
|
|
return super.exportXls(request, materialItems, MaterialItems.class, "material_items");
|
|
|
@@ -169,10 +153,11 @@ public class MaterialItemsController extends JeecgController<MaterialItems, IMat
|
|
|
* @param response
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequiresPermissions("medical:material_items:importExcel")
|
|
|
+// @RequiresPermissions("medical:material_items:importExcel")
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
- return super.importExcel(request, response, MaterialItems.class);
|
|
|
+// return super.importExcel(request, response, MaterialItems.class);
|
|
|
+ return materialItemsService.importExcel(request, response);
|
|
|
}
|
|
|
|
|
|
}
|