瀏覽代碼

add 医生管理
add 医院传输日志管理

18339543638 3 年之前
父節點
當前提交
80b0afa630

+ 49 - 0
coffee-admin/src/main/test/java/com/coffee/admin/BusHospitalLogTest.java

@@ -0,0 +1,49 @@
+package com.coffee.admin;
+
+import com.coffee.bus.controller.BusHospitalController;
+import com.coffee.bus.controller.BusHospitalLogController;
+import com.coffee.bus.entity.BusHospitalEntity;
+import com.coffee.bus.entity.BusHospitalLogEntity;
+import com.coffee.bus.enums.HospitalLogEnum;
+import com.coffee.bus.service.LocalBusHospitalLogService;
+import com.coffee.bus.service.LocalBusHospitalService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalTest.java
+ * @Description TODO
+ * @createTime 2022年03月19日 10:27:00
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = AdminApplication.class)
+public class BusHospitalLogTest {
+    @Autowired
+    private LocalBusHospitalLogService logService;
+
+    @Autowired
+    private BusHospitalLogController logController;
+    @Test
+    public void save(){
+        BusHospitalLogEntity logEntity = new BusHospitalLogEntity();
+        logEntity.setIp("192.168.100.32");
+        logEntity.setReceiveTime(new Date());
+        logEntity.setResult("success");
+        logEntity.setType(HospitalLogEnum.HEART);
+        logService.save(logEntity);
+    }
+
+    @Test
+    public void query(){
+        List<BusHospitalLogEntity> list = logService.list();
+        System.out.println(list);
+    }
+}

+ 43 - 0
coffee-system/src/main/java/com/coffee/bus/controller/BuDoctorController.java

@@ -0,0 +1,43 @@
+package com.coffee.bus.controller;
+
+import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.entity.BusDoctorEntity;
+import com.coffee.bus.entity.BusHospitalEntity;
+import com.coffee.bus.service.LocalBusDoctorService;
+import com.coffee.bus.service.LocalBusHospitalService;
+import com.coffee.common.crud.BaseService;
+import com.coffee.common.crud.controller.BaseCrudController;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalController.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:28:00
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/bus/doctor")
+@Api(tags = "医院医生管理",description = "统一权限前缀(bus:doctor),例如新增bus:doctor:add")
+public class BuDoctorController extends BaseCrudController<BusDoctorEntity, Long> {
+    private final LocalBusDoctorService doctorService;
+
+
+    /**
+     * 权限控制前缀
+     * @return
+     */
+    @Override
+    public String getPermissionPrefix() {
+        return "bus:doctor";
+    }
+
+    @Override
+    public BaseService<? extends Mapper<BusDoctorEntity>, BusDoctorEntity, Long> getService() {
+        return doctorService;
+    }
+}

+ 43 - 0
coffee-system/src/main/java/com/coffee/bus/controller/BusHospitalLogController.java

@@ -0,0 +1,43 @@
+package com.coffee.bus.controller;
+
+import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.entity.BusHospitalEntity;
+import com.coffee.bus.entity.BusHospitalLogEntity;
+import com.coffee.bus.service.LocalBusHospitalLogService;
+import com.coffee.bus.service.LocalBusHospitalService;
+import com.coffee.common.crud.BaseService;
+import com.coffee.common.crud.controller.BaseCrudController;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalController.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:28:00
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/log/hospital")
+@Api(tags = "医院传输日志管理",description = "统一权限前缀(log:hospital),例如新增log:hospital:add")
+public class BusHospitalLogController extends BaseCrudController<BusHospitalLogEntity, Long> {
+    private final LocalBusHospitalLogService logService;
+
+
+    /**
+     * 权限控制前缀
+     * @return
+     */
+    @Override
+    public String getPermissionPrefix() {
+        return "log:hospital";
+    }
+
+    @Override
+    public BaseService<? extends Mapper<BusHospitalLogEntity>, BusHospitalLogEntity, Long> getService() {
+        return logService;
+    }
+}

+ 21 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusDoctorEntity.java

