挂号 病例
This commit is contained in:
parent
87bba3ea0f
commit
b4fdc67811
|
|
@ -4,6 +4,9 @@ import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
|
|
@ -12,44 +15,6 @@ import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class FileUtil {
|
public class FileUtil {
|
||||||
public List<String> readToList(List<String> file_list) {
|
|
||||||
List<String> list = new ArrayList<String>();
|
|
||||||
for (String file : file_list) {
|
|
||||||
List<String> child_list = readToList(file);
|
|
||||||
list.addAll(child_list);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> readToList(String file) {
|
|
||||||
List<String> list = new ArrayList<String>();
|
|
||||||
int i = 0;
|
|
||||||
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
|
|
||||||
String line;
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
list.add(line);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new MessageException("读取文件失败");
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String readToString(String path) {
|
|
||||||
StringBuilder content = new StringBuilder();
|
|
||||||
try (BufferedReader br = new BufferedReader(new FileReader(path))) {
|
|
||||||
String line;
|
|
||||||
while ((line = br.readLine()) != null) {
|
|
||||||
content.append(line).append("\n");
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new MessageException("读取文件失败");
|
|
||||||
}
|
|
||||||
return content.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<String> unzip(String path, String filename) {
|
public List<String> unzip(String path, String filename) {
|
||||||
List<String> file_list = new ArrayList<String>();
|
List<String> file_list = new ArrayList<String>();
|
||||||
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(path + "/" + filename))) {
|
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(path + "/" + filename))) {
|
||||||
|
|
@ -81,25 +46,64 @@ public class FileUtil {
|
||||||
return file_list;
|
return file_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void zipFiles(String[] srcFiles, String zipFile) {
|
public boolean deleteImage(String fileName) {
|
||||||
try (FileOutputStream fos = new FileOutputStream(zipFile);
|
if (fileName == null || fileName.isEmpty()) {
|
||||||
ZipOutputStream zos = new ZipOutputStream(fos)) {
|
throw new MessageException("文件名为空");
|
||||||
|
|
||||||
for (String srcFile : srcFiles) {
|
|
||||||
File fileToZip = new File(srcFile);
|
|
||||||
FileInputStream fis = new FileInputStream(fileToZip);
|
|
||||||
ZipEntry zipEntry = new ZipEntry(fileToZip.getName());
|
|
||||||
zos.putNextEntry(zipEntry);
|
|
||||||
|
|
||||||
byte[] bytes = new byte[1024];
|
|
||||||
int length;
|
|
||||||
while ((length = fis.read(bytes)) >= 0) {
|
|
||||||
zos.write(bytes, 0, length);
|
|
||||||
}
|
}
|
||||||
fis.close();
|
try {
|
||||||
|
// 指定文件保存的目录
|
||||||
|
Path uploadPath = Paths.get("D:/uploads/");
|
||||||
|
|
||||||
|
// 构建完整的文件路径
|
||||||
|
Path filePath = uploadPath.resolve(fileName);
|
||||||
|
|
||||||
|
// 检查文件是否存在
|
||||||
|
if (!Files.exists(filePath)) {
|
||||||
|
throw new MessageException("文件不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
Files.delete(filePath);
|
||||||
|
return true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
throw new MessageException("删除文件失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public List<String> readToList(List<String> file_list) {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
for (String file : file_list) {
|
||||||
|
List<String> child_list = readToList(file);
|
||||||
|
list.addAll(child_list);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> readToList(String file) {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
int i = 0;
|
||||||
|
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
|
||||||
|
String line;
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
list.add(line);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new MessageException("读取文件失败");
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String readFileToString(String path) {
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
try (BufferedReader br = new BufferedReader(new FileReader(path))) {
|
||||||
|
String line;
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
content.append(line).append("\n");
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new MessageException("读取文件失败");
|
||||||
|
}
|
||||||
|
return content.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ package com.syjiaer.clinic.server.common.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.NotNull;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -121,4 +123,30 @@ public class ParmsUtil {
|
||||||
}
|
}
|
||||||
return Integer.parseInt(map.get(key).toString());
|
return Integer.parseInt(map.get(key).toString());
|
||||||
}
|
}
|
||||||
|
public <T> T getObjectWithCheck(String key, Class<T> clazz) {
|
||||||
|
T t = getObject(key, clazz);
|
||||||
|
if (t == null) {
|
||||||
|
throw new MessageException("Object is null for key: " + key);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取目标对象的实际类
|
||||||
|
Class<?> tClazz = t.getClass();
|
||||||
|
while (tClazz != null) {
|
||||||
|
for (Field field : tClazz.getDeclaredFields()) {
|
||||||
|
field.setAccessible(true); // 设置字段可访问
|
||||||
|
try {
|
||||||
|
Object value = field.get(t); // 修复:使用 t 而不是 this
|
||||||
|
if (value == null && field.isAnnotationPresent(NotNull.class)) {
|
||||||
|
NotNull annotation = field.getAnnotation(NotNull.class);
|
||||||
|
String nullStr = annotation.value();
|
||||||
|
throw new MessageException(nullStr); // 字段不能为空时抛出异常
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new MessageException("Illegal access exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tClazz = tClazz.getSuperclass(); // 遍历父类字段
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.goods;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.goods.GoodsCate;
|
||||||
|
import com.syjiaer.clinic.server.service.goods.GoodsCateService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 商品 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author NiuZiYuan
|
||||||
|
* @since 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/goods/cate")
|
||||||
|
public class GoodsCateController extends BaseController {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(GoodsCateController.class);
|
||||||
|
@Autowired
|
||||||
|
private GoodsCateService goodsCateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商二级分类列表
|
||||||
|
* 参数 type 商品一级类型
|
||||||
|
*/
|
||||||
|
@RequestMapping("list")
|
||||||
|
public Result<List<GoodsCate>> list(){
|
||||||
|
Map<String,Object> map=getParms();
|
||||||
|
int type= parmsUtil.getInteger("type","类型不能为空");
|
||||||
|
List<GoodsCate> list=goodsCateService.listByType(type);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有的分类
|
||||||
|
*/
|
||||||
|
@RequestMapping("getAllList")
|
||||||
|
public Result<Map<Integer,List<GoodsCate>>> getAllList(){
|
||||||
|
Map<Integer,List<GoodsCate>> resultMap=goodsCateService.listAll();
|
||||||
|
return success(resultMap);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除二级分类
|
||||||
|
* 参数 id
|
||||||
|
*/
|
||||||
|
@RequestMapping("del")
|
||||||
|
public Result del(){
|
||||||
|
Map<String,Object> map=getParms();
|
||||||
|
Integer id= parmsUtil.getInteger("id","id不能为空");
|
||||||
|
goodsCateService.del(id);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存二级分类
|
||||||
|
* 参数 cateList
|
||||||
|
*/
|
||||||
|
@RequestMapping("save")
|
||||||
|
public Result save(){
|
||||||
|
List<GoodsCate> cateList = parmsUtil.getList("cateList", GoodsCate.class);
|
||||||
|
goodsCateService.save(cateList);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,142 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.goods;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
|
import com.syjiaer.clinic.server.common.enums.GoodsPricingModelEnum;
|
||||||
|
import com.syjiaer.clinic.server.common.util.ParmsUtil;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.goods.Goods;
|
||||||
|
import com.syjiaer.clinic.server.entity.goods.GoodsView;
|
||||||
|
import com.syjiaer.clinic.server.entity.goods.dto.GoodsQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.goods.vo.GoodsDetailVo;
|
||||||
|
import com.syjiaer.clinic.server.service.goods.GoodsService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 商品 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author NiuZiYuan
|
||||||
|
* @since 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/goods/goods")
|
||||||
|
public class GoodsController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Autowired
|
||||||
|
private ParmsUtil parmsUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品建档 或 修改
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("save")
|
||||||
|
public Result<Object> save() {
|
||||||
|
|
||||||
|
Goods goods = JSONObject.parseObject(JSONObject.toJSONString(parmsUtil.getMap()), Goods.class);
|
||||||
|
if (goods.getPurchaseUnitPrice()==null) {
|
||||||
|
return error("请输入参考进价");
|
||||||
|
}
|
||||||
|
if (goods.getName() == null || goods.getName().isEmpty()) {
|
||||||
|
return error("请输入信息");
|
||||||
|
}
|
||||||
|
if (goods.getPricingModel() == null) {
|
||||||
|
return error("定价模式不能为空");
|
||||||
|
}
|
||||||
|
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel()) && goods.getMakeUp() == null) {
|
||||||
|
return error("加成率不能为空");
|
||||||
|
}
|
||||||
|
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Fixed.getPricingModel()) && goods.getUnitPrice() == null) {
|
||||||
|
return error("固定售价不能为空");
|
||||||
|
}
|
||||||
|
if (goods.getIdCode() != null && goods.getIdCode().isEmpty()){
|
||||||
|
goods.setIdCode(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
Goods dbGoods = goodsService.createGoods(goods);
|
||||||
|
|
||||||
|
return success(dbGoods);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品重新初始化医保库存
|
||||||
|
*/
|
||||||
|
@RequestMapping("returnInit")
|
||||||
|
public Result<Object> returnInit() {
|
||||||
|
Integer goodId = parmsUtil.getInteger("id");
|
||||||
|
goodsService.returnInit(goodId);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品搜索 goods页搜索
|
||||||
|
*/
|
||||||
|
@RequestMapping("searchDetail")
|
||||||
|
public Result<Page<GoodsDetailVo>> searchGoodeDetail() {
|
||||||
|
QueryWrapper<GoodsView> queryWrapper = new QueryWrapper<>();
|
||||||
|
GoodsQuery goodsQuery = parmsUtil.getObject("query", GoodsQuery.class);
|
||||||
|
Page<GoodsDetailVo> result = goodsService.searchGoodeDetail(goodsQuery);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品搜索 一键建档内的搜索
|
||||||
|
*/
|
||||||
|
@RequestMapping("search")
|
||||||
|
public Result<Object> search() {
|
||||||
|
Map<String, Object> parms = getParms();
|
||||||
|
String keyword = (String) parms.get("keyword");
|
||||||
|
if (keyword == null || keyword.isEmpty()) {
|
||||||
|
return success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
List<Goods> searchResult = goodsService.search(keyword);;
|
||||||
|
return success(searchResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据商品id获取商品
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("get")
|
||||||
|
public Result<Object> get() {
|
||||||
|
int id = parmsUtil.getInteger("id", "请输入ID");
|
||||||
|
return success(goodsService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品添加标识码
|
||||||
|
* 参数:goodsId,idCode
|
||||||
|
*/
|
||||||
|
@RequestMapping("addIdCode")
|
||||||
|
public Result<Object> addIdCode(){
|
||||||
|
Integer goodsId = parmsUtil.getInteger("goodsId","商品id为空");
|
||||||
|
String idCode = parmsUtil.getString("idCode","标识码为空");
|
||||||
|
goodsService.addIdCode(goodsId,idCode);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取二级分类绑定的商品数量
|
||||||
|
* 参数 cateId 二级分类ID
|
||||||
|
*/
|
||||||
|
@RequestMapping("getByCateId")
|
||||||
|
public Result<Long> getCountByCateId() {
|
||||||
|
Integer cateId = parmsUtil.getInteger("cateId", "请输入分类ID");
|
||||||
|
return success(goodsService.getByCateId(cateId));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.item;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.item.Item;
|
||||||
|
import com.syjiaer.clinic.server.service.item.ItemService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/item")
|
||||||
|
public class ItemController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ItemService itemService;
|
||||||
|
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<Item>> getAllItems() {
|
||||||
|
int page = parmsUtil.getInteger("page", "页码不能为空");
|
||||||
|
int size = parmsUtil.getInteger("size", "页容量不能为空");
|
||||||
|
String name = parmsUtil.getString("name");
|
||||||
|
String tel = parmsUtil.getString("tel");
|
||||||
|
|
||||||
|
return success(itemService.getPageList(page, size, name, tel));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getItemById")
|
||||||
|
public Result<Item> getItemById() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if (id == null) {
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
return success(itemService.getItemById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public Result<?> createItem() {
|
||||||
|
Item item = parmsUtil.getObject("data", Item.class);
|
||||||
|
itemService.createItem(item);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
public Result<?> updateItem() {
|
||||||
|
Item item = parmsUtil.getObject("data", Item.class);
|
||||||
|
itemService.updateItem(item);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<?> deleteItem() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
itemService.del(id);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/search")
|
||||||
|
public Result<List<Item>> search() {
|
||||||
|
String keyword = parmsUtil.getString("keyword");
|
||||||
|
if (keyword == null || keyword.isEmpty()) {
|
||||||
|
return success(new ArrayList<>());
|
||||||
|
}
|
||||||
|
return success(itemService.search(keyword));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.item;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.item.ItemGroup;
|
||||||
|
import com.syjiaer.clinic.server.entity.item.param.ItemGroupParam;
|
||||||
|
import com.syjiaer.clinic.server.service.item.ItemGroupService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/item/group")
|
||||||
|
public class ItemGroupController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ItemGroupService itemGroupService;
|
||||||
|
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<ItemGroup>> list() {
|
||||||
|
Integer page = parmsUtil.getInteger("page", "页码不能为空");
|
||||||
|
Integer size = parmsUtil.getInteger("size", "页容量不能为空");
|
||||||
|
String name = parmsUtil.getString("name");
|
||||||
|
Page<ItemGroup> pageResult = itemGroupService.getItemGroupList(page, size, name);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getItemGroupById")
|
||||||
|
public Result<ItemGroup> getItemGroupById() {
|
||||||
|
Integer id = parmsUtil.getInteger("id", "id不能为空");
|
||||||
|
ItemGroup itemGroup = itemGroupService.getItemGroupById(id);
|
||||||
|
return success(itemGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/save")
|
||||||
|
public Result<?> save() {
|
||||||
|
ItemGroupParam itemGroupParam = parmsUtil.getObject("data", ItemGroupParam.class);
|
||||||
|
if (itemGroupParam == null){
|
||||||
|
throw new MessageException("请求参数不能为空");
|
||||||
|
}
|
||||||
|
itemGroupService.saveItemGroup(itemGroupParam);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<?> delete() {
|
||||||
|
Integer id = parmsUtil.getInteger("id", "id不能为空");
|
||||||
|
itemGroupService.delete(id);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.medical;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.enums.MedicalRecordDetailTypeEnum;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.medical.dto.MedicalRecordSaveDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.medical.dto.MedicalRecordVo;
|
||||||
|
import com.syjiaer.clinic.server.service.medical.MedicalRecordService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/medical/record")
|
||||||
|
public class MedicalRecordController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MedicalRecordService medicalRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存病历
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/save")
|
||||||
|
public Result<Object> save() {
|
||||||
|
MedicalRecordSaveDto saveDto = parmsUtil.getObject("data", MedicalRecordSaveDto.class);
|
||||||
|
medicalRecordService.save(saveDto);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询患者病历
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/listByPatient")
|
||||||
|
public Result<List<MedicalRecordVo>> listByPatient() {
|
||||||
|
Integer patientId = parmsUtil.getInteger("patientId", "患者不能为空");
|
||||||
|
return success( medicalRecordService.listByPatientId(patientId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*根据挂单号回显病历详情
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getDetailByRegisId")
|
||||||
|
public Result<MedicalRecordVo> getDetailByRegisId() {
|
||||||
|
Integer regisId = parmsUtil.getInteger("regisId", "挂单id不能为空");
|
||||||
|
return success(medicalRecordService.getDetailByRegisId(regisId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.organization;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
|
import com.syjiaer.clinic.server.service.organization.OrganizationMemberService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/organization/member")
|
||||||
|
public class OrganizationMemberController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private OrganizationMemberService organizationMemberService;
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<OrganizationMember>> list() {
|
||||||
|
int page = parmsUtil.getInteger("page","页码不能为空");
|
||||||
|
int size = parmsUtil.getInteger("size", "页容量不能为空");
|
||||||
|
String name = parmsUtil.getString("name");
|
||||||
|
String tel = parmsUtil.getString("tel");
|
||||||
|
return success(organizationMemberService.listPage(page,size,name,tel));
|
||||||
|
}
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public Result<?> add() {
|
||||||
|
OrganizationMember organizationMember = parmsUtil.getObjectWithCheck("data", OrganizationMember.class);
|
||||||
|
if(organizationMember ==null){
|
||||||
|
throw new MessageException("data参数为空");
|
||||||
|
}
|
||||||
|
organizationMemberService.save(organizationMember);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
public Result<?> edit() {
|
||||||
|
OrganizationMember organizationMember = parmsUtil.getObjectWithCheck("data", OrganizationMember.class);
|
||||||
|
organizationMemberService.edit(organizationMember);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<?> delete() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if(id == null){
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
organizationMemberService.delete(id);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public Result<OrganizationMember> getById() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
return success(organizationMemberService.get(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/allDoctorList")
|
||||||
|
public Result<List<OrganizationMember>> allDoctorList() {
|
||||||
|
return success(organizationMemberService.doctorList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.organization;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||||
|
import com.syjiaer.clinic.server.service.organization.OrganizationSectionService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/organization/section")
|
||||||
|
public class OrganizationSectionController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private OrganizationSectionService organizationSectionService;
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<OrganizationSection>> list() {
|
||||||
|
int page = parmsUtil.getInteger("page","页码不能为空");
|
||||||
|
int size = parmsUtil.getInteger("size", "页容量不能为空");
|
||||||
|
String name = parmsUtil.getString("name");
|
||||||
|
String caty = parmsUtil.getString("caty");
|
||||||
|
String resperName = parmsUtil.getString("resperName");
|
||||||
|
String resperTel = parmsUtil.getString("resperTel");
|
||||||
|
return success(organizationSectionService.list(page,size,name,caty,resperName,resperTel));
|
||||||
|
}
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public Result<?> add() {
|
||||||
|
OrganizationSection organizationSection = parmsUtil.getObjectWithCheck("data", OrganizationSection.class);
|
||||||
|
organizationSectionService.add(organizationSection);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
public Result<?> edit() {
|
||||||
|
OrganizationSection organizationSection = parmsUtil.getObjectWithCheck("data", OrganizationSection.class);
|
||||||
|
if(organizationSection ==null){
|
||||||
|
throw new MessageException("data参数为空");
|
||||||
|
}
|
||||||
|
organizationSectionService.edit(organizationSection);
|
||||||
|
return success("编辑成功");
|
||||||
|
}
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<?> delete() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if(id == null){
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
organizationSectionService.delete(id);
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public Result<OrganizationSection> getById() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if(id == null){
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
OrganizationSection organizationSection = organizationSectionService.get(id);
|
||||||
|
return success(organizationSection);
|
||||||
|
}
|
||||||
|
@RequestMapping("/allList")
|
||||||
|
public Result<List<JSONObject>> allList() {
|
||||||
|
return success( organizationSectionService.getAllList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.patient;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.util.DateUtil;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
||||||
|
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
||||||
|
import com.syjiaer.clinic.server.service.patient.PatientRegistrationService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/registration")
|
||||||
|
public class RegistrationController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private PatientRegistrationService patientRegistrationService;
|
||||||
|
@Autowired
|
||||||
|
private PatientInfoService patientInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/add")
|
||||||
|
public Result<?> registration() {
|
||||||
|
|
||||||
|
PatientRegistration registrationParam = parmsUtil.getObjectWithCheck("data", PatientRegistration.class);
|
||||||
|
patientRegistrationService.registration(registrationParam);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询 挂号列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<PatientRegistration>> list() {
|
||||||
|
int page = parmsUtil.getInteger("page", "页码不能为空");
|
||||||
|
int size = parmsUtil.getInteger("size", "页容量不能为空");
|
||||||
|
String date = parmsUtil.getString("date");
|
||||||
|
Page<PatientRegistration> pageResult = patientRegistrationService.listPage(page, size, date);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改挂号信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/edit")
|
||||||
|
public Result<?> edit() {
|
||||||
|
PatientRegistration registration = parmsUtil.getObjectWithCheck("data", PatientRegistration.class);
|
||||||
|
if (registration == null) {
|
||||||
|
throw new MessageException("data参数为空");
|
||||||
|
}
|
||||||
|
patientRegistrationService.updateById(registration);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除挂号信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<?> delete() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if (id == null) {
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
patientRegistrationService.delete(id);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取挂号信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getById")
|
||||||
|
public Result<PatientRegistration> getById() {
|
||||||
|
Integer id = parmsUtil.getInteger("id");
|
||||||
|
if (id == null) {
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
PatientRegistration result = patientRegistrationService.getById(id);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/allList")
|
||||||
|
public Result<List<PatientRegistration>> allList() {
|
||||||
|
List<PatientRegistration> list = patientRegistrationService.listAll();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号信息分页搜索
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getListByType")
|
||||||
|
public Result<Page<PatientRegistration>> getListByType() {
|
||||||
|
RegistrationQuery query = parmsUtil.getObject("query", RegistrationQuery.class);
|
||||||
|
return success(patientRegistrationService.getPageByType(query));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id返回挂号详细信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getDetailById")
|
||||||
|
public Result<PatientAndRegistrationInfoVo> getDetailById(){
|
||||||
|
Integer regisId= parmsUtil.getInteger("id","挂号单不能为空");
|
||||||
|
return success(patientRegistrationService.getDetailById(regisId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,117 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.medical.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class GoodsRetailDto {
|
||||||
|
@ApiModelProperty("自增主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("通用名")
|
||||||
|
private String commonName;
|
||||||
|
|
||||||
|
@ApiModelProperty("医保目录编码")
|
||||||
|
private String hilistCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("进货价")
|
||||||
|
private BigDecimal purchaseUnitPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("生厂商")
|
||||||
|
private String producer;
|
||||||
|
|
||||||
|
@ApiModelProperty("条形码")
|
||||||
|
private String barcode;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小制剂单位")
|
||||||
|
private String medicineDosageUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小包装数量")
|
||||||
|
private Integer minPackagingNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小包装单位")
|
||||||
|
private String minPackagingUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty("保质期")
|
||||||
|
private Integer expiryTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("国药准字")
|
||||||
|
private String approvalCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("拓展字段")
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
@ApiModelProperty("分类ID")
|
||||||
|
private Integer cateId;
|
||||||
|
|
||||||
|
@ApiModelProperty("软删除 1为删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("利润分类")
|
||||||
|
private String profitCate;
|
||||||
|
|
||||||
|
@ApiModelProperty("标签")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("利率")
|
||||||
|
private Double interestRate;
|
||||||
|
|
||||||
|
@ApiModelProperty("库存整数量 ")
|
||||||
|
private Integer inventoryWholeNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("标识码 由追溯码生成")
|
||||||
|
private String idCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("库存分数量")
|
||||||
|
private Integer inventoryFragmentNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("0不允许拆零 1允许拆零")
|
||||||
|
private Boolean trdnFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("拆零价格")
|
||||||
|
private BigDecimal disassemblyPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小制剂数量")
|
||||||
|
private String medicineDosageNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("包装单位")
|
||||||
|
private String packagingUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty("售卖模式")
|
||||||
|
private Integer pricingModel;
|
||||||
|
|
||||||
|
@ApiModelProperty("加成率 30=30%")
|
||||||
|
private Integer makeUp;
|
||||||
|
|
||||||
|
@ApiModelProperty("0禁售 1可售")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@ApiModelProperty("库存预警数量")
|
||||||
|
private Integer inventoryWarnNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("到期预警天数")
|
||||||
|
private Integer expiryWarnDays;
|
||||||
|
@ApiModelProperty("选择的数量")
|
||||||
|
private Integer selectNum;
|
||||||
|
@ApiModelProperty("选择的单位")
|
||||||
|
private String selectedUnit;
|
||||||
|
@ApiModelProperty("选择的价格")
|
||||||
|
private BigDecimal selectedPrice;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
package com.syjiaer.clinic.server.entity.medical.dto;
|
package com.syjiaer.clinic.server.entity.medical.dto;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.entity.item.Item;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class MedicalRecordSaveDto {
|
public class MedicalRecordSaveDto {
|
||||||
|
|
@ -46,7 +47,7 @@ public class MedicalRecordSaveDto {
|
||||||
private String diagnosisSummary;
|
private String diagnosisSummary;
|
||||||
|
|
||||||
@ApiModelProperty("服务项目列表")
|
@ApiModelProperty("服务项目列表")
|
||||||
private List<Integer> itemList;
|
private List<Item> itemList;
|
||||||
@ApiModelProperty("药品耗材列表")
|
@ApiModelProperty("药品耗材列表")
|
||||||
private Map<Integer,Integer> goodsMap;
|
private List<GoodsRetailDto> goodsList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.medical.dto;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.entity.medical.MedicalRecordDetail;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class MedicalRecordVo {
|
||||||
|
@ApiModelProperty("自增id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者id")
|
||||||
|
private Integer patientId;
|
||||||
|
|
||||||
|
@ApiModelProperty("主诉")
|
||||||
|
private String mainAppeal;
|
||||||
|
|
||||||
|
@ApiModelProperty("现病史")
|
||||||
|
private String nowMedicalHistory;
|
||||||
|
|
||||||
|
@ApiModelProperty("往病史")
|
||||||
|
private String beforeMedicalHistory;
|
||||||
|
|
||||||
|
@ApiModelProperty("过敏史")
|
||||||
|
private String allergyHistory;
|
||||||
|
|
||||||
|
@ApiModelProperty("体检检查")
|
||||||
|
private String exam;
|
||||||
|
|
||||||
|
@ApiModelProperty("非通用字段")
|
||||||
|
private String json;
|
||||||
|
|
||||||
|
@ApiModelProperty("接诊医生id")
|
||||||
|
private Integer dockerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("接诊医生姓名")
|
||||||
|
private String dockerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("诊断详细数据")
|
||||||
|
private String diagnosisDetail;
|
||||||
|
|
||||||
|
@ApiModelProperty("诊断概况")
|
||||||
|
private String diagnosisSummary;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建日期")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
@ApiModelProperty("诊疗服务")
|
||||||
|
private List<MedicalRecordDetail> serviceDetail;
|
||||||
|
@ApiModelProperty("药品耗材")
|
||||||
|
private List<MedicalRecordDetail> goodsDetail;
|
||||||
|
}
|
||||||
|
|
@ -41,8 +41,17 @@ public class PatientRegistration implements Serializable {
|
||||||
@ApiModelProperty("医生id")
|
@ApiModelProperty("医生id")
|
||||||
private Integer organizationDoctorId;
|
private Integer organizationDoctorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty("就诊类型")
|
@ApiModelProperty("就诊类型")
|
||||||
private Integer visitType;
|
private Short visitType;
|
||||||
|
|
||||||
@ApiModelProperty("挂号时间")
|
@ApiModelProperty("挂号时间")
|
||||||
private LocalDateTime createDatetime;
|
private LocalDateTime createDatetime;
|
||||||
|
|
@ -65,6 +74,9 @@ public class PatientRegistration implements Serializable {
|
||||||
@ApiModelProperty("挂号类型")
|
@ApiModelProperty("挂号类型")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
@ApiModelProperty("病人id")
|
@ApiModelProperty("病人id")
|
||||||
private Integer patientInfoId;
|
private Integer patientInfoId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
package com.syjiaer.clinic.server.entity.patient.param;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class PatientRegistrationParam {
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ApiModelProperty("科室id")
|
|
||||||
private Integer organizationSectionId;
|
|
||||||
|
|
||||||
@ApiModelProperty("医生id")
|
|
||||||
private Integer organizationDoctorId;
|
|
||||||
|
|
||||||
@ApiModelProperty("患者姓名")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@ApiModelProperty("患者年龄")
|
|
||||||
private Integer age;
|
|
||||||
|
|
||||||
@ApiModelProperty("患者手机号")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@ApiModelProperty("就诊类型")
|
|
||||||
private Short visitType;
|
|
||||||
|
|
||||||
@ApiModelProperty("挂号时间")
|
|
||||||
private LocalDateTime createDatetime;
|
|
||||||
|
|
||||||
@ApiModelProperty("推荐")
|
|
||||||
private String recommendations;
|
|
||||||
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String memo;
|
|
||||||
|
|
||||||
@ApiModelProperty("预诊")
|
|
||||||
private String advanceDiagnosis;
|
|
||||||
|
|
||||||
@ApiModelProperty("挂号费")
|
|
||||||
private BigDecimal registrationMoney;
|
|
||||||
|
|
||||||
@ApiModelProperty("逻辑删除")
|
|
||||||
private Short delFlag;
|
|
||||||
|
|
||||||
@ApiModelProperty("挂号类型")
|
|
||||||
private Short type;
|
|
||||||
|
|
||||||
@ApiModelProperty("性别")
|
|
||||||
private String gender;
|
|
||||||
|
|
||||||
@ApiModelProperty("病人id")
|
|
||||||
private Integer patientInfoId;
|
|
||||||
|
|
||||||
@ApiModelProperty("挂号状态 1候诊 2在诊 3已诊 0取消")
|
|
||||||
private Integer status;
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.patient.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class PatientAndRegistrationInfoVo {
|
||||||
|
@ApiModelProperty("自增id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证号")
|
||||||
|
private String certno;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty("年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty("就诊次数")
|
||||||
|
private Integer visitCount;
|
||||||
|
@ApiModelProperty("上次就诊时间")
|
||||||
|
private LocalDateTime lastVisitTime;
|
||||||
|
@ApiModelProperty("挂号医生姓名")
|
||||||
|
private String dockerName;
|
||||||
|
@ApiModelProperty("挂号医生科室")
|
||||||
|
private String dockerSection;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.syjiaer.clinic.server.mapper.patient;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,7 +13,7 @@ import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
* @author NiuZiYuan
|
* @author NiuZiYuan
|
||||||
* @since 2025-04-10
|
* @since 2025-04-10
|
||||||
*/
|
*/
|
||||||
public interface RegistrationMapper extends BaseMapper<PatientRegistration> {
|
public interface PatientRegistrationMapper extends BaseMapper<PatientRegistration> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -24,7 +25,7 @@ public class GoodsCateService {
|
||||||
* 获取分类列表
|
* 获取分类列表
|
||||||
* 参数 type 分类类型
|
* 参数 type 分类类型
|
||||||
*/
|
*/
|
||||||
public List<GoodsCate> list(int type){
|
public List<GoodsCate> listByType(int type){
|
||||||
QueryWrapper<GoodsCate> queryWrapper=new QueryWrapper<>();
|
QueryWrapper<GoodsCate> queryWrapper=new QueryWrapper<>();
|
||||||
queryWrapper.eq("type",type);
|
queryWrapper.eq("type",type);
|
||||||
queryWrapper.orderByAsc("sort");
|
queryWrapper.orderByAsc("sort");
|
||||||
|
|
@ -33,7 +34,7 @@ public class GoodsCateService {
|
||||||
/*
|
/*
|
||||||
* 获取所有分类列表
|
* 获取所有分类列表
|
||||||
*/
|
*/
|
||||||
public Map<Integer,List<GoodsCate>> getAllList(){
|
public Map<Integer,List<GoodsCate>> listAll(){
|
||||||
List<GoodsCate> list=goodsCateMapper.selectList(new QueryWrapper<>());
|
List<GoodsCate> list=goodsCateMapper.selectList(new QueryWrapper<>());
|
||||||
return list.stream().collect(Collectors.groupingBy(GoodsCate::getType));
|
return list.stream().collect(Collectors.groupingBy(GoodsCate::getType));
|
||||||
}
|
}
|
||||||
|
|
@ -42,11 +43,25 @@ public class GoodsCateService {
|
||||||
* 参数 id 分类id
|
* 参数 id 分类id
|
||||||
*/
|
*/
|
||||||
public void del(int id){
|
public void del(int id){
|
||||||
|
GoodsCate goodsCate = goodsCateMapper.selectById(id);
|
||||||
goodsCateMapper.deleteById(id);
|
goodsCateMapper.deleteById(id);
|
||||||
UpdateWrapper<Goods> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<Goods> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.set("cate_id",-1);
|
|
||||||
updateWrapper.eq("cate_id",id);
|
updateWrapper.eq("cate_id",id);
|
||||||
|
updateWrapper.set("cate_id",-1);
|
||||||
goodsMapper.update(updateWrapper);
|
goodsMapper.update(updateWrapper);
|
||||||
|
//对所有该类型的分类重新设置sort
|
||||||
|
List<GoodsCate> goodsCateList = goodsCateMapper.selectList(new QueryWrapper<GoodsCate>()
|
||||||
|
.eq("type", goodsCate.getType()).orderByAsc("sort"));
|
||||||
|
List<GoodsCate> updateList = new ArrayList<>();
|
||||||
|
for (int i = 0 ; i< goodsCateList.size() ; i++){
|
||||||
|
GoodsCate updateItem = new GoodsCate();
|
||||||
|
updateItem.setId(goodsCateList.get(i).getId());
|
||||||
|
updateItem.setSort(i+1);
|
||||||
|
updateList.add(updateItem);
|
||||||
|
}
|
||||||
|
goodsCateMapper.updateById(updateList);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 保存/修改分类
|
* 保存/修改分类
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ public class GoodsService {
|
||||||
* 新建商品
|
* 新建商品
|
||||||
* @param goods 商品信息
|
* @param goods 商品信息
|
||||||
*/
|
*/
|
||||||
public void createGoods(Goods goods) {
|
public Goods createGoods(Goods goods) {
|
||||||
|
|
||||||
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel())) {
|
if (goods.getPricingModel().equals(GoodsPricingModelEnum.Bonus.getPricingModel())) {
|
||||||
//进价加成 更新固定售价
|
//进价加成 更新固定售价
|
||||||
goods.setUnitPrice(goods.getPurchaseUnitPrice()
|
goods.setUnitPrice(goods.getPurchaseUnitPrice()
|
||||||
|
|
@ -78,12 +79,17 @@ public class GoodsService {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return goods;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 重新初始化医保库存
|
* 重新初始化医保库存
|
||||||
*/
|
*/
|
||||||
public void returnInit(Goods goods) {
|
public void returnInit(Integer goodId) {
|
||||||
// todo 重新初始化医保库存
|
Goods goods = goodsMapper.selectById(goodId);
|
||||||
|
if (goods == null) {
|
||||||
|
throw new MessageException("商品不存在");
|
||||||
|
}
|
||||||
|
// 重新初始化医保库存
|
||||||
requestReturnInit(goods);
|
requestReturnInit(goods);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
@ -349,6 +355,9 @@ public class GoodsService {
|
||||||
* @return 商品
|
* @return 商品
|
||||||
*/
|
*/
|
||||||
public Goods getById(int goodsId) {
|
public Goods getById(int goodsId) {
|
||||||
|
if (goodsId <= 0) {
|
||||||
|
throw new MessageException("请输入ID");
|
||||||
|
}
|
||||||
return goodsMapper.selectById(goodsId);
|
return goodsMapper.selectById(goodsId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public class ItemGroupService extends BaseService {
|
||||||
private ItemMapper itemMapper;
|
private ItemMapper itemMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ItemGroupMapper itemGroupMapper;
|
private ItemGroupMapper itemGroupMapper;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 获取项目组列表
|
* 获取项目组列表
|
||||||
* @param pageNum 页码
|
* @param pageNum 页码
|
||||||
|
|
@ -38,6 +39,7 @@ public class ItemGroupService extends BaseService {
|
||||||
queryWrapper.eq("del_flag", false);
|
queryWrapper.eq("del_flag", false);
|
||||||
return pageHelper(pageNum, pageSize, queryWrapper, itemGroupMapper);
|
return pageHelper(pageNum, pageSize, queryWrapper, itemGroupMapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 获取项目组详情
|
* 获取项目组详情
|
||||||
* @param id 项目组id
|
* @param id 项目组id
|
||||||
|
|
@ -45,6 +47,7 @@ public class ItemGroupService extends BaseService {
|
||||||
public ItemGroup getItemGroupById(int id) {
|
public ItemGroup getItemGroupById(int id) {
|
||||||
return itemGroupMapper.selectById(id);
|
return itemGroupMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 保存/修改项目组
|
* 保存/修改项目组
|
||||||
* @param itemGroupParam 项目组参数
|
* @param itemGroupParam 项目组参数
|
||||||
|
|
@ -71,6 +74,7 @@ public class ItemGroupService extends BaseService {
|
||||||
ItemGroup itemGroup = getItemGroup(itemGroupParam);
|
ItemGroup itemGroup = getItemGroup(itemGroupParam);
|
||||||
itemGroupMapper.insert(itemGroup);
|
itemGroupMapper.insert(itemGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 生成项目组
|
* 生成项目组
|
||||||
* @param itemGroupParam 项目组参数
|
* @param itemGroupParam 项目组参数
|
||||||
|
|
@ -102,6 +106,7 @@ public class ItemGroupService extends BaseService {
|
||||||
itemGroup.setPurchaseUnitPrice(purchaseUnitPrice);
|
itemGroup.setPurchaseUnitPrice(purchaseUnitPrice);
|
||||||
return itemGroup;
|
return itemGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 删除项目组
|
* 删除项目组
|
||||||
* @param id 项目组id
|
* @param id 项目组id
|
||||||
|
|
@ -114,4 +119,5 @@ public class ItemGroupService extends BaseService {
|
||||||
itemGroup.setDelFlag(true);
|
itemGroup.setDelFlag(true);
|
||||||
itemGroupMapper.updateById(itemGroup);
|
itemGroupMapper.updateById(itemGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ItemService extends BaseService {
|
public class ItemService extends BaseService {
|
||||||
|
|
@ -24,7 +26,7 @@ public class ItemService extends BaseService {
|
||||||
* @param name 项目名称
|
* @param name 项目名称
|
||||||
* @param tel 手机号
|
* @param tel 手机号
|
||||||
*/
|
*/
|
||||||
public Page<Item> getItemList(int pageNum, int pageSize, String name, String tel) {
|
public Page<Item> getPageList(int pageNum, int pageSize, String name, String tel) {
|
||||||
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
|
||||||
if (name != null && !name.isEmpty()) {
|
if (name != null && !name.isEmpty()) {
|
||||||
queryWrapper.like("name", name);
|
queryWrapper.like("name", name);
|
||||||
|
|
@ -33,7 +35,7 @@ public class ItemService extends BaseService {
|
||||||
queryWrapper.eq("tel", tel);
|
queryWrapper.eq("tel", tel);
|
||||||
}
|
}
|
||||||
queryWrapper.eq("del_flag", 0);
|
queryWrapper.eq("del_flag", 0);
|
||||||
return pageHelper(pageNum, pageSize, queryWrapper, itemMapper);
|
return pageHelper(pageNum, pageSize, queryWrapper, itemMapper,"create_datetime",false);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 根据id获取项目信息
|
* 根据id获取项目信息
|
||||||
|
|
@ -67,4 +69,24 @@ public class ItemService extends BaseService {
|
||||||
item.setUpdateDatetime(LocalDateTime.now());
|
item.setUpdateDatetime(LocalDateTime.now());
|
||||||
itemMapper.updateById(item);
|
itemMapper.updateById(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void del(Integer id) {
|
||||||
|
if (id == null) {
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
|
Item item = itemMapper.selectById(id);
|
||||||
|
if (item == null || item.getDelFlag() == 1) {
|
||||||
|
throw new MessageException("该服务项目已被删除或不存在");
|
||||||
|
}
|
||||||
|
Item updateItem = new Item();
|
||||||
|
updateItem.setId(id);
|
||||||
|
updateItem.setDelFlag(1);
|
||||||
|
itemMapper.updateById(updateItem);
|
||||||
|
}
|
||||||
|
public List<Item> search(String keyword){
|
||||||
|
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.like("item_name", keyword);
|
||||||
|
queryWrapper.last("limit 20");
|
||||||
|
return itemMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package com.syjiaer.clinic.server.service.medical;
|
|
||||||
|
|
||||||
public class MedicalRecordDetailService {
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +1,22 @@
|
||||||
package com.syjiaer.clinic.server.service.medical;
|
package com.syjiaer.clinic.server.service.medical;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.syjiaer.clinic.server.common.enums.MedicalRecordDetailTypeEnum;
|
import com.syjiaer.clinic.server.common.enums.MedicalRecordDetailTypeEnum;
|
||||||
import com.syjiaer.clinic.server.entity.goods.Goods;
|
import com.syjiaer.clinic.server.entity.goods.Goods;
|
||||||
import com.syjiaer.clinic.server.entity.item.Item;
|
import com.syjiaer.clinic.server.entity.item.Item;
|
||||||
|
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||||
import com.syjiaer.clinic.server.entity.medical.MedicalRecord;
|
import com.syjiaer.clinic.server.entity.medical.MedicalRecord;
|
||||||
import com.syjiaer.clinic.server.entity.medical.MedicalRecordDetail;
|
import com.syjiaer.clinic.server.entity.medical.MedicalRecordDetail;
|
||||||
|
import com.syjiaer.clinic.server.entity.medical.dto.GoodsRetailDto;
|
||||||
import com.syjiaer.clinic.server.entity.medical.dto.MedicalRecordSaveDto;
|
import com.syjiaer.clinic.server.entity.medical.dto.MedicalRecordSaveDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.medical.dto.MedicalRecordVo;
|
||||||
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.medical.MedicalRecordDetailMapper;
|
import com.syjiaer.clinic.server.mapper.medical.MedicalRecordDetailMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.medical.MedicalRecordMapper;
|
import com.syjiaer.clinic.server.mapper.medical.MedicalRecordMapper;
|
||||||
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import com.syjiaer.clinic.server.service.goods.GoodsService;
|
||||||
|
import com.syjiaer.clinic.server.service.item.ItemService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -19,47 +26,112 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MedicalRecordService {
|
public class MedicalRecordService extends BaseService {
|
||||||
@Autowired
|
|
||||||
private ItemMapper itemMapper;
|
|
||||||
@Autowired
|
|
||||||
private GoodsMapper goodsMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordMapper medicalRecordMapper;
|
private MedicalRecordMapper medicalRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MedicalRecordDetailMapper medicalRecordDetailMapper;
|
private MedicalRecordDetailMapper medicalRecordDetailMapper;
|
||||||
|
@Autowired
|
||||||
|
private ItemMapper itemMapper;
|
||||||
|
@Autowired
|
||||||
|
private GoodsMapper goodsMapper;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 保存
|
* 保存
|
||||||
* @param saveDto 病历信息
|
* @param saveDto 病历信息
|
||||||
*/
|
*/
|
||||||
public void save(MedicalRecordSaveDto saveDto) {
|
public void save(MedicalRecordSaveDto saveDto) {
|
||||||
|
ManagerUser managerUser = getManagerUser();
|
||||||
MedicalRecord medicalRecord = new MedicalRecord();
|
MedicalRecord medicalRecord = new MedicalRecord();
|
||||||
BeanUtils.copyProperties(saveDto, medicalRecord);
|
BeanUtils.copyProperties(saveDto, medicalRecord);
|
||||||
|
medicalRecord.setDockerId(managerUser.getId());
|
||||||
|
medicalRecord.setDockerName(managerUser.getName());
|
||||||
|
medicalRecordMapper.insert(medicalRecord);
|
||||||
|
Integer medicalRecordId = medicalRecord.getId();
|
||||||
List<MedicalRecordDetail> detailList = new ArrayList<>();
|
List<MedicalRecordDetail> detailList = new ArrayList<>();
|
||||||
for (Integer id : saveDto.getItemList()){
|
|
||||||
Item dbItem = itemMapper.selectById(id);
|
for (Item item : saveDto.getItemList()) {
|
||||||
|
Item dbItem = itemMapper.selectById(item.getId());
|
||||||
MedicalRecordDetail detail = new MedicalRecordDetail();
|
MedicalRecordDetail detail = new MedicalRecordDetail();
|
||||||
detail.setProjectId(id);
|
detail.setMedicalRecordId(medicalRecordId);
|
||||||
|
detail.setProjectId(item.getId());
|
||||||
detail.setProjectName(dbItem.getItemName());
|
detail.setProjectName(dbItem.getItemName());
|
||||||
detail.setProjectSocialCode(dbItem.getItemSocialCode());
|
detail.setProjectSocialCode(dbItem.getItemSocialCode());
|
||||||
detail.setProjectUnit(dbItem.getUnit());
|
detail.setProjectUnit(dbItem.getUnit());
|
||||||
detail.setProjectUnitPrice(dbItem.getUnitPrice());
|
detail.setProjectUnitPrice(dbItem.getUnitPrice());
|
||||||
detail.setType(MedicalRecordDetailTypeEnum.item.getType());
|
detail.setType(MedicalRecordDetailTypeEnum.item.getType());
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
|
|
||||||
}
|
}
|
||||||
for (Map.Entry<Integer,Integer> itemMap : saveDto.getGoodsMap().entrySet()){
|
for (GoodsRetailDto goodsRetailDto : saveDto.getGoodsList()) {
|
||||||
Goods dbGoods = goodsMapper.selectById(itemMap.getKey());
|
Goods dbGoods = goodsMapper.selectById(goodsRetailDto.getId());
|
||||||
MedicalRecordDetail detail = new MedicalRecordDetail();
|
MedicalRecordDetail detail = new MedicalRecordDetail();
|
||||||
detail.setProjectId(itemMap.getKey());
|
detail.setMedicalRecordId(medicalRecordId);
|
||||||
|
detail.setProjectId(goodsRetailDto.getId());
|
||||||
detail.setProjectName(dbGoods.getName());
|
detail.setProjectName(dbGoods.getName());
|
||||||
detail.setProjectSocialCode(dbGoods.getHilistCode());
|
detail.setProjectSocialCode(dbGoods.getHilistCode());
|
||||||
detail.setProjectUnit(dbGoods.getPackagingUnit());
|
detail.setProjectUnit(goodsRetailDto.getSelectedUnit());
|
||||||
detail.setProjectUnitPrice(dbGoods.getUnitPrice());
|
detail.setProjectUnitPrice(goodsRetailDto.getSelectedPrice());
|
||||||
detail.setType(MedicalRecordDetailTypeEnum.goods.getType());
|
detail.setType(MedicalRecordDetailTypeEnum.goods.getType());
|
||||||
detail.setNumber(itemMap.getValue());
|
detail.setNumber(goodsRetailDto.getSelectNum());
|
||||||
detailList.add(detail);
|
detailList.add(detail);
|
||||||
}
|
}
|
||||||
medicalRecordMapper.insert(medicalRecord);
|
|
||||||
medicalRecordDetailMapper.insert(detailList);
|
medicalRecordDetailMapper.insert(detailList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据患者的id查询病历
|
||||||
|
* @param patientId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<MedicalRecordVo> listByPatientId(Integer patientId) {
|
||||||
|
QueryWrapper<MedicalRecord> query = new QueryWrapper<>();
|
||||||
|
query.eq("patient_id", patientId);
|
||||||
|
query.orderByDesc("create_datetime");
|
||||||
|
query.last("limit 10");
|
||||||
|
List<MedicalRecord> mrList = medicalRecordMapper.selectList(query);
|
||||||
|
List<MedicalRecordVo> mrvList = new ArrayList<>();
|
||||||
|
for (MedicalRecord medicalRecord : mrList) {
|
||||||
|
QueryWrapper<MedicalRecordDetail> severQuery = new QueryWrapper<>();
|
||||||
|
MedicalRecordVo vo = new MedicalRecordVo();
|
||||||
|
BeanUtils.copyProperties(medicalRecord, vo);
|
||||||
|
severQuery.eq("medical_record_id", medicalRecord.getId());
|
||||||
|
severQuery.eq("type", 1);
|
||||||
|
List<MedicalRecordDetail> serverDetail = medicalRecordDetailMapper.selectList(severQuery);
|
||||||
|
vo.setServiceDetail(serverDetail);
|
||||||
|
QueryWrapper<MedicalRecordDetail> goodsQuery = new QueryWrapper<>();
|
||||||
|
severQuery.eq("medical_record_id", medicalRecord.getId());
|
||||||
|
severQuery.eq("type", 2);
|
||||||
|
List<MedicalRecordDetail> goodsDetail = medicalRecordDetailMapper.selectList(goodsQuery);
|
||||||
|
vo.setGoodsDetail(goodsDetail);
|
||||||
|
mrvList.add(vo);
|
||||||
|
}
|
||||||
|
return mrvList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据挂单号回显病历信息
|
||||||
|
* @param regisId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public MedicalRecordVo getDetailByRegisId(Integer regisId) {
|
||||||
|
QueryWrapper<MedicalRecord> query = new QueryWrapper<>();
|
||||||
|
query.eq("registration_id", regisId);
|
||||||
|
|
||||||
|
MedicalRecord mr = medicalRecordMapper.selectOne(query);
|
||||||
|
QueryWrapper<MedicalRecordDetail> severQuery = new QueryWrapper<>();
|
||||||
|
MedicalRecordVo vo = new MedicalRecordVo();
|
||||||
|
BeanUtils.copyProperties(mr, vo);
|
||||||
|
severQuery.eq("medical_record_id", mr.getId());
|
||||||
|
severQuery.eq("type", 1);
|
||||||
|
List<MedicalRecordDetail> serverDetail = medicalRecordDetailMapper.selectList(severQuery);
|
||||||
|
vo.setServiceDetail(serverDetail);
|
||||||
|
QueryWrapper<MedicalRecordDetail> goodsQuery = new QueryWrapper<>();
|
||||||
|
goodsQuery.eq("medical_record_id", mr.getId());
|
||||||
|
goodsQuery.eq("type", 2);
|
||||||
|
List<MedicalRecordDetail> goodsDetail = medicalRecordDetailMapper.selectList(goodsQuery);
|
||||||
|
vo.setGoodsDetail(goodsDetail);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,14 @@ package com.syjiaer.clinic.server.service.organization;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.util.FileUtil;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.common.vo.Result;
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -16,9 +19,12 @@ import java.util.List;
|
||||||
* 组织成员
|
* 组织成员
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class OrganizationMemberService extends BaseService {
|
public class OrganizationMemberService extends BaseService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrganizationMemberMapper organizationMemberMapper;
|
private OrganizationMemberMapper organizationMemberMapper;
|
||||||
|
@Autowired
|
||||||
|
private FileUtil fileUtil;
|
||||||
/*
|
/*
|
||||||
* 获取成员列表
|
* 获取成员列表
|
||||||
* @param pageNum 页码
|
* @param pageNum 页码
|
||||||
|
|
@ -26,7 +32,7 @@ public class OrganizationMemberService extends BaseService {
|
||||||
* @param name 姓名
|
* @param name 姓名
|
||||||
* @param tel 电话
|
* @param tel 电话
|
||||||
*/
|
*/
|
||||||
public Page<OrganizationMember> list(int pageNum, int pageSize, String name, String tel) {
|
public Page<OrganizationMember> listPage(int pageNum, int pageSize, String name, String tel) {
|
||||||
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
||||||
if (name != null && !name.isEmpty()) {
|
if (name != null && !name.isEmpty()) {
|
||||||
queryWrapper.like("name", name);
|
queryWrapper.like("name", name);
|
||||||
|
|
@ -49,6 +55,12 @@ public class OrganizationMemberService extends BaseService {
|
||||||
organizationMember.setCreateDatetime(LocalDateTime.now());
|
organizationMember.setCreateDatetime(LocalDateTime.now());
|
||||||
organizationMemberMapper.insertOrUpdate(organizationMember);
|
organizationMemberMapper.insertOrUpdate(organizationMember);
|
||||||
}
|
}
|
||||||
|
public void edit(OrganizationMember organizationMember) {
|
||||||
|
if(organizationMember ==null){
|
||||||
|
throw new MessageException("data参数为空");
|
||||||
|
}
|
||||||
|
organizationMemberMapper.updateById(organizationMember);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* 删除成员信息
|
* 删除成员信息
|
||||||
* @param id 成员id
|
* @param id 成员id
|
||||||
|
|
@ -56,20 +68,30 @@ public class OrganizationMemberService extends BaseService {
|
||||||
public void delete(int id) {
|
public void delete(int id) {
|
||||||
OrganizationMember organizationMember = organizationMemberMapper.selectById(id);
|
OrganizationMember organizationMember = organizationMemberMapper.selectById(id);
|
||||||
if (organizationMember == null) {
|
if (organizationMember == null) {
|
||||||
throw new MessageException("id不存在");
|
throw new MessageException("该成员不存在");
|
||||||
|
}
|
||||||
|
OrganizationMember updateMember = new OrganizationMember();
|
||||||
|
updateMember.setId(id);
|
||||||
|
updateMember.setDelFlag(true);
|
||||||
|
organizationMemberMapper.updateById(updateMember);
|
||||||
|
try {
|
||||||
|
fileUtil.deleteImage(organizationMember.getElectronicSignature());
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
log.error("删除电子签名文件失败", e);
|
||||||
}
|
}
|
||||||
organizationMember.setDelFlag(true);
|
|
||||||
organizationMemberMapper.updateById(organizationMember);
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 根据id获取成员信息
|
* 根据id获取成员信息
|
||||||
* @param id 成员id
|
* @param id 成员id
|
||||||
*/
|
*/
|
||||||
public OrganizationMember get(int id) {
|
public OrganizationMember get(int id) {
|
||||||
|
if(id <= 0){
|
||||||
|
throw new MessageException("id参数为空");
|
||||||
|
}
|
||||||
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("del_flag", false).eq("id", id);
|
queryWrapper.eq("del_flag", false).eq("id", id);
|
||||||
OrganizationMember organizationMember = organizationMemberMapper.selectOne(queryWrapper);
|
return organizationMemberMapper.selectOne(queryWrapper);
|
||||||
return organizationMember;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 获取医生列表
|
* 获取医生列表
|
||||||
|
|
@ -78,7 +100,6 @@ public class OrganizationMemberService extends BaseService {
|
||||||
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("role", 0)
|
queryWrapper.eq("role", 0)
|
||||||
.eq("del_flag", false);
|
.eq("del_flag", false);
|
||||||
List<OrganizationMember> organizationMembers = organizationMemberMapper.selectList(queryWrapper);
|
return organizationMemberMapper.selectList(queryWrapper);
|
||||||
return organizationMembers;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.syjiaer.clinic.server.service.organization;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.config.Config;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.util.StringUtil;
|
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
|
@ -11,6 +12,7 @@ import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -25,7 +27,19 @@ public class OrganizationSectionService extends BaseService {
|
||||||
private StringUtil stringUtil;
|
private StringUtil stringUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrganizationSectionMapper organizationSectionMapper;
|
private OrganizationSectionMapper organizationSectionMapper;
|
||||||
|
@Autowired
|
||||||
|
private Config config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询科室
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @param name
|
||||||
|
* @param caty
|
||||||
|
* @param resperName
|
||||||
|
* @param resperTel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Page<OrganizationSection> list(int pageNum, int pageSize, String name, String caty, String resperName, String resperTel) {
|
public Page<OrganizationSection> list(int pageNum, int pageSize, String name, String caty, String resperName, String resperTel) {
|
||||||
QueryWrapper<OrganizationSection> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrganizationSection> queryWrapper = new QueryWrapper<>();
|
||||||
if (name != null && !name.isEmpty()) {
|
if (name != null && !name.isEmpty()) {
|
||||||
|
|
@ -45,25 +59,99 @@ public class OrganizationSectionService extends BaseService {
|
||||||
return pageResult;
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(OrganizationSection organizationSection) {
|
/**
|
||||||
if (organizationSection == null) {
|
* 添加科室
|
||||||
throw new MessageException("organizationSection参数为空");
|
* @param organizationSection
|
||||||
|
*/
|
||||||
|
public void add(OrganizationSection organizationSection) {
|
||||||
|
String socialInsuplcAdmdvs = config.get("social", "insuplcAdmdvs");
|
||||||
|
long count = organizationSectionMapper.selectCount(new QueryWrapper<OrganizationSection>().eq("code", organizationSection.getCode()));
|
||||||
|
if (count > 0) {
|
||||||
|
throw new MessageException("科室编码重复");
|
||||||
}
|
}
|
||||||
if (organizationSection.getId() == null) {
|
|
||||||
organizationSection.setCreateDatetime(LocalDateTime.now());
|
organizationSection.setCreateDatetime(LocalDateTime.now());
|
||||||
//生成编码
|
String caty = organizationSection.getCaty();
|
||||||
organizationSection.setCode(stringUtil.getCode("S"));
|
String processing = getString(caty);
|
||||||
}
|
organizationSection.setCaty(processing);
|
||||||
organizationSectionMapper.insertOrUpdate(organizationSection);
|
organizationSectionMapper.insert(organizationSection);
|
||||||
}
|
// try {
|
||||||
public void delete(int id) {
|
// socialRequest.call3401(new com.syjiaer.clinic.server.modules.social.api.input.IM3401()
|
||||||
QueryWrapper<OrganizationSection> queryWrapper = new QueryWrapper<>();
|
// .setHospDeptCodg(organizationSection.getCode())
|
||||||
queryWrapper.eq("del_flag", 0).eq("id", id);
|
// .setHospDeptName(organizationSection.getName())
|
||||||
OrganizationSection organizationSection = organizationSectionMapper.selectOne(queryWrapper);
|
// .setCaty(organizationSection.getCaty())
|
||||||
if(organizationSection == null){
|
// .setBegntime(organizationSection.getBeginDate())
|
||||||
throw new MessageException("id不存在");
|
// .setEndtime(organizationSection.getEndDate())
|
||||||
|
// .setItro(organizationSection.getInfo())
|
||||||
|
// .setDeptResperName(organizationSection.getResperName())
|
||||||
|
// .setDeptResperTel(organizationSection.getResperTel())
|
||||||
|
// .setDeptMedServScp(organizationSection.getMedServScp())
|
||||||
|
// .setDeptEstbdat(organizationSection.getCreationDate())
|
||||||
|
// .setAprvBedCnt(organizationSection.getBedCnt())
|
||||||
|
// .setHiCrtfBedCnt(organizationSection.getSocialBedCnt())
|
||||||
|
// .setPoolareaNo(social_insuplcAdmdvs)
|
||||||
|
// .setDrPsncnt(organizationSection.getDrPsncnt())
|
||||||
|
// .setPharPsncnt(organizationSection.getPharPsncnt())
|
||||||
|
// .setNursPsncnt(organizationSection.getNursPsncnt())
|
||||||
|
// .setTecnPsncnt(organizationSection.getTecnPsncnt())
|
||||||
|
// .setMemo(organizationSection.getMemo()));
|
||||||
|
// } catch (MessageException messageException) {
|
||||||
|
// log.error("科室添加失败", messageException);
|
||||||
|
// throw new MessageException("科室添加失败");
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Transactional
|
||||||
|
public void edit(OrganizationSection organizationSection) {
|
||||||
|
String caty = organizationSection.getCaty();
|
||||||
|
String processing = getString(caty);
|
||||||
|
organizationSection.setCaty(processing);
|
||||||
organizationSectionMapper.updateById(organizationSection);
|
organizationSectionMapper.updateById(organizationSection);
|
||||||
|
// try {
|
||||||
|
// socialRequest.call3402(new com.syjiaer.clinic.server.modules.social.api.input.IM3402()
|
||||||
|
// .setHospDeptCodg(organizationSection.getCode())
|
||||||
|
// .setHospDeptName(organizationSection.getName())
|
||||||
|
// .setBegntime(organizationSection.getBeginDate())
|
||||||
|
// .setEndtime(organizationSection.getEndDate())
|
||||||
|
// .setItro(organizationSection.getInfo())
|
||||||
|
// .setDeptResperName(organizationSection.getResperName())
|
||||||
|
// .setDeptResperTel(organizationSection.getResperTel())
|
||||||
|
// .setDeptMedServScp(organizationSection.getMedServScp())
|
||||||
|
// .setCaty(organizationSection.getCaty())
|
||||||
|
// .setDeptEstbdat(organizationSection.getCreationDate())
|
||||||
|
// .setAprvBedCnt(organizationSection.getBedCnt())
|
||||||
|
// .setHiCrtfBedCnt(organizationSection.getSocialBedCnt())
|
||||||
|
// .setDrPsncnt(organizationSection.getDrPsncnt())
|
||||||
|
// .setPharPsncnt(organizationSection.getPharPsncnt())
|
||||||
|
// .setNursPsncnt(organizationSection.getNursPsncnt())
|
||||||
|
// .setTecnPsncnt(organizationSection.getTecnPsncnt())
|
||||||
|
// .setMemo(organizationSection.getMemo())
|
||||||
|
// );
|
||||||
|
// } catch (MessageException messageException) {
|
||||||
|
// log.error("科室修改失败", messageException);
|
||||||
|
// throw new MessageException("科室修改失败");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void delete(Integer id) {
|
||||||
|
OrganizationSection organizationSection = organizationSectionMapper.selectById(id);
|
||||||
|
if (organizationSection == null){
|
||||||
|
throw new MessageException("科室不存在");
|
||||||
|
}
|
||||||
|
organizationSection.setDelFlag(1);
|
||||||
|
organizationSectionMapper.updateById(organizationSection);
|
||||||
|
// try {
|
||||||
|
// socialRequest.call3403(new com.syjiaer.clinic.server.modules.social.api.input.IM3403()
|
||||||
|
// .setHospDeptCodg(organizationSection.getCode())
|
||||||
|
// .setHospDeptName(organizationSection.getName())
|
||||||
|
// .setBegntime(organizationSection.getBeginDate())
|
||||||
|
// );
|
||||||
|
// } catch (MessageException messageException) {
|
||||||
|
// log.error("科室删除失败", messageException);
|
||||||
|
// throw new MessageException("科室删除失败");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
public OrganizationSection get(int id) {
|
public OrganizationSection get(int id) {
|
||||||
QueryWrapper<OrganizationSection> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<OrganizationSection> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
@ -83,4 +171,27 @@ public class OrganizationSectionService extends BaseService {
|
||||||
}).toList();
|
}).toList();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getString(String caty) {
|
||||||
|
if (caty.contains("[")) {
|
||||||
|
String substring = caty.substring(1, caty.length() - 1).replace("\"", "");
|
||||||
|
String[] split = substring.split(",");
|
||||||
|
caty = split[split.length - 1];
|
||||||
|
}
|
||||||
|
return caty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JSONObject> getAllList() {
|
||||||
|
QueryWrapper<OrganizationSection> organizationSectionQueryWrapper = new QueryWrapper<>();
|
||||||
|
organizationSectionQueryWrapper.eq("del_flag", 0);
|
||||||
|
List<OrganizationSection> organizationSections = organizationSectionMapper.selectList(organizationSectionQueryWrapper);
|
||||||
|
List<JSONObject> list = organizationSections.stream().map(organizationSection -> {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("id", organizationSection.getId());
|
||||||
|
jsonObject.put("name", organizationSection.getName());
|
||||||
|
return jsonObject;
|
||||||
|
}).toList();
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,25 @@
|
||||||
package com.syjiaer.clinic.server.service.patient;
|
package com.syjiaer.clinic.server.service.patient;
|
||||||
|
|
||||||
public class PatientInfoService {
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
||||||
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
@Service
|
||||||
|
public class PatientInfoService extends BaseService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,215 @@
|
||||||
|
package com.syjiaer.clinic.server.service.patient;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.util.DateUtil;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
||||||
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
||||||
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂号服务
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PatientRegistrationService extends BaseService {
|
||||||
|
@Autowired
|
||||||
|
private PatientRegistrationMapper patientRegistrationMapper;
|
||||||
|
@Autowired
|
||||||
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private OrganizationMemberMapper organizationMemberMapper;
|
||||||
|
@Autowired
|
||||||
|
private OrganizationSectionMapper organizationSectionMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 挂号
|
||||||
|
* @param patientRegistrationParam 挂号信息
|
||||||
|
*/
|
||||||
|
public void registration(PatientRegistration registrationParam) {
|
||||||
|
//TODO 挂号和患者 记录身份证号非必填
|
||||||
|
if (registrationParam == null) {
|
||||||
|
throw new MessageException("data参数为空");
|
||||||
|
}
|
||||||
|
PatientRegistration registration = new PatientRegistration();
|
||||||
|
BeanUtils.copyProperties(registrationParam, registration);
|
||||||
|
registration.setRegistrationMoney(new BigDecimal("0"));
|
||||||
|
registration.setCreateDatetime(LocalDateTime.now());
|
||||||
|
registration.setType(1);
|
||||||
|
registration.setStatus(1);
|
||||||
|
|
||||||
|
//将患者添加到患者表
|
||||||
|
|
||||||
|
PatientInfo patientInfo = new PatientInfo();
|
||||||
|
patientInfo.setName(registrationParam.getName());
|
||||||
|
patientInfo.setPhone(registrationParam.getPhone());
|
||||||
|
patientInfo.setSex(registrationParam.getGender());
|
||||||
|
patientInfo.setAge(registrationParam.getAge());
|
||||||
|
|
||||||
|
QueryWrapper<PatientInfo> patientInfoQuery = new QueryWrapper<>();
|
||||||
|
patientInfoQuery.eq("phone", registrationParam.getPhone());
|
||||||
|
List<PatientInfo> patientInfoList = patientInfoMapper.selectList(patientInfoQuery);
|
||||||
|
if (patientInfoList.isEmpty()) {
|
||||||
|
patientInfoMapper.insert(patientInfo);
|
||||||
|
} else {
|
||||||
|
patientInfo.setId(patientInfoList.get(0).getId());
|
||||||
|
patientInfoMapper.updateById(patientInfo);
|
||||||
|
}
|
||||||
|
registration.setPatientInfoId(patientInfo.getId());
|
||||||
|
patientRegistrationMapper.insert(registration);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 挂号列表
|
||||||
|
* @param pageNum 页码
|
||||||
|
* @param pageSize 每页数量
|
||||||
|
* @param date 日期
|
||||||
|
*/
|
||||||
|
public Page<PatientRegistration> list(int pageNum, int pageSize, String date) {
|
||||||
|
if (date == null || date.isEmpty()) {
|
||||||
|
date = LocalDate.now().toString();
|
||||||
|
}
|
||||||
|
String startDate = date + " 00:00:00";
|
||||||
|
String endDate = date + " 23:59:59";
|
||||||
|
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
||||||
|
//查询条件
|
||||||
|
queryWrapper.between("create_datetime", DateUtil.getDateTime(startDate), DateUtil.getDateTime(endDate));
|
||||||
|
queryWrapper.eq("del_flag", 0);
|
||||||
|
Page<PatientRegistration> pageResult = pageHelper(pageNum, pageSize, queryWrapper, patientRegistrationMapper);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 删除挂号信息
|
||||||
|
* @param id 挂号id
|
||||||
|
*/
|
||||||
|
public void delete(int id) {
|
||||||
|
PatientRegistration patientRegistration = patientRegistrationMapper.selectById(id);
|
||||||
|
if (patientRegistration == null) {
|
||||||
|
throw new MessageException("id不存在");
|
||||||
|
}
|
||||||
|
patientRegistration.setDelFlag(1);
|
||||||
|
patientRegistrationMapper.updateById(patientRegistration);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 根据id查询挂号信息
|
||||||
|
* @param id 挂号id
|
||||||
|
*/
|
||||||
|
public PatientRegistration getById(int id) {
|
||||||
|
return patientRegistrationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 获取所有已删除挂号信息
|
||||||
|
* @param id 挂号id
|
||||||
|
*/
|
||||||
|
public List<PatientRegistration> allList() {
|
||||||
|
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("del_flag", 1);
|
||||||
|
List<PatientRegistration> list = patientRegistrationMapper.selectList(queryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* 根据查询条件查询挂号信息
|
||||||
|
* @param query 查询条件
|
||||||
|
*/
|
||||||
|
public Page<PatientRegistration> getPageByType(RegistrationQuery query) {
|
||||||
|
QueryWrapper<PatientRegistration> regisQuery = new QueryWrapper<>();
|
||||||
|
regisQuery.eq("del_flag", 0);
|
||||||
|
regisQuery.orderByAsc("create_datetime");
|
||||||
|
if (query.getStatus() != null) {
|
||||||
|
regisQuery.eq("status", query.getStatus());
|
||||||
|
}
|
||||||
|
if (query.getKeyword() != null) {
|
||||||
|
regisQuery.like("name", query.getKeyword());
|
||||||
|
regisQuery.or().like("phone", query.getKeyword());
|
||||||
|
}
|
||||||
|
if (query.getPageNum() == null) {
|
||||||
|
query.setPageNum(1);
|
||||||
|
}
|
||||||
|
if (query.getPageSize() == null) {
|
||||||
|
query.setPageSize(Constants.DetailPageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pageHelper(query.getPageNum(), query.getPageSize(), regisQuery, patientRegistrationMapper,"create_datetime",false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按时间范围分页查询挂号信息
|
||||||
|
* @param page
|
||||||
|
* @param size
|
||||||
|
* @param date
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
public Page<PatientRegistration> listPage(int page, int size, String date) {
|
||||||
|
if (date == null || date.isEmpty()) {
|
||||||
|
date = LocalDate.now().toString();
|
||||||
|
}
|
||||||
|
String startDate = date + " 00:00:00";
|
||||||
|
String endDate = date + " 23:59:59";
|
||||||
|
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
||||||
|
//查询条件
|
||||||
|
queryWrapper.between("create_datetime", DateUtil.getDateTime(startDate), DateUtil.getDateTime(endDate));
|
||||||
|
queryWrapper.eq("del_flag", 0);
|
||||||
|
return pageHelper(page, size, queryWrapper, patientRegistrationMapper,"create_datetime",false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PatientRegistration> listAll() {
|
||||||
|
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("del_flag", 1);
|
||||||
|
return patientRegistrationMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateById(PatientRegistration registration) {
|
||||||
|
patientRegistrationMapper.updateById(registration);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据挂号id 查询挂号详细信息
|
||||||
|
* @param regisId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PatientAndRegistrationInfoVo getDetailById(Integer regisId) {
|
||||||
|
|
||||||
|
PatientRegistration registration = patientRegistrationMapper.selectById(regisId);
|
||||||
|
|
||||||
|
PatientInfo patientInfo = patientInfoMapper.selectById(registration.getPatientInfoId());
|
||||||
|
PatientAndRegistrationInfoVo vo = new PatientAndRegistrationInfoVo();
|
||||||
|
if (patientInfo!=null){
|
||||||
|
BeanUtils.copyProperties(patientInfo,vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
OrganizationMember docker = organizationMemberMapper.selectById(registration.getOrganizationDoctorId());
|
||||||
|
vo.setDockerName(docker.getName());
|
||||||
|
OrganizationSection section = organizationSectionMapper.selectById(docker.getSectionId());
|
||||||
|
vo.setDockerSection(section.getName());
|
||||||
|
|
||||||
|
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("patient_info_id",registration.getPatientInfoId());
|
||||||
|
queryWrapper.eq("status",3);
|
||||||
|
queryWrapper.orderByDesc("create_datetime");
|
||||||
|
List<PatientRegistration> PatientRegislist = patientRegistrationMapper.selectList(queryWrapper);
|
||||||
|
if (!PatientRegislist.isEmpty()){
|
||||||
|
vo.setLastVisitTime(PatientRegislist.get(0).getCreateDatetime());
|
||||||
|
vo.setVisitCount(PatientRegislist.size());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,141 +0,0 @@
|
||||||
package com.syjiaer.clinic.server.service.patient;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.syjiaer.clinic.server.common.constants.Constants;
|
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
|
||||||
import com.syjiaer.clinic.server.common.util.DateUtil;
|
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
|
||||||
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
|
||||||
import com.syjiaer.clinic.server.entity.patient.param.PatientRegistrationParam;
|
|
||||||
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
|
||||||
import com.syjiaer.clinic.server.mapper.patient.RegistrationMapper;
|
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 挂号服务
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class RegistrationService extends BaseService {
|
|
||||||
@Autowired
|
|
||||||
private RegistrationMapper registrationMapper;
|
|
||||||
@Autowired
|
|
||||||
private PatientInfoMapper patientInfoMapper;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 挂号
|
|
||||||
* @param patientRegistrationParam 挂号信息
|
|
||||||
*/
|
|
||||||
public void registration(PatientRegistrationParam patientRegistrationParam) {
|
|
||||||
//TODO 挂号和患者 记录身份证号非必填
|
|
||||||
PatientRegistration patientRegistration = new PatientRegistration();
|
|
||||||
BeanUtils.copyProperties(patientRegistrationParam, patientRegistration);
|
|
||||||
if (patientRegistrationParam.getId() == null) {
|
|
||||||
patientRegistration.setRegistrationMoney(new BigDecimal("0"));
|
|
||||||
patientRegistration.setCreateDatetime(LocalDateTime.now());
|
|
||||||
patientRegistration.setType(1);
|
|
||||||
patientRegistration.setStatus(1);
|
|
||||||
registrationMapper.insert(patientRegistration);
|
|
||||||
}else {
|
|
||||||
registrationMapper.updateById(patientRegistration);
|
|
||||||
}
|
|
||||||
//将患者添加到患者表
|
|
||||||
QueryWrapper<PatientInfo> patientInfoQuery = new QueryWrapper<>();
|
|
||||||
patientInfoQuery.eq("phone", patientRegistrationParam.getPhone());
|
|
||||||
PatientInfo patientInfo = new PatientInfo();
|
|
||||||
patientInfo.setName(patientRegistrationParam.getName());
|
|
||||||
patientInfo.setPhone(patientRegistrationParam.getPhone());
|
|
||||||
patientInfo.setSex(patientRegistrationParam.getGender());
|
|
||||||
patientInfo.setAge(patientRegistrationParam.getAge());
|
|
||||||
List<PatientInfo> patientInfoList = patientInfoMapper.selectList(patientInfoQuery);
|
|
||||||
if (patientInfoList.isEmpty()) {
|
|
||||||
patientInfoMapper.insert(patientInfo);
|
|
||||||
} else {
|
|
||||||
patientInfo.setId(patientInfoList.get(0).getId());
|
|
||||||
patientInfoMapper.updateById(patientInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 挂号列表
|
|
||||||
* @param pageNum 页码
|
|
||||||
* @param pageSize 每页数量
|
|
||||||
* @param date 日期
|
|
||||||
*/
|
|
||||||
public Page<PatientRegistration> list(int pageNum, int pageSize, String date) {
|
|
||||||
if (date == null || date.isEmpty()) {
|
|
||||||
date = LocalDate.now().toString();
|
|
||||||
}
|
|
||||||
String startDate = date + " 00:00:00";
|
|
||||||
String endDate = date + " 23:59:59";
|
|
||||||
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
|
||||||
//查询条件
|
|
||||||
queryWrapper.between("create_datetime", DateUtil.getDateTime(startDate), DateUtil.getDateTime(endDate));
|
|
||||||
queryWrapper.eq("del_flag", 0);
|
|
||||||
Page<PatientRegistration> pageResult = pageHelper(pageNum, pageSize, queryWrapper, registrationMapper);
|
|
||||||
return pageResult;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 删除挂号信息
|
|
||||||
* @param id 挂号id
|
|
||||||
*/
|
|
||||||
public void delete(int id) {
|
|
||||||
PatientRegistration patientRegistration = registrationMapper.selectById(id);
|
|
||||||
if (patientRegistration == null) {
|
|
||||||
throw new MessageException("id不存在");
|
|
||||||
}
|
|
||||||
patientRegistration.setDelFlag(1);
|
|
||||||
registrationMapper.updateById(patientRegistration);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 根据id查询挂号信息
|
|
||||||
* @param id 挂号id
|
|
||||||
*/
|
|
||||||
public PatientRegistration getById(int id) {
|
|
||||||
PatientRegistration patientRegistration = registrationMapper.selectById(id);
|
|
||||||
return patientRegistration;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 获取所有已删除挂号信息
|
|
||||||
* @param id 挂号id
|
|
||||||
*/
|
|
||||||
public List<PatientRegistration> allList() {
|
|
||||||
QueryWrapper<PatientRegistration> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("del_flag", 1);
|
|
||||||
List<PatientRegistration> list = registrationMapper.selectList(queryWrapper);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* 根据查询条件查询挂号信息
|
|
||||||
* @param query 查询条件
|
|
||||||
*/
|
|
||||||
public Page<PatientRegistration> getListByType(RegistrationQuery query) {
|
|
||||||
QueryWrapper<PatientRegistration> regisQuery = new QueryWrapper<>();
|
|
||||||
regisQuery.eq("del_flag", 0);
|
|
||||||
regisQuery.orderByAsc("create_datetime");
|
|
||||||
if (query.getStatus() != null) {
|
|
||||||
regisQuery.eq("status", query.getStatus());
|
|
||||||
}
|
|
||||||
if (query.getKeyword() != null) {
|
|
||||||
regisQuery.like("name", query.getKeyword());
|
|
||||||
regisQuery.or().like("phone", query.getKeyword());
|
|
||||||
}
|
|
||||||
if (query.getPageNum() == null) {
|
|
||||||
query.setPageNum(1);
|
|
||||||
}
|
|
||||||
if (query.getPageSize() == null) {
|
|
||||||
query.setPageSize(Constants.DetailPageSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
Page<PatientRegistration> registrationPage = pageHelper(query.getPageNum(), query.getPageSize(), regisQuery, registrationMapper);
|
|
||||||
return registrationPage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.syjiaer.clinic.server.mapper.patient.RegistrationMapper">
|
<mapper namespace="com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue