|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.emr.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.emr.dao.Archive_DetailMapper;
|
|
|
|
|
import com.emr.dao.Archive_MasterMapper;
|
|
|
|
|
import com.emr.dao.CommomMapper;
|
|
|
|
|
@ -21,6 +22,7 @@ import com.emr.service.recordType.EmrTypeService;
|
|
|
|
|
import com.emr.service.tScanAssort.T_Scan_AssortService;
|
|
|
|
|
import com.emr.util.DateUtils;
|
|
|
|
|
import com.emr.util.ExceptionPrintUtil;
|
|
|
|
|
import com.emr.util.HttpClientUtils;
|
|
|
|
|
import com.emr.util.Jpg2PdfUtil;
|
|
|
|
|
import com.emr.vo.*;
|
|
|
|
|
import com.emr.vo.FontVo.*;
|
|
|
|
|
@ -34,6 +36,9 @@ import com.lowagie.text.pdf.*;
|
|
|
|
|
import com.lowagie.text.pdf.codec.TiffImage;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.apache.shiro.authc.UsernamePasswordToken;
|
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
|
import org.apache.shiro.util.CollectionUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
@ -97,9 +102,6 @@ public class FontController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private BatchExportService batchExportService;
|
|
|
|
|
|
|
|
|
|
@Value("${guangzong_token}")
|
|
|
|
|
private String guangzong_token;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.1
|
|
|
|
|
*
|
|
|
|
|
@ -640,10 +642,55 @@ public class FontController {
|
|
|
|
|
* @param // hemodialysisId 血透ID
|
|
|
|
|
* @return String
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "commomListqf", method = RequestMethod.POST)
|
|
|
|
|
public String commomListqf(Model model, HttpServletRequest request, @RequestParam("hemodialysisId") String hemodialysisId, @RequestParam("dataSource") String dataSource) {
|
|
|
|
|
String token = guangzong_token;
|
|
|
|
|
@RequestMapping(value = "commomListqf", method = RequestMethod.GET)
|
|
|
|
|
public String commomListqf(Model model, HttpServletRequest request,
|
|
|
|
|
@RequestParam("dataSource") String dataSource,
|
|
|
|
|
@RequestParam(value="hemodialysisId",required = false) String hemodialysisId,
|
|
|
|
|
@RequestParam(value="admissId",required = false) String admissId,
|
|
|
|
|
@RequestParam(value="outpatientNo",required = false) String outpatientNo) {
|
|
|
|
|
|
|
|
|
|
String userName = ObjectUtils.isEmpty(request.getParameter("userName")) ? "admin" : request.getParameter("userName");
|
|
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
|
|
params.put("userName", userName);
|
|
|
|
|
params.put("userPwd", "123456");
|
|
|
|
|
String result = HttpClientUtils.doPost(POWER_URLHEAD + "/login", params);
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
|
|
String token = jsonObject.getString("token");
|
|
|
|
|
if(!ObjectUtils.isEmpty(token)){
|
|
|
|
|
this.getUserInfo(request, token, userName);
|
|
|
|
|
//查询表格配置表的数据,根据配置动态显示表格字段
|
|
|
|
|
Map<String,Object> tableConfigMap = commomMapper.queryTableConfig(dataSource);
|
|
|
|
|
if(!ObjectUtils.isEmpty(tableConfigMap)){
|
|
|
|
|
//血透ID 广总血透接口的参数
|
|
|
|
|
model.addAttribute("hemodialysisId",hemodialysisId);
|
|
|
|
|
//住院号
|
|
|
|
|
model.addAttribute("admissId",admissId);
|
|
|
|
|
//门诊号
|
|
|
|
|
model.addAttribute("outpatientNo",outpatientNo);
|
|
|
|
|
//获取数据来源
|
|
|
|
|
model.addAttribute("dataSource",dataSource);
|
|
|
|
|
//获取需要查询字段
|
|
|
|
|
model.addAttribute("tableQueryField",tableConfigMap.get("tableField"));
|
|
|
|
|
//显示查询字段,并转为驼峰格式
|
|
|
|
|
model.addAttribute("tableField", ObjectUtils.isEmpty(tableConfigMap.get("tableField")) ? "" : DateUtils.toCamelCase(tableConfigMap.get("tableField").toString()));
|
|
|
|
|
//获取查询字段中文名称
|
|
|
|
|
model.addAttribute("tableFieldName",tableConfigMap.get("tableFieldName"));
|
|
|
|
|
//获取排序字段,可点击表头列实现排序
|
|
|
|
|
model.addAttribute("sortField",ObjectUtils.isEmpty(tableConfigMap.get("sortField")) ? "" : DateUtils.toCamelCase(tableConfigMap.get("sortField").toString()));
|
|
|
|
|
//获取默认排序字段
|
|
|
|
|
request.getSession().setAttribute("defaultSortField",tableConfigMap.get("defaultSortField"));
|
|
|
|
|
//获取默认排序字段方式
|
|
|
|
|
request.getSession().setAttribute("defaultSortFieldType",tableConfigMap.get("defaultSortFieldType"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "recordManage/commomSearch/commomListqf";
|
|
|
|
|
}else{
|
|
|
|
|
model.addAttribute("msg", "模拟登录失败");
|
|
|
|
|
return "font/msg";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void getUserInfo(HttpServletRequest request, String token, String userName){
|
|
|
|
|
//创建连接工厂
|
|
|
|
|
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
|
//创建客户端
|
|
|
|
|
@ -660,32 +707,19 @@ public class FontController {
|
|
|
|
|
client.destroy();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Power_User powerUser = JSON.parseObject(objects[0].toString(), Power_User.class);
|
|
|
|
|
powerUser.setUserName(userName);
|
|
|
|
|
|
|
|
|
|
//设置进session
|
|
|
|
|
request.getSession().setAttribute("CURRENT_USER", powerUser);
|
|
|
|
|
|
|
|
|
|
//查询表格配置表的数据,根据配置动态显示表格字段
|
|
|
|
|
Map<String,Object> tableConfigMap = commomMapper.queryTableConfig(dataSource);
|
|
|
|
|
if(!ObjectUtils.isEmpty(tableConfigMap)){
|
|
|
|
|
//血透ID 广总血透接口的参数
|
|
|
|
|
model.addAttribute("hemodialysisId",hemodialysisId);
|
|
|
|
|
//获取数据来源
|
|
|
|
|
model.addAttribute("dataSource",dataSource);
|
|
|
|
|
//获取需要查询字段
|
|
|
|
|
model.addAttribute("tableQueryField",tableConfigMap.get("tableField"));
|
|
|
|
|
//显示查询字段,并转为驼峰格式
|
|
|
|
|
model.addAttribute("tableField", ObjectUtils.isEmpty(tableConfigMap.get("tableField")) ? "" : DateUtils.toCamelCase(tableConfigMap.get("tableField").toString()));
|
|
|
|
|
//获取查询字段中文名称
|
|
|
|
|
model.addAttribute("tableFieldName",tableConfigMap.get("tableFieldName"));
|
|
|
|
|
//获取排序字段,可点击表头列实现排序
|
|
|
|
|
model.addAttribute("sortField",ObjectUtils.isEmpty(tableConfigMap.get("sortField")) ? "" : DateUtils.toCamelCase(tableConfigMap.get("sortField").toString()));
|
|
|
|
|
//获取默认排序字段
|
|
|
|
|
request.getSession().setAttribute("defaultSortField",tableConfigMap.get("defaultSortField"));
|
|
|
|
|
//获取默认排序字段方式
|
|
|
|
|
request.getSession().setAttribute("defaultSortFieldType",tableConfigMap.get("defaultSortFieldType"));
|
|
|
|
|
}
|
|
|
|
|
request.getSession().setAttribute("power_menus", powerUser.getMenus());
|
|
|
|
|
request.getSession().setAttribute("token", token);
|
|
|
|
|
|
|
|
|
|
return "recordManage/commomSearch/commomGuangListqf";
|
|
|
|
|
//验证shiro(有shiro才此操作)
|
|
|
|
|
UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456");
|
|
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
|
|
subject.login(userToken);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|