|
@@ -12,8 +12,11 @@ import cn.hnthyy.thmz.enums.TemplateKindTypeEnum;
|
|
|
import cn.hnthyy.thmz.enums.TemplateTypeEnum;
|
|
|
import cn.hnthyy.thmz.enums.YesNoEnum;
|
|
|
import cn.hnthyy.thmz.service.his.mz.EmployeeService;
|
|
|
+import cn.hnthyy.thmz.service.his.zd.DictDataService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.ButtonService;
|
|
|
import cn.hnthyy.thmz.service.thmz.TemplateService;
|
|
|
import cn.hnthyy.thmz.service.thmz.UserRoleRelationService;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -33,7 +36,7 @@ public class TemplateController {
|
|
|
@Autowired
|
|
|
private EmployeeService employeeService;
|
|
|
@Resource
|
|
|
- private UserRoleRelationService userRoleRelationService;
|
|
|
+ private ButtonService buttonService;
|
|
|
|
|
|
/**
|
|
|
* 保存医疗范文
|
|
@@ -66,6 +69,13 @@ public class TemplateController {
|
|
|
resultMap.put("message", "保存医疗范文失败,范文内容参数为空");
|
|
|
return resultMap;
|
|
|
}
|
|
|
+ if(TemplateKindTypeEnum.TCYH.code.equals(template.getTemplateKindType())){
|
|
|
+ if(!buttonService.hasButton(TokenUtil.getUser().getId(), "template_permission")){
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ resultMap.put("message", "您没有修改或新增套餐模板的权限");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
User tokenUser = TokenUtil.getUser(httpServletRequest);
|
|
|
if (TemplateTypeEnum.SECTION_TEMPLATE.code.equals(template.getTemplateType())) {
|
|
|
Employee employee = employeeService.queryByUserCode(tokenUser.getUserIdCode());
|
|
@@ -124,7 +134,7 @@ public class TemplateController {
|
|
|
return resultMap;
|
|
|
}
|
|
|
Template dbTemplate = templateService.queryById(template.getId());
|
|
|
- if(!userRoleRelationService.isManger(TokenUtil.getUser().getId()) && TemplateKindTypeEnum.TCYH.code.equals(dbTemplate.getTemplateKindType())){
|
|
|
+ if(!buttonService.hasButton(TokenUtil.getUser().getId(),"template_permission")){
|
|
|
resultMap.put("code", -1);
|
|
|
resultMap.put("message", "您没有停用套餐模板的权限!");
|
|
|
return resultMap;
|