Browse Source

Merge branch 'dev' of humingfen/wlyy2.0 into dev

huangwenjie 6 years ago
parent
commit
ad8c93c78a

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java

@ -43,6 +43,8 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    private String abortReason;//中止原因
    @Column(name = "abort_time")
    private Date abortTime;//中止时间
    @Column(name = "patient_img")
    private String patientImg;//居民签名照/证件照
    @Column(name = "saas_id")
    public String getSaasId() {
@ -161,4 +163,13 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    public void setAbortTime(Date abortTime) {
        this.abortTime = abortTime;
    }
    @Column(name = "patient_img")
    public String getPatientImg() {
        return patientImg;
    }
    public void setPatientImg(String patientImg) {
        this.patientImg = patientImg;
    }
}

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -95,6 +95,8 @@ public class SpecialistMapping {
        public static final String selectByLabelAndPatient = "/selectByLabelAndPatient";
        public static final String sendToFamilyDoctor = "/sendToFamilyDoctor";
        public static final String abortPlanById = "/abortPlanById";
        public static final String updatePatientImgById = "/updatePatientImgById";
    }
    public static class serviceItem{

+ 15 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

@ -341,4 +341,19 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.updatePatientImgById)
    @ApiOperation(value = "更新康复计划居民签名照/证件照")
    public Envelop updatePatientImgById(@ApiParam(name = "planId", value = "康复计划id", required = true)
                                            @RequestParam(value = "planId")String planId,
                                        @ApiParam(name = "patientImg", value = "居民签名/证件照地址",required = true)
                                            @RequestParam(value = "patientImg")String patientImg){
        try {
            return rehabilitationPlanService.updatePatientImgById(planId, patientImg);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
}

+ 8 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/PatientRehabilitationPlanDao.java

@ -45,4 +45,12 @@ public interface PatientRehabilitationPlanDao extends PagingAndSortingRepository
    @Query("select p from PatientRehabilitationPlanDO p where p.disease =?1 and p.status=1 and p.patient=?2")
    List<PatientRehabilitationPlanDO> selectByDiseaseAndPatient(String disease,String patient);
    @Modifying
    @Query("update PatientRehabilitationPlanDO t set t.patientImg = ?2 where t.id=?1 ")
    int updatePatientImgById(String planId, String patientImg);
    @Query("update PatientRehabilitationPlanDO a set a.status=?1,a.abortTime= ?3 where a.id =?2 ")
    @Modifying
    int updateStatusAndTimeById(Integer status, String id, Date date);
}

+ 21 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -78,7 +78,7 @@ public class RehabilitationManageService {
            sql.replace("from", ",f.idcard,f.hospital_name from");
            sql += leftSql;
        }
        sql += " where p.`status` > 0 ";
        sql += " where 1=1 ";
        if(planType!=null){
            sql += " and p.plan_type="+planType;
        }
@ -1110,7 +1110,7 @@ public class RehabilitationManageService {
            }
            if (rehabilitationDetailDOList.size()>0 && rehabilitationDetailDOList.size()==allCount){
                planId = rehabilitationDetailDOList.get(0).getPlanId();
                patientRehabilitationPlanDao.updateStatusById(2,planId);
                patientRehabilitationPlanDao.updateStatusAndTimeById(2,planId, new Date());
            }
        }catch (Exception e){
            throw  new Exception("更新服务状态失败!");
@ -1171,6 +1171,8 @@ public class RehabilitationManageService {
            resultMap.put("diseaseName",p.getDiseaseName());
            resultMap.put("createUser",p.getCreateUser());
            resultMap.put("planTitle",p.getTitle());
            resultMap.put("status", p.getStatus());
            resultMap.put("patientImg", p.getPatientImg());
        }
//        resultMap.put("healthyCondition",healthyCondition);
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
@ -1254,7 +1256,7 @@ public class RehabilitationManageService {
                " p.patient," +
                " p.`name`," +
                " p.title," +
                " p.disease_name,p.abort_reason,p.abort_time," +
                " p.disease_name,p.abort_reason,p.abort_time,p.create_time," +
                " a.*" +
                " FROM" +
                " wlyy_patient_rehabilitation_plan p" +
@ -1284,6 +1286,8 @@ public class RehabilitationManageService {
        Integer finishCount = list.size();//完成服务项目数
        double totalExpense = 0;
        Set<String> hospitalSet = new HashSet();
        Set<String> serviceDoctor = new HashSet();
        DecimalFormat df = new DecimalFormat("0.00");
        for (Map<String,Object> map : list){
            double expense = 0;
@ -1292,11 +1296,25 @@ public class RehabilitationManageService {
            }
            totalExpense += expense;
            map.put("expense",df.format(expense/100));
            //组装机构和服务医生
            if(map.get("hospital") != null){
                if(map.get("hospital_name") != null && !hospitalSet.contains(("hospital_name") + "")) {
                    hospitalSet.add(map.get("hospital_name") + "");
                }
            }
            if(map.get("doctor_code") != null){
                if(map.get("doctor_name") != null && !hospitalSet.contains(("doctor_name") + "")) {
                    serviceDoctor.add(map.get("doctor_name") + "");
                }
            }
        }
        reslutMap.put("totalExpense",df.format(totalExpense/100));
        reslutMap.put("allCount",allCount);
        reslutMap.put("finishCount",finishCount);
        reslutMap.put("serviceList",list);
        reslutMap.put("hospitalAll", hospitalSet.toString().replace("[","").replace("]","").replace(",", "、"));
        reslutMap.put("serviceDoctor", serviceDoctor.toString().replace("[","").replace("]","").replace(",", "、"));
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,reslutMap);
    }
}

+ 16 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -373,9 +373,16 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
     * @return
     */
    public MixEnvelop updatePlanStatusById(Integer status, String planId) throws Exception{
        if(patientRehabilitationPlanDao.updateStatusById(status,planId)>0){
        if(status == 1) {
            if (patientRehabilitationPlanDao.updateStatusById(status, planId) > 0) {
            return MixEnvelop.getSuccess(SpecialistMapping.api_success,patientRehabilitationPlanDao.findById(planId));
                return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientRehabilitationPlanDao.findById(planId));
            }
        }else if(status == 2){
            if (patientRehabilitationPlanDao.updateStatusAndTimeById(2,planId, new Date()) > 0) {
                return MixEnvelop.getSuccess(SpecialistMapping.api_success, patientRehabilitationPlanDao.findById(planId));
            }
        }
        return MixEnvelop.getError("更新失败!");
    }
@ -404,4 +411,11 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
    public List<PatientRehabilitationPlanDO> selectByLabelAndPatient(String patient,String label){
        return patientRehabilitationPlanDao.selectByDiseaseAndPatient(label,patient);
    }
    public Envelop updatePatientImgById(String planId, String patientImg) {
        if(patientRehabilitationPlanDao.updatePatientImgById(planId,patientImg) > 0){
            return Envelop.getSuccess(SpecialistMapping.api_success);
        }
        return Envelop.getError("更新失败!");
    }
}