Browse Source

长处方

trick9191 7 years ago
parent
commit
0bf6551cb4

+ 16 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -132,15 +132,7 @@ public class PrescriptionInfoService extends BaseService {
                Iterator iterator = pres.iterator();
                while(iterator.hasNext()){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject)iterator.next();
                    StringBuffer sql = new StringBuffer(" SELECT pr.code FORM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND r.status = 0");
                    List<Map<String,Object>> mp = jdbcTemplate.queryForList(sql.toString(),new Object[]{r.getString("code")});
                    if(mp!=null&&mp.size()>0){
                        //审核中的标识
                        r.put("reviewedState",'0');
                    }else{
                        //非发起申请
                        r.put("reviewedState",'1');
                    }
                    r.put("reviewedState",presCheckState(r.getString("code")));
                }
                return pres;
//                //基卫接口
@ -1009,4 +1001,19 @@ public class PrescriptionInfoService extends BaseService {
        String val =  redisTemplate.opsForValue().get("wlyy:dict:recipeFrequency:"+code);
        return new JSONObject(val);
    }
    /**
     * 获取处方对应续方审核状态
     * @param code
     * @return 0 审核中,1为处理完成
     */
    public String presCheckState(String code){
        StringBuffer sql = new StringBuffer(" SELECT pr.code FORM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND r.status = 0");
        List<Map<String,Object>> mp = jdbcTemplate.queryForList(sql.toString(),code);
        if(mp!=null&&mp.size()>0){
            return "0";
        }else{
            return "1";
        }
    }
}