|
|
@@ -9,11 +9,13 @@ 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.Constant;
|
|
|
import org.jeecg.modules.medical.entity.MedicalInsRuleProject;
|
|
|
+import org.jeecg.modules.medical.service.IMedicalInsRuleProjectDiagnoseService;
|
|
|
import org.jeecg.modules.medical.service.IMedicalInsRuleProjectService;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -28,6 +30,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,164 +40,183 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
|
|
- /**
|
|
|
+/**
|
|
|
* @Description: medical_ins_rule_project
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2023-05-09 14:39:13
|
|
|
+ * @Date: 2023-05-09 14:39:13
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
-@Api(tags="medical_ins_rule_project")
|
|
|
+@Api(tags = "medical_ins_rule_project")
|
|
|
@RestController
|
|
|
@RequestMapping("/medical/medicalInsRuleProject")
|
|
|
@Slf4j
|
|
|
public class MedicalInsRuleProjectController extends JeecgController<MedicalInsRuleProject, IMedicalInsRuleProjectService> {
|
|
|
- @Autowired
|
|
|
- private IMedicalInsRuleProjectService medicalInsRuleProjectService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页列表查询
|
|
|
- *
|
|
|
- * @param medicalInsRuleProject
|
|
|
- * @param pageNo
|
|
|
- * @param pageSize
|
|
|
- * @param req
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "medical_ins_rule_project-分页列表查询")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-分页列表查询", notes="medical_ins_rule_project-分页列表查询")
|
|
|
- @GetMapping(value = "/list")
|
|
|
- public Result<IPage<MedicalInsRuleProject>> queryPageList(MedicalInsRuleProject medicalInsRuleProject,
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
- HttpServletRequest req) {
|
|
|
- QueryWrapper<MedicalInsRuleProject> queryWrapper = QueryGenerator.initQueryWrapper(medicalInsRuleProject, req.getParameterMap());
|
|
|
- Page<MedicalInsRuleProject> page = new Page<MedicalInsRuleProject>(pageNo, pageSize);
|
|
|
- IPage<MedicalInsRuleProject> pageList = medicalInsRuleProjectService.page(page, queryWrapper);
|
|
|
- return Result.OK(pageList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加
|
|
|
- *
|
|
|
- * @param medicalInsRuleProject
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_project-添加")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-添加", notes="medical_ins_rule_project-添加")
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public Result<String> add(@RequestBody MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
- medicalInsRuleProjectService.save(medicalInsRuleProject);
|
|
|
- return Result.OK("添加成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 编辑
|
|
|
- *
|
|
|
- * @param medicalInsRuleProject
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_project-编辑")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-编辑", notes="medical_ins_rule_project-编辑")
|
|
|
- @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
- public Result<String> edit(@RequestBody MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
- medicalInsRuleProjectService.updateById(medicalInsRuleProject);
|
|
|
- return Result.OK("编辑成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id删除
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_project-通过id删除")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-通过id删除", notes="medical_ins_rule_project-通过id删除")
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
- public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
- medicalInsRuleProjectService.removeById(id);
|
|
|
- return Result.OK("删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量删除
|
|
|
- *
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
- */
|
|
|
- @AutoLog(value = "medical_ins_rule_project-批量删除")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-批量删除", notes="medical_ins_rule_project-批量删除")
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
- public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
- this.medicalInsRuleProjectService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id查询
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- //@AutoLog(value = "medical_ins_rule_project-通过id查询")
|
|
|
- @ApiOperation(value="medical_ins_rule_project-通过id查询", notes="medical_ins_rule_project-通过id查询")
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
- public Result<MedicalInsRuleProject> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
- MedicalInsRuleProject medicalInsRuleProject = medicalInsRuleProjectService.getById(id);
|
|
|
- if(medicalInsRuleProject==null) {
|
|
|
- return Result.error("未找到对应数据");
|
|
|
- }
|
|
|
- return Result.OK(medicalInsRuleProject);
|
|
|
- }
|
|
|
+ @Autowired
|
|
|
+ private IMedicalInsRuleProjectService medicalInsRuleProjectService;
|
|
|
+ @Autowired
|
|
|
+ private IMedicalInsRuleProjectDiagnoseService diagnoseService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleProject
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "medical_ins_rule_project-分页列表查询")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-分页列表查询", notes = "medical_ins_rule_project-分页列表查询")
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ public Result<IPage<MedicalInsRuleProject>> queryPageList(MedicalInsRuleProject medicalInsRuleProject,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ QueryWrapper<MedicalInsRuleProject> queryWrapper = QueryGenerator.initQueryWrapper(medicalInsRuleProject, req.getParameterMap());
|
|
|
+ Page<MedicalInsRuleProject> page = new Page<MedicalInsRuleProject>(pageNo, pageSize);
|
|
|
+ IPage<MedicalInsRuleProject> pageList = medicalInsRuleProjectService.page(page, queryWrapper);
|
|
|
+ return Result.OK(pageList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleProject
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_project-添加")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-添加", notes = "medical_ins_rule_project-添加")
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public Result<String> add(@RequestBody MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
+ String medicalDiagnoseCode = medicalInsRuleProject.getMedicalDiagnoseCode();
|
|
|
+ String correlationMedicalDiagnoseCode = medicalInsRuleProject.getCorrelationMedicalDiagnoseCode();
|
|
|
+ //多行文本
|
|
|
+ medicalInsRuleProjectService.save(medicalInsRuleProject);
|
|
|
+ if (StringUtils.hasText(medicalDiagnoseCode)) {
|
|
|
+ List<String> code = Arrays.asList(medicalDiagnoseCode.split("\n"));
|
|
|
+ medicalInsRuleProject.setCode(code);
|
|
|
+ Integer projectCodeType = 1;
|
|
|
+ diagnoseService.saveDiagnose(code, medicalInsRuleProject.getMedicalInsRuleInfoId(), projectCodeType, medicalInsRuleProject.getProjectCode());
|
|
|
+
|
|
|
+ }
|
|
|
+ if (StringUtils.hasText(correlationMedicalDiagnoseCode)) {
|
|
|
+ List<String> code = Arrays.asList(correlationMedicalDiagnoseCode.split("\n"));
|
|
|
+ medicalInsRuleProject.setCode(code);
|
|
|
+ Integer projectCodeType = 2;
|
|
|
+ diagnoseService.saveDiagnose(code, medicalInsRuleProject.getMedicalInsRuleInfoId(), projectCodeType, medicalInsRuleProject.getProjectCode());
|
|
|
+
|
|
|
+ }
|
|
|
+ return Result.OK("添加成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑
|
|
|
+ *
|
|
|
+ * @param medicalInsRuleProject
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_project-编辑")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-编辑", notes = "medical_ins_rule_project-编辑")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
+ medicalInsRuleProjectService.updateById(medicalInsRuleProject);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id删除
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_project-通过id删除")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-通过id删除", notes = "medical_ins_rule_project-通过id删除")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ medicalInsRuleProjectService.removeById(id);
|
|
|
+ return Result.OK("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除
|
|
|
+ *
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "medical_ins_rule_project-批量删除")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-批量删除", notes = "medical_ins_rule_project-批量删除")
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
+ this.medicalInsRuleProjectService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过id查询
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ //@AutoLog(value = "medical_ins_rule_project-通过id查询")
|
|
|
+ @ApiOperation(value = "medical_ins_rule_project-通过id查询", notes = "medical_ins_rule_project-通过id查询")
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
+ public Result<MedicalInsRuleProject> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ MedicalInsRuleProject medicalInsRuleProject = medicalInsRuleProjectService.getById(id);
|
|
|
+ if (medicalInsRuleProject == null) {
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
+ }
|
|
|
+ return Result.OK(medicalInsRuleProject);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 导出excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param medicalInsRuleProject
|
|
|
- */
|
|
|
+ * 导出excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param medicalInsRuleProject
|
|
|
+ */
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
return super.exportXls(request, medicalInsRuleProject, MedicalInsRuleProject.class, "999");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 导出灵活表头的Excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param medicalInsRuleProject
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 导出灵活表头的Excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param medicalInsRuleProject
|
|
|
+ */
|
|
|
// @RequiresPermissions("medical:medical_ins_rule_project:exportXls")
|
|
|
- @RequestMapping(value = "/export/templateXls")
|
|
|
- public ModelAndView exportTemplateXls(HttpServletRequest request, MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
+ @RequestMapping(value = "/export/templateXls")
|
|
|
+ public ModelAndView exportTemplateXls(HttpServletRequest request, MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
// return super.exportXls(request, medicalInsRuleProject, MedicalInsRuleProject.class, "medical_ins_rule_project");
|
|
|
- try {
|
|
|
- return medicalInsRuleProjectService.exportTemplateXls(request, medicalInsRuleProject, MedicalInsRuleProject.class, "666");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 导入灵活表头的Excel
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping(value = "/import/templateExcel", method = RequestMethod.POST)
|
|
|
- public Result<?> importTemplateExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ try {
|
|
|
+ return medicalInsRuleProjectService.exportTemplateXls(request, medicalInsRuleProject, MedicalInsRuleProject.class, "666");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导入灵活表头的Excel
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/import/templateExcel", method = RequestMethod.POST)
|
|
|
+ public Result<?> importTemplateExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
// return super.importExcel(request, response, MedicalInsRuleProject.class);
|
|
|
- return medicalInsRuleProjectService.importTemplateExcel(request, response, MedicalInsRuleProject.class);
|
|
|
- }
|
|
|
+ return medicalInsRuleProjectService.importTemplateExcel(request, response, MedicalInsRuleProject.class);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 通过excel导入数据
|
|
|
- *
|
|
|
- * @param request
|
|
|
- * @param response
|
|
|
- * @return
|
|
|
- */
|
|
|
+ * 通过excel导入数据
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
return super.importExcel(request, response, MedicalInsRuleProject.class);
|