Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangjun 4 anos atrás
pai
commit
662e049826

+ 22 - 14
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -3150,7 +3150,7 @@ public class YkyyEntranceService {
        int size = sfzhArray.size();
        if (size == 1) {
            JSONObject json = sfzhArray.getJSONObject(0);
            Object jzkh = json.get("JZKH");//社保卡
            Object jzkh = json.get("jzkh");//社保卡
            //获取居民信息
            brid = json.getFloat("brid");//病人id
            if (jzkh != null && !jzkh.toString().equals(medicare)) {//判断是否跟当前医保卡号一致
@ -3184,20 +3184,28 @@ public class YkyyEntranceService {
            }
            if (array.size() == 1) {
                brid = sfzhArray.getJSONObject(0).getFloat("brid");
            } else { //否则就取最早一条更新
                brid = sfzhArray.getJSONObject(0).getFloat("brid");
                Map<String, Object> updateParams = new HashedMap();
                updateParams.put("brid", brid);
                updateParams.put("jzkh", medicare);
                logger.info("更新params:" + updateParams);
                HttpResponse updateResponse = HttpUtils.doGet(updateJzkh, updateParams);
                String updateContent = updateResponse.getContent();
                logger.info("更新患者信息updateResponse:" + updateContent);
                JSONObject rsult = JSON.parseObject(updateContent);
                Integer s = rsult.getInteger("status");
                if (s != 200) {
            } else { //否则就去最早一条更新
                String nullSql = "SELECT brid \"brid\" from portal_his.V_ZKSG_BRCX@xec_link where sfzh = '" + idcard + "' and  jzkh is null ";
                Integer count = getSqlResult(nullSql).size();
                if (count == size) {//如果都为空就默认取一条,然后更新社保卡号
                    brid = sfzhArray.getJSONObject(0).getFloat("brid");
                    Map<String, Object> updateParams = new HashedMap();
                    updateParams.put("brid", brid);
                    updateParams.put("jzkh", medicare);
                    logger.info("更新params:" + updateParams);
                    HttpResponse updateResponse = HttpUtils.doGet(updateJzkh, updateParams);
                    String updateContent = updateResponse.getContent();
                    logger.info("更新患者信息updateResponse:" + updateContent);
                    JSONObject rsult = JSON.parseObject(updateContent);
                    Integer s = rsult.getInteger("status");
                    if (s != 200) {
                        res.put("status", -1);
                        res.put("message", "更新社保卡失败!");
                        return res;
                    }
                }else {
                    res.put("status", -1);
                    res.put("message", "更新社保卡失败!");
                    res.put("message", "您输入的卡号和该就诊人在医院预留的卡号不一致,请重新输入。");
                    return res;
                }
            }