Browse Source

添加查询药品自付比例的controller

lighter 2 years ago
parent
commit
172562eb5c

+ 4 - 0
src/main/java/thyyxxk/webserver/controller/dictionary/NationalMatchController.java

@@ -55,4 +55,8 @@ public class NationalMatchController {
         return service.updateLocalItem(param);
     }
 
+    @GetMapping("/queryPsnPayProp")
+    public String queryPsnPayProp(@RequestParam("hiListCode") String hiListCode) {
+        return service.queryPsnPayProp(hiListCode, true);
+    }
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/dictionary/NationalMatchDao.java

@@ -170,4 +170,8 @@ public interface NationalMatchDao {
                       @Param("specification") String specification,
                       @Param("code") String code);
 
+    @Update("update yp_zd_dict set selfpay_prop=#{selfpayProp} where national_code=#{hilistCode}")
+    void matchMedicineSelfPayProp(@Param("hilistCode") String hilistCode,
+                                  @Param("selfpayProp") String selfpayProp);
+
 }

+ 5 - 2
src/main/java/thyyxxk/webserver/service/dictionary/NationalMatchService.java

@@ -133,7 +133,7 @@ public class NationalMatchService {
 
     public ResultVo<String> executeMatch(StandardLocalItem param) {
         String staffId = TokenUtil.getTokenUserId();
-        String selfpayProp = queryPsnPayProp(param.getNationalCode());
+        String selfpayProp = queryPsnPayProp(param.getNationalCode(), false);
         if (param.getType() < NationalMatchType.SERVICE) {
             dao.matchMedicineAndHerbal(param.getCode(), staffId, param.getNationalCode(), param.getNationalName(), selfpayProp);
         } else {
@@ -177,7 +177,7 @@ public class NationalMatchService {
         return ResultVoUtil.success("修改成功。");
     }
 
-    public String queryPsnPayProp(String hilistCode) {
+    public String queryPsnPayProp(String hilistCode, boolean needUpdate) {
         JSONObject input = exec.makeTradeHeader(SiFunction.DOWNLOAD_MEDICAL_INSURANCE_PAY_FIRST_CATALOGUE);
         JSONObject data = new JSONObject();
         data.put("hilist_code", hilistCode);
@@ -205,6 +205,9 @@ public class NationalMatchService {
                 }
             }
         }
+        if (needUpdate && null != psnPayProp) {
+            dao.matchMedicineSelfPayProp(hilistCode, psnPayProp);
+        }
         return psnPayProp;
     }