|
@@ -1,5 +1,6 @@
|
|
|
package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -8,9 +9,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.JianChaShenQingDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.JcZdClass;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.YshYjReq;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.YshZdYjTemplate;
|
|
|
+import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.ZyTcYj;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.query.ChaXunJianCha;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.PatientTemp;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
@@ -112,6 +115,33 @@ public class JianChaShenQingServer {
|
|
|
return ResultVoUtil.success(dao.chaKanFenLeiXiangQing(code, bwCode));
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<String> shanShuJianChaMuBan(String code, String deptCode) {
|
|
|
+ ZyTcYj yj = dao.jianChaLuRuRen(code);
|
|
|
+ if (yj == null) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找对应的记录可能已经被删除了。");
|
|
|
+ }
|
|
|
+ if (jianChaMuBanPanDuan(yj.getOpId(), yj.getTcExec(), deptCode)) {
|
|
|
+ dao.shanChuJianChaMuBan(code);
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有权限修改。");
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean jianChaMuBanPanDuan(String opId, String tcExec, String deptCode) {
|
|
|
+ List<Integer> userRole = publicServer.getRoleCode().getData();
|
|
|
+ // 医务部
|
|
|
+ if (userRole.contains(38)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // 科主任 可以删除自己科室任意模板
|
|
|
+ if (userRole.contains(11) && tcExec.trim().equals(deptCode)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // 普通的只能删除自己的
|
|
|
+ return opId.trim().equals(TokenUtil.getTokenUserId());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public ResultVo<IPage<YshZdYjTemplate>> huoMuShuoMingMuBan(String name, Integer fenLei, long total, long currentPage) {
|
|
|
Page<YshZdYjTemplate> page = new Page<>(currentPage, 20, total == 0);
|
|
|
page = dao.huoQuShuoMingMuBan(page, StringUtil.isContainChinese(name), fenLei, TokenUtil.getTokenUserId());
|
|
@@ -131,10 +161,37 @@ public class JianChaShenQingServer {
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
+ private ResultVo<String> xiuGaiMuBan(YshZdYjTemplate param, YshZdYjTemplate mb) {
|
|
|
+ if (publicServer.noNeedRule(new int[]{38})) {
|
|
|
+ if (!TokenUtil.getTokenUserId().equals(mb.getOpId().trim())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该模板创建人不是你,无法操作。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dao.genXingShouMingMuBan(param.getJcText(), param.getName(),
|
|
|
+ PingYinUtils.pyShouZiMuDaXie(param.getName()),
|
|
|
+ PingYinUtils.getWBCode(param.getName()), param.getCode());
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ }
|
|
|
+
|
|
|
+ private ResultVo<String> shanChuMuBan(YshZdYjTemplate mb) {
|
|
|
+ List<Integer> userRole = publicServer.getRoleCode().getData();
|
|
|
+ if (publicServer.noNeedRule(userRole, new int[]{38})) {
|
|
|
+ if (TokenUtil.getTokenUserId().equals(mb.getOpId().trim()) || (userRole.contains(11) && mb.getDeptCode().trim().equals(mb.getUserDeptCode().trim()))) {
|
|
|
+ dao.shanChuShouMingMuBan(mb.getCode());
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ } else {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有权限修改。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dao.shanChuShouMingMuBan(mb.getCode());
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private ResultVo<String> xinZengShouMingMuBan(YshZdYjTemplate param) {
|
|
|
- if (param.getWhFlag().trim().equals("3") && publicServer.needRule(new int[]{38})) {
|
|
|
+ if (param.getWhFlag().trim().equals("3") && publicServer.noNeedRule(new int[]{38})) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有权限创建全院模板。");
|
|
|
- } else if (param.getWhFlag().trim().equals("2") && publicServer.needRule(new int[]{11})) {
|
|
|
+ } else if (param.getWhFlag().trim().equals("2") && publicServer.noNeedRule(new int[]{11})) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "科主任才可以创建科室模板。");
|
|
|
}
|
|
|
param.setCode(publicServer.getYjTemplateNo().toString());
|
|
@@ -145,36 +202,43 @@ public class JianChaShenQingServer {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
}
|
|
|
|
|
|
- public ResultVo<String> xiuGaiMuBan(YshZdYjTemplate param, YshZdYjTemplate mb) {
|
|
|
- ResultVo<String> jiaoYan = muBanJiaoYan(mb.getOpId());
|
|
|
- if (jiaoYan != null) return jiaoYan;
|
|
|
- dao.genXingShouMingMuBan(param.getJcText(), param.getName(),
|
|
|
- PingYinUtils.pyShouZiMuDaXie(param.getName()),
|
|
|
- PingYinUtils.getWBCode(param.getName()), param.getCode());
|
|
|
- return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
- }
|
|
|
|
|
|
- public ResultVo<String> shanChuMuBan(YshZdYjTemplate mb) {
|
|
|
- ResultVo<String> jiaoYan = muBanJiaoYan(mb.getOpId());
|
|
|
- if (jiaoYan != null) return jiaoYan;
|
|
|
- dao.shanChuShouMingMuBan(mb.getCode());
|
|
|
- return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
+ /**
|
|
|
+ * 搜索临床诊断
|
|
|
+ *
|
|
|
+ * @param name 搜索的名字
|
|
|
+ * @param laiYuan true 医保 false 本院
|
|
|
+ * @return 返回搜索的数据
|
|
|
+ */
|
|
|
+ public ResultVo<List<GetDropdownBox>> huoQuLinChuangZhenDuan(String name, Boolean laiYuan) {
|
|
|
+ return laiYuan ? ResultVoUtil.success(dao.yiBaoZhenDuan(StringUtil.isContainChinese(name))) :
|
|
|
+ ResultVoUtil.success(dao.benYuanLinChuangZhenDuan(StringUtil.isContainChinese(name)));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 判断检查模板是否有重复的
|
|
|
+ *
|
|
|
+ * @param name 名称
|
|
|
+ * @param reqType 2-检验 3-检查
|
|
|
+ * @return 返回有没有
|
|
|
+ */
|
|
|
+ public ResultVo<Boolean> jianChaMuBanMing(String name, Integer reqType) {
|
|
|
+ return ResultVoUtil.success(dao.huoQuJianChaJianYanChongFuMuBanMing(name, reqType, TokenUtil.getTokenUserId()) > 0);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 模板的校验
|
|
|
+ * 保存检查或检验模板
|
|
|
*
|
|
|
- * @param opID 录入人
|
|
|
- * @return 提示信息
|
|
|
+ * @param param 数据
|
|
|
+ * @return 返回提示
|
|
|
*/
|
|
|
- public ResultVo<String> muBanJiaoYan(String opID) {
|
|
|
- if (publicServer.needRule(new int[]{38})) {
|
|
|
- if (!TokenUtil.getTokenUserId().equals(opID)) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该模板创建人不是你,无法操作。");
|
|
|
- }
|
|
|
+ public ResultVo<String> baoCunJianChaJianYanMuBan(ZyTcYj param) {
|
|
|
+ log.info("数据:{}", JSON.toJSONString(param));
|
|
|
+ // TODO 新增模板的时候要先删除
|
|
|
+ if (param.getFuGaiYuanShuJu()) {
|
|
|
+
|
|
|
}
|
|
|
- return null;
|
|
|
+ return ResultVoUtil.success();
|
|
|
}
|
|
|
}
|
|
|
|