فهرست منبع

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

chenweida 7 سال پیش
والد
کامیت
0adc31bdb8

+ 12 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -9,6 +9,7 @@ import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
/**
 * Created by Administrator on 2017/7/21.
@ -72,6 +73,8 @@ public class Prescription extends IdEntity {
    private String strOriginalData; //CA原文数据
    private List<PrescriptionInfo> prescriptionInfo;
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {
        return code;
@ -543,4 +546,13 @@ public class Prescription extends IdEntity {
    public void setStrOriginalData(String strOriginalData) {
        this.strOriginalData = strOriginalData;
    }
    @Transient
    public List<PrescriptionInfo> getPrescriptionInfo() {
        return prescriptionInfo;
    }
    public void setPrescriptionInfo(List<PrescriptionInfo> prescriptionInfo) {
        this.prescriptionInfo = prescriptionInfo;
    }
}

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

@ -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";
        }
    }
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -363,6 +363,17 @@ public class PrescriptionInfoController extends BaseController{
        }
    }
    @RequestMapping(value = "/drugToRate", method = RequestMethod.GET)
    @ApiOperation(value ="频次翻译")
    public String drugToRate(String code){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.drugToRate(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescription" ,method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取长处方详细信息")