Jelajahi Sumber

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

Zhaops 6 tahun lalu
induk
melakukan
841035aaee

+ 11 - 0
icss-service/src/main/java/com/diagbot/dto/TranFieldInfoDTO.java

@@ -0,0 +1,11 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.TranFieldInfo;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/11/21 14:08
+ */
+public class TranFieldInfoDTO extends TranFieldInfo {
+}

+ 35 - 0
icss-service/src/main/java/com/diagbot/facade/TranFieldInfoFacade.java

@@ -0,0 +1,35 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TranFieldInfoDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.TranFieldInfoServiceImpl;
+import com.diagbot.vo.TranFieldInfoVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/11/21 14:13
+ */
+@Component
+public class TranFieldInfoFacade extends TranFieldInfoServiceImpl {
+
+
+    /**
+     * 根据uuid获取相关信息
+     * @param info
+     * @return
+     */
+    public RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(TranFieldInfoVO info){
+        List<TranFieldInfoDTO> tranFieldInfoDTOList = this.getInfosByUuid(info);
+        if(tranFieldInfoDTOList == null || tranFieldInfoDTOList.size() == 0){
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
+                    "获取信息失败");
+        }
+        return RespDTO.onSuc(tranFieldInfoDTOList);
+    }
+}

+ 5 - 0
icss-service/src/main/java/com/diagbot/mapper/TranFieldInfoMapper.java

@@ -1,7 +1,11 @@
 package com.diagbot.mapper;
 
+import com.diagbot.dto.TranFieldInfoDTO;
 import com.diagbot.entity.TranFieldInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.TranFieldInfoVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface TranFieldInfoMapper extends BaseMapper<TranFieldInfo> {
 
+    public List<TranFieldInfoDTO> getInfosByUuid(TranFieldInfoVO tranFieldInfoVO);
 }

+ 6 - 1
icss-service/src/main/java/com/diagbot/service/TranFieldInfoService.java

@@ -1,7 +1,11 @@
 package com.diagbot.service;
 
-import com.diagbot.entity.TranFieldInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.TranFieldInfoDTO;
+import com.diagbot.entity.TranFieldInfo;
+import com.diagbot.vo.TranFieldInfoVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface TranFieldInfoService extends IService<TranFieldInfo> {
 
+    public List<TranFieldInfoDTO> getInfosByUuid(TranFieldInfoVO tranFieldInfoVO);
 }

+ 8 - 0
icss-service/src/main/java/com/diagbot/service/impl/TranFieldInfoServiceImpl.java

@@ -1,11 +1,15 @@
 package com.diagbot.service.impl;
 
+import com.diagbot.dto.TranFieldInfoDTO;
 import com.diagbot.entity.TranFieldInfo;
 import com.diagbot.mapper.TranFieldInfoMapper;
 import com.diagbot.service.TranFieldInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.TranFieldInfoVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 字段对应表 服务实现类
@@ -17,4 +21,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class TranFieldInfoServiceImpl extends ServiceImpl<TranFieldInfoMapper, TranFieldInfo> implements TranFieldInfoService {
 
+    @Override
+    public List<TranFieldInfoDTO> getInfosByUuid(TranFieldInfoVO tranFieldInfoVO) {
+        return baseMapper.getInfosByUuid(tranFieldInfoVO);
+    }
 }

+ 19 - 0
icss-service/src/main/java/com/diagbot/vo/TranFieldInfoVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/11/21 14:08
+ */
+@Getter
+@Setter
+public class TranFieldInfoVO {
+
+    @NotNull(message = "请输入医院编码")
+    private String uuid;
+}

+ 22 - 0
icss-service/src/main/java/com/diagbot/web/TranFieldInfoController.java

@@ -1,10 +1,22 @@
 package com.diagbot.web;
 
 
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TranFieldInfoDTO;
+import com.diagbot.facade.TranFieldInfoFacade;
+import com.diagbot.vo.TranFieldInfoVO;
 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.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
+import java.util.List;
+
 /**
  * <p>
  * 字段对应表 前端控制器
@@ -17,5 +29,15 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/tranFieldInfo")
 @Api(value = "字段对应信息API", tags = { "字段对应信息API" })
 public class TranFieldInfoController {
+    @Autowired
+    TranFieldInfoFacade tranFieldInfoFacade;
 
+    @ApiOperation(value = "患者信息——查询[by:wangyu]",
+            notes = "patientCode:患者编号,必填<br>" +
+                    "hospitalCode:医院编号,必填<br>")
+    @PostMapping("/getPatientInfo")
+    @SysLogger("getPatientInfo")
+    public RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(@Valid @RequestBody TranFieldInfoVO tranFieldInfoVO) {
+        return tranFieldInfoFacade.getInfoByUuid(tranFieldInfoVO);
+    }
 }

+ 3 - 0
icss-service/src/main/resources/mapper/TranFieldInfoMapper.xml

@@ -17,4 +17,7 @@
         <result column="remark" property="remark" />
     </resultMap>
 
+    <select id="getInfosByUuid" resultType="com.diagbot.dto.TranFieldInfoDTO">
+        SELECT * FROM `tran_field_info` t where t.status = '1' and FIND_IN_SET(#{uuid},uuid)
+    </select>
 </mapper>