Prechádzať zdrojové kódy

Merge branch 'zsl' into dev

18339543638 3 rokov pred
rodič
commit
0ec99e5355

+ 19 - 1
coffee-system/src/main/java/com/coffee/bus/controller/BusDrugController.java

@@ -1,5 +1,12 @@
 package com.coffee.bus.controller;
 
+import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.entity.BusDrugEntity;
+import com.coffee.bus.service.LocalBusDrugService;
+import com.coffee.bus.service.LocalBusFormulaService;
+import com.coffee.common.crud.BaseService;
+import com.coffee.common.crud.controller.BaseCrudController;
+import com.coffee.common.result.R;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -7,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * @author lifang
  * @version 1.0.0
@@ -18,10 +27,19 @@ import org.springframework.web.bind.annotation.RestController;
 @AllArgsConstructor
 @RequestMapping("/bus/drug")
 @Api(tags = "药品管理",description = "统一权限前缀(bus:drug),例如新增bus:drug:add")
-public class BusDrugController {
+public class BusDrugController extends BaseCrudController<BusDrugEntity,String> {
+    private final LocalBusDrugService scoreService;
+
+
     @GetMapping
     @ApiOperation("改接口无意义,当该模块下存在接口时,将该接口删除")
     public void show(){
 
     }
+
+    @Override
+    public BaseService<? extends Mapper<BusDrugEntity>, BusDrugEntity, String> getService() {
+        return scoreService;
+    }
+
 }

+ 44 - 0
coffee-system/src/main/java/com/coffee/bus/controller/BusFormulaController.java

@@ -0,0 +1,44 @@
+package com.coffee.bus.controller;
+
+import com.baomidou.mybatisplus.core.mapper.Mapper;
+import com.coffee.bus.entity.BusEvaluationEntity;
+import com.coffee.bus.entity.BusFormulaEntity;
+import com.coffee.bus.service.LocalBusEvaluationService;
+import com.coffee.bus.service.LocalBusFormulaService;
+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 zsl
+ * @version 1.0.0
+ * @ClassName BusFormulaController.java
+ * @Description TODO
+ * @createTime 2022/4/20 8:25
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/bus/formula")
+@Api(tags = "配方管理",description = "统一权限前缀(bus:formula),bus:formula:add")
+
+public class BusFormulaController  extends BaseCrudController<BusFormulaEntity, String> {
+    private final LocalBusFormulaService scoreService;
+
+    /**
+     * 权限控制前缀
+     * @return
+     */
+    @Override
+    public String getPermissionPrefix() {
+        return "bus:formula";
+    }
+
+
+    @Override
+    public BaseService<? extends Mapper<BusFormulaEntity>, BusFormulaEntity, String> getService() {
+        return scoreService;
+    }
+}

+ 39 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusDrugEntity.java

@@ -0,0 +1,39 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.common.entity.TenantGenericEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName BusDrugEntity.java
+ * @Description TODO
+ * @createTime 2022/4/189:22
+ */
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName(value = "bus_drug",autoResultMap = true)
+@ApiModel(value="药品管理", description="药品管理实体类")
+@ToString
+public class BusDrugEntity extends TenantGenericEntity<String,String> {
+    @ApiModelProperty(value = "药品名称")
+    @Length(max = 255,message = "药品名称长度不得超过255个字节")
+    private String name;
+
+    @ApiModelProperty(value = "药品类型")
+    @Length(max = 255,message = "药品类型不得超过255个字符")
+    private String type;
+
+    @ApiModelProperty(value = "药品单位")
+    @Length(max = 255,message = "药品单位不得超过255个字符")
+    private String unit;
+
+}

+ 35 - 0
coffee-system/src/main/java/com/coffee/bus/entity/BusFormulaEntity.java

@@ -0,0 +1,35 @@
+package com.coffee.bus.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.coffee.common.entity.TenantGenericEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.hibernate.validator.constraints.Length;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName BusFormulaEntity.java
+ * @Description TODO
+ * @createTime 2022/4/1817:30
+ */
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName(value = "bus_formula",autoResultMap = true)
+@ApiModel(value="配方管理", description="配方管理实体类")
+@ToString
+public class BusFormulaEntity extends TenantGenericEntity<String,String> {
+
+    @ApiModelProperty(value = "配方名称")
+    @Length(max = 255,message = "配方名称长度不得超过255个字节")
+    private String name;
+
+    @ApiModelProperty(value = "配方类型")
+    @Length(max = 2048,message = "配方类型不得超过2048个字符")
+    private String content;
+
+}

+ 17 - 0
coffee-system/src/main/java/com/coffee/bus/mapper/BusDrugMapper.java

@@ -0,0 +1,17 @@
+package com.coffee.bus.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.coffee.bus.entity.BusDrugEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName BusDrugMapper.java
+ * @Description 药品管理
+ * @createTime 2022/4/189:37
+ */
+@Mapper
+public interface BusDrugMapper extends BaseMapper<BusDrugEntity> {
+
+}

+ 17 - 0
coffee-system/src/main/java/com/coffee/bus/mapper/BusFormulaMapper.java

@@ -0,0 +1,17 @@
+package com.coffee.bus.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.coffee.bus.entity.BusFormulaEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName BusFormulaMapper.java
+ * @Description 配方管理
+ * @createTime 2022/4/189:37
+ */
+
+@Mapper
+public interface BusFormulaMapper extends BaseMapper<BusFormulaEntity> {
+}

+ 32 - 0
coffee-system/src/main/java/com/coffee/bus/service/LocalBusDrugService.java

@@ -0,0 +1,32 @@
+package com.coffee.bus.service;
+
+import com.coffee.bus.entity.BusDrugEntity;
+import com.coffee.bus.mapper.BusDrugMapper;
+import com.coffee.common.crud.BaseService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName LocalBusDrugService.java
+ * @Description TODO
+ * @createTime 2022/4/1816:51
+ */
+@Service
+public class LocalBusDrugService extends BaseService<BusDrugMapper, BusDrugEntity,String> {
+
+    @Override
+    public void validateBeforeSave(BusDrugEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeUpdate(BusDrugEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeDelete(String id) {
+
+    }
+}

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

@@ -0,0 +1,33 @@
+package com.coffee.bus.service;
+
+import com.coffee.bus.entity.BusFormulaEntity;
+import com.coffee.bus.mapper.BusFormulaMapper;
+import com.coffee.common.crud.BaseService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author zsl
+ * @version 1.0.0
+ * @ClassName LocalBusFormulaService.java
+ * @Description 配方管理
+ * @createTime 2022/4/208:23
+ */
+@Service
+public class LocalBusFormulaService extends BaseService<BusFormulaMapper, BusFormulaEntity,String> {
+    @Override
+    public void validateBeforeSave(BusFormulaEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeUpdate(BusFormulaEntity entity) {
+
+    }
+
+    @Override
+    public void validateBeforeDelete(String id) {
+
+    }
+
+
+}