|
@@ -1,16 +1,27 @@
|
|
|
package thyyxxk.webserver.controller.jiekou;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import thyyxxk.webserver.config.auth.PassToken;
|
|
|
+import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.datamodify.MzChargeDetail;
|
|
|
import thyyxxk.webserver.entity.jiekou.PatientInformation;
|
|
|
import thyyxxk.webserver.entity.jiekou.getPatientInformationParam;
|
|
|
+import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
+import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.service.jiekou.DuiWaiJieKouService;
|
|
|
+import thyyxxk.webserver.service.zhuyuanyiji.MenZhengXiangMuServer;
|
|
|
+import thyyxxk.webserver.utils.ListUtil;
|
|
|
+import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
+import thyyxxk.webserver.utils.StringUtil;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -23,12 +34,17 @@ import java.util.List;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/thyy")
|
|
|
+@Slf4j
|
|
|
public class DuiWaiJieKouController {
|
|
|
private final DuiWaiJieKouService service;
|
|
|
+ private final PublicServer publicServer;
|
|
|
+ private final MenZhengXiangMuServer mzServer;
|
|
|
|
|
|
@Autowired
|
|
|
- public DuiWaiJieKouController(DuiWaiJieKouService service) {
|
|
|
+ public DuiWaiJieKouController(DuiWaiJieKouService service, PublicServer publicServer, MenZhengXiangMuServer mzServer) {
|
|
|
this.service = service;
|
|
|
+ this.publicServer = publicServer;
|
|
|
+ this.mzServer = mzServer;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -37,4 +53,76 @@ public class DuiWaiJieKouController {
|
|
|
public ResultVo<List<PatientInformation>> getPatientInformation(@RequestBody getPatientInformationParam param) {
|
|
|
return service.getPatientInformation(param);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 门诊项目确认
|
|
|
+ *
|
|
|
+ * @param mz reqNos 可多个申请号 confirmId 操作人 execDept 执行科室
|
|
|
+ * @return 操作提示
|
|
|
+ */
|
|
|
+ @PassToken
|
|
|
+ @PostMapping("/mzProjectConfirm")
|
|
|
+ public ResultVo<String> mzProjectConfirm(@RequestBody MzChargeDetail mz) {
|
|
|
+ log.info("门诊项目确认接口调用:{}", JSON.toJSONString(mz));
|
|
|
+ if (ListUtil.isBlank(mz.getReqNos())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "申请号不能为空。");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(mz.getConfirmId())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "操作人不能为空");
|
|
|
+ }
|
|
|
+ UserInfo userInfo = publicServer.huoQuYuanGongXinXi(mz.getConfirmId());
|
|
|
+ MzChargeDetail mzChargeDetail = new MzChargeDetail();
|
|
|
+ mzChargeDetail.setSource("接口");
|
|
|
+ if (userInfo != null) {
|
|
|
+ if (mz.getExecDept() == null) {
|
|
|
+ mzChargeDetail.setExecDept(userInfo.getDeptCode());
|
|
|
+ } else {
|
|
|
+ mzChargeDetail.setExecDept(mz.getExecDept());
|
|
|
+ }
|
|
|
+ mzChargeDetail.setConfirmId(userInfo.getCode());
|
|
|
+ } else {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到对应的操作人信息。");
|
|
|
+ }
|
|
|
+ mzChargeDetail.setXiangMuZhuangTai(0);
|
|
|
+ for (Integer reqNo : mz.getReqNos()) {
|
|
|
+ if (mzChargeDetail.getList() == null) {
|
|
|
+ mzChargeDetail.setList(new ArrayList<>());
|
|
|
+ }
|
|
|
+ MzChargeDetail chargeDetail = new MzChargeDetail();
|
|
|
+ chargeDetail.setReqNo(reqNo);
|
|
|
+ chargeDetail.setConfirmFlag(1);
|
|
|
+ mzChargeDetail.getList().add(chargeDetail);
|
|
|
+ }
|
|
|
+ ResultVo<String> fanHui = mzServer.menZhenXiangMuQueXiaoHuoQueRen(mzChargeDetail);
|
|
|
+ if (fanHui.getCode() == 201) {
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, fanHui.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ @PassToken
|
|
|
+ @PostMapping("/mzProjectCancel")
|
|
|
+ public ResultVo<String> mzProjectCancel(@RequestBody MzChargeDetail mz) {
|
|
|
+ log.info("门诊项目确认接口调用:{}", JSON.toJSONString(mz));
|
|
|
+ if (ListUtil.isBlank(mz.getReqNos())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "申请号不能为空。");
|
|
|
+ }
|
|
|
+ MzChargeDetail mzChargeDetail = new MzChargeDetail();
|
|
|
+ mzChargeDetail.setSource("接口");
|
|
|
+ for (Integer reqNo : mz.getReqNos()) {
|
|
|
+ if (mzChargeDetail.getList() == null) {
|
|
|
+ mzChargeDetail.setList(new ArrayList<>());
|
|
|
+ }
|
|
|
+ MzChargeDetail chargeDetail = new MzChargeDetail();
|
|
|
+ chargeDetail.setReqNo(reqNo);
|
|
|
+ chargeDetail.setConfirmFlag(3);
|
|
|
+ mzChargeDetail.getList().add(chargeDetail);
|
|
|
+ }
|
|
|
+ ResultVo<String> fanHui = mzServer.menZhenXiangMuQueXiaoHuoQueRen(mzChargeDetail);
|
|
|
+ if (fanHui.getCode() == 201) {
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, fanHui.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
}
|