|
@ -22,6 +22,7 @@ import io.swagger.annotations.ApiParam;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
@ -47,12 +48,44 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
|
|
private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
|
|
private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
|
|
@Autowired
|
|
@Autowired
|
|
private ServiceItemConfigService itemConfigService;
|
|
private ServiceItemConfigService itemConfigService;
|
|
|
|
@Autowired
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
|
@GetMapping(value = "findDoctorByOrg")
|
|
|
|
@ApiOperation(value = "查询机构医生")
|
|
|
|
public PageEnvelop findDoctorByOrg(@ApiParam(name = "orgCode", value = "机构code", required = false)
|
|
|
|
@RequestParam(value = "orgCode",required = false) String orgCode,
|
|
|
|
@ApiParam(name = "name", value = "医生姓名", required = false)
|
|
|
|
@RequestParam(value = "name",required = false) String name,
|
|
|
|
@ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
|
|
|
|
@RequestParam(value = "page") int page,
|
|
|
|
@ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
|
|
|
|
@RequestParam(value = "size") int size){
|
|
|
|
try {
|
|
|
|
String sql = "SELECT d.id,d.name,h.dept_name deptName,d.mobile ";
|
|
|
|
String countSql = "SELECT count(d.id)";
|
|
|
|
String filter = " from base_doctor_hospital h,base_doctor d WHERE h.doctor_code=d.id and d.del='1' and d.enabled='1' and h.del='1'";
|
|
|
|
if(StringUtils.isNotBlank(orgCode)){
|
|
|
|
filter += " and h.org_code='"+orgCode+"' ";
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(name)){
|
|
|
|
filter += " and d.name like '%"+name+"%' ";
|
|
|
|
}
|
|
|
|
String orderBy = " limit "+(page-1)*size+","+size;
|
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filter+orderBy);
|
|
|
|
Long count = jdbcTemplate.queryForObject(countSql+filter,Long.class);
|
|
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,count);
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return PageEnvelop.getError("查询失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = BaseRequestMapping.ServicePackage.CREATE)
|
|
@PostMapping(value = BaseRequestMapping.ServicePackage.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){
|
|
try {
|
|
try {
|
|
ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
|
|
ServicePackageDO servicePackageDO = toEntity(jsonData, ServicePackageDO.class);
|
|
servicePackageService.create(servicePackageDO,getUID());
|
|
servicePackageService.create(servicePackageDO,getUID());
|