|
@ -1,8 +1,8 @@
|
|
package com.yihu.jw.patient.endpoint.personal_info;
|
|
package com.yihu.jw.patient.endpoint.personal_info;
|
|
|
|
|
|
import com.yihu.jw.base.service.patient.BasePatientService;
|
|
|
|
import com.yihu.jw.base.util.ConstantUtils;
|
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
|
import com.yihu.jw.patient.service.personal_Info.PatientService;
|
|
|
|
import com.yihu.jw.patient.util.ConstantUtils;
|
|
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
|
|
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
@ -32,17 +32,17 @@ import java.util.Map;
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(value = BaseRequestMapping.BasePatient.PREFIX)
|
|
@RequestMapping(value = BaseRequestMapping.BasePatient.PREFIX)
|
|
@Api(value = "居民信息管理", description = "居民信息管理服务接口", tags = {"wlyy基础服务 - 居民信息管理服务接口"})
|
|
@Api(value = "居民信息管理", description = "居民信息管理服务接口", tags = {"wlyy基础服务 - 居民信息管理服务接口"})
|
|
public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
public class PatientEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private BasePatientService basePatientService;
|
|
|
|
|
|
private PatientService patientService;
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.BasePatient.CREATE)
|
|
@PostMapping(value = BaseRequestMapping.BasePatient.CREATE)
|
|
@ApiOperation(value = "创建")
|
|
@ApiOperation(value = "创建")
|
|
public Envelop create(
|
|
public Envelop create(
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
@RequestParam String jsonData) throws Exception {
|
|
@RequestParam String jsonData) throws Exception {
|
|
String msg = basePatientService.createPatient(jsonData);
|
|
|
|
|
|
String msg = patientService.createPatient(jsonData);
|
|
if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
|
|
if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
|
|
return success(msg);
|
|
return success(msg);
|
|
}
|
|
}
|
|
@ -54,7 +54,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
public Envelop delete(
|
|
public Envelop delete(
|
|
@ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
|
|
@ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
|
|
@RequestParam(value = "ids") String ids) {
|
|
@RequestParam(value = "ids") String ids) {
|
|
basePatientService.delete(ids.split(","));
|
|
|
|
|
|
patientService.delete(ids.split(","));
|
|
return success("删除成功");
|
|
return success("删除成功");
|
|
}
|
|
}
|
|
|
|
|
|
@ -63,7 +63,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
public Envelop update(
|
|
public Envelop update(
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
@RequestParam String jsonData) throws Exception {
|
|
@RequestParam String jsonData) throws Exception {
|
|
String msg = basePatientService.updatePatient(jsonData);
|
|
|
|
|
|
String msg = patientService.updatePatient(jsonData);
|
|
if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
|
|
if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
|
|
return failed(msg);
|
|
return failed(msg);
|
|
}
|
|
}
|
|
@ -75,7 +75,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
public Envelop getPatientById(
|
|
public Envelop getPatientById(
|
|
@ApiParam(name = "id", value = "居民id")
|
|
@ApiParam(name = "id", value = "居民id")
|
|
@RequestParam(value = "id", required = true) String id) throws Exception {
|
|
@RequestParam(value = "id", required = true) String id) throws Exception {
|
|
String result = basePatientService.getPatientById(id);
|
|
|
|
|
|
String result = patientService.getPatientById(id);
|
|
return success(result);
|
|
return success(result);
|
|
}
|
|
}
|
|
|
|
|
|
@ -92,8 +92,8 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "page") int page,
|
|
@RequestParam(value = "page") int page,
|
|
@ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
|
|
@ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
|
|
@RequestParam(value = "size") int size) throws Exception {
|
|
@RequestParam(value = "size") int size) throws Exception {
|
|
List<BasePatientDO> basePatients = basePatientService.search(fields, filters, sorts, page, size);
|
|
|
|
int count = (int) basePatientService.getCount(filters);
|
|
|
|
|
|
List<BasePatientDO> basePatients = patientService.search(fields, filters, sorts, page, size);
|
|
|
|
int count = (int) patientService.getCount(filters);
|
|
return success(basePatients, count, page, size, BasePatientVO.class);
|
|
return success(basePatients, count, page, size, BasePatientVO.class);
|
|
}
|
|
}
|
|
|
|
|
|
@ -106,7 +106,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
|
|
@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
|
|
@RequestParam(value = "sorts", required = false) String sorts) throws Exception {
|
|
@RequestParam(value = "sorts", required = false) String sorts) throws Exception {
|
|
List<BasePatientDO> basePatients = basePatientService.search(fields, filters, sorts);
|
|
|
|
|
|
List<BasePatientDO> basePatients = patientService.search(fields, filters, sorts);
|
|
return success(basePatients, BasePatientVO.class);
|
|
return success(basePatients, BasePatientVO.class);
|
|
}
|
|
}
|
|
|
|
|
|
@ -122,7 +122,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
|
|
@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
|
|
@RequestParam(value = "sorts", required = false) String sorts) throws Exception {
|
|
@RequestParam(value = "sorts", required = false) String sorts) throws Exception {
|
|
|
|
|
|
List<Map<String,Object>> basePatients = basePatientService.queryPatientBaseInfo(nameOrIdcard, page,size,sorts);
|
|
|
|
|
|
List<Map<String,Object>> basePatients = patientService.queryPatientBaseInfo(nameOrIdcard, page,size,sorts);
|
|
return success(basePatients);
|
|
return success(basePatients);
|
|
}
|
|
}
|
|
}
|
|
}
|