维护系统->检查方法、部位导出表格功能OK
This commit is contained in:
@@ -5,6 +5,7 @@ import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 检查方法Service接口
|
||||
@@ -22,5 +23,7 @@ public interface ICheckMethodAppService{
|
||||
|
||||
R<?> removeCheckMethod(Integer checkMethodId);
|
||||
|
||||
R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkTpye, String name, String packageName);
|
||||
R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
|
||||
|
||||
R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.openhis.web.check.appservice;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public interface ICheckPartAppService {
|
||||
R<?> getCheckPartList();
|
||||
|
||||
@@ -12,5 +14,7 @@ public interface ICheckPartAppService {
|
||||
|
||||
R<?> updateCheckPart(CheckPart checkPart);
|
||||
|
||||
R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkTpye, String name, String packageName);
|
||||
R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName);
|
||||
|
||||
R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,16 @@ import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.check.service.ICheckMethodService;
|
||||
import com.openhis.web.check.appservice.ICheckMethodAppService;
|
||||
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -26,10 +31,10 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkTpye, String name, String packageName) {
|
||||
public R<?> searchCheckMethodList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
|
||||
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkTpye != null && ObjectUtil.isNotEmpty(checkTpye)) {
|
||||
wrapper.eq(CheckMethod::getCheckType, checkTpye);
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckMethod::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckMethod::getName, name);
|
||||
@@ -80,4 +85,45 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
||||
boolean remove = checkMethodService.removeById(checkMethodId);
|
||||
return R.ok(remove);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> exportCheckMethod(String checkType, String name, String packageName, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<CheckMethod> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckMethod::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckMethod::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckMethod::getPackageName, packageName);
|
||||
}
|
||||
List<CheckMethod> list = checkMethodService.list(wrapper);
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return R.fail("导出Excel失败,无数据。");
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备表头(key对应实体的字段名)
|
||||
Map<String, String> headers = new LinkedHashMap<>();
|
||||
headers.put("checkType", "检查类型");
|
||||
headers.put("code", "方法代码");
|
||||
headers.put("name", "方法名称");
|
||||
headers.put("packageName", "套餐名称");
|
||||
headers.put("exposureNum", "曝光次数");
|
||||
headers.put("orderNum", "序号");
|
||||
headers.put("remark", "备注");
|
||||
|
||||
// 文件名,只传文字部分
|
||||
String excelName = "检查方法列表";
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
return R.ok(null, "导出Excel成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,19 @@ package com.openhis.web.check.appservice.impl;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.check.domain.CheckMethod;
|
||||
import com.openhis.check.domain.CheckPart;
|
||||
import com.openhis.check.service.ICheckPartService;
|
||||
import com.openhis.web.check.appservice.ICheckPartAppService;
|
||||
import com.openhis.web.reportmanage.utils.ExcelFillerUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
@@ -24,10 +28,10 @@ public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkTpye, String name, String packageName) {
|
||||
public R<?> searchCheckPartList(Integer pageNo, Integer pageSize, String checkType, String name, String packageName) {
|
||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkTpye != null && ObjectUtil.isNotEmpty(checkTpye)) {
|
||||
wrapper.eq(CheckPart::getCheckType, checkTpye);
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckPart::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckPart::getName, name);
|
||||
@@ -59,4 +63,47 @@ public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
boolean b = checkPartService.updateById(checkPart);
|
||||
return R.ok(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> exportCheckPart(String checkType, String name, String packageName, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<CheckPart> wrapper = new LambdaQueryWrapper<>();
|
||||
if (checkType != null && ObjectUtil.isNotEmpty(checkType)) {
|
||||
wrapper.eq(CheckPart::getCheckType, checkType);
|
||||
}
|
||||
if (name != null && ObjectUtil.isNotEmpty(name)) {
|
||||
wrapper.like(CheckPart::getName, name);
|
||||
}
|
||||
if (packageName != null && ObjectUtil.isNotEmpty(packageName)) {
|
||||
wrapper.eq(CheckPart::getPackageName, packageName);
|
||||
}
|
||||
List<CheckPart> list = checkPartService.list(wrapper);
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return R.fail("导出Excel失败,无数据。");
|
||||
}
|
||||
|
||||
try {
|
||||
// 准备表头(key对应实体的字段名)
|
||||
Map<String, String> headers = new LinkedHashMap<>();
|
||||
headers.put("checkType", "检查类型");
|
||||
headers.put("code", "部位代码");
|
||||
headers.put("name", "部位名称");
|
||||
headers.put("packageName", "套餐名称");
|
||||
headers.put("exposureNum", "曝光次数");
|
||||
headers.put("price", "金额");
|
||||
headers.put("number", "序号");
|
||||
headers.put("serviceScope", "服务范围");
|
||||
headers.put("subType", "下级医技类型");
|
||||
headers.put("remark", "备注");
|
||||
|
||||
// 文件名,只传文字部分
|
||||
String excelName = "检查部位列表";
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
return R.ok(null, "导出Excel成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@RestController
|
||||
@@ -33,10 +34,10 @@ public class CheckMethodController {
|
||||
public R<?> searchCheckMethodList(
|
||||
@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String checkTpye,
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName) {
|
||||
return R.ok(checkMethodAppService.searchCheckMethodList(pageNo,pageSize,checkTpye,name,packageName));
|
||||
return R.ok(checkMethodAppService.searchCheckMethodList(pageNo,pageSize,checkType,name,packageName));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -65,4 +66,17 @@ public class CheckMethodController {
|
||||
public R<?> updateCheckMethod(@RequestBody CheckMethod checkMethod){
|
||||
return R.ok(checkMethodAppService.updateCheckMethod(checkMethod));
|
||||
}
|
||||
|
||||
/*
|
||||
* 导出检查方法列表
|
||||
* @Param
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCheckMethod(
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName,
|
||||
HttpServletResponse response) {
|
||||
checkMethodAppService.exportCheckMethod(checkType, name, packageName, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@@ -31,10 +32,10 @@ public class CheckPartController {
|
||||
@GetMapping("/search")
|
||||
public R<?> searchCheckPartList(@RequestParam(required = false) Integer pageNo,
|
||||
@RequestParam(required = false) Integer pageSize,
|
||||
@RequestParam(required = false) String checkTpye,
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName){
|
||||
return R.ok(checkPartAppService.searchCheckPartList(pageNo,pageSize,checkTpye,name,packageName));
|
||||
return R.ok(checkPartAppService.searchCheckPartList(pageNo,pageSize,checkType,name,packageName));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -63,4 +64,17 @@ public class CheckPartController {
|
||||
public R<?> updateCheckPart(@RequestBody CheckPart checkPart){
|
||||
return R.ok(checkPartAppService.updateCheckPart(checkPart));
|
||||
}
|
||||
|
||||
/*
|
||||
* 导出检查部位列表
|
||||
* @Param
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCheckPart(
|
||||
@RequestParam(required = false) String checkType,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String packageName,
|
||||
HttpServletResponse response) {
|
||||
checkPartAppService.exportCheckPart(checkType, name, packageName, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.openhis.check.domain;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
Reference in New Issue
Block a user