@@ -0,0 +1,21 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.common.entity.TenantGenericEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusDoctorEntity.java
+ * @Description TODO
+ * @createTime 2022年03月21日 11:17:00
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName(value = "bus_doctor",autoResultMap = true)
+public class BusDoctorEntity  extends TenantGenericEntity<Long,Long> {
+    private String name;
+    private String job;
+}

+ 36 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusHospitalLogEntity.java

@@ -0,0 +1,36 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.bus.enums.HospitalLogEnum;
+import com.coffee.common.config.mybatis.DateToBigIntHandler;
+import com.coffee.common.entity.TenantGenericEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.ibatis.type.EnumOrdinalTypeHandler;
+
+import java.util.Date;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalLogEntity.java
+ * @Description TODO
+ * @createTime 2022年03月21日 11:25:00
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName(value = "bus_hospital_log",autoResultMap = true)
+public class BusHospitalLogEntity extends TenantGenericEntity<Long,Long> {
+    @TableField(typeHandler = DateToBigIntHandler.class)
+    private Date receiveTime;
+
+    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
+    private HospitalLogEnum  type;
+
+    private String result;
+
+    private String ip;
+
+    private String meta;
+}

+ 22 - 0
coffee-system/src/main/java/com/coffee/bus/enums/HospitalLogEnum.java

@@ -0,0 +1,22 @@
+package com.coffee.bus.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName HospitalLogEnum.java
+ * @Description 枚举顺序切不可乱动!!!!!!
+ * @createTime 2022年03月21日 11:26:00
+ */
+@AllArgsConstructor
+public enum HospitalLogEnum{
+    HEART("心跳信息"),
+    PATIENT("病人信息");
+
+    @Getter
+    private String value;
+
+
+}

+ 16 - 0
coffee-system/src/main/java/com/coffee/bus/mapper/BusDoctorMapper.java

@@ -0,0 +1,16 @@
+package com.coffee.bus.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.coffee.bus.entity.BusDoctorEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalMapper.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:15:00
+ */
+@Mapper
+public interface BusDoctorMapper extends BaseMapper<BusDoctorEntity> {
+}

+ 16 - 0
coffee-system/src/main/java/com/coffee/bus/mapper/BusHospitalLogMapper.java

@@ -0,0 +1,16 @@
+package com.coffee.bus.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.coffee.bus.entity.BusHospitalLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName BusHospitalMapper.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:15:00
+ */
+@Mapper
+public interface BusHospitalLogMapper extends BaseMapper<BusHospitalLogEntity> {
+}

+ 33 - 0
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDoctorService.java

@@ -0,0 +1,33 @@
+package com.coffee.bus.service;
+
+import com.coffee.bus.entity.BusDoctorEntity;
+import com.coffee.bus.entity.BusHospitalEntity;
+import com.coffee.bus.mapper.BusDoctorMapper;
+import com.coffee.bus.mapper.BusHospitalMapper;
+import com.coffee.common.crud.BaseService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName LocalBusHospitalService.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:27:00
+ */
+@Service
+public class LocalBusDoctorService extends BaseService<BusDoctorMapper, BusDoctorEntity,Long> {
+    @Override
+    public void validateBeforeSave(BusDoctorEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeUpdate(BusDoctorEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeDelete(Long id) {
+
+    }
+}

+ 31 - 0
coffee-system/src/main/java/com/coffee/bus/service/LocalBusHospitalLogService.java

@@ -0,0 +1,31 @@
+package com.coffee.bus.service;
+
+import com.coffee.bus.entity.BusHospitalLogEntity;
+import com.coffee.bus.mapper.BusHospitalLogMapper;
+import com.coffee.common.crud.BaseService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lifang
+ * @version 1.0.0
+ * @ClassName LocalBusHospitalService.java
+ * @Description TODO
+ * @createTime 2022年03月19日 09:27:00
+ */
+@Service
+public class LocalBusHospitalLogService extends BaseService<BusHospitalLogMapper, BusHospitalLogEntity,Long> {
+    @Override
+    public void validateBeforeSave(BusHospitalLogEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeUpdate(BusHospitalLogEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeDelete(Long id) {
+
+    }
+}