|
@@ -0,0 +1,59 @@
|
|
|
+package thyyxxk.webserver.service.yibaokeshipipei;
|
|
|
+
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
+import thyyxxk.webserver.dao.his.yibaokeshipipei.YibaoKeShiPiPeiDao;
|
|
|
+import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
+import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
+import thyyxxk.webserver.utils.TokenUtil;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 描述: 医保科室匹配
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author xc
|
|
|
+ * @date 2021-07-21 14:29
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@Slf4j
|
|
|
+public class YiBaoKeShiPiPeiService {
|
|
|
+
|
|
|
+ private final YibaoKeShiPiPeiDao dao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public YiBaoKeShiPiPeiService(YibaoKeShiPiPeiDao dao) {
|
|
|
+ this.dao = dao;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return 获取 本院全部科室的code和name 在这里判断一下 如果 si_caty 为空的话 那就说明 是没有匹配的 切不显示 8 开头的科室
|
|
|
+ */
|
|
|
+ public ResultVo<List<GetDropdownBox>> getBenYuanKeShi(Integer flag) {
|
|
|
+ return ResultVoUtil.success(dao.getBenYuanKeShiCode(flag));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return 返回 医保科室的 code 和 name
|
|
|
+ */
|
|
|
+ public ResultVo<List<GetDropdownBox>> getYiBaoKeShi() {
|
|
|
+ return ResultVoUtil.success(dao.getYiBaoKeShi());
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<Integer> piPeiKeShi(String benYuanCode, String yiBaoCode, Integer flag) {
|
|
|
+ if (flag == 1) {
|
|
|
+ log.info("匹配医保科室编码 ==> 操作人:{},本院编码:{},医保编码:{}", TokenUtil.getTokenUserId(), benYuanCode, yiBaoCode);
|
|
|
+ dao.piPeiKeShi(benYuanCode, yiBaoCode);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "匹配成功。");
|
|
|
+ } else {
|
|
|
+ log.info("删除医保科室匹配关系 ==> 操作人:{},本院编码:{},医保编码:{}", TokenUtil.getTokenUserId(), benYuanCode, yiBaoCode);
|
|
|
+ dao.piPeiKeShi(benYuanCode, null);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "删除匹配成功。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|