trick9191 7 роки тому
батько
коміт
e7152a46c7

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

@ -75,6 +75,8 @@ public class Prescription extends IdEntity {
    private List<PrescriptionInfo> prescriptionInfo;
    private String reviewedState;
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {
        return code;
@ -555,4 +557,13 @@ public class Prescription extends IdEntity {
    public void setPrescriptionInfo(List<PrescriptionInfo> prescriptionInfo) {
        this.prescriptionInfo = prescriptionInfo;
    }
    @Transient
    public String getReviewedState() {
        return reviewedState;
    }
    public void setReviewedState(String reviewedState) {
        this.reviewedState = reviewedState;
    }
}

+ 16 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -116,16 +116,24 @@ public class PresModeAdapter {
            while (iterator.hasNext()){
                JSONArray modeArray = (JSONArray) iterator.next();
                JSONObject mode = (JSONObject) modeArray.get(0);
                Prescription p  = new Prescription();
                p.setCode(mode.getInteger("RECIPE_NO")+"");
                p.setCreateTime(mode.getDate("APPLY_TIME"));
                JSONObject p  = new JSONObject();
                p.put("code",mode.getInteger("RECIPE_NO")+"");
                p.put("createTime",mode.getString("APPLY_TIME"));
                Doctor doctor =  zyDictService.getDoctByJw(mode.getString("APPLY_OPERATOR"),mode.getString("HEALTH_ORG_CODE"));
                // "APPLY_OPERATOR_NAME": 开单医生姓名","HEALTH_ORG_CODE": "开单机构编码",
                p.setDoctor(doctor.getCode());
                p.setDoctorName(doctor.getName());
                p.setHospitalName(doctor.getHospitalName());
                p.setHospital(doctor.getHospital());
                if(doctor!=null){
                    p.put("doctor",doctor.getCode());
                    p.put("doctorName",doctor.getName());
                    p.put("hospitalName",doctor.getHospitalName());
                    p.put("hospital",doctor.getHospital());
                }else{
                    p.put("doctor",mode.getString("APPLY_OPERATOR"));
                    p.put("hospitalName",mode.getString("APPLY_OPERATOR_NAME"));
                    //p.setHospitalName(doctor.getHospitalName());
                    p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
                }
                PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
                diagnosis.setCode(mode.getString("DIAGNOSE_CODE"));//诊断代码
@ -177,7 +185,7 @@ public class PresModeAdapter {
                    prescriptionInfo.setPhysicSkinTestName(info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
                    prescriptionInfos.add(prescriptionInfo);
                }
                p.setPrescriptionInfo(prescriptionInfos);
                p.put("prescriptionInfo",prescriptionInfos);
                rs.add(p);
            }
            return rs;

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

@ -129,9 +129,8 @@ public class PrescriptionInfoService extends BaseService {
                String rp= jwPrescriptionService.getLastRecipe(p.getSsc(),null,null,null);
                com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
                Iterator iterator = pres.iterator();
                while(iterator.hasNext()){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject)iterator.next();
                for(int i=0;i<pres.size();i++){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) pres.get(i);
                    r.put("reviewedState",presCheckState(r.getString("code")));
                }
                return pres;
@ -1008,7 +1007,7 @@ public class PrescriptionInfoService extends BaseService {
     * @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");
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM 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";