Kaynağa Gözat

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

huangwenjie 6 yıl önce
ebeveyn
işleme
656a408a8f

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

@ -34,8 +34,6 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    private Integer planType;//安排类型(1康复计划,2转社区医院,3转家庭病床)
    @Column(name = "service_package_id")
    private String servicePackageId;//服务包id
    @Column(name = "service_qr_code")
    private String serviceQrCode;//服务码
    @Column(name = "status")
    private Integer status;//状态(0已中止,1进行中,2已完成)
@ -137,13 +135,4 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntityWithOperator
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    @Column(name = "service_qr_code")
    public String getServiceQrCode() {
        return serviceQrCode;
    }
    public void setServiceQrCode(String serviceQrCode) {
        this.serviceQrCode = serviceQrCode;
    }
}

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

@ -38,6 +38,8 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    private Integer status;//状态(0未完成,1已完成,2已预约)
    @Column(name = "expense")
    private Integer expense;
    @Column(name = "service_qr_code")
    private String serviceQrCode;//服务码
    @Column(name = "saas_id")
    public String getSaasId() {
@ -137,4 +139,13 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    public void setExpense(Integer expense) {
        this.expense = expense;
    }
    @Column(name = "service_qr_code")
    public String getServiceQrCode() {
        return serviceQrCode;
    }
    public void setServiceQrCode(String serviceQrCode) {
        this.serviceQrCode = serviceQrCode;
    }
}

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

@ -156,10 +156,9 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @PostMapping(value = SpecialistMapping.rehabilitation.createServiceQrCode)
    @ApiOperation(value = "根据康复计划id和居民code生成服务码")
    public MixEnvelop<String,String> createServiceQrCode(@ApiParam(name = "planId", value = "计划居民关系唯一标识")@RequestParam(value = "planId", required = true)String planId,
                                                         @ApiParam(name = "patientCode", value = "居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
    public MixEnvelop<String,String> createServiceQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            return rehabilitationPlanService.createServiceQrCode(planId,patientCode);
            return rehabilitationPlanService.createServiceQrCode(planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -169,19 +168,19 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
    @PostMapping(value = SpecialistMapping.rehabilitation.checkAfterQrCode)
    @ApiOperation(value = "居民扫码后验证是否是关联的居民扫码")
    public MixEnvelop<Boolean,Boolean> checkAfterQrCode(@ApiParam(name = "planId", value = "计划居民关系唯一标识")@RequestParam(value = "planId", required = true)String planId,
    public MixEnvelop<Boolean,Boolean> checkAfterQrCode(@ApiParam(name = "planDetailId", value = "康复计划项目明细ID")@RequestParam(value = "planDetailId", required = true)String planDetailId,
                                                         @ApiParam(name = "patientCode", value = "居民端登录的居民code")@RequestParam(value = "patientCode", required = true)String patientCode){
        try {
            String message="";
            Boolean flag = true;
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==1){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==200){
                message = "验证成功!";
            }
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==-1){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==-1){
                message = "请相关居民扫描二维码";
                flag=false;
            }
            if (rehabilitationPlanService.checkAfterQrCode(planId,patientCode)==-10000){
            if (rehabilitationPlanService.checkAfterQrCode(planDetailId,patientCode)==-10000){
                message = "相关康复管理数据错误,请联系工作人员!";
                flag=false;
            }

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

@ -51,4 +51,6 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    @Query(value ="select count(1) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where doctor in (?1,?2) and p.patient=?3  and d.status=?4",nativeQuery = true)
    Integer completeServiceByDoctor(String generalDoctor,String healthDoctor,String patient,Integer status);
    RehabilitationDetailDO findById(String planDetailId);
}

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

@ -31,6 +31,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by humingfen on 2018/8/17.
@ -126,14 +127,16 @@ public class RehabilitationPlanService {
        }
        return (List<RehabilitationDetailDO>)rehabilitationDetailDao.save(details);
    }
    public MixEnvelop<String,String> createServiceQrCode(String planId,String patientCode){
        PatientRehabilitationPlanDO patientRehabilitationPlanDO = patientRehabilitationPlanDao.findById(planId);
    public MixEnvelop<String,String> createServiceQrCode(String planDetailId){
        RehabilitationDetailDO rehabilitationDetailDO = rehabilitationDetailDao.findById(planDetailId);
        String fileUrl = "";
        if (patientRehabilitationPlanDO!=null) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(patientRehabilitationPlanDO.getServiceQrCode())) {
                fileUrl = patientRehabilitationPlanDO.getServiceQrCode();
        if (rehabilitationDetailDO!=null) {
            if (org.apache.commons.lang3.StringUtils.isNotBlank(rehabilitationDetailDO.getServiceQrCode())) {
                fileUrl = rehabilitationDetailDO.getServiceQrCode();
            } else {
                InputStream ipt = QrcodeUtil.createQrcode(planId+"|"+patientCode, 300, "png");
                String contentJsonStr="{\"planDetailId\":\""+planDetailId+"\"}";
                InputStream ipt = QrcodeUtil.createQrcode(contentJsonStr, 300, "png");
                isneiwang = false;
                if (isneiwang) {
                    // 圖片列表
@ -165,18 +168,19 @@ public class RehabilitationPlanService {
                    }
                }
                //更新到康复计划居民关系表中
                String sql = "update wlyy_patient_rehabilitation_plan set service_qr_code='" + fileUrl + "' where id='" + planId + "'";
                String sql = "update wlyy_rehabilitation_plan_detail set service_qr_code='" + fileUrl + "' where id='" + planDetailId + "'";
                jdbcTemplate.update(sql);
            }
        }
        return MixEnvelop.getSuccess("获取二维码成功!",fileUrl);
    }
    public Integer checkAfterQrCode(String planId,String patietCode){
    public Integer checkAfterQrCode(String planDetailId,String patietCode){
        int result = 0;
        PatientRehabilitationPlanDO patientRehabilitationPlanDO =  patientRehabilitationPlanDao.findById(planId);
        if (patientRehabilitationPlanDO!=null){
            if (StringUtils.pathEquals(patientRehabilitationPlanDO.getPatient(),patietCode)){
        String sql ="SELECT rp.patient FROM `wlyy_rehabilitation_plan_detail` pd LEFT JOIN wlyy_patient_rehabilitation_plan rp ON pd.plan_id = rp.id WHERE pd.id='"+planDetailId+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if (list!=null && list.size()>0){
            if (String.valueOf(list.get(0).get("patient")).equals(patietCode)){
                result =200;
            }else {
                result = -1;