|
@ -25,15 +25,15 @@ import java.util.*;
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/wlyy_service")
|
|
|
@Api(description = "卫计委签约接口调试")
|
|
|
public class WlyySerivceController extends BaseController {
|
|
|
public class WlyySerivceController extends BaseController{
|
|
|
@Autowired
|
|
|
private GuahaoXMService guahaoXM;
|
|
|
|
|
|
@Autowired
|
|
|
private JwSmjkService jwSmjkService;
|
|
|
|
|
|
@Autowired
|
|
|
HttpUtil HttpUtil;
|
|
|
private HttpUtil HttpUtil;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 检查是否签约
|
|
@ -41,19 +41,19 @@ public class WlyySerivceController extends BaseController {
|
|
|
* @param idcard
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/CheckSignFamily", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/sign/CheckSignFamily",method = RequestMethod.POST)
|
|
|
@ApiOperation("检查是否签约")
|
|
|
public String checkSignFamily(@RequestParam("idcard") String idcard) {
|
|
|
try {
|
|
|
public String checkSignFamily(@RequestParam("idcard") String idcard){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idcard, "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "调用失败");
|
|
|
}catch (Exception e){
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -63,20 +63,20 @@ public class WlyySerivceController extends BaseController {
|
|
|
* @param code
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/UploadSignFamily", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/sign/UploadSignFamily",method = RequestMethod.POST)
|
|
|
@ApiOperation("上传签约数据")
|
|
|
public String uploadSignFamily(@RequestParam("code") String code) {
|
|
|
try {
|
|
|
public String uploadSignFamily(@RequestParam("code")String code){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/UploadSignFamily?code=" + code, "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "调用失败");
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -86,19 +86,19 @@ public class WlyySerivceController extends BaseController {
|
|
|
* @param start_time
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/LoadAllSignFamily", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/sign/LoadAllSignFamily",method = RequestMethod.POST)
|
|
|
@ApiOperation("初次采集签约接口")
|
|
|
public String loadAllSignFamily(@RequestParam("start_time") String start_time) {
|
|
|
try {
|
|
|
public String loadAllSignFamily(@RequestParam("start_time")String start_time){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadAllSignFamily?start_time=" + start_time, "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "调用失败");
|
|
|
}catch (Exception e){
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -108,20 +108,20 @@ public class WlyySerivceController extends BaseController {
|
|
|
* @param idcard
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/LoadSignFamily", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/sign/LoadSignFamily",method = RequestMethod.POST)
|
|
|
@ApiOperation("单条采集签约接口")
|
|
|
public String loadSingleSignFamily(@RequestParam("idcard") String idcard) {
|
|
|
try {
|
|
|
public String loadSingleSignFamily(@RequestParam("idcard")String idcard){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamily?idcard=" + idcard, "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "调用失败");
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -132,19 +132,19 @@ public class WlyySerivceController extends BaseController {
|
|
|
* @param end_time
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/LoadSignFamilyBatch", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/sign/LoadSignFamilyBatch",method = RequestMethod.POST)
|
|
|
@ApiOperation("时间范围采集签约接口")
|
|
|
public String loadSignFamilyBatch(@RequestParam("start_time") String start_time, @RequestParam("end_time") String end_time) {
|
|
|
try {
|
|
|
public String loadSignFamilyBatch(@RequestParam("start_time")String start_time,@RequestParam("end_time")String end_time){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamilyBatch?start_time=" + start_time + "&end_time=" + end_time, "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "调用失败");
|
|
|
}catch (Exception e){
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -153,19 +153,19 @@ public class WlyySerivceController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/ReUploadSignFamily", method = RequestMethod.POST)
|
|
|
public String reuploadSignFamily() {
|
|
|
try {
|
|
|
@RequestMapping(value = "/third/sign/ReUploadSignFamily",method = RequestMethod.POST)
|
|
|
public String reuploadSignFamily(){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUploadSignFamily", "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "调用失败");
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -174,37 +174,36 @@ public class WlyySerivceController extends BaseController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/sign/ReUpdateSignFamily", method = RequestMethod.POST)
|
|
|
public String reupdateSignFamily() {
|
|
|
try {
|
|
|
@RequestMapping(value = "/third/sign/ReUpdateSignFamily",method = RequestMethod.POST)
|
|
|
public String reupdateSignFamily(){
|
|
|
try{
|
|
|
String checkUrl = SystemConf.getInstance().getJwUrl();
|
|
|
String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUpdateSignFamily", "");
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
return write(-1, "调用失败");
|
|
|
} else {
|
|
|
return write(200, "调用成功", "data", jsonString);
|
|
|
if(StringUtils.isEmpty(jsonString)){
|
|
|
return write(-1,"调用失败");
|
|
|
}else{
|
|
|
return write(200,"调用成功","data",jsonString);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
return error(-1, "调用失败");
|
|
|
}catch (Exception e){
|
|
|
return error(-1,"调用失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 转诊预约医生特殊号源获取
|
|
|
*
|
|
|
* @param OrgCode 医院编号
|
|
|
* @param OrgCode 医院编号
|
|
|
* @param DeptCode 科室编号
|
|
|
* @param DocCode 医生编号
|
|
|
* @param DocCode 医生编号
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/smjk/RegDeptSpeDoctorSectionList", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/smjk/RegDeptSpeDoctorSectionList",method = RequestMethod.POST)
|
|
|
@ApiOperation("转诊预约获取特殊号源接口")
|
|
|
public String getSpeDoctorSectionList(@RequestParam("OrgCode") String OrgCode,
|
|
|
@RequestParam("DeptCode") String DeptCode,
|
|
|
@RequestParam("DocCode") String DocCode) {
|
|
|
try {
|
|
|
List<Map<String, Object>> list = guahaoXM.GetDoctorArrangeTenDay(OrgCode, DeptCode, DocCode);
|
|
|
@RequestParam("DocCode") String DocCode){
|
|
|
try{
|
|
|
List<Map<String,Object>> list = guahaoXM.GetDoctorArrangeTenDay(OrgCode,DeptCode,DocCode);
|
|
|
return write(200, "获取医生排班成功!", "data", list);
|
|
|
|
|
|
/* *//*****modify by linz 暂时把号源转换成普通号源****//*
|
|
@ -214,107 +213,107 @@ public class WlyySerivceController extends BaseController {
|
|
|
map.put("date",date.replaceAll("-","/"));
|
|
|
}
|
|
|
return write(200, "获取医生排班成功!", "data", list);*/
|
|
|
} catch (Exception e) {
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "医生排班时间获取失败");
|
|
|
return error(-1,"医生排班时间获取失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取转诊预约医生列表
|
|
|
*
|
|
|
* @param orgCode 机构编码
|
|
|
* @param deptCode 科室编码
|
|
|
* @param strCredential 身份证据
|
|
|
* @param orgCode 机构编码
|
|
|
* @param deptCode 科室编码
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/third/smjk/RegDeptSpeDoctorList", method = RequestMethod.POST)
|
|
|
@RequestMapping(value = "/third/smjk/RegDeptSpeDoctorList",method = RequestMethod.POST)
|
|
|
@ApiOperation("获取转诊预约医生列表")
|
|
|
@ResponseBody
|
|
|
public String getRegDeptSpeDoctorList(
|
|
|
@ApiParam(name = "orgCode", value = "机构编码") @RequestParam(name = "orgCode", required = true) String orgCode,
|
|
|
@ApiParam(name = "deptCode", value = "科室编码") @RequestParam(name = "deptCode", required = true) String deptCode,
|
|
|
@ApiParam(name = "strCredential", value = "身份证据") @RequestParam(name = "strCredential", required = true) String strCredential) {
|
|
|
@ApiParam(name="orgCode",value="机构编码") @RequestParam(name="orgCode",required = true) String orgCode,
|
|
|
@ApiParam(name="deptCode",value="科室编码") @RequestParam(name="deptCode",required = true) String deptCode){
|
|
|
|
|
|
try {
|
|
|
String list = jwSmjkService.getRegDeptSpeDoctorList(orgCode, deptCode, strCredential);
|
|
|
//10天排班的医生列表
|
|
|
//String list = jwSmjkService.getRegDeptSpeDoctorList(orgCode,deptCode);
|
|
|
|
|
|
//7天排班的医生列表
|
|
|
String list = jwSmjkService.GetDoctorList(orgCode,deptCode);
|
|
|
return write(200, "获取转诊预约医生列表成功!", "data", list);
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return error(-1, "获取转诊预约医生列表列表失败");
|
|
|
return error(-1,"获取转诊预约医生列表列表失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 转诊预约医生号源转换
|
|
|
*
|
|
|
* @param xml
|
|
|
* @return
|
|
|
*/
|
|
|
private List<Map<String, Object>> parseXmlForSpe(String xml) {
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
|
Document document = null;
|
|
|
try {
|
|
|
document = DocumentHelper.parseText(xml);
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException("解析数据失败!");
|
|
|
}
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();//取出root的子集合
|
|
|
for (Object o : child) {
|
|
|
List<?> dataList = ((Element) o).elements();
|
|
|
for (Object dataElement : dataList) {
|
|
|
private List<Map<String,Object>> parseXmlForSpe(String xml) {
|
|
|
List<Map<String,Object>> re = new ArrayList<>();
|
|
|
Document document = null;
|
|
|
try{
|
|
|
document = DocumentHelper.parseText(xml);
|
|
|
}catch (Exception e){
|
|
|
throw new RuntimeException("解析数据失败!");
|
|
|
}
|
|
|
Element root = document.getRootElement();
|
|
|
List<?> child = root.elements();//取出root的子集合
|
|
|
for (Object o : child) {
|
|
|
List<?> dataList = ((Element) o).elements();
|
|
|
for(Object dataElement:dataList) {
|
|
|
|
|
|
Element e = (Element) dataElement;
|
|
|
// 日期
|
|
|
String date = e.attributeValue("date");
|
|
|
// a或者p
|
|
|
String time = e.attributeValue("time");
|
|
|
// 限号
|
|
|
String max = e.attributeValue("max");
|
|
|
// 已使用的号
|
|
|
String used = e.attributeValue("used");
|
|
|
// 1正常、2满号、3已过期
|
|
|
String status = e.attributeValue("status");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("date", date);
|
|
|
map.put("time", time);
|
|
|
map.put("max", max);
|
|
|
map.put("used", used);
|
|
|
map.put("status", status);
|
|
|
// 排班信息
|
|
|
List<?> sections = e.elements();
|
|
|
List<Map<String, String>> arrangeList = new ArrayList<>();
|
|
|
for (Object s : sections) {
|
|
|
Element section = (Element) s;
|
|
|
Element e = (Element) dataElement;
|
|
|
// 日期
|
|
|
String date = e.attributeValue("date");
|
|
|
// a或者p
|
|
|
String time = e.attributeValue("time");
|
|
|
// 限号
|
|
|
String s_max = section.attributeValue("max");
|
|
|
String max = e.attributeValue("max");
|
|
|
// 已使用的号
|
|
|
String s_used = section.attributeValue("used");
|
|
|
// 一次专家坐诊时间段的开始时间
|
|
|
String start_time = section.attributeValue("start_time");
|
|
|
// 结束时间
|
|
|
String end_time = section.attributeValue("end_time");
|
|
|
String used = e.attributeValue("used");
|
|
|
// 1正常、2满号、3已过期
|
|
|
String status = e.attributeValue("status");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("date", date);
|
|
|
map.put("time", time);
|
|
|
map.put("max", max);
|
|
|
map.put("used", used);
|
|
|
map.put("status", status);
|
|
|
// 排班信息
|
|
|
List<?> sections = e.elements();
|
|
|
List<Map<String, String>> arrangeList = new ArrayList<>();
|
|
|
for (Object s : sections) {
|
|
|
Element section = (Element) s;
|
|
|
// 限号
|
|
|
String s_max = section.attributeValue("max");
|
|
|
// 已使用的号
|
|
|
String s_used = section.attributeValue("used");
|
|
|
// 一次专家坐诊时间段的开始时间
|
|
|
String start_time = section.attributeValue("start_time");
|
|
|
// 结束时间
|
|
|
String end_time = section.attributeValue("end_time");
|
|
|
|
|
|
Map<String, String> item = new HashMap<>();
|
|
|
item.put("max", s_max);
|
|
|
item.put("used", s_used);
|
|
|
item.put("startTime", start_time);
|
|
|
item.put("endTime", end_time);
|
|
|
arrangeList.add(item);
|
|
|
Map<String, String> item = new HashMap<>();
|
|
|
item.put("max", s_max);
|
|
|
item.put("used", s_used);
|
|
|
item.put("startTime", start_time);
|
|
|
item.put("endTime", end_time);
|
|
|
arrangeList.add(item);
|
|
|
}
|
|
|
map.put("sections", arrangeList);
|
|
|
re.add(map);
|
|
|
}
|
|
|
map.put("sections", arrangeList);
|
|
|
re.add(map);
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
|
|
|
public static Date getDateAfter(Date d, int day) {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.setTime(d);
|
|
|
now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
|
|
|
return now.getTime();
|
|
|
}
|
|
|
public static Date getDateAfter(Date d, int day) {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.setTime(d);
|
|
|
now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
|
|
|
return now.getTime();
|
|
|
}
|
|
|
}
|