|
@@ -1,5 +1,6 @@
|
|
package thyyxxk.wxservice_server.service;
|
|
package thyyxxk.wxservice_server.service;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -10,6 +11,7 @@ import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
|
|
import thyyxxk.wxservice_server.constant.Constants;
|
|
import thyyxxk.wxservice_server.constant.Constants;
|
|
import thyyxxk.wxservice_server.constant.Gender;
|
|
import thyyxxk.wxservice_server.constant.Gender;
|
|
import thyyxxk.wxservice_server.dao.AppointmentDao;
|
|
import thyyxxk.wxservice_server.dao.AppointmentDao;
|
|
|
|
+import thyyxxk.wxservice_server.entity.BriefPatInfo;
|
|
import thyyxxk.wxservice_server.entity.ResultVo;
|
|
import thyyxxk.wxservice_server.entity.ResultVo;
|
|
import thyyxxk.wxservice_server.entity.appointment.*;
|
|
import thyyxxk.wxservice_server.entity.appointment.*;
|
|
import thyyxxk.wxservice_server.entity.hrgresponse.SourcesResponse;
|
|
import thyyxxk.wxservice_server.entity.hrgresponse.SourcesResponse;
|
|
@@ -247,4 +249,60 @@ public class AppointmentService {
|
|
return ThmzUtil.getResultVoCompletableFuture(hrgResponse);
|
|
return ThmzUtil.getResultVoCompletableFuture(hrgResponse);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ResultVo<List<MzyReqrec>> listMzyReqrecUnPay(BriefPatInfo patInfo) {
|
|
|
|
+ String url = hrgApiUrl + "/listMzyReqrecUnPay?patientId=" + patInfo.getPatientId();
|
|
|
|
+ JSONObject response = new RestTemplate().getForObject(url, JSONObject.class);
|
|
|
|
+ if (null == response) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
|
+ }
|
|
|
|
+ Integer resultCode = response.getInteger("resultCode");
|
|
|
|
+ if (null == resultCode) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if (resultCode != 0) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response.getString("message"));
|
|
|
|
+ }
|
|
|
|
+ JSONArray data = response.getJSONArray("data");
|
|
|
|
+ if (null == data || data.size() == 0) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
|
+ }
|
|
|
|
+ List<MzyReqrec> list = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
|
+ JSONObject mzy = data.getJSONObject(i).getJSONObject("mzyReqrec");
|
|
|
|
+ if (null != mzy) {
|
|
|
|
+ list.add(JSONObject.parseObject(JSONObject.toJSONString(mzy), MzyReqrec.class));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (list.isEmpty()) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
|
+ }
|
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public ResultVo<MzyReqrec> getMzyReqrecInfo(BriefPatInfo patInfo) {
|
|
|
|
+ String url = hrgApiUrl + "/getMzyReqrecInfo?patientId=" + patInfo.getPatientId() + "×=" + patInfo.getTimes();
|
|
|
|
+ JSONObject response = new RestTemplate().getForObject(url, JSONObject.class);
|
|
|
|
+ if (null == response) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
|
+ }
|
|
|
|
+ Integer resultCode = response.getInteger("resultCode");
|
|
|
|
+ if (null == resultCode) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
|
+ }
|
|
|
|
+ if (resultCode != 0) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response.getString("message"));
|
|
|
|
+ }
|
|
|
|
+ JSONObject data = response.getJSONObject("data");
|
|
|
|
+ if (null == data) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
|
+ }
|
|
|
|
+ MzyReqrec mzyReqrec = JSONObject.parseObject(JSONObject.toJSONString(data), MzyReqrec.class);
|
|
|
|
+ if (StringUtil.notBlank(mzyReqrec.getPaymode())) {
|
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
|
+ }
|
|
|
|
+ mzyReqrec.setDoctorCode(redis.getEmployeeName(mzyReqrec.getDoctorCode()));
|
|
|
|
+ mzyReqrec.setUnitCode(redis.getDepartmentName(mzyReqrec.getUnitCode()));
|
|
|
|
+ mzyReqrec.setAmpm(redis.getAmpmName(mzyReqrec.getAmpm()));
|
|
|
|
+ return ResultVoUtil.success(mzyReqrec);
|
|
|
|
+ }
|
|
}
|
|
}
|