소스 검색

安康码的接口

shiqian 3 년 전
부모
커밋
d6c39d417b

+ 35 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/AnkangMaController.java

@@ -0,0 +1,35 @@
+package com.boman.web.core.controller;
+
+import com.boman.domain.dto.AjaxResult;
+import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author shiqian
+ * @date 2021年11月18日 15:39
+ **/
+@RequestMapping("/akm")
+@RestController
+public class AnkangMaController {
+
+    @Resource
+    private IVaccineInfoService vaccineInfoService;
+
+    /**
+     * 功能描述: 安康码根据身份证号码查询信息
+     *
+     * @param idCard idCard
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @GetMapping("/info/{idCard}")
+    public AjaxResult getByIdCard(@PathVariable("idCard") String idCard) {
+        return AjaxResult.success("成功", vaccineInfoService.getByIdCard(idCard));
+    }
+
+
+}

+ 8 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -91,4 +91,12 @@ public interface VaccineInfoMapper
     public String selectSysDictDataByDictLabel(String vaccineName);
 
     List<VaccineInfoOperation> listByTotalTaskCnt();
+
+    /**
+     * 功能描述: 安康码根据身份证号码查询信息
+     *
+     * @param idCard idCard
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    VaccineInfoOperation getByIdCard(String idCard);
 }

+ 8 - 0
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java

@@ -77,4 +77,12 @@ public interface IVaccineInfoService
     AjaxResult statistic();
 
     List<JSONObject> list();
+
+    /**
+     * 功能描述: 安康码根据身份证号码查询信息
+     *
+     * @param idCard idCard
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    JSONObject getByIdCard(String idCard);
 }

+ 17 - 0
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -1011,4 +1011,21 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
         return standardlyMapper.list1(deptName);
     }
+
+    /**
+     * 功能描述: 安康码根据身份证号码查询信息
+     *
+     * @param idCard idCard
+     * @return com.alibaba.fastjson.JSONObject
+     */
+    @Override
+    public JSONObject getByIdCard(String idCard) {
+        VaccineInfoOperation info = vaccineInfoMapper.getByIdCard(idCard);
+        JSONObject result = new JSONObject(2);
+        // 姓名
+        result.put("userName", info.getUserName());
+        // 家庭住址
+        result.put("domicile", info.getDomicile());
+        return result;
+    }
 }

+ 5 - 1
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -378,7 +378,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM vaccine_info
         WHERE age > 18
     </select>
-<!--    AND (-->
+
+    <select id="getByIdCard" resultMap="VaccineInfoResult">
+        select * from vaccine_info where id_card = #{idCard} limit 1;
+    </select>
+    <!--    AND (-->
 <!--    contraindication IS NULL-->
 <!--    OR suspend IS NULL-->
 <!--    OR other IS NULL-->