|  | @ -1,12 +1,35 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.patient.endpoint.sericePackage;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.org.BaseOrgDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.service.servicePackage.PackageService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.base.doctor.BaseDoctorSimpleVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.base.org.BaseOrgVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.patient.signPackage.ServicePackageVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.base.BaseRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.base.WechatRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.patient.PatientRequestMapping;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RequestParam;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.ArrayList;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Trick on 2018/11/27.
 | 
	
		
			
				|  |  |  */
 | 
	
	
		
			
				|  | @ -15,4 +38,90 @@ import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | @Api(value = "居民服务包签约", description = "居民服务包签约", tags = {"居民端 - 居民服务包签约"})
 | 
	
		
			
				|  |  | public class PackageServiceEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PackageService packageService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findPackageService, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取服务包", notes = "获取服务包")
 | 
	
		
			
				|  |  |     public MixEnvelop findPackageService(@ApiParam(name = "city", value = "城市代码")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "city", required = true)String city,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "labelCode", value = "标签code")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "labelCode", required = true)String labelCode,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "city", value = "城市代码")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "city", required = true)String labelType,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "page", value = "第几页")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "page", required = true)Integer page,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "size", required = true)Integer size) {
 | 
	
		
			
				|  |  |         return packageService.findPackageService(city,labelCode,labelType,page,size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findServicePackageByPackageId, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取服务包详情", notes = "获取服务包详情")
 | 
	
		
			
				|  |  |     public ObjEnvelop<ServicePackageVO> findServicePackageByPackageId(@ApiParam(name = "packageId", value = "服务包id")
 | 
	
		
			
				|  |  |                                                           @RequestParam(value = "packageId", required = true)String packageId) {
 | 
	
		
			
				|  |  |         ServicePackageDO packageDO = packageService.findServicePackageByPackageId(packageId);
 | 
	
		
			
				|  |  |         ServicePackageVO packageVO = convertToModel(packageDO,ServicePackageVO.class);
 | 
	
		
			
				|  |  |         List<ServicePackageItemDO> itemDOs = packageService.findServicePackageItemByPackageId(packageId);
 | 
	
		
			
				|  |  |         List<SerivePackageItemVO> itemVOs = new ArrayList<>();
 | 
	
		
			
				|  |  |         convertToModels(itemDOs,itemVOs,SerivePackageItemVO.class);
 | 
	
		
			
				|  |  |         packageVO.setItems(itemVOs);
 | 
	
		
			
				|  |  |         return success(PatientRequestMapping.SignPackage.api_success,packageVO);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findOrgByPackageId, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取服务包执行机构", notes = "获取服务包执行机构")
 | 
	
		
			
				|  |  |     public MixEnvelop findOrgByPackageId(@ApiParam(name = "packageId", value = "服务包id")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "packageId", required = true)String packageId,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "latitude", value = "纬度")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "latitude", required = true)Double latitude,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "longitude", value = "经度")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "longitude", required = true)Double longitude,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "page", value = "第几页")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "page", required = true)Integer page,
 | 
	
		
			
				|  |  |                                          @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                          @RequestParam(value = "size", required = true)Integer size) {
 | 
	
		
			
				|  |  |         return packageService.findOrgByPackageId( packageId, latitude, longitude, page, size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findDoctorByOrg, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取机构下医生", notes = "获取机构下医生")
 | 
	
		
			
				|  |  |     public MixEnvelop findDoctorByOrg(@ApiParam(name = "org", value = "机构code")
 | 
	
		
			
				|  |  |                                       @RequestParam(value = "org", required = true)String org,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "page", value = "第几页")
 | 
	
		
			
				|  |  |                                       @RequestParam(value = "page", required = true)Integer page,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "size", value = "每页大小")
 | 
	
		
			
				|  |  |                                       @RequestParam(value = "size", required = true)Integer size) {
 | 
	
		
			
				|  |  |         return packageService.findDoctorByOrg( org,  page,  size);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.signPackage, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "签约服务包", notes = "签约服务包")
 | 
	
		
			
				|  |  |     public Envelop signPackage(@ApiParam(name = "recordJson", value = "签约实体")
 | 
	
		
			
				|  |  |                                @RequestParam(value = "recordJson", required = true)String recordJson) throws Exception{
 | 
	
		
			
				|  |  |         ServicePackageSignRecordDO recordDO = toEntity(recordJson, ServicePackageSignRecordDO.class);
 | 
	
		
			
				|  |  |         return packageService.signPackage(recordDO);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findDoctorById, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取医生基础信息", notes = "获取医生基础信息")
 | 
	
		
			
				|  |  |     public ObjEnvelop<BaseDoctorSimpleVO> findDoctorById(@ApiParam(name = "doctorCode", value = "机构code")
 | 
	
		
			
				|  |  |                                                          @RequestParam(value = "doctorCode", required = true)String doctorCode) {
 | 
	
		
			
				|  |  |         BaseDoctorDO baseDoctorDO = packageService.findDoctorById(doctorCode);
 | 
	
		
			
				|  |  |         BaseDoctorSimpleVO baseDoctorSimpleVO = convertToModel(baseDoctorDO,BaseDoctorSimpleVO.class);
 | 
	
		
			
				|  |  |         return success(PatientRequestMapping.SignPackage.api_success,baseDoctorSimpleVO);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = PatientRequestMapping.SignPackage.findOrgById, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "获取机构基础信息详情", notes = "获取机构基础信息详情")
 | 
	
		
			
				|  |  |     public ObjEnvelop<BaseOrgVO> findOrgById(@ApiParam(name = "orgId", value = "机构id")
 | 
	
		
			
				|  |  |                                  @RequestParam(value = "orgId", required = true)String orgId) {
 | 
	
		
			
				|  |  |         BaseOrgDO baseOrgDO =  packageService.findOrgById(orgId);
 | 
	
		
			
				|  |  |         BaseOrgVO baseOrgVO = convertToModel(baseOrgDO,BaseOrgVO.class);
 | 
	
		
			
				|  |  |         return success(PatientRequestMapping.SignPackage.api_success,baseOrgVO);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | //=================================
 | 
	
		
			
				|  |  | }
 |