diff --git a/src/main/java/com/emr/controller/UrlInterceptor.java b/src/main/java/com/emr/controller/UrlInterceptor.java index ed49f735..ae8d6cbe 100644 --- a/src/main/java/com/emr/controller/UrlInterceptor.java +++ b/src/main/java/com/emr/controller/UrlInterceptor.java @@ -32,8 +32,6 @@ public class UrlInterceptor implements HandlerInterceptor { @Value("${POWER_URLHEAD}") private String POWER_URLHEAD; - @Value("${powerUrl}") - private String powerUrl; public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception { // String url = request.getServletPath(); diff --git a/src/main/java/com/emr/controller/unfileMedicalController.java b/src/main/java/com/emr/controller/unfileMedicalController.java index 58bcc9bb..e5a2a57b 100644 --- a/src/main/java/com/emr/controller/unfileMedicalController.java +++ b/src/main/java/com/emr/controller/unfileMedicalController.java @@ -40,10 +40,6 @@ import java.util.List; public class unfileMedicalController { @Autowired private Archive_MasterService archiveMasterService; - - @Autowired - private Emr_DictionaryService emrDictionaryService; - @Autowired private DownloadPdfBloodService downloadPdfBloodService; diff --git a/src/main/java/com/emr/entity/Archive_Master_Vo.java b/src/main/java/com/emr/entity/Archive_Master_Vo.java index 5146a7c1..54b98dfc 100644 --- a/src/main/java/com/emr/entity/Archive_Master_Vo.java +++ b/src/main/java/com/emr/entity/Archive_Master_Vo.java @@ -17,6 +17,8 @@ import java.util.List; public class Archive_Master_Vo { private String id; + private String pdfFlag; + private String masterId; private String patientId; diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 1121e4b4..14aa6ff0 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -27,6 +27,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.google.common.collect.Maps; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @@ -93,6 +95,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { return archiveMasterMapper.selByCol(archiveMaster); } + @Override public OffsetLimitPage selectByCol(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { PageHelper.offsetPage(offset, limit); @@ -710,6 +713,23 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { } } + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + // 从session获取用户名 + Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); + Integer userId = user.getUserId(); + if (user.getRoleId()!=0){ + String url = POWER_JSP+"/font/getUserMun?userId="+userId; + String obj = HttpClientUtils.httpGetFlag(url); + if (StringUtils.isNotBlank(obj)){ + for (Archive_Master_Vo masterVo:list){ + masterVo.setPdfFlag("1"); + } + } + } else { + for (Archive_Master_Vo masterVo:list){ + masterVo.setPdfFlag("1"); + } + } return list; } diff --git a/src/main/java/com/emr/shiro/MyRealm.java b/src/main/java/com/emr/shiro/MyRealm.java index b01f3b09..2011e741 100644 --- a/src/main/java/com/emr/shiro/MyRealm.java +++ b/src/main/java/com/emr/shiro/MyRealm.java @@ -30,8 +30,6 @@ public class MyRealm extends AuthorizingRealm { @Autowired private RoleService roleService;*/ - @Value("${powerUrl}") - private String powerUrl; /** diff --git a/src/main/java/com/emr/util/HttpClientUtils.java b/src/main/java/com/emr/util/HttpClientUtils.java index 409ed359..035ca855 100644 --- a/src/main/java/com/emr/util/HttpClientUtils.java +++ b/src/main/java/com/emr/util/HttpClientUtils.java @@ -165,6 +165,35 @@ public class HttpClientUtils { return jsonResult; } + + public static String httpGetFlag(String url) { + // get请求返回结果 + String strResult=null; + CloseableHttpClient client = HttpClients.createDefault(); + // 发送get请求 + HttpGet request = new HttpGet(url); + request.setConfig(requestConfig); + try { + CloseableHttpResponse response = client.execute(request); + + // 请求发送成功,并得到响应 + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + // 读取服务器返回过来的json字符串数据 + HttpEntity entity = response.getEntity(); + strResult = EntityUtils.toString(entity, "utf-8"); + // 把json字符串转换成json对象 + } else { + logger.error("get请求提交失败:" + url); + } + } catch (IOException e) { + logger.error("get请求提交失败:" + url, e); + } finally { + request.releaseConnection(); + } + return strResult; + } + + public static String doGet(String url, Map param) { // 创建Httpclient对象 diff --git a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp index 77dcef9a..c392ee8f 100644 --- a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp +++ b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp @@ -3464,7 +3464,7 @@ if (index != null && index != "" && index.indexOf("select") != -1 && row.archivestate != "已封存") { html = '';// '删除'; } - if (index != null && index != "" && index.indexOf("select") != -1 && row.archivestate != "已封存") { + if (index != null && index != "" && index.indexOf("select") != -1 && row.archivestate != "已封存" && row.pdfFlag != null) { html = html + '';// '删除'; } if (index.indexOf("qxSel") != -1) {