|
@ -20,6 +20,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.entity.ServiceException;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@ -28,12 +29,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
@ -50,7 +47,7 @@ import java.util.*;
|
|
|
* @author George
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/patient/consult", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@RequestMapping(value = "/patient/consult")
|
|
|
@Api(description = "患者端-患者咨询")
|
|
|
public class ConsultController extends EnvelopRestEndpoint {
|
|
|
|
|
@ -98,6 +95,32 @@ public class ConsultController extends EnvelopRestEndpoint {
|
|
|
@Value("${im.data_base_name}")
|
|
|
private String im;
|
|
|
|
|
|
/**
|
|
|
* 修改状态为1的咨询记录为结束
|
|
|
*
|
|
|
* @param code 咨询标识
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping(value = "finish")
|
|
|
@ApiOperation("修改状态为1的咨询记录为结束")
|
|
|
public Envelop finish(@RequestParam(required = true) String code) {
|
|
|
try {
|
|
|
int row = consultTeamService.finishConsult(code, getRepUID(), 1);
|
|
|
if (row > 0) {
|
|
|
return Envelop.getSuccess("操作成功!");
|
|
|
}else if(row == -2) {
|
|
|
return Envelop.getError( "续方未审核,不能结束续方咨询!",-1);
|
|
|
} else {
|
|
|
return Envelop.getError("操作失败!",-1);
|
|
|
}
|
|
|
} catch (ServiceException se) {
|
|
|
return Envelop.getError(se.getMessage(),-1);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return Envelop.getError("操作失败!",-1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取未完成咨询
|
|
|
*
|