Trick 6 anni fa
parent
commit
58f37c73a8

+ 18 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/config/UrlconfigEndPoint.java

@ -0,0 +1,18 @@
package com.yihu.jw.patient.endpoint.config;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Trick on 2018/12/10.
 */
@RestController
@RequestMapping(PatientRequestMapping.open.openUrl)
@Api(tags = "开发接口", description = "开发接口")
public class UrlconfigEndPoint extends EnvelopRestEndpoint {
}

+ 26 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java

@ -13,6 +13,7 @@ import com.yihu.jw.restmodel.base.doctor.BaseDoctorSimpleVO;
import com.yihu.jw.restmodel.base.label.BasePatientLabelVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageRecordVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2018/11/27.
@ -103,6 +105,24 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return packageService.signPackage(recordDO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.signPackageAndFamily)
    @ApiOperation(value = "绑定家人,签约服务包", notes = "绑定家人,签约服务包")
    public Envelop signPackageAndFamily(@ApiParam(name = "recordJson", value = "签约实体")
                                        @RequestParam(value = "recordJson", required = true)String recordJson,
                                        @ApiParam(name = "patient", value = "申请绑定的居民code")
                                        @RequestParam(value = "patient", required = true)String patient,
                                        @ApiParam(name = "familyMobile", value = "家人的手机号码")
                                        @RequestParam(value = "familyMobile", required = true)String familyMobile,
                                        @ApiParam(name = "platform", value = "消息平台,1微信端/患者端,2医生APP端")
                                        @RequestParam(value = "platform", required = true)Integer platform,
                                        @ApiParam(name = "familyBindRole", value = "1\"配偶\",2\"父亲\",3\"母亲\",4\"公公\",5\"婆婆\",6\"岳父\",7\"岳母\",8\"女婿\",9\"儿媳\",10\"子女\"")
                                        @RequestParam(value = "familyBindRole", required = true)Integer familyBindRole,
                                        @ApiParam(name = "isAdult", value = "0未成年人 1成年人")
                                        @RequestParam(value = "isAdult", required = true)Integer isAdult) throws Exception {
        ServicePackageSignRecordDO recordDO = toEntity(recordJson, ServicePackageSignRecordDO.class);
        return packageService.signPackageAndFamily(recordDO,patient,familyMobile,platform,familyBindRole,isAdult);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findDoctorById)
    @ApiOperation(value = "获取医生基础信息", notes = "获取医生基础信息")
    public ObjEnvelop<BaseDoctorSimpleVO> findDoctorById(@ApiParam(name = "doctorCode", value = "医生code")
@ -157,5 +177,11 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return MixEnvelop.getSuccess(PatientRequestMapping.SignPackage.api_success,basePatientLabelVOs);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findSingleSignPackageById)
    @ApiOperation(value = "根据签约id获取签约详情", notes = "根据签约id获取签约详情")
    public ObjEnvelop<ServicePackageRecordVO> findSingleSignPackageById(@ApiParam(name = "signId", value = "签约id") @RequestParam(value = "signId", required = false)String signId) {
        return success(PatientRequestMapping.SignPackage.api_success,packageService.findSingleSignPackageById(signId));
    }
//=================================
}

+ 46 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

@ -236,6 +236,16 @@ public class PackageService {
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
    }
    public Envelop signPackageAndFamily(ServicePackageSignRecordDO recordDO,String patient, String familyMobile, Integer platform, Integer familyBindRole, Integer isAdult) throws Exception{
        //1.绑定家人
        myFamilyService.signBindFamily(patient,familyMobile,platform,familyBindRole,isAdult);
        //2.服务签约
        servicePackageSignRecordDao.save(recordDO);
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
    }
    public BaseDoctorDO findDoctorById(String doctorCode){
        return baseDoctorDao.findOne(doctorCode);
    }
@ -380,6 +390,42 @@ public class PackageService {
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
    public ServicePackageRecordVO findSingleSignPackageById(String signId){
        String sql="SELECT " +
                " r.id, " +
                " r.saas_id AS saasId," +
                " p.id AS servicePackageId, " +
                " p.name AS servicePackageName, " +
                " r.patient," +
                " r.name," +
                " r.idcard," +
                " r.sign_doctor AS signDoctor, " +
                " r.sign_doctor_name AS signDoctorName, " +
                " r.ssc," +
                " r.hospital," +
                " r.hospital_name AS hospitalName," +
                " r.admin_team_code AS adminTeamCode," +
                " r.price," +
                " r.start_time AS startTime," +
                " r.end_time AS endTime," +
                " r.status," +
                " r.doctor_team_code AS doctorTeamCode," +
                " r.operator," +
                " r.create_time AS createTime," +
                " r.sort," +
                " p.introduce, " +
                " p.end_introduce AS endIntroduce " +
                " FROM " +
                " base_service_package_sign_record r  " +
                " JOIN base_service_package p ON r.service_package_id = p.id " +
                " WHERE r.id='"+signId+"'";
        List<ServicePackageRecordVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServicePackageRecordVO.class));
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
    public List<PatientLabelDO> findLabelByLabelType(String labelType){
       return patientLabelDao.findByLabelTypeAndStatus(labelType,1);
    }