|
@ -28,6 +28,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -79,7 +80,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
@Autowired
|
|
|
private JwPrescriptionService jwPrescriptionService;
|
|
|
@Autowired
|
|
|
private RedisTemplate redisTemplate;
|
|
|
private StringRedisTemplate redisTemplate;
|
|
|
@Autowired
|
|
|
private PresModeAdapter presModeAdapter;
|
|
|
|
|
@ -131,15 +132,8 @@ 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;
|
|
|
// //基卫接口
|
|
|
// List<Map<String,Object>> prescriptions = new ArrayList<>();
|
|
@ -1002,4 +996,24 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
public JSONObject drugToRate(String code){
|
|
|
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";
|
|
|
}
|
|
|
}
|
|
|
}
|