Jelajahi Sumber

专科医生签约接口补充

zdm 6 tahun lalu
induk
melakukan
63cc499e50

+ 20 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java

@ -73,6 +73,10 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntityWithOperator
    private Date signDate;//签约日期
    @Column(name = "remark")
    private String remark;//记录专科医生审核原因等
    @Column(name = "sign_certificate")
    private String signCertificate;//签约证明
    @Column(name = "health_status_code")
    private String healthStatusCode;//健康状况编码
    public String getSaasId() {
@ -236,4 +240,20 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntityWithOperator
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getSignCertificate() {
        return signCertificate;
    }
    public void setSignCertificate(String signCertificate) {
        this.signCertificate = signCertificate;
    }
    public String getHealthStatusCode() {
        return healthStatusCode;
    }
    public void setHealthStatusCode(String healthStatusCode) {
        this.healthStatusCode = healthStatusCode;
    }
}

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

@ -39,6 +39,7 @@ public class SpecialistMapping {
        public static final String getPatientAndDiseaseByDoctor ="/getPatientAndDiseaseByDoctor";
        public static final String searchPatientInSpecialist ="/searchPatientInSpecialist";
        public static final String searchPatientInSpeciaInfo ="/searchPatientInSpeciaInfo";
        public static final String createPatientInSpeciaRelation ="/createPatientInSpeciaRelation";

+ 32 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -12,6 +12,7 @@ import com.yihu.jw.service.SpecialistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
@ -403,7 +404,37 @@ public class SpecialistController extends EnvelopRestEndpoint {
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return null;
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.specialist.createPatientInSpeciaRelation)
    @ApiOperation(value = "专科医生发起签约")
    public ObjEnvelop<SpecialistPatientRelationDO> createPatientInSpeciaRelation(
            @ApiParam(name = "jsonData", value = "签约关系json")
            @RequestParam(value = "jsonData") String jsonData) {
        try {
            SpecialistPatientRelationDO specialistPatientRelationDO=toEntity(jsonData,SpecialistPatientRelationDO.class);
            if(StringUtils.isBlank(specialistPatientRelationDO.getPatient())){
                return failed("病人编码不能为空!",ObjEnvelop.class);
            }
            if(StringUtils.isBlank(specialistPatientRelationDO.getPatientName())){
                return failed("病人姓名不能为空!",ObjEnvelop.class);
            }
            if(StringUtils.isBlank(specialistPatientRelationDO.getDoctor())){
                return failed("医生编码不能为空!",ObjEnvelop.class);
            }
            if(StringUtils.isBlank(specialistPatientRelationDO.getDoctorName())){
                return failed("医生姓名不能为空!",ObjEnvelop.class);
            }
            if(null==specialistPatientRelationDO.getTeamCode()){
                return failed("医生团队不能为空!",ObjEnvelop.class);
            }
            return specialistService.createPatientInSpeciaRelation(specialistPatientRelationDO);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }

+ 19 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -8,6 +8,7 @@ import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -866,4 +867,22 @@ public class SpecialistService{
        return jsonObject;
    }
    /**
     * 专科医生发起签约
     * @param specialistPatientRelationDO
     * @return
     * @throws Exception
     */
    public ObjEnvelop<SpecialistPatientRelationDO> createPatientInSpeciaRelation(SpecialistPatientRelationDO specialistPatientRelationDO) throws Exception {
        specialistPatientRelationDO.setSignStatus("1");
        specialistPatientRelationDO.setSignDate(new Date());
        specialistPatientRelationDO.setCreateUser(specialistPatientRelationDO.getDoctor());
        specialistPatientRelationDO.setCreateUserName(specialistPatientRelationDO.getDoctorName());
        specialistPatientRelationDO.setStatus("1");//计管师分配状态
        specialistPatientRelationDO.setSignYear(String.valueOf(DateUtil.getNowYear()));
        specialistPatientRelationDO.setSignDate(new Date());
        specialistPatientRelationDO = specialistPatientRelationDao.save(specialistPatientRelationDO);
        return ObjEnvelop.getSuccess("success", specialistPatientRelationDO);
    }
}