|
|
@@ -1,18 +1,23 @@
|
|
|
package org.jeecg.modules.medical.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
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.aspect.annotation.Dict;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.DictDto;
|
|
|
+import org.jeecg.common.system.vo.DictModel;
|
|
|
+import org.jeecg.common.system.vo.DictModelMany;
|
|
|
+import org.jeecg.common.system.vo.SysCategoryModel;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.medical.entity.MedicalInsRuleInfo;
|
|
|
+import org.jeecg.modules.medical.entity.MedicalInsRuleProject;
|
|
|
import org.jeecg.modules.medical.service.IMedicalInsRuleInfoService;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -20,6 +25,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import org.jeecg.modules.medical.service.IMedicalInsRuleProjectService;
|
|
|
+import org.jeecg.modules.medical.vo.CommonResponse;
|
|
|
+import org.jeecg.modules.system.model.TreeSelectModel;
|
|
|
+import org.jeecg.modules.system.service.ISysCategoryService;
|
|
|
+import org.jeecg.modules.system.service.ISysDictService;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
@@ -27,6 +37,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
|
@@ -37,138 +48,195 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
|
- /**
|
|
|
+/**
|
|
|
* @Description: medical_ins_rule_info
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2023-04-23
|
|
|
+ * @Date: 2023-04-23
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
-@Api(tags="medical_ins_rule_info")
|
|
|
+@Api(tags = "医保规则管理")
|
|
|
@RestController
|
|
|
@RequestMapping("/medical/medicalInsRuleInfo")
|
|
|
@Slf4j
|
|
|
public class MedicalInsRuleInfoController extends JeecgController<MedicalInsRuleInfo, IMedicalInsRuleInfoService> {
|
|
|
- @Autowired
|
|
|
- private IMedicalInsRuleInfoService medicalInsRuleInfoService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页列表查询
|
|
|
- *
|
|
|
- * @param medicalInsRuleInfo
|
|
|
- * @param pageNo
|
|
|
- * @param pageSize
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "medical_ins_rule_info-分页列表查询")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-分页列表查询", notes="medical_ins_rule_info-分页列表查询")
|
|
|
- @GetMapping(value = "/list")
|
|
|
- public Result<IPage<MedicalInsRuleInfo>> queryPageList(MedicalInsRuleInfo medicalInsRuleInfo,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- QueryWrapper<MedicalInsRuleInfo> queryWrapper = QueryGenerator.initQueryWrapper(medicalInsRuleInfo, req.getParameterMap());
|
|
|
- Page<MedicalInsRuleInfo> page = new Page<MedicalInsRuleInfo>(pageNo, pageSize);
|
|
|
- IPage<MedicalInsRuleInfo> pageList = medicalInsRuleInfoService.page(page, queryWrapper);
|
|
|
- return Result.OK(pageList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- *
|
|
|
- * @param medicalInsRuleInfo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_info-添加")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-添加", notes="medical_ins_rule_info-添加")
|
|
|
- @RequiresPermissions("medical:medical_ins_rule_info:add")
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public Result<String> add(@RequestBody MedicalInsRuleInfo medicalInsRuleInfo) {
|
|
|
- medicalInsRuleInfoService.save(medicalInsRuleInfo);
|
|
|
- return Result.OK("添加成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- *
|
|
|
- * @param medicalInsRuleInfo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_info-编辑")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-编辑", notes="medical_ins_rule_info-编辑")
|
|
|
- @RequiresPermissions("medical:medical_ins_rule_info:edit")
|
|
|
- @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<String> edit(@RequestBody MedicalInsRuleInfo medicalInsRuleInfo) {
|
|
|
- medicalInsRuleInfoService.updateById(medicalInsRuleInfo);
|
|
|
- return Result.OK("编辑成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_info-通过id删除")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-通过id删除", notes="medical_ins_rule_info-通过id删除")
|
|
|
- @RequiresPermissions("medical:medical_ins_rule_info:delete")
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
- public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- medicalInsRuleInfoService.removeById(id);
|
|
|
- return Result.OK("删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- *
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_info-批量删除")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-批量删除", notes="medical_ins_rule_info-批量删除")
|
|
|
- @RequiresPermissions("medical:medical_ins_rule_info:deleteBatch")
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.medicalInsRuleInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id查询
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "medical_ins_rule_info-通过id查询")
|
|
|
- @ApiOperation(value="medical_ins_rule_info-通过id查询", notes="medical_ins_rule_info-通过id查询")
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
- public Result<MedicalInsRuleInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- MedicalInsRuleInfo medicalInsRuleInfo = medicalInsRuleInfoService.getById(id);
|
|
|
- if(medicalInsRuleInfo==null) {
|
|
|
- return Result.error("未找到对应数据");
|
|
|
- }
|
|
|
- return Result.OK(medicalInsRuleInfo);
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private IMedicalInsRuleInfoService medicalInsRuleInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ISysCategoryService sysCategoryService;
|
|
|
+ @Autowired
|
|
|
+ private ISysDictService sysDictService;
|
|
|
+ @Autowired
|
|
|
+ private IMedicalInsRuleProjectService projectService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleInfo
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "medical_ins_rule_info-分页列表查询")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-分页列表查询", notes = "medical_ins_rule_info-分页列表查询")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public Result<IPage<MedicalInsRuleInfo>> queryPageList(MedicalInsRuleInfo medicalInsRuleInfo,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<MedicalInsRuleInfo> queryWrapper = QueryGenerator.initQueryWrapper(medicalInsRuleInfo, req.getParameterMap());
|
|
|
+ Page<MedicalInsRuleInfo> page = new Page<MedicalInsRuleInfo>(pageNo, pageSize);
|
|
|
+ IPage<MedicalInsRuleInfo> pageList = medicalInsRuleInfoService.page(page, queryWrapper);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "类别下拉值", notes = "类别下拉值")
|
|
|
+ @GetMapping(value = "/categoryList")
|
|
|
+ public Result<List<TreeSelectModel>> queryDictList(@RequestParam(name = "dictCode") String dictCode, HttpServletRequest req) {
|
|
|
+ return Result.OK(sysCategoryService.queryListByCode(dictCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "类别对应数据", notes = "类别对应数据")
|
|
|
+ @GetMapping(value = "/childrenList")
|
|
|
+ public Result<List<CommonResponse>> childrenList(@RequestParam(name = "category") String category, HttpServletRequest req) {
|
|
|
+ List<MedicalInsRuleInfo> list = medicalInsRuleInfoService.lambdaQuery().eq(MedicalInsRuleInfo::getCategory, category).list();
|
|
|
+ List<CommonResponse> responses = new ArrayList<>();
|
|
|
+ for (MedicalInsRuleInfo info : list) {
|
|
|
+ CommonResponse response = new CommonResponse();
|
|
|
+ response.setId(info.getId());
|
|
|
+ response.setName(info.getRuleName());
|
|
|
+ responses.add(response);
|
|
|
+ }
|
|
|
+ return Result.OK(responses);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "通过医保规则ID获取规则项目分页", notes = "通过医保规则ID获取规则项目分页")
|
|
|
+ @GetMapping(value = "/projectPage")
|
|
|
+ public Result<?> projectPage(@RequestParam(name = "id") Integer id,
|
|
|
+ @RequestParam(name = "projectName",required = false) String projectName,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ MedicalInsRuleInfo medicalInsRuleInfo = medicalInsRuleInfoService.getById(id);
|
|
|
+ if (medicalInsRuleInfo == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ List<DictDto> dictDtos = sysDictService.queryDictByKeys(Arrays.asList(medicalInsRuleInfo.getSelectedRoles().split(",")));
|
|
|
+ MedicalInsRuleProject medicalInsRuleProject = new MedicalInsRuleProject();
|
|
|
+ medicalInsRuleProject.setMedicineInsRuleInfoId(id);
|
|
|
+ if(StringUtils.hasText(projectName)){
|
|
|
+ medicalInsRuleProject.setProjectName(projectName);
|
|
|
+ }
|
|
|
+ QueryWrapper<MedicalInsRuleProject> queryWrapper = QueryGenerator.initQueryWrapper(medicalInsRuleProject, req.getParameterMap());
|
|
|
+ Page<MedicalInsRuleProject> page = new Page<MedicalInsRuleProject>(pageNo, pageSize);
|
|
|
+ IPage<MedicalInsRuleProject> pageList = projectService.page(page, queryWrapper);
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("title", dictDtos);
|
|
|
+ map.put("page", page);
|
|
|
+ return Result.OK(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_info-添加")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-添加", notes = "medical_ins_rule_info-添加")
|
|
|
+// @RequiresPermissions("medical:medical_ins_rule_info:add")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<String> add(@RequestBody MedicalInsRuleInfo medicalInsRuleInfo) {
|
|
|
+ List<MedicalInsRuleInfo> list = medicalInsRuleInfoService.lambdaQuery().eq(MedicalInsRuleInfo::getRuleName, medicalInsRuleInfo.getRuleName()).list();
|
|
|
+ if (list.size() > 0) {
|
|
|
+ return Result.error("规则名称已存在!");
|
|
|
+ }
|
|
|
+ medicalInsRuleInfoService.save(medicalInsRuleInfo);
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_info-编辑")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-编辑", notes = "medical_ins_rule_info-编辑")
|
|
|
+// @RequiresPermissions("medical:medical_ins_rule_info:edit")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody MedicalInsRuleInfo medicalInsRuleInfo) {
|
|
|
+ medicalInsRuleInfoService.updateById(medicalInsRuleInfo);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_info-通过id删除")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-通过id删除", notes = "medical_ins_rule_info-通过id删除")
|
|
|
+// @RequiresPermissions("medical:medical_ins_rule_info:delete")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ medicalInsRuleInfoService.removeById(id);
|
|
|
+ return Result.OK("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_info-批量删除")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-批量删除", notes = "medical_ins_rule_info-批量删除")
|
|
|
+// @RequiresPermissions("medical:medical_ins_rule_info:deleteBatch")
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+ this.medicalInsRuleInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "medical_ins_rule_info-通过id查询")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_info-通过id查询", notes = "medical_ins_rule_info-通过id查询")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<MedicalInsRuleInfo> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ MedicalInsRuleInfo medicalInsRuleInfo = medicalInsRuleInfoService.getById(id);
|
|
|
+ if (medicalInsRuleInfo == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ return Result.OK(medicalInsRuleInfo);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param medicalInsRuleInfo
|
|
|
- */
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param medicalInsRuleInfo
|
|
|
+ */
|
|
|
@RequiresPermissions("medical:medical_ins_rule_info:exportXls")
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, MedicalInsRuleInfo medicalInsRuleInfo) {
|
|
|
- return super.exportXls(request, medicalInsRuleInfo, MedicalInsRuleInfo.class, "medical_ins_rule_info");
|
|
|
+ return super.exportXlsEmpty(request, medicalInsRuleInfo, MedicalInsRuleInfo.class, "medical_ins_rule_info");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequiresPermissions("medical:medical_ins_rule_info:importExcel")
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|