|
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
+import thyyxxk.simzfeeoprnsystm.config.MedinsurConfig;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.RxDao;
|
|
|
import thyyxxk.simzfeeoprnsystm.dicts.SiFunction;
|
|
|
import thyyxxk.simzfeeoprnsystm.pojo.CodeName;
|
|
@@ -34,19 +35,41 @@ public class DigitalReceiptService {
|
|
|
private final ExecService exec;
|
|
|
private final RxDao rxDao;
|
|
|
private final RestTemplate template;
|
|
|
+ private final MedinsurConfig cfg;
|
|
|
// 处方流转正式地址
|
|
|
// private final static String cflzUrl = "http://130.150.161.72:8079/cflz";
|
|
|
// private final static String ypcxUrl = "http://130.150.161.72:8079/cflzYpcx";
|
|
|
+ // private final static String drCxUrl = "http://130.150.161.72:8079/drCx";
|
|
|
|
|
|
// 处方流转测试地址
|
|
|
private final static String cflzUrl = "http://130.150.161.72:8079/testCflz";
|
|
|
private final static String ypcxUrl = "http://130.150.161.72:8079/testCflzYpcx";
|
|
|
+ private final static String drcxUrl = "http://130.150.161.72:8079/testDrCx";
|
|
|
|
|
|
@Autowired
|
|
|
- public DigitalReceiptService(ExecService exec, RxDao rxDao, RestTemplate template) {
|
|
|
+ public DigitalReceiptService(ExecService exec, RxDao rxDao, RestTemplate template, MedinsurConfig cfg) {
|
|
|
this.exec = exec;
|
|
|
this.rxDao = rxDao;
|
|
|
this.template = template;
|
|
|
+ this.cfg = cfg;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<JSONObject> drInquiry() throws Exception {
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("fixmedinsCode", cfg.getHospId());
|
|
|
+ data.put("mdtrtareaAdmvs", cfg.getHospArea());
|
|
|
+ JSONObject input = HseEncAndDecUtil.encryptMsg(data);
|
|
|
+ log.info("查询定点医师信息明文:{}", data);
|
|
|
+ JSONObject result = template.postForObject(drcxUrl, input, JSONObject.class);
|
|
|
+ if (null == result) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
+ }
|
|
|
+ Integer code = result.getInteger("code");
|
|
|
+ if (null == code || code != 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("message"));
|
|
|
+ }
|
|
|
+ JSONObject decryptResult = HseEncAndDecUtil.decryptMsg(result);
|
|
|
+ return ResultVoUtil.success(decryptResult);
|
|
|
}
|
|
|
|
|
|
public ResultVo<JSONObject> medicineInquiry(MedicineInquiry inquiry) throws Exception {
|
|
@@ -126,6 +149,8 @@ public class DigitalReceiptService {
|
|
|
if (null == phar || StringUtil.isBlank(phar.getYbCode())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "审方药师医保编码不能为空。");
|
|
|
}
|
|
|
+ request.getRxMdtrtinfo().setPrscDrCertType("01");
|
|
|
+ request.getRxMdtrtinfo().setPrscDrCertno("320823197007280258");
|
|
|
String dataRef = JSONObject.toJSONStringWithDateFormat(request.getRxPreCheck(), "yyyy-MM-dd HH:mm:ss");
|
|
|
JSONObject data = JSONObject.parseObject(dataRef);
|
|
|
String rxdrugdetailRef = JSONArray.toJSONStringWithDateFormat(request.getRxDrugDetailList(), "yyyy-MM-dd HH:mm:ss");
|