Browse Source

系统配置

gaodm 5 years ago
parent
commit
680a6764e4

+ 71 - 0
zzcx-service/src/main/java/com/diagbot/dto/SysSetDTO.java

@@ -0,0 +1,71 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.time.LocalDateTime;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:06
+ * @version: V1.0
+ */
+@Getter
+@Setter
+public class SysSetDTO {
+//    /**
+//     * 主键
+//     */
+//    @TableId(value = "id", type = IdType.AUTO)
+//    private Long id;
+//
+//    /**
+//     * 是否删除,N:未删除,Y:删除
+//     */
+//    private String isDeleted;
+//
+//    /**
+//     * 记录创建时间
+//     */
+//    private LocalDateTime gmtCreate;
+//
+//    /**
+//     * 记录修改时间,如果时间是1970年则表示纪录未修改
+//     */
+//    private LocalDateTime gmtModified;
+//
+//    /**
+//     * 创建人,0表示无创建人值
+//     */
+//    private String creator;
+//
+//    /**
+//     * 修改人,如果为0则表示纪录未修改
+//     */
+//    private String modifier;
+//
+//    /**
+//     * 医院名称
+//     */
+//    private String hospitalCode;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 36 - 0
zzcx-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -0,0 +1,36 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.SysSetDTO;
+import com.diagbot.entity.SysSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.SysSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.SysSetVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:04
+ * @version: V1.0
+ */
+@Component
+public class SysSetFacade extends SysSetServiceImpl {
+    public List<SysSetDTO> getSysSet(SysSetVO sysSetVO){
+        if (null != sysSetVO && StringUtil.isBlank(sysSetVO.getHospitalCode())){
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "医院编码不能为空!");
+        }
+        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
+        sysSetQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_code",sysSetVO.getHospitalCode());
+        List<SysSet> sysSetList = this.list(sysSetQueryWrapper);
+        List<SysSetDTO> res = BeanUtil.listCopyTo(sysSetList, SysSetDTO.class);
+        return res;
+    }
+}

+ 17 - 0
zzcx-service/src/main/java/com/diagbot/vo/SysSetVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @date: 2020/2/9 12:06
+ * @version: V1.0
+ */
+@Getter
+@Setter
+public class SysSetVO {
+    //医院编码
+    private String hospitalCode;
+}

+ 23 - 1
zzcx-service/src/main/java/com/diagbot/web/SysSetController.java

@@ -1,9 +1,21 @@
 package com.diagbot.web;
 
 
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysSetDTO;
+import com.diagbot.facade.SysSetFacade;
+import com.diagbot.vo.SysSetVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,8 +25,18 @@ import org.springframework.stereotype.Controller;
  * @author gaodm
  * @since 2020-02-09
  */
-@Controller
+@RestController
 @RequestMapping("/sysSet")
+@Api(value = "医院配置API", tags = { "医院配置API" })
+@SuppressWarnings("unchecked")
 public class SysSetController {
+    @Autowired
+    private SysSetFacade sysSetFacade;
 
+    @ApiOperation(value = "获取医院配置[by:gaodm]")
+    @PostMapping("/getSysSet")
+    @SysLogger("getSysSet")
+    public RespDTO<List<SysSetDTO>> getSysSet(SysSetVO sysSetVO){
+        return RespDTO.onSuc(sysSetFacade.getSysSet(sysSetVO));
+    }
 